On 26.02.2016 14:25, Paul Houle wrote:
You're not really supposed to use a named blank
node as if it had a
specific meaning.
The name of a bnode never indicates a specific meaning. It is only used
to mark multiple occurrences of the same bnode in some syntactic formats
(such as RDF serialisations or SPARQL query results). Different
syntactic formats of the same RDF document use bnode names in different
places (for example, N3 syntax needs more bnode names than Turtle syntax
to encode the same RDF graph). The concept of a "named" bnode is a
syntactic one that is specific to serialisations. Bnode names are not
part of the RDF semantics at all. Moreover, the names can change when
you process RDF data, and from request to request.
I wonder if SPARQL actually supports unnamed bnodes in its result
formats. In any case, it would often be more expensive for a query
engine to check if the same bnode occurs multiple times in a result in
order to replace it with an unnamed bnode if it doesn't.
rdf:nil represents the empty list and is a good stand-in for "no value"
situations.
Using rdf:nil actually not be correct here, neither in RDF nor in SPARQL
results. The simple example is a query for "all pairs of a woman and a
man who have a child together". You don't want to get all pairs of
people who have no child (that's what "no value" means) or who have an
unspecified child (that's what "unknown value" means). In either case,
the results would be wrong if you used rdf:nil to represent the (missing
or unknown) values.
Cheers,
Markus