sparql - How to get Wikidata labels in more than one language? -


i'm traying regions of italy in both italian , english. can in 1 laguage query...

prefix wikibase: <http://wikiba.se/ontology#> prefix wd: <http://www.wikidata.org/entity/> prefix wdt: <http://www.wikidata.org/prop/direct/>  select distinct ?regionit ?regionitlabel ?iso_code ?geo { ?regionit wdt:p31 wd:q16110; wdt:p300 ?iso_code;  wdt:p625 ?geo             service wikibase:label { bd:serviceparam wikibase:language "it"  } }  order ?regionitlabel 

... adding language using standard sparql syntax doesn't work.

... adding language using standard sparql syntax doesn't work.

how doing that? works:

prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix wikibase: <http://wikiba.se/ontology#> prefix wd: <http://www.wikidata.org/entity/> prefix wdt: <http://www.wikidata.org/prop/direct/>  select distinct ?regionit ?label (lang(?label) ?label_lang)  ?iso_code ?geo {     ?regionit wdt:p31 wd:q16110;               wdt:p300 ?iso_code;                wdt:p625 ?geo ;               rdfs:label ?label } order ?regionit 

link try query

to limit italian , english filter on lang:

prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix wikibase: <http://wikiba.se/ontology#> prefix wd: <http://www.wikidata.org/entity/> prefix wdt: <http://www.wikidata.org/prop/direct/>  select distinct ?regionit ?label ?iso_code ?geo {     ?regionit wdt:p31 wd:q16110;               wdt:p300 ?iso_code;                wdt:p625 ?geo ;               rdfs:label ?label     filter(lang(?label) = 'it' || lang(?label) = 'en') } order ?regionit 

link try query

obviously multiplies number of results, 1 each language. if that's issue can do:

... rdfs:label ?label_it , ?label_en filter(lang(?label_it) = 'it' && lang(?label_en) = 'en') ... 

which language service does.


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -