query-df0588d5b91a6b1cf13a29e1659d55bc
Ближайшие к Солнцу галактики
SELECT distinct ?item ?label ?dist ?distunitLabel WHERE {
?item wdt:P361 wd:Q3944.
SERVICE wikibase:label {
bd:serviceParam wikibase:language "ru" .
?item rdfs:label ?label.
?distunit rdfs:label ?distunitLabel.
}
?item p:P2583/psv:P2583 ?distT.
?distT wikibase:quantityAmount ?dist.
?distT wikibase:quantityUnit ?distunit.
OPTIONAL { ?item wdt:P18 ?_image. }
}
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 psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Ближайшие к Солнцу галактики
SELECT distinct ?item ?label ?dist ?distunitLabel WHERE {
?item wdt:P361 wd:Q3944.
SERVICE wikibase:label {
bd:serviceParam wikibase:language "ru" .
?item rdfs:label ?label.
?distunit rdfs:label ?distunitLabel.
}
?item p:P2583/psv:P2583 ?distT.
?distT wikibase:quantityAmount ?dist.
?distT wikibase:quantityUnit ?distunit.
OPTIONAL { ?item wdt:P18 ?_image. }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v7("?_image")
v6("?dist"):::projected
v5("?distT")
v3("?distunit")
v4("?distunitLabel"):::projected
v1("?item"):::projected
v2("?label"):::projected
a1((" "))
c2(["wd:Q3944"]):::iri
c4(["bd:serviceParam"]):::iri
c6(["ru"]):::literal
v1 --"p:direct/P361"--> c2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c4 --"wikibase:language"--> c6
v1 --"rdfs:label"--> v2
v3 --"rdfs:label"--> v4
end
v1 --"p:P2583"--> a1
a1 --"p:statement/value/P2583"--> v5
v5 --"wikibase:quantityAmount"--> v6
v5 --"wikibase:quantityUnit"--> v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P18".-> v7
end