This is an idea for how SHACL AF Node Expression can be used to annotate a hydra search template so that values coming from the request query string would be transformed to SPARQL patterns an injeced into the resulting query
The collection resource <shapes>
supports a targetNode
query string parameter which should be translated to a SPARQL union like below. The $this
token will represent each collection member (instance of shape). For example, when requesting shapes?targetNode=foobar
, the generated patterns could be:
{
# query the target node directly
$this sh:targetNode <foobar>
}
UNION