query-f3d8c406a716e7717cb841bb9932450b

rq turtle/ttl

Taxa year of publication of scientific name for taxon (P574)

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
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 pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT ?item ?taxonName ?year (SUBSTR(?published1, 1, 10) as ?published) ?publishedIn ?title WHERE {
      ?item p:P225 ?taxonNameStatement .
      ?taxonNameStatement ps:P225 ?taxonName .
      ?taxonNameStatement pq:P574 ?date .
      ?taxonNameStatement prov:wasDerivedFrom ?ref .  
      OPTIONAL {?ref pr:P248/wdt:P1476 ?title} .
      OPTIONAL {?ref pr:P248/wdt:P577 ?published1} .
      OPTIONAL {?ref pr:P248/wdt:P1433/wdt:P1476 ?publishedIn} .
      BIND(xsd:integer(YEAR(?date)) as ?year) 
      #Filter(?year >= 2000)
      Filter(?year = 2016)  
      #Filter(?year >= 2017)  
}
ORDER BY DESC(?year) ASC(?taxonName)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?date") v3("?item"):::projected v10("?published") v8("?published1"):::projected v9("?publishedIn"):::projected v6("?ref") v2("?taxonName"):::projected v4("?taxonNameStatement") v7("?title"):::projected v10("?year"):::projected a1((" ")) a2((" ")) a3((" ")) a4((" ")) f0[["?year = '2016^^xsd:integer'"]] f0 --> v10 v3 --"p:P225"--> v4 v4 --"p:statement/P225"--> v2 v4 --"p:qualifier/P574"--> v5 v4 --"prov:wasDerivedFrom"--> v6 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v6 -."p:reference/P248".-> a1 a1 --"p:direct/P1476"--> v7 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v6 -."p:reference/P248".-> a2 a2 --"p:direct/P577"--> v8 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v6 -."p:reference/P248".-> a3 a3 --"p:direct/P1433"--> a4 a4 --"p:direct/P1476"--> v9 end bind1[/"http://www.w3.org/2001/XMLSchema#integer(year-from-dateTime(?date))"/] v5 --o bind1 bind1 --as--o v10 bind2[/"substring(?published1,'1^^xsd:integer','10^^xsd:integer')"/] v8 --o bind2 bind2 --as--o v10