query-5b21fd176476d89858842d293067e101
Different colors, different propertiesHi! I've created this query:
Use at
- https://query.wikidata.org/sparql
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#>
#defaultView:Map
SELECT ?item ?itemLabel ?itemDescription ?coord ?gmp ?gkg ?ind ?com ?layer
WHERE {
?item (wdt:P131)* wd:Q16245 .
MINUS { { ?item wdt:P31 wd:Q1134686 . } UNION { ?item wdt:P31 wd:Q747074 . } }
?item wdt:P625 ?coord .
OPTIONAL {?item wdt:P3749 ?gmp}
OPTIONAL {?item wdt:P2671 ?gkg}
OPTIONAL {?item wdt:P969 ?ind}
OPTIONAL {?item wdt:P373 ?com}
BIND(IF(BOUND(?gmp),'gmp exists','no gmp exists') AS ?layer)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],it,en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?com"):::projected
v2("?coord"):::projected
v4("?gkg"):::projected
v3("?gmp"):::projected
v5("?ind"):::projected
v1("?item"):::projected
v7("?layer"):::projected
c14(["#91;AUTO_LANGUAGE#93;,it,en"]):::literal
c4(["wd:Q1134686"]):::iri
c12(["bd:serviceParam"]):::iri
c2(["wd:Q16245"]):::iri
c5(["wd:Q747074"]):::iri
v1 --"wdt:P131"--> c2
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> c5
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> c4
end
union0r <== or ==> union0l
end
end
v1 --"wdt:P625"--> v2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P3749".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P2671".-> v4
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P969".-> v5
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P373".-> v6
end
bind1[/"if(bound(?gmp),'gmp exists','no gmp exists')"/]
v3 --o bind1
bind1 --as--o v7
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c14
end