I am using wikidata Query Service to fetch data: https://query.wikidata.org/
I have already managed to use an entity's label using 2 methods:
- Using wikibase label service. For example:
SELECT ?spouse ?spouseLabel WHERE { wd:Q1744 wdt:P26 ?spouse. SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } }
- Using the
rdfs:label
property:
SELECT ?spouse ?spouseLabel WHERE { wd:Q1744 wdt:P26 ?spouse. ?spouse rdfs:label ?spouseLabel. filter(lang(?spouseLabel) = "en"). }
However, it seems that for complex queries, the second method performs faster, in contrary to what the MediaWiki user manual states:
The service is very helpful when you want to retrieve labels, as it reduces the complexity of SPARQL queries that you would otherwise need to achieve the same effect.
(https://www.mediawiki.org/wiki/Wikidata_query_service/User_Manual#Label_service)
What does the wikibase add that I can't achieve using just rdfs:label? It seems odd since they both seemingly achieve the same purpose, but rdfs:label method seems faster (which is logical, becuase the query does not need to join data from external sources).
Thanks!