query-77a947b0aa4b0664ceb0427ce31d4a39
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
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 ?taxon_authorLabel ?taxon_year
?stated_in ?year ?authors_en
WHERE {
{
SELECT
?st (SAMPLE(?taxon_name) AS ?taxon_name) (SAMPLE(?taxon_author) AS ?taxon_author) (YEAR(SAMPLE(?taxon_year_)) AS ?taxon_year)
(SAMPLE(?stated_in) AS ?stated_in) (YEAR(SAMPLE(?pubdate)) AS ?year) (GROUP_CONCAT(?author_en; SEPARATOR="; ") AS ?authors_en)
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 { ?author rdfs:label ?author_en. FILTER(LANG(?author_en) = "en") }
}
OPTIONAL { ?stated_in wdt:P577 ?pubdate. }
}
OPTIONAL {
?st ps:P225 ?taxon_name.
OPTIONAL { ?st pq:P405 ?taxon_author. }
OPTIONAL { ?st pq:P574 ?taxon_year_. }
}
}
GROUP BY ?st
#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;
v12("?_anon_42b5416610844a34809f33a099ae9de123477")
v13("?_anon_42b5416610844a34809f33a099ae9de123478")
v7("?author")
v6("?author_en")
v16("?authors_en"):::projected
v3("?item")
v4("?p")
v8("?pubdate")
v1("?refn")
v2("?st"):::projected
v15("?stated_in"):::projected
v14("?taxon_author"):::projected
v14("?taxon_name"):::projected
v14("?taxon_year"):::projected
v11("?taxon_year_")
v15("?year"):::projected
c7(["wikibase:BestRank"]):::iri
c2(["wd:Q1361864"]):::iri
c17(["bd:serviceParam"]):::iri
c19(["#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".-> v15
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v15 -."wdt:P50".-> v7
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v7 -."rdfs:label".-> v6
end
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v15 -."wdt:P577".-> v8
end
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v2 -."ps:P225".-> v14
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v2 -."pq:P405".-> v14
end
subgraph optional6["(optional)"]
style optional6 fill:#bbf,stroke-dasharray: 5 5;
v2 -."pq:P574".-> v11
end
end
bind6[/"sample(?taxon_year_)"/]
v11 --o bind6
bind6 --as--o v12
bind7[/"sample(?pubdate)"/]
v8 --o bind7
bind7 --as--o v13
bind8[/"sample(?taxon_name)"/]
v14 --o bind8
bind8 --as--o v14
bind9[/"sample(?taxon_author)"/]
v14 --o bind9
bind9 --as--o v14
bind10[/"year-from-dateTime()"/]
null --o bind10
bind10 --as--o v14
bind11[/"sample(?stated_in)"/]
v15 --o bind11
bind11 --as--o v15
bind12[/"year-from-dateTime()"/]
null --o bind12
bind12 --as--o v15
bind13[/"?author_en"/]
v6 --o bind13
bind13 --as--o v16
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c17 --"wikibase:language"--> c19
end