Skip to content

Graph Queries on Metadata

SPARQL Graph Queries (CONSTRUCT and DESCRIBE) can be applied to metadata graphs. The graph query must be supplied as a URL-parameter graphQuery when fetching the metadata graph. A graph query can be applied to a simple metadata graph and traversal results (see separate KB entry on Traversal). The query must be URL-encoded.

Example:

{base-uri}/{context-id}/metadata/{entry-id}?recursive=dcat&format=text/turtle&graphQuery=PREFIX%20es%3A%20<http%3A%2F%2Fentrystore.org%2Fterms%2F>%0D%0APREFIX%20dct%3A%20<http%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F>%0D%0ACONSTRUCT%20%7B%20%3Fs%20es%3Aname%20%3Fo%20%7D%20WHERE%20%7B%20%3Fs%20dct%3Atitle%20%3Fo%20%7D

The URL-decoded graph query of the example is:

PREFIX es: <http://entrystore.org/terms/>
PREFIX dct: <http://purl.org/dc/terms/>
CONSTRUCT { ?s es:name ?o } WHERE { ?s dct:title ?o }