Skip to content

Replace query:include with SHACL #251

@tpluscode

Description

@tpluscode

Currently the use of query:include requires that additional assertions are made about a class, which is likely a term from an external vocabulary. For example to load friends when a foaf:Person resource is loaded

foaf:Person 
  a hydra:Class ;             # this changes the semantics of external resource
  hydra:apiDocumentation <> ; # this is necessary to be picked up by ApiDocumentation loader
  query:include 
    [ query:path foaf:knows ] ,
    [ query:path foaf:account ] ;
.

Instead, it would be beneficial to create an independent shape resource (subclass of sh:Shape) which would use SHACL's targets and semantics for defining how to load representations. Later SHACL Advanced Features could also be added.

</api/Peron#representationShape>
  a hex:RepresentationShape ; # rdfs:subClassOf sh:Shape
  sh:targetClass foaf:Person ;
  sh:property
   [ sh:path foaf:knows ] ,
   [ sh:path foaf:account ] .

This should be incorporated into the load query but possibly could remain a separate DESCRIBE as it is now implemented

DESCRIBE ?this ?include {
  ?this a foaf:Person .

  {
    ?this foaf:knows ?include
  }
  UNION
  {
    ?this foaf:account ?include
  }
}
VALUES ?this { <...> }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions