query-bc4a8c3ef2fd29fa67fd52b091da9831

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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
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 
(sample(?mass_) as ?mass) (sample(?mass_unitLabel) as ?massUnitLabel) 
(sample(?constellation_) as ?constellation) (sample(?constellation_Label) as ?constellationLabel)  
(sample(?PM_) as ?PM) (sample(?PM_unitLabel) as ?PMUnitLabel) 
(sample(?Rad_Vel_) as ?Rad_Vel) (sample(?Rad_Vel_unitLabel) as ?Rad_VelUnitLabel) 
(sample(?SC_) as ?SC) (sample(?SC_unitLabel) as ?SCUnitLabel) 
(sample(?lumin_) as ?lumin) (sample(?lumin_unitLabel) as ?luminUnitLabel) 
(sample(?metal_) as ?metal) (sample(?metal_unitLabel) as ?metalUnitLabel) 
(sample(?parallax_) as ?parallax) (sample(?parallax_unitLabel) as ?parallaxUnitLabel) 
(sample(?LY_) as ?LY) 
(sample(?RA_) as ?RA) (sample(?RA_unitLabel) as ?RAUnitLabel) 
(sample(?declination_) as ?declination) (sample(?declination_unitLabel) as ?declinationUnitLabel) 
(sample(?Eff_Temp_) as ?Eff_Temp) (sample(?Eff_Temp_unitLabel) as ?Eff_TempUnitLabel) 
(sample(?SIMBAD_) as ?SIMBAD) WHERE
{
   {
  SELECT ?item WHERE 
{
  ?item wdt:P31 wd:Q523 .
  } LIMIT 100000 }  OPTIONAL {?item wdt:P59 ?constellation_. }
  OPTIONAL {?item wdt:P2214 ?parallax_. }
  OPTIONAL {?item p:P2583/psn:P2583 ?stat .
            ?stat wikibase:quantityAmount ?dist_to_earth. 
           BIND((?dist_to_earth * 0.00000000000000010570) as ?LY_)}
  OPTIONAL {?item p:P2067/psn:P2067 [wikibase:quantityAmount ?mass_ ; wikibase:quantityUnit ?mass_unit] . }
  OPTIONAL {?item p:P2215/psn:P2215 [wikibase:quantityAmount ?PM_ ; wikibase:quantityUnit ?PM_unit] . }
  OPTIONAL {?item p:P2216/psn:P2216 [wikibase:quantityAmount ?Rad_Vel_ ; wikibase:quantityUnit ?Rad_Vel_unit] . }
  OPTIONAL {?item p:P215/psn:P215   [wikibase:quantityAmount ?SC_ ; wikibase:quantityUnit ?SC_unit] . }
  OPTIONAL {?item p:P2060/psn:P2060 [wikibase:quantityAmount ?lumin_ ; wikibase:quantityUnit ?lumin_unit] . }
  OPTIONAL {?item p:P2227/psn:P2227 [wikibase:quantityAmount ?metal_ ; wikibase:quantityUnit ?metal_unit] . }
  OPTIONAL {?item p:P6257/psn:P6257 [wikibase:quantityAmount ?RA_ ; wikibase:quantityUnit ?RA_unit] . }
  OPTIONAL {?item p:P6258/psn:P6258 [wikibase:quantityAmount ?declination_ ; wikibase:quantityUnit ?declination_unit] . }
  OPTIONAL {?item p:P6879/psn:P6879 [wikibase:quantityAmount ?Eff_Temp_ ; wikibase:quantityUnit ?Eff_Temp_unit] . }
  OPTIONAL {?item wdt:P3083 ?SIMBAD_. }
  filter(?LY_ <30|| ?parallax_ > 100)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". 
                           ?constellation_ rdfs:label ?constellation_Label.
                           ?item rdfs:label ?itemLabel .
                           ?mass_unit rdfs:label ?mass_unitLabel .
                           ?PM_unit rdfs:label ?PM_unitLabel .
                           ?Rad_Vel_unit rdfs:label ?Rad_Vel_unitLabel .
                           ?SC_unit rdfs:label ?SC_unitLabel .
                           ?lumin_unit rdfs:label ?lumin_unitLabel .
                           ?metal_unit rdfs:label ?metal_unitLabel .
                           ?RA_unit rdfs:label ?RA_unitLabel .
                           ?declination_unit rdfs:label ?declination_unitLabel .
                           ?Eff_Temp_unit rdfs:label ?Eff_Temp_unitLabel .
                         }
} group by ?item ?itemLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v59("?Eff_Temp") v60("?Eff_TempUnitLabel") v23("?Eff_Temp_"):::projected v24("?Eff_Temp_unit") v36("?Eff_Temp_unitLabel"):::projected v54("?LY") v7("?LY_"):::projected v42("?PM") v43("?PMUnitLabel") v9("?PM_"):::projected v10("?PM_unit") v29("?PM_unitLabel"):::projected v55("?RA") v56("?RAUnitLabel") v19("?RA_"):::projected v20("?RA_unit") v34("?RA_unitLabel"):::projected v44("?Rad_Vel") v45("?Rad_VelUnitLabel") v11("?Rad_Vel_"):::projected v12("?Rad_Vel_unit") v30("?Rad_Vel_unitLabel"):::projected v46("?SC") v47("?SCUnitLabel") v13("?SC_"):::projected v14("?SC_unit") v31("?SC_unitLabel"):::projected v61("?SIMBAD") v25("?SIMBAD_"):::projected v40("?constellation") v41("?constellationLabel") v4("?constellation_"):::projected v26("?constellation_Label"):::projected v57("?declination") v58("?declinationUnitLabel") v21("?declination_"):::projected v22("?declination_unit") v35("?declination_unitLabel"):::projected v6("?dist_to_earth") v3("?item"):::projected v27("?itemLabel"):::projected v48("?lumin") v49("?luminUnitLabel") v15("?lumin_"):::projected v16("?lumin_unit") v32("?lumin_unitLabel"):::projected v38("?mass") v39("?massUnitLabel") v7("?mass_"):::projected v8("?mass_unit") v28("?mass_unitLabel"):::projected v50("?metal") v51("?metalUnitLabel") v17("?metal_"):::projected v18("?metal_unit") v33("?metal_unitLabel"):::projected v52("?parallax") v53("?parallaxUnitLabel") v2("?parallax_"):::projected v37("?parallax_unitLabel"):::projected v5("?stat") a1((" ")) a3((" ")) a2((" ")) a5((" ")) a4((" ")) a7((" ")) a6((" ")) a9((" ")) a8((" ")) a11((" ")) a10((" ")) a13((" ")) a12((" ")) a15((" ")) a14((" ")) a17((" ")) a16((" ")) a19((" ")) a18((" ")) c31(["bd:serviceParam"]):::iri c4(["wd:Q523"]):::iri c33(["#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/P59".-> v4 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P2214".-> v2 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:P2583".-> a1 a1 --"p:statement/value-normalized/P2583"--> v5 v5 --"wikibase:quantityAmount"--> v6 bind1[/"?dist_to_earth * '0.00000000000000010570^^xsd:decimal'"/] v6 --o bind1 bind1 --as--o v7 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; a2 -."wikibase:quantityAmount".-> v7 a2 --"wikibase:quantityUnit"--> v8 v3 --"p:P2067"--> a3 a3 --"p:statement/value-normalized/P2067"--> a2 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; a4 -."wikibase:quantityAmount".-> v9 a4 --"wikibase:quantityUnit"--> v10 v3 --"p:P2215"--> a5 a5 --"p:statement/value-normalized/P2215"--> a4 end subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; a6 -."wikibase:quantityAmount".-> v11 a6 --"wikibase:quantityUnit"--> v12 v3 --"p:P2216"--> a7 a7 --"p:statement/value-normalized/P2216"--> a6 end subgraph optional6["(optional)"] style optional6 fill:#bbf,stroke-dasharray: 5 5; a8 -."wikibase:quantityAmount".-> v13 a8 --"wikibase:quantityUnit"--> v14 v3 --"p:P215"--> a9 a9 --"p:statement/value-normalized/P215"--> a8 end subgraph optional7["(optional)"] style optional7 fill:#bbf,stroke-dasharray: 5 5; a10 -."wikibase:quantityAmount".-> v15 a10 --"wikibase:quantityUnit"--> v16 v3 --"p:P2060"--> a11 a11 --"p:statement/value-normalized/P2060"--> a10 end subgraph optional8["(optional)"] style optional8 fill:#bbf,stroke-dasharray: 5 5; a12 -."wikibase:quantityAmount".-> v17 a12 --"wikibase:quantityUnit"--> v18 v3 --"p:P2227"--> a13 a13 --"p:statement/value-normalized/P2227"--> a12 end subgraph optional9["(optional)"] style optional9 fill:#bbf,stroke-dasharray: 5 5; a14 -."wikibase:quantityAmount".-> v19 a14 --"wikibase:quantityUnit"--> v20 v3 --"p:P6257"--> a15 a15 --"p:statement/value-normalized/P6257"--> a14 end subgraph optional10["(optional)"] style optional10 fill:#bbf,stroke-dasharray: 5 5; a16 -."wikibase:quantityAmount".-> v21 a16 --"wikibase:quantityUnit"--> v22 v3 --"p:P6258"--> a17 a17 --"p:statement/value-normalized/P6258"--> a16 end subgraph optional11["(optional)"] style optional11 fill:#bbf,stroke-dasharray: 5 5; a18 -."wikibase:quantityAmount".-> v23 a18 --"wikibase:quantityUnit"--> v24 v3 --"p:P6879"--> a19 a19 --"p:statement/value-normalized/P6879"--> a18 end subgraph optional12["(optional)"] style optional12 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P3083".-> v25 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c31 --"wikibase:language"--> c33 v4 --"rdfs:label"--> v26 v3 --"rdfs:label"--> v27 v8 --"rdfs:label"--> v28 v10 --"rdfs:label"--> v29 v12 --"rdfs:label"--> v30 v14 --"rdfs:label"--> v31 v16 --"rdfs:label"--> v32 v18 --"rdfs:label"--> v33 v20 --"rdfs:label"--> v34 v22 --"rdfs:label"--> v35 v24 --"rdfs:label"--> v36 end bind26[/"sample(?mass_)"/] v7 --o bind26 bind26 --as--o v38 bind27[/"sample(?mass_unitLabel)"/] v28 --o bind27 bind27 --as--o v39 bind28[/"sample(?constellation_)"/] v4 --o bind28 bind28 --as--o v40 bind29[/"sample(?constellation_Label)"/] v26 --o bind29 bind29 --as--o v41 bind30[/"sample(?PM_)"/] v9 --o bind30 bind30 --as--o v42 bind31[/"sample(?PM_unitLabel)"/] v29 --o bind31 bind31 --as--o v43 bind32[/"sample(?Rad_Vel_)"/] v11 --o bind32 bind32 --as--o v44 bind33[/"sample(?Rad_Vel_unitLabel)"/] v30 --o bind33 bind33 --as--o v45 bind34[/"sample(?SC_)"/] v13 --o bind34 bind34 --as--o v46 bind35[/"sample(?SC_unitLabel)"/] v31 --o bind35 bind35 --as--o v47 bind36[/"sample(?lumin_)"/] v15 --o bind36 bind36 --as--o v48 bind37[/"sample(?lumin_unitLabel)"/] v32 --o bind37 bind37 --as--o v49 bind38[/"sample(?metal_)"/] v17 --o bind38 bind38 --as--o v50 bind39[/"sample(?metal_unitLabel)"/] v33 --o bind39 bind39 --as--o v51 bind40[/"sample(?parallax_)"/] v2 --o bind40 bind40 --as--o v52 bind41[/"sample(?parallax_unitLabel)"/] v37 --o bind41 bind41 --as--o v53 bind42[/"sample(?LY_)"/] v7 --o bind42 bind42 --as--o v54 bind43[/"sample(?RA_)"/] v19 --o bind43 bind43 --as--o v55 bind44[/"sample(?RA_unitLabel)"/] v34 --o bind44 bind44 --as--o v56 bind45[/"sample(?declination_)"/] v21 --o bind45 bind45 --as--o v57 bind46[/"sample(?declination_unitLabel)"/] v35 --o bind46 bind46 --as--o v58 bind47[/"sample(?Eff_Temp_)"/] v23 --o bind47 bind47 --as--o v59 bind48[/"sample(?Eff_Temp_unitLabel)"/] v36 --o bind48 bind48 --as--o v60 bind49[/"sample(?SIMBAD_)"/] v25 --o bind49 bind49 --as--o v61