query-49b636f0678efca85005f5bc308f9bd1
🪣 Map of geolocated entities co-occurring with invasive species in the literature
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map
PREFIX target: <http://www.wikidata.org/entity/Q183368>
SELECT
?location ?locationLabel
?geo
?example_work ?example_workLabel
WHERE {
{
SELECT
?location ?geo
(SAMPLE(?work) AS ?example_work)
WHERE {
# Find works that are marked with main subject of the topic.
?work wdt:P921 / ( wdt:P31*/wdt:P279* | wdt:P361+ | wdt:P1269+ ) target: .
# Identify co-occuring topic that is geo-locatable.
?work wdt:P921 ?location .
?location wdt:P625 ?geo .
}
GROUP BY ?location ?geo
}
# Label the results
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en,da,de,es,fr,jp,nl,no,ru,sv,zh".
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?example_work"):::projected
v3("?geo"):::projected
v2("?location"):::projected
v1("?work")
a1((" "))
a2((" "))
c11(["en,da,de,es,fr,jp,nl,no,ru,sv,zh"]):::literal
c9(["bd:serviceParam"]):::iri
c4([http://www.wikidata.org/entity/Q183368]):::iri
v1 --"wdt:P921"--> a1
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
a1 --"wdt:P1269"--> c4
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
a1 --"wdt:P361"--> c4
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
a1 --"wdt:P31"--> a2
a2 --"wdt:P279"--> c4
end
union0r <== or ==> union0l
end
v1 --"wdt:P921"--> v2
v2 --"wdt:P625"--> v3
bind1[/"sample(?work)"/]
v1 --o bind1
bind1 --as--o v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end