query-ca8aac7eaffe3a3ddc24dfa49934cbc9
Propertiesparent taxon (P171)taxon rank (P105)taxon author citation (P6507)publication date (P577)author name string (P2093)taxon name (P225)author (P50)stated in (P248)reference has role (P6184)taxon author (P405)series ordinal (P1545)
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
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 p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?taxon ?taxon_name ?author_citation ?ref ?refLabel ?author ?ord ?year WHERE { # use this line to check reference items first
?taxon wdt:P171* wd:Q264543. # Chlorophyta
# ?taxon wdt:P105 wd:Q34740. # genus rank
?taxon p:P225 ?s.
?s ps:P225 ?taxon_name.
# check: some taxon names have authors that are different from the authors of the containing publication
OPTIONAL { ?taxon wdt:P6507 ?author_citation. }
FILTER NOT EXISTS { ?s pq:P405 ?taxon_author. }
?s prov:wasDerivedFrom ?r.
?r pr:P248 ?ref.
?r pr:P6184 wd:Q1361864. # first valid description
# all authors reconciled
?ref p:P50 ?au .
?au ps:P50 ?author .
OPTIONAL { ?au pq:P1545 ?ord. }
?ref wdt:P577 ?pubdate .
FILTER NOT EXISTS { ?ref wdt:P2093 ?namestring. }
BIND (YEAR(xsd:dateTime(?pubdate)) AS ?year )
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }
} ORDER BY ?taxon xsd:integer(?ord) # add qualifiers in order of taxon author
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v10("?au")
v11("?author"):::projected
v8("?author_citation"):::projected
v4("?namestring")
v2("?ord"):::projected
v12("?pubdate")
v9("?r")
v3("?ref"):::projected
v5("?s")
v1("?taxon"):::projected
v6("?taxon_author")
v7("?taxon_name"):::projected
v13("?year"):::projected
c19(["#91;AUTO_LANGUAGE#93;,mul,en"]):::literal
c11(["wd:Q1361864"]):::iri
c17(["bd:serviceParam"]):::iri
c4(["wd:Q264543"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"p:direct/P2093"--> e0v2
e0v2("?namestring"):::projected
e0v1("?ref"):::projected
end
f0--EXISTS--> f0e0
f0 --> v3
f0 --> c1
f0 --> v4
v3 --"p:direct/P2093"--> v4
f1[["not "]]
subgraph f1e1["Exists Clause"]
e1v1 --"p:qualifier/P405"--> e1v2
e1v1("?s"):::projected
e1v2("?taxon_author"):::projected
end
f1--EXISTS--> f1e1
f1 --> v5
f1 --> c2
f1 --> v6
v5 --"p:qualifier/P405"--> v6
v1 --"p:direct/P171"--> c4
v1 --"p:P225"--> v5
v5 --"p:statement/P225"--> v7
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P6507".-> v8
end
v5 --"prov:wasDerivedFrom"--> v9
v9 --"p:reference/P248"--> v3
v9 --"p:reference/P6184"--> c11
v3 --"p:P50"--> v10
v10 --"p:statement/P50"--> v11
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v10 -."p:qualifier/P1545".-> v2
end
v3 --"p:direct/P577"--> v12
bind2[/"year-from-dateTime(http://www.w3.org/2001/XMLSchema#dateTime(?pubdate))"/]
v12 --o bind2
bind2 --as--o v13
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c17 --"wikibase:language"--> c19
end