Previous topic  Top  Next topic  Print this Topic

Graph Queries


The resulting graph of CONSTRUCT and DESCRIBE queries is represented as a set of triples. Each triple maps to one solution, providing a triple instantiation: Variable $s for subject, variable $p for predicate, and variable $o for object position.

Example: Given the RDF ontology

@prefix : <> .

@prefix vcard: <> .

 :alice :name "Alice" .

 :bob :name "Bob" .

and the SPARQL query


PREFIX vcard: <>

CONSTRUCT { ?person vcard:FN ?name }

WHERE { ?person :name ?name }

will produce the resulting graph, represented as triples via variable bindings










which equals the RDF ontology

@prefix : <> .

@prefix vcard: <> .

 :alice vcard:FN "Alice" .

 :bob vcard:FN "Bob" .