Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collections: use SHACL Advanced Features for ordering (and filtering?) #209

Open
tpluscode opened this issue Dec 11, 2021 · 0 comments
Open

Comments

@tpluscode
Copy link
Member

The query:order and query:filter annotations of collections should be replaced with SHACL AF Node expressions

Ordering

</articles>
  a api:ArticleCollection ;
- query:order (
-   [ query:path schema:title ]
-   [ query:path schema:dateCreated ; query:direction ldp:Descending ]
+ sh:orderBy (
+   [ sh:path schema:title ]
+   [ sh:path schema:dateCreated ; sh:desc true ]
  ) ;
.

Filtering

Both should be possible, current use with code:, as well as declaratively with SHACL AF

</api/shape>
  a hydra:IriTemplate ;
  hydra:template "{?targetNode}" ;
  hydra:mapping 
  [
    hydra:variable "targetNode" ;
    hydra:property sh:targetNode ;
    query:filter
-   [
-     a code:EcmaScriptModule ;
-     code:link <file:filters/shape.js#byTargetNode> ;
-   ] ;
+   [
+     sh:union (
+       [ sh:path sh:targetNode query:value ]
+       [ 
+          sh:nodes [ sh:path sh:targetClass ]
+          sh:path [ sh:inversePath rdf:type ]
+       ]
+     )
  ] ;
.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant