PREFIX Clause
The PREFIX clause declares any abbreviations for URIs that you want to reference in a query. You can declare prefixes to simplify query text if your data includes long URI names. If you do not declare prefixes, you must include the full URI names in the query.
Syntax
PREFIX uri_abbreviation: <uri_to_substitute_for_abbreviation> [ PREFIX uri_abbreviation: <uri_to_substitute_for_abbreviation> ] [ ... ]
URIs can be well-formed and absolute, such as <http://www.w3.org/1999/02/22-rdf-syntax-ns>
or relative, such as <http://cambridgesemantics.com/property#>
or <tickit/sales/>
.
AnzoGraph DB places no special restrictions on URIs, only that you place the URI text between < > characters, for example, <sales>.
Examples
The following example query declares a prefix and then uses the declared URI abbreviation in place of full the URI names in the query.
PREFIX t: <http://anzograph.com/tickit/> SELECT ?eventname ?location FROM <http://anzograph.com/tickit> WHERE { ?eventid t:venueid ?venueid . ?venueid t:venuename ?location . ?eventid t:dateid ?dateid . ?eventid t:eventname ?eventname . } ORDER BY ?location