query-0f188671180129f5969a4d282784a1b6
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 psn: <http://www.wikidata.org/prop/statement/value-normalized/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pqn: <http://www.wikidata.org/prop/qualifier/value-normalized/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT
?airportName ?pageBanner ?logo ?icao ?iata ?faa ?website ?operator ?opening ?status ?elevation ?elevationUnitLabel ?image
?runway ?lengthValue ?lengthUnitLabel ?widthValue ?widthUnitLabel ?materialLabel
WHERE {
BIND(wd:Q8685 AS ?airport) # JFK International Airport's Wikidata ID
# Fetching general airport information
OPTIONAL { ?airport wdt:P373 ?airportName. }
OPTIONAL { ?airport wdt:P948 ?pageBanner. }
OPTIONAL { ?airport wdt:P154 ?logo. }
OPTIONAL { ?airport wdt:P239 ?icao. }
OPTIONAL { ?airport wdt:P238 ?iata. }
OPTIONAL { ?airport wdt:P240 ?faa. }
OPTIONAL { ?airport wdt:P856 ?website. }
OPTIONAL { ?airport wdt:P137 ?operator. }
OPTIONAL { ?airport wdt:P571 ?opening. }
OPTIONAL { ?airport wdt:P5817 ?status. }
OPTIONAL {
?airport p:P2044 ?elevationStatement.
?elevationStatement psn:P2044 ?elevationValueNode.
?elevationValueNode wikibase:quantityAmount ?elevation.
OPTIONAL {
?elevationValueNode wikibase:quantityUnit ?elevationUnit.
?elevationUnit rdfs:label ?elevationUnitLabel FILTER(LANG(?elevationUnitLabel) = "en")
}
}
OPTIONAL { ?airport wdt:P18 ?image. }
# Fetching runway specific information
OPTIONAL {
?airport p:P529 ?runwayStatement.
?runwayStatement ps:P529 ?runway.
# Accessing the length qualifier
OPTIONAL {
?runwayStatement pqn:P2043 ?lengthNode.
?lengthNode wikibase:quantityAmount ?lengthValue.
?lengthNode wikibase:quantityUnit ?lengthUnit.
}
# Accessing the width qualifier
OPTIONAL {
?runwayStatement pqn:P2049 ?widthNode.
?widthNode wikibase:quantityAmount ?widthValue.
?widthNode wikibase:quantityUnit ?widthUnit.
}
# Accessing the material qualifier
OPTIONAL {
?runwayStatement pq:P186 ?material.
OPTIONAL { ?material rdfs:label ?materialLabel FILTER(LANG(?materialLabel) = "en") }
}
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?airport")
v2("?airportName"):::projected
v15("?elevation"):::projected
v13("?elevationStatement")
v16("?elevationUnit")
v12("?elevationUnitLabel"):::projected
v14("?elevationValueNode")
v7("?faa"):::projected
v6("?iata"):::projected
v5("?icao"):::projected
v17("?image"):::projected
v20("?lengthNode")
v22("?lengthUnit")
v21("?lengthValue"):::projected
v4("?logo"):::projected
v27("?material")
v26("?materialLabel"):::projected
v10("?opening"):::projected
v9("?operator"):::projected
v3("?pageBanner"):::projected
v19("?runway"):::projected
v18("?runwayStatement")
v11("?status"):::projected
v8("?website"):::projected
v23("?widthNode")
v25("?widthUnit")
v24("?widthValue"):::projected
c24(["bd:serviceParam"]):::iri
c26(["#91;AUTO_LANGUAGE#93;,en"]):::literal
bind0[/"'wd:Q8685'"/]
bind0 --as--o v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P373".-> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P948".-> v3
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P154".-> v4
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P239".-> v5
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P238".-> v6
end
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P240".-> v7
end
subgraph optional6["(optional)"]
style optional6 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P856".-> v8
end
subgraph optional7["(optional)"]
style optional7 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P137".-> v9
end
subgraph optional8["(optional)"]
style optional8 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P571".-> v10
end
subgraph optional9["(optional)"]
style optional9 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P5817".-> v11
end
subgraph optional10["(optional)"]
style optional10 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:P2044".-> v13
v13 --"p:statement/value-normalized/P2044"--> v14
v14 --"wikibase:quantityAmount"--> v15
subgraph optional11["(optional)"]
style optional11 fill:#bbf,stroke-dasharray: 5 5;
v14 -."wikibase:quantityUnit".-> v16
v16 --"rdfs:label"--> v12
end
end
subgraph optional12["(optional)"]
style optional12 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P18".-> v17
end
subgraph optional13["(optional)"]
style optional13 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:P529".-> v18
v18 --"p:statement/P529"--> v19
subgraph optional14["(optional)"]
style optional14 fill:#bbf,stroke-dasharray: 5 5;
v18 -."p:qualifier/value-normalized/P2043".-> v20
v20 --"wikibase:quantityAmount"--> v21
v20 --"wikibase:quantityUnit"--> v22
end
subgraph optional15["(optional)"]
style optional15 fill:#bbf,stroke-dasharray: 5 5;
v18 -."p:qualifier/value-normalized/P2049".-> v23
v23 --"wikibase:quantityAmount"--> v24
v23 --"wikibase:quantityUnit"--> v25
end
subgraph optional16["(optional)"]
style optional16 fill:#bbf,stroke-dasharray: 5 5;
v18 -."p:qualifier/P186".-> v27
subgraph optional17["(optional)"]
style optional17 fill:#bbf,stroke-dasharray: 5 5;
v27 -."rdfs:label".-> v26
end
end
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c24 --"wikibase:language"--> c26
end