Duplicates in SPARQL clause VALUES lead to unexplainable result

Viewed 62

I accidentaly noticed that if you write SPARQL query like this

SELECT ?id ?idLabel WHERE{
  VALUES ?id { wd:Q1  wd:Q1  }.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}

the result is kinda strange: four rows instead of expected two.

I get it that it's lame to write duplicates in the VALUE clause, but I'm just wondering why it works like this. Could someone explain please?

1 Answers

It's a bug of the non standard label service. When running this query you get two results for the wikibase:label of wd:Q1, these are then added to each wd:Q1. So when you have 2 same values you will get 4 rows, if you have 3 same values, you'll get 9 and so on.

Related