On 4/23/15 5:25 PM, Nicola Vitucci wrote:
Il 23/04/2015 20:01, Kingsley Idehen ha scritto:
On 4/23/15 1:02 PM, Nicola Vitucci wrote:
Il 23/04/2015 18:36, Gerard Meijssen ha scritto:
>> >Hoi, >> >Do I understand correctly that you cannot have results showing labels >> >for a given languages? >> >Thanks, >> > GerardM >> >
Hi Gerard,
what do you mean? Are you looking for something like this?
http://wikisparql.org/sparql?query=PREFIX+wd%3A+%3Chttp%3A%2F%2Fwww.wikidata...
(The chosen language is Spanish)
Nicola
Do you not have a URL parameter that resolves to the query source?
Example: http://milenio.dcc.uchile.cl/sparql?default-graph-uri=&qtxt=PREFIX+wd:+%...
and+mayor:%0D%0A++OPTIONAL+%7B%0D%0A++++%3Fcity+wd:P373s/wd:P373v+%3Fcitylabel+.%0D%0A++++%23+FILTER+(+LANG(%3Fcitylabel)+%3D+%22en%22+)%0D%0A++%7D%0D%0A++OPTIONAL+%7B%0D%0A++++%3Fmayor+wd:P373s/wd:P373v+%3Fmayorlabel+.%0D%0A++++%23+FILTER+(+LANG(%3Fmayorlabel)+%3D+%22en%22+)%0D%0A++%7D%0D%0A%0D%0A%7D+ORDER+BY+DESC(%3Fpopulation)+LIMIT+100&format=text/html&CXML_redir_for_subjs=121&CXML_redir_for_hrefs=&timeout=30000&debug=on
If not, please paste the query source in a reply.
Hi Kingsley,
currently there is no such parameter, but it's a good idea - I'll add it.
The query source with the Spanish labels is below (replace "es" with "ru" for the Russian labels):
PREFIX wd:http://www.wikidata.org/entity/ SELECT DISTINCT ?city ?citylabel ?mayorlabel WHERE { ?city wd:P31s/wd:P31v wd:Q515 . ?city wd:P6s ?statement . ?statement wd:P6v ?mayor . ?mayor wd:P21s/wd:P21v wd:Q6581072 . FILTER NOT EXISTS { ?statement wd:P582q ?x } ?city wd:P1082s/wd:P1082v/http://www.wikidata.org/ontology#numericValue ?population . OPTIONAL { ?city rdfs:label ?citylabel . FILTER ( LANG(?citylabel) = "es" ) } OPTIONAL { ?mayor rdfs:label ?mayorlabel . FILTER ( LANG(?mayorlabel) = "es" ) } } ORDER BY DESC(?population) LIMIT 100
Nicola
Yes, I know that. Our responses our a little out of sync. The link I shared to the query definition exposed what I wanted to share with others re. use of LANG() and the nature of SELECT list output etc..
Anyway, it would be great if you add the @qtx parameter as alternative to @query when the goal is identifying a document that's comprised of the SPARQL Query Definition rather than SPARQL Query Result (or solution).
This is good news!