query-c5159957cab238acdae39b722fb8704d

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX psn: <http://www.wikidata.org/prop/statement/value-normalized/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?parallax ?dist_to_earth ?unitLabel ?ly WHERE
{
   {
  SELECT ?item WHERE 
{
  ?item wdt:P31 wd:Q523 .
  } LIMIT 10000 }  OPTIONAL {?item wdt:P2214 ?parallax. }
  OPTIONAL {?item p:P2583/psn:P2583 ?stat .
            ?stat wikibase:quantityAmount ?dist_to_earth. 
            ?stat wikibase:quantityUnit ?unit.
           BIND((?dist_to_earth * 0.00000000000000010570) as ?ly)}
  filter(?ly <30 || ?parallax > 100)
  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; v5("?dist_to_earth"):::projected v3("?item"):::projected v7("?ly"):::projected v2("?parallax"):::projected v4("?stat") v6("?unit") a1((" ")) c4(["wd:Q523"]):::iri c11(["bd:serviceParam"]):::iri c13(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["(?ly < '30^^xsd:integer' || ?parallax > '100^^xsd:integer')"]] f0 --> v7 f0 --> v2 v3 --"p:direct/P31"--> c4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P2214".-> v2 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:P2583".-> a1 a1 --"p:statement/value-normalized/P2583"--> v4 v4 --"wikibase:quantityAmount"--> v5 v4 --"wikibase:quantityUnit"--> v6 bind1[/"?dist_to_earth * '0.00000000000000010570^^xsd:decimal'"/] v5 --o bind1 bind1 --as--o v7 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end