query-8195066fd231eb3f4d225dd3d4494143
World Port IndexItems with a World Port Index Number
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
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 bd: <http://www.bigdata.com/rdf#>
SELECT ?wpi ?port ?portLabel (GROUP_CONCAT(DISTINCT ?unlocode;separator=", ") AS ?unlocodes) ?mt (GROUP_CONCAT(DISTINCT ?website;separator=", ") AS ?websites) (GROUP_CONCAT(DISTINCT ?typeLabel;separator=", ") AS ?types) ?coordinates
WHERE {
?port wdt:P7625 ?wpi
OPTIONAL { ?port wdt:P31 ?type } .
OPTIONAL { ?port wdt:P7625 ?wpi } .
OPTIONAL { ?port wdt:P1937 ?unlocode } .
OPTIONAL { ?port wdt:P856 ?website } .
OPTIONAL { ?port wdt:P625 ?coordinates } .
OPTIONAL { ?port wdt:P1624 ?mt } .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de,fr".
?port rdfs:label ?portLabel .
?type rdfs:label ?typeLabel}
}
GROUP BY ?wpi ?port ?portLabel ?coordinates ?mt
ORDER BY ASC(xsd:integer(?wpi))
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?coordinates"):::projected
v7("?mt"):::projected
v2("?port"):::projected
v8("?portLabel"):::projected
v3("?type")
v9("?typeLabel"):::projected
v12("?types")
v4("?unlocode"):::projected
v10("?unlocodes")
v5("?website"):::projected
v11("?websites")
v1("?wpi"):::projected
c10(["#91;AUTO_LANGUAGE#93;,en,de,fr"]):::literal
c8(["bd:serviceParam"]):::iri
v2 --"wdt:P7625"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P31".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P7625".-> v1
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P1937".-> v4
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P856".-> v5
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P625".-> v6
end
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P1624".-> v7
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
v2 --"rdfs:label"--> v8
v3 --"rdfs:label"--> v9
end
bind3[/"?unlocode"/]
v4 --o bind3
bind3 --as--o v10
bind4[/"?website"/]
v5 --o bind4
bind4 --as--o v11
bind5[/"?typeLabel"/]
v9 --o bind5
bind5 --as--o v12