1

I don't understand why this SPARQL queries produce duplicates:

SELECT DISTINCT ?WikidataItem ?itemLabel
WHERE {  
  ?WikidataItem rdfs:label ?itemLabel. 
  ?WikidataItem ?label "Mozilla Firefox"@en.  
}
LIMIT 5

Try it here.

Is it producing a row of output in every language? How can I change my query in order for it to produce only the single result in English?

Update

I'm still confused about how to solve my problem, since I perhaps oversimplified my example. I actually am using FILTER(CONTAINS(LCASE(?itemLabel), "firefox"@en)) among other things to limit my query. How do I output only the English language label for each entry?

1
  • Do you need just FILTER(lang(?itemLabel)='en')? Feb 27, 2019 at 18:24

1 Answer 1

2

Is it producing a row of output in every language?

Yes, you're correct: ?itemLabel match labels in all languages.

Try simply SELECT * {?item rdfs:label "Mozilla Firefox"@en}.

If you want to project a variable, use VALUES:

SELECT * {VALUES (?label) {("Mozilla Firefox"@en)} ?item rdfs:label ?label}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.