query-a00a2d157955dcf0a21b8cfbd390acdc

rq turtle/ttl

Propertiesparent taxon (P171)title (P1476)publication date (P577)main subject (P921)instance of (P31)found in taxon (P703)of (P642)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?title ?topicLabel ?taxonLabel ?protLabel
  (MIN(?pdate) AS ?pubdate)
{
  VALUES ?topic { wd:Q908902 wd:Q7202 } 
  ?item p:P921 [ ps:P921 ?topic; pq:P642 ?taxon ].
  ?taxon wdt:P171 wd:Q278567.
  ?item wdt:P1476 ?title.
  ?item wdt:P577 ?pdate.
  OPTIONAL { 
    ?item wdt:P921 ?prot.
    ?prot wdt:P31 wd:Q8054
    { ?prot wdt:P703 ?taxon } UNION { ?prot wdt:P703 wd:Q278567 }
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } .
}
GROUP BY ?item ?title ?topicLabel ?taxonLabel ?protLabel
ORDER BY ?pubdate

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?item"):::projected v6("?pdate"):::projected v7("?prot") v8("?pubdate") v3("?taxon") v5("?title"):::projected v2("?topic") a1((" ")) c15(["en"]):::literal c5(["wd:Q278567"]):::iri c13(["bd:serviceParam"]):::iri c10(["wd:Q8054"]):::iri bind0[/VALUES ?topic/] bind0-->v2 bind00(["wd:Q908902"]) bind00 --> bind0 bind01(["wd:Q7202"]) bind01 --> bind0 a1 --"p:statement/P921"--> v2 a1 --"p:qualifier/P642"--> v3 v4 --"p:P921"--> a1 v3 --"p:direct/P171"--> c5 v4 --"p:direct/P1476"--> v5 v4 --"p:direct/P577"--> v6 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."p:direct/P921".-> v7 v7 --"p:direct/P31"--> c10 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v7 --"p:direct/P703"--> c5 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v7 --"p:direct/P703"--> v3 end union0r <== or ==> union0l end end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c13 --"wikibase:language"--> c15 end bind2[/"min(?pdate)"/] v6 --o bind2 bind2 --as--o v8