query-6b244d32fdf1a7fcb50c70c43905e9d0

rq turtle/ttl

Astronauti italiani in ordine di tempo di permanenza nello spazio SELECT ?item ?itemLabel ?timeinspace ?unitLabel ?wikiarticle WHERE { ?item wdt:P106 wd:Q11631. # Astronuati ?item wdt:P31 wd:Q5. # umani (i.e. non di fantasia) ?item wdt:P27 wd:Q38. # Nazionalità italiana

OPTIONAL { ?item wdt:P2873 ?timeinspace } # Tempo nello spazio OPTIONAL { ?item p:P2873/psv:P2873 [ # Unità di tempo wikibase:quantityUnit ?unit ] } FILTER (?timeinspace > 0). OPTIONAL { # Articolo su Wikipedia ?wikiarticle schema:about ?item . ?wikiarticle schema:inLanguage "en" . FILTER (SUBSTR(str(?wikiarticle), 1, 25) = "https://en.wikipedia.org/") }

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

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Astronauti italiani in ordine di tempo di permanenza nello spazio
SELECT ?item ?itemLabel ?timeinspace ?unitLabel ?wikiarticle 
WHERE {
  ?item wdt:P106 wd:Q11631.                  # Astronuati
  ?item wdt:P31 wd:Q5.                       # umani (i.e. non di fantasia)
  ?item wdt:P27 wd:Q38.                      # Nazionalità italiana

  OPTIONAL { ?item wdt:P2873 ?timeinspace }  # Tempo nello spazio
  OPTIONAL { ?item p:P2873/psv:P2873 [       # Unità di tempo
            wikibase:quantityUnit ?unit 
            ]
  }
  FILTER (?timeinspace > 0).
  OPTIONAL {                                 # Articolo su Wikipedia
      ?wikiarticle schema:about ?item .
      ?wikiarticle schema:inLanguage "en" .
      FILTER (SUBSTR(str(?wikiarticle), 1, 25) = "https://en.wikipedia.org/")
    }

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

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?item"):::projected v1("?timeinspace"):::projected v4("?unit") v2("?wikiarticle"):::projected a2((" ")) a1((" ")) c17(["en"]):::literal c10(["wd:Q38"]):::iri c19(["bd:serviceParam"]):::iri c8(["wd:Q5"]):::iri c21(["#91;AUTO_LANGUAGE#93;,en"]):::literal c6(["wd:Q11631"]):::iri f0[["?timeinspace > '0^^xsd:integer'"]] f0 --> v1 v3 --"p:direct/P106"--> c6 v3 --"p:direct/P31"--> c8 v3 --"p:direct/P27"--> c10 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P2873".-> v1 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; a1 -."wikibase:quantityUnit".-> v4 v3 --"p:P2873"--> a2 a2 --"p:statement/value/P2873"--> a1 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."schema:about".-> v3 v2 --"schema:inLanguage"--> c17 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c19 --"wikibase:language"--> c21 end