Syntax for IRIs
The iri production designates the set of IRIs [Internationalized Resource Identifiers (IRIs)]; IRIs are a generalization of URIs [Uniform Resource Identifier (URI): Generic Syntax] and are fully compatible with URIs and URLs. The PrefixedName production designates a prefixed name. The mapping from a prefixed name to an IRI
is described below. IRI references (relative or absolute IRIs) are designated by the
IRIREF production, where the '<' and '>' delimiters do not form part of the IRI reference.
Relative IRIs match the irelative-ref reference in section 2.2 ABNF for IRI References and IRIs in [Internationalized Resource Identifiers (IRIs)] and are resolved to IRIs as described below.
The set of RDF terms defined in RDF Concepts and Abstract Syntax includes RDF URI
references while SPARQL terms include IRIs. RDF URI references containing "<", ">", '"' (double quote), space, "{", "}", "|", "\", "^", and "```" are not IRIs. The behavior of a SPARQL query against RDF statements composed
of such RDF URI references is not defined.
Prefixed Names
The PREFIX keyword associates a prefix label with an IRI. A prefixed name is a prefix label
and a local part, separated by a colon ":". A prefixed name is mapped to an IRI by concatenating the IRI associated with the
prefix and the local part. The prefix label or the local part may be empty. Note that
SPARQL local names allow leading digits while XML local names do not. SPARQL local names also allow the non-alphanumeric characters allowed in IRIs via backslash character
escapes (e.g. ns:id\=123). SPARQL local names have more syntactic restrictions than CURIEs.
Relative IRIs
Relative IRIs are combined with base IRIs as per Uniform Resource Identifier (URI): Generic Syntax [Uniform Resource Identifier (URI): Generic Syntax] using only the basic algorithm in section 5.2. Neither Syntax-Based Normalization nor Scheme-Based Normalization (described in sections 6.2.2 and 6.2.3 of RFC3986) are performed. Characters additionally allowed in IRI references are treated in the same way that unreserved characters are treated in URI references, per section 6.5 of Internationalized Resource Identifiers (IRIs) [Internationalized Resource Identifiers (IRIs)].
The BASE keyword defines the Base IRI used to resolve relative IRIs per RFC3986 section 5.1.1,
"Base URI Embedded in Content". Section 5.1.2, "Base URI from the Encapsulating Entity"
defines how the Base IRI may come from an encapsulating document, such as a SOAP envelope
with an xml:base directive or a mime multipart document with a Content-Location header.
The "Retrieval URI" identified in 5.1.3, Base "URI from the Retrieval URI", is the
URL from which a particular SPARQL query was retrieved. If none of the above specifies
the Base URI, the default Base URI (section 5.1.4, "Default Base URI") is used.
The following fragments are some of the different ways to write the same IRI:
<http://example.org/book/book1>
BASE <http://example.org/book/>
<book1>
PREFIX book: <http://example.org/book/>
book:book1
Copyright © 2013 W3C® (MIT, ERCIM, Keio, Beihang). This software or document includes material copied from or derived from SPARQL 1.1 Query.