query-69feeecd72c5c44a2fefa9a9eeadc43c

rq turtle/ttl

Countries border cleansing ]reply[20:27, 31 March 2020 (UTC)) talk (Bouzinac with "border between country X and country Z" ? Would be appreciated ! (P527)has part(s) Hello, anyone willing to help me clean data on stuffs like "borders of country X" and add

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
select  ?item ?itemLabel ?statutLabel ?qualifier ?qualifierLabel 
(GROUP_CONCAT(DISTINCT(?paysLabel); separator="; ") as ?countries)
(GROUP_CONCAT(DISTINCT(?comprendLabel); separator="; ") as ?countries_comprised)
{
SELECT ?item ?itemLabel ?qualifier ?qualifierLabel ?statutLabel ?pays ?paysLabel ?comprend ?comprendLabel WHERE {
?item p:P31 ?statut_statement.
?statut wdt:P279 wd:Q1292279.
?statut_statement ps:P31 ?statut.
?item p:P31 _:b1.
_:b1 pq:P642 ?qualifier.
OPTIONAL { ?item wdt:P17 ?pays. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en". }#change language here
OPTIONAL { ?item wdt:P527 ?comprend. }
}
} group by ?item ?itemLabel ?statutLabel ?qualifier ?qualifierLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?comprend") v8("?comprendLabel"):::projected v9("?countries") v10("?countries_comprised") v1("?item"):::projected v5("?pays") v7("?paysLabel"):::projected v4("?qualifier"):::projected v3("?statut") v2("?statut_statement") a1((" ")) c8(["bd:serviceParam"]):::iri c10(["fr,en"]):::literal c3(["wd:Q1292279"]):::iri v1 --"p:P31"--> v2 v3 --"p:direct/P279"--> c3 v2 --"p:statement/P31"--> v3 v1 --"p:P31"--> a1 a1 --"p:qualifier/P642"--> v4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:direct/P17".-> v5 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:direct/P527".-> v6 end bind2[/"?paysLabel"/] v7 --o bind2 bind2 --as--o v9 bind3[/"?comprendLabel"/] v8 --o bind3 bind3 --as--o v10