query-799584dfe945df5dc5ce97f6ef897a02

rq turtle/ttl

Taxa with Plazi IDs as a qualifiers for references

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
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 ?PlaziID ?PlaziID_URL ?publication ?publicationLabel ?referenceHasRole ?referenceHasRoleLabel  ?item ?itemLabel
WHERE
{
  {?item p:P225 ?statement .
    ?statement prov:wasDerivedFrom ?reference .
    ?reference pr:P1992 ?PlaziID
  BIND(IRI(CONCAT("http://treatment.plazi.org/id/",?PlaziID)) as ?PlaziID_URL)
  }
  OPTIONAL { ?item p:P225 ?statement .
    ?statement prov:wasDerivedFrom ?reference .
    ?reference pr:P248 ?publication.
              OPTIONAL { ?item p:P225 ?statement .
    ?statement prov:wasDerivedFrom ?reference .
    ?reference pr:P248 ?publication.
    ?reference pr:P6184 ?referenceHasRole}
}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . }
}
order by ?itemLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?PlaziID"):::projected v6("?PlaziID_URL"):::projected v2("?item"):::projected v1("?itemLabel"):::projected v7("?publication"):::projected v4("?reference") v8("?referenceHasRole"):::projected v3("?statement") c7(["bd:serviceParam"]):::iri c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal v2 --"p:P225"--> v3 v3 --"prov:wasDerivedFrom"--> v4 v4 --"p:reference/P1992"--> v5 bind0[/"concat('http://treatment.plazi.org/id/',?PlaziID)"/] v5 --o bind0 bind0 --as--o v6 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:P225".-> v3 v3 --"prov:wasDerivedFrom"--> v4 v4 --"p:reference/P248"--> v7 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:P225".-> v3 v3 --"prov:wasDerivedFrom"--> v4 v4 --"p:reference/P248"--> v7 v4 --"p:reference/P6184"--> v8 end end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end