Reputation: 6640
In SPARQL, I often see usage of # at the end of prefix definitions, like this:
@prefix dt: <http://example.org/datatype#>
What's the purpose? I couldn't find this in the SPARQL documentation.
Upvotes: 2
Views: 316
Reputation: 96607
Your example seems to be in Turtle, as in SPARQL the syntax would be:
PREFIX dt: <http://example.org/datatype#>
But it’s the same idea: Instead of having to use full IRIs in your query, you can use prefixed names:
In your example, the prefix label is dt
. It’s mapped to the IRI http://example.org/datatype#
.
In your query, it might get used as dt:foobar
, where foobar
is called the local part.
The mapped IRI from the prefix label and the local part get concatenated to form the "actual" IRI:
http://example.org/datatype#
+ foobar
=
http://example.org/datatype#foobar
(Instead of using dt:foobar
, you could also use <http://example.org/datatype#foobar>
.)
So the #
just happens to be part of the IRI design. It’s a popular way to structure vocabulary IRIs in the Semantic Web. The other popular way is using a /
. See HashVsSlash.
Upvotes: 8