query-b63c127a84d73275871c94b871649b4c

rq turtle/ttl

Ponts amb mides normalitzades (totes en metres) SELECT DISTINCT ?item ?itemLabel ?mides WHERE { VALUES ?tipus {wd:Q12280} ?item wdt:P17 wd:Q29. ?item wdt:P31/wdt:P279* ?tipus. OPTIONAL {?item p:P2043 ?sllarg. ?sllarg psn:P2043 ?sllargn. ?sllargn wikibase:quantityAmount ?llarg. } OPTIONAL { ?item p:P2787 ?sllum. ?sllum psn:P2787 ?sllumn. ?sllumn wikibase:quantityAmount ?llum. } OPTIONAL {?item p:P2049 ?sample. ?sample psn:P2049 ?samplen. ?samplen wikibase:quantityAmount ?ample. } OPTIONAL {?item p:P2048 ?salt. ?salt psn:P2048 ?saltn. ?saltn wikibase:quantityAmount ?alt. } OPTIONAL {?item wdt:P1314 ?ulls} BIND(CONCAT(IF(BOUND(?ulls),CONCAT("ulls:",str(?ulls),""),""), IF(BOUND(?llum),CONCAT("llum:",str(?llum),""),""), IF(BOUND(?llarg),CONCAT("llarg:",str(?llarg),""),""), IF(BOUND(?ample),CONCAT("ample:",str(?ample),""),""), IF(BOUND(?alt),CONCAT("alt:",str(?alt),""),"")) as ?mides) SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],ca,en,es,fr".}
}

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#>
# Ponts amb mides normalitzades (totes en metres)
SELECT DISTINCT ?item ?itemLabel ?mides
 WHERE {
 VALUES ?tipus {wd:Q12280}
 ?item wdt:P17 wd:Q29.
 ?item wdt:P31/wdt:P279* ?tipus.
        OPTIONAL {?item p:P2043  ?sllarg.
               ?sllarg psn:P2043  ?sllargn.
                ?sllargn wikibase:quantityAmount ?llarg. 
              }
        OPTIONAL { ?item p:P2787  ?sllum.
               ?sllum psn:P2787  ?sllumn.
                ?sllumn wikibase:quantityAmount ?llum. 
              }
        OPTIONAL {?item p:P2049  ?sample.
               ?sample psn:P2049  ?samplen.
                ?samplen wikibase:quantityAmount ?ample. 
              }
        OPTIONAL {?item p:P2048  ?salt.
               ?salt psn:P2048  ?saltn.
                ?saltn wikibase:quantityAmount ?alt. 
              }
   OPTIONAL {?item wdt:P1314 ?ulls}
   BIND(CONCAT(IF(BOUND(?ulls),CONCAT("ulls:",str(?ulls),"</br>"),""), 
               IF(BOUND(?llum),CONCAT("llum:",str(?llum),"</br>"),""), 
               IF(BOUND(?llarg),CONCAT("llarg:",str(?llarg),"</br>"),""), 
               IF(BOUND(?ample),CONCAT("ample:",str(?ample),"</br>"),""), 
               IF(BOUND(?alt),CONCAT("alt:",str(?alt),"</br>"),"")) as ?mides)
   SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],ca,en,es,fr".}   
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v14("?alt") v11("?ample") v2("?item"):::projected v5("?llarg") v8("?llum") v16("?mides"):::projected v12("?salt") v13("?saltn") v9("?sample") v10("?samplen") v3("?sllarg") v4("?sllargn") v6("?sllum") v7("?sllumn") v1("?tipus") v15("?ulls") a1((" ")) c18(["#91;AUTO_LANGUAGE#93;,ca,en,es,fr"]):::literal c2(["wd:Q29"]):::iri c16(["bd:serviceParam"]):::iri bind0[/VALUES ?tipus/] bind0-->v1 bind00(["wd:Q12280"]) bind00 --> bind0 v2 --"p:direct/P17"--> c2 v2 --"p:direct/P31"--> a1 a1 --"p:direct/P279"--> v1 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:P2043".-> v3 v3 --"p:statement/value-normalized/P2043"--> v4 v4 --"wikibase:quantityAmount"--> v5 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:P2787".-> v6 v6 --"p:statement/value-normalized/P2787"--> v7 v7 --"wikibase:quantityAmount"--> v8 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:P2049".-> v9 v9 --"p:statement/value-normalized/P2049"--> v10 v10 --"wikibase:quantityAmount"--> v11 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:P2048".-> v12 v12 --"p:statement/value-normalized/P2048"--> v13 v13 --"wikibase:quantityAmount"--> v14 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P1314".-> v15 end bind1[/"concat(if(bound(?ulls),concat('ulls:',str(?ulls),'</br>'),''),if(bound(?llum),concat('llum:',str(?llum),'</br>'),''),if(bound(?llarg),concat('llarg:',str(?llarg),'</br>'),''),if(bound(?ample),concat('ample:',str(?ample),'</br>'),''),if(bound(?alt),concat('alt:',str(?alt),'</br>'),''))"/] v15 --o bind1 v8 --o bind1 v5 --o bind1 v11 --o bind1 v14 --o bind1 bind1 --as--o v16 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c16 --"wikibase:language"--> c18 end