Reputation: 60213
Does SPARQL have "don't care" variables?
Let's say I want all items that have a end time, but I don't care what the end time actually is:
?item wdt:P582 ?iWillNeverNeedThisVariable.
Is there a more elegant way to write this, by not naming this variable?
This would be easier to understand, less verbose, and also prevent don't-care variable names from accidentally overlapping.
I tried writing just ?
but a syntax error appears.
Upvotes: 4
Views: 911
Reputation: 16630
In a SPARQL query, blank nodes in the query act in the role of "don't care" variables and they then don't show up in "SELECT *"
?item wdt:P582 [] .
Upvotes: 9