I am pretty new to SPARQL and RDF and I was wondering what exactly does the below mean in SPARQL?
[] vc:n ?vcard .
The complete query is
PREFIX vc: <http://www.w3.org/2006/vcard/ns#>
SELECT ?given ?family
WHERE{
[] vc:n ?vcard .
OPTIONAL {?vcard vc:given-name ?given .}
OPTIONAL {?vcard vc:family-name ?family .}
}
[]
is a blank node in a query. It acts like a named variable except you can't use it in aSELECT
project orFILTER
or anywhere where you need to name the variable. You can replace[]
with a named variable using a name not used anywhere in the query.SELECT *
would add it but otherwise it is much the same query.[ … ] is a blank node
The square brackets are described in the SPARQL 1.1 Query Language. In particular, see 4.1.4 Syntax for Blank Nodes