Is there some way to use a kind of placeholder variable with SPARQL without returning it when using SELECT * ? (kleene star)
Where I would not want to return the ?s variable, just the ?title, ?name, and ?s2 variables while leaving the SELECT *.
I understand I can limit the select results by using SELECT ?title ?name ..., but I'm just curious if there is some kind of notation for placeholder variables or some way to manage this.
EDIT: - I understand you can use blank nodes to accomplish this in some cases, for example:
However, doesn't this cause problems since blank nodes can't be used across basic graph patterns? For example, this breaks in the case:
Duplicating my answer from SO:
For variables scoped to a single pattern yes, use the blank node variable syntax as you demonstrated by @Signified's answer and in your question
In the general case no, if you use a variable then
One possible workaround is to use sub-queries where you do list variables and leave out the variables you don't want e.g.
But then I assume this is exactly what you are trying to avoid since you end up listing variables anyway.
answered 21 Feb '13, 18:00
Rob Vesse ♦