query-315b693b60e4b8129e4b752b2917d9a7

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 psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT
  ?item ?itemLabel 
  ?mp ?mpunit ?mpunitLabel 
  ?bp ?bpunit ?bpunitLabel 
  ?colorLabel 
  ?img 
WHERE
{
    ?item wdt:P31 wd:Q11173 .

    ?item p:P2101/psv:P2101 [ wikibase:quantityAmount ?mp ; wikibase:quantityUnit ?mpunit ] .
    FILTER ( ( ?mp <  30 && ?mpunit = wd:Q25267 ) \u007C\u007C ( ?mp <  86 && ?mpunit = wd:Q42289 )  ) 

    ?item p:P2102/psv:P2102 [ wikibase:quantityAmount ?bp ; wikibase:quantityUnit ?bpunit ] .
    FILTER ( ( ?bp < 250 && ?bpunit = wd:Q25267 ) \u007C\u007C ( ?bp < 482 && ?mpunit = wd:Q42289 )  ) 

    OPTIONAL { ?item wdt:P462 ?color } 
    FILTER ( ?color != wd:Q23444 \u007C\u007C !BOUND(?color) )

    OPTIONAL { ?item wdt:P18 ?img }

    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
LIMIT 1000

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?bp"):::projected v3("?bpunit"):::projected v1("?color") v7("?img"):::projected v6("?item"):::projected v5("?mp"):::projected v4("?mpunit"):::projected a2((" ")) a1((" ")) a4((" ")) a3((" ")) c19(["bd:serviceParam"]):::iri c9(["wd:Q11173"]):::iri c21(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["(?color != 'wd:Q23444' || not bound(?color))"]] f0 --> v1 f1[["(?bp < '250^^xsd:integer'?bpunit = 'wd:Q25267' || ?bp < '482^^xsd:integer'?mpunit = 'wd:Q42289')"]] f1 --> v2 f1 --> v3 f1 --> v4 f2[["(?mp < '30^^xsd:integer'?mpunit = 'wd:Q25267' || ?mp < '86^^xsd:integer'?mpunit = 'wd:Q42289')"]] f2 --> v5 f2 --> v4 v6 --"p:direct/P31"--> c9 a1 --"wikibase:quantityAmount"--> v5 a1 --"wikibase:quantityUnit"--> v4 v6 --"p:P2101"--> a2 a2 --"p:statement/value/P2101"--> a1 a3 --"wikibase:quantityAmount"--> v2 a3 --"wikibase:quantityUnit"--> v3 v6 --"p:P2102"--> a4 a4 --"p:statement/value/P2102"--> a3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v6 -."p:direct/P462".-> v1 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v6 -."p:direct/P18".-> v7 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c19 --"wikibase:language"--> c21 end