query-ed2da4b016cccc143b1c39772fffa2fa

rq turtle/ttl

from element-specific scholia sparqle; TODO: list element qid+Label SELECT DISTINCT ?allotrope ?allotropeLabel WITH{ ## ?density ?densityUnit ?densityUnitLabel SELECT ?allotrope (SAMPLE(?densityStats) AS ?densityStat) WHERE { ?allotrope wdt:P31|wdt:P279 ?allotropeType . ?allotropeType p:P279 ?allotropeSpecsStatement . ?allotropeSpecsStatement ps:P279 wd:Q21198401 ; # pq:P642 target: . #remove element-specific QID (from scholia) OPTIONAL { ?allotrope p:P2054 ?densityStats . } } GROUP BY ?allotrope } AS %ALLOTROPES { INCLUDE %ALLOTROPES

OPTIONAL {

ps:P279 wd:Q21198401 p:P642 .

?allotrope p:P2054 ?densityStat .

?densityStat psv:P2054 ?densityValNode .

?densityValNode wikibase:quantityAmount ?density ;

wikibase:quantityUnit ?densityUnit .

}

SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY ASC(?allotropeLabel)

Use at

{
  H{  ## ?density ?densityUnit ?densityUnitLabel
  SELECT ?allotrope (SAMPLE(?densityStats) AS ?densityStat) WHERE {
    ?allotrope wdt:P31|wdt:P279 ?allotropeType .
    ?allotropeType p:P279 ?allotropeSpecsStatement .
    ?allotropeSpecsStatement ps:P279 wd:Q21198401 ;
                             # pq:P642 target: . #remove element-specific QID (from scholia)
    OPTIONAL {
      ?allotrope p:P2054 ?densityStats .
    }
  } GROUP BY ?allotrope
}#   OPTIONAL {
## ps:P279 wd:Q21198401  p:P642 .
#    ?allotrope p:P2054 ?densityStat .
#    ?densityStat psv:P2054 ?densityValNode .
#    ?densityValNode wikibase:quantityAmount ?density ;
#                    wikibase:quantityUnit ?densityUnit .
#  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ASC(?allotropeLabel)

Query found at