query-af288bc3658e412a2f3ce927d2565af7
TODO
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT
?item ?itemLabel
(GROUP_CONCAT(DISTINCT ?typeLabel; SEPARATOR=", ") AS ?typeLabels)
(GROUP_CONCAT(DISTINCT ?districtLabel; SEPARATOR=", ") AS ?districtLabels)
(GROUP_CONCAT(DISTINCT ?crossesLabel; SEPARATOR=", ") AS ?crossesLabels)
(GROUP_CONCAT(DISTINCT ?carriesLabel; SEPARATOR=", ") AS ?carriesLabels)
(SAMPLE(?coords) AS ?coordinates)
WHERE
{
?item wdt:P31 / wdt:P279 * wd:Q12280 . # Bridges
?item wdt:P131 + wd:Q90 . # in Paris
?item wdt:P31 ?type .
?item wdt:P131 ?district .
OPTIONAL { ?item wdt:P177 ?crosses . }
OPTIONAL { ?item wdt:P205 ?carries . }
OPTIONAL { ?item wdt:P625 ?coords . }
SERVICE wikibase:label
{
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,fr" .
?item rdfs:label ?itemLabel .
?type rdfs:label ?typeLabel .
?district rdfs:label ?districtLabel .
?crosses rdfs:label ?crossesLabel .
?carries rdfs:label ?carriesLabel .
}
}
GROUP BY ?item ?itemLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?carries")
v11("?carriesLabel"):::projected
v15("?carriesLabels")
v16("?coordinates")
v6("?coords"):::projected
v4("?crosses")
v10("?crossesLabel"):::projected
v14("?crossesLabels")
v3("?district")
v9("?districtLabel"):::projected
v13("?districtLabels")
v1("?item"):::projected
v7("?itemLabel"):::projected
v2("?type")
v8("?typeLabel"):::projected
v12("?typeLabels")
a1((" "))
c5(["wd:Q90"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en,fr"]):::literal
c3(["wd:Q12280"]):::iri
c10(["bd:serviceParam"]):::iri
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
v1 --"wdt:P131"--> c5
v1 --"wdt:P31"--> v2
v1 --"wdt:P131"--> v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P177".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P205".-> v5
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P625".-> v6
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
v1 --"rdfs:label"--> v7
v2 --"rdfs:label"--> v8
v3 --"rdfs:label"--> v9
v4 --"rdfs:label"--> v10
v5 --"rdfs:label"--> v11
end
bind5[/"?typeLabel"/]
v8 --o bind5
bind5 --as--o v12
bind6[/"?districtLabel"/]
v9 --o bind6
bind6 --as--o v13
bind7[/"?crossesLabel"/]
v10 --o bind7
bind7 --as--o v14
bind8[/"?carriesLabel"/]
v11 --o bind8
bind8 --as--o v15
bind9[/"sample(?coords)"/]
v6 --o bind9
bind9 --as--o v16