query-f347d02c89ced2316b385a6de9b87923

rq turtle/ttl

TODO

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 prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT
  ?st ?taxon_name ?taxon_author (YEAR(?taxon_year_) AS ?taxon_year)
  ?stated_in (YEAR(?pubdate) AS ?year) ?author ?author_str 
WHERE {
   {
  SELECT * 
  WHERE {
    ?refn pr:P6184 wd:Q1361864;
      ^prov:wasDerivedFrom ?st.
    ?item wdt:P31 wd:Q16521;
      ?p ?st.
    ?st a wikibase:BestRank.
    OPTIONAL {
      ?refn pr:P248 ?stated_in.
      OPTIONAL { ?stated_in wdt:P50 ?author . }
      OPTIONAL { ?stated_in wdt:P2093 ?author_str . }
      OPTIONAL { ?stated_in wdt:P577 ?pubdate. }
    }
    OPTIONAL {
      ?st ps:P225 ?taxon_name.
      OPTIONAL { ?st pq:P405 ?taxon_author. }
      OPTIONAL { ?st pq:P574 ?taxon_year_. }
    }
  }
  #LIMIT 10000
}  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; v6("?author"):::projected v7("?author_str"):::projected v3("?item") v4("?p") v8("?pubdate"):::projected v1("?refn") v2("?st"):::projected v5("?stated_in"):::projected v10("?taxon_author"):::projected v9("?taxon_name"):::projected v12("?taxon_year") v11("?taxon_year_"):::projected v13("?year") c7(["wikibase:BestRank"]):::iri c2(["wd:Q1361864"]):::iri c16(["bd:serviceParam"]):::iri c18(["#91;AUTO_LANGUAGE#93;,en"]):::literal c5(["wd:Q16521"]):::iri v1 --"pr:P6184"--> c2 v2 --"prov:wasDerivedFrom"--> v1 v3 --"wdt:P31"--> c5 v3 -->v4--> v2 v2 --"a"--> c7 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."pr:P248".-> v5 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v5 -."wdt:P50".-> v6 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v5 -."wdt:P2093".-> v7 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v5 -."wdt:P577".-> v8 end end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v2 -."ps:P225".-> v9 subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v2 -."pq:P405".-> v10 end subgraph optional6["(optional)"] style optional6 fill:#bbf,stroke-dasharray: 5 5; v2 -."pq:P574".-> v11 end end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c16 --"wikibase:language"--> c18 end bind0[/"year-from-dateTime(?taxon_year_)"/] v11 --o bind0 bind0 --as--o v12 bind1[/"year-from-dateTime(?pubdate)"/] v8 --o bind1 bind1 --as--o v13