query-74b642dbc071a9031171cbf147aa1e5b
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT
?item
(SAMPLE(COALESCE(?en_label, ?item_label)) as ?label)
(SAMPLE(?location) as ?location)
WHERE {
SERVICE wikibase:box {
?item wdt:P625 ?location .
bd:serviceParam wikibase:cornerSouthWest "Point(3 -90)"^^geo:wktLiteral .
bd:serviceParam wikibase:cornerNorthEast "Point(3.1 90)"^^geo:wktLiteral .
}
MINUS {?item wdt:P18 ?image}
MINUS {?item wdt:P373 ?commonsCat}
OPTIONAL {?item rdfs:label ?en_label . FILTER(LANG(?en_label) = "en")}
OPTIONAL {?item rdfs:label ?item_label}
}
GROUP BY ?item
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?commonsCat")
v1("?en_label"):::projected
v4("?image")
v2("?item"):::projected
v6("?item_label"):::projected
v7("?label")
v8("?location"):::projected
c4(["bd:serviceParam"]):::iri
c8([sPoint(3.1 90)^^<http://www.opengis.net/ont/geosparql#wktLiteral>"]):::literal
c6([sPoint(3 -90)^^<http://www.opengis.net/ont/geosparql#wktLiteral>"]):::literal
subgraph s1["http://wikiba.se/ontology#box"]
style s1 stroke-width:4px;
v2 --"wdt:P625"--> v8
c4 --"wikibase:cornerSouthWest"--> c6
c4 --"wikibase:cornerNorthEast"--> c8
end
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v2 --"wdt:P18"--> v4
end
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
v2 --"wdt:P373"--> v5
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."rdfs:label".-> v1
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."rdfs:label".-> v6
end
bind4[/"sample(?en_label?item_label)"/]
v1 --o bind4
v6 --o bind4
bind4 --as--o v7
bind5[/"sample(?location)"/]
v8 --o bind5
bind5 --as--o v8