query-8574c16c1366033a9d1a99f9c514a52a

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT distinct ?item ?itemLabel ?property ?value ?valueLabel ?statement
WHERE 
{
  {?item p:P1399 ?stat .
# imported from Wikimedia project (P143) and/or Wikimedia import URL (P4656)
  {?stat prov:wasDerivedFrom/pr:P143 [] .  } UNION
  {?stat prov:wasDerivedFrom/pr:P4656 [] . }
  bind(?stat as ?statement)
  bind(wdt:P1399 as ?property)
  ?stat ps:P1399 ?value .
  }
  UNION
 {?item p:P1050 ?stat2 .  
# imported from Wikimedia project (P143) and/or Wikimedia import URL (P4656)
  {?stat2 prov:wasDerivedFrom/pr:P143 [] .  } UNION
  {?stat2 prov:wasDerivedFrom/pr:P4656 [] . }
  bind(?stat2 as ?statement)
  bind(wdt:P1050 as ?property)
  ?stat2 ps:P1050 ?value .
  }    
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } 
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?item"):::projected v7("?property"):::projected v2("?stat") v6("?stat2") v7("?statement"):::projected v5("?value"):::projected a2((" ")) a4((" ")) a6((" ")) a8((" ")) a1((" ")) a3((" ")) a5((" ")) a7((" ")) c9(["bd:serviceParam"]):::iri c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v1 --"p:P1050"--> v6 subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; v6 --"prov:wasDerivedFrom"--> a7 a7 --"p:reference/P4656"--> a8 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v6 --"prov:wasDerivedFrom"--> a5 a5 --"p:reference/P143"--> a6 end union1r <== or ==> union1l end bind0[/"?stat2"/] v6 --o bind0 bind0 --as--o v7 bind1[/"'p:direct/P1050'"/] bind1 --as--o v7 v6 --"p:statement/P1050"--> v5 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"p:P1399"--> v2 subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; v2 --"prov:wasDerivedFrom"--> a3 a3 --"p:reference/P4656"--> a4 end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v2 --"prov:wasDerivedFrom"--> a1 a1 --"p:reference/P143"--> a2 end union2r <== or ==> union2l end bind2[/"?stat"/] v2 --o bind2 bind2 --as--o v7 bind3[/"'p:direct/P1399'"/] bind3 --as--o v7 v2 --"p:statement/P1399"--> v5 end union0r <== or ==> union0l end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end