query-81579dff73fc57d0678527f1c80f8b92

rq turtle/ttl

Recherche dans Wikidata les éléments qui sont des GALM (ou l'une de ses sous-classes) et qui ont pour pays la Suisse. SELECT distinct ?item ?itemLabel (group_concat(distinct ?locLabel) as ?locLabel1) ?cantonLabel ?ISIL ?GLAM ?Commons WHERE { ?item wdt:P31/wdt:P279 wd:Q1030034 . ?item wdt:P17 wd:Q39 . OPTIONAL { ?item wdt:P791 ?ISIL } OPTIONAL { ?item wdt:P3066 ?GLAM } OPTIONAL { ?item wdt:P373 ?Commons } OPTIONAL { ?item wdt:P131 ?loc . FILTER NOT EXISTS { ?loc wdt:P31 wd:Q23058 } } OPTIONAL { ?item wdt:P131 ?canton . ?canton wdt:P31 wd:Q23058 } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],fr,de,it,en,rm,es". } } group by ?item ?itemLabel ?cantonLabel ?ISIL ?GLAM ?Commons ORDER BY (fn:lower-case(str(?cantonLabel))) (fn:lower-case(str(?itemLabel)))

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Recherche dans Wikidata les éléments qui sont des GALM (ou l'une de ses sous-classes) et qui ont pour pays la Suisse.
  SELECT distinct ?item ?itemLabel (group_concat(distinct ?locLabel) as ?locLabel1) ?cantonLabel ?ISIL ?GLAM ?Commons
  WHERE 
  {
     ?item wdt:P31/wdt:P279* wd:Q1030034 .
     ?item wdt:P17 wd:Q39 .
    OPTIONAL  { ?item wdt:P791 ?ISIL }
    OPTIONAL {  ?item wdt:P3066 ?GLAM }
    OPTIONAL {  ?item wdt:P373 ?Commons }
    OPTIONAL {  ?item wdt:P131 ?loc . FILTER NOT EXISTS { ?loc wdt:P31 wd:Q23058 } }
    OPTIONAL {  ?item wdt:P131* ?canton . ?canton wdt:P31 wd:Q23058  }
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],fr,de,it,en,rm,es". }
  } group by ?item ?itemLabel ?cantonLabel ?ISIL ?GLAM ?Commons
  ORDER BY (fn:lower-case(str(?cantonLabel)))  (fn:lower-case(str(?itemLabel)))

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?Commons"):::projected v6("?GLAM"):::projected v5("?ISIL"):::projected v8("?canton") v1("?cantonLabel"):::projected v4("?item"):::projected v2("?itemLabel"):::projected v3("?loc") v9("?locLabel"):::projected v10("?locLabel1") a1((" ")) c2(["wd:Q23058"]):::iri c14(["#91;AUTO_LANGUAGE#93;,fr,de,it,en,rm,es"]):::literal c6(["wd:Q39"]):::iri c12(["bd:serviceParam"]):::iri c4(["wd:Q1030034"]):::iri v4 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c4 v4 --"wdt:P17"--> c6 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P791".-> v5 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P3066".-> v6 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P373".-> v7 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P131".-> v3 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P131".-> v8 v8 --"wdt:P31"--> c2 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c12 --"wikibase:language"--> c14 end bind1[/"?locLabel"/] v9 --o bind1 bind1 --as--o v10