query-2032e6cf9ae79acd299b74ac42303622
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 pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?parent_taxonLabel ?taxon_name ?item ?year_described (group_concat(distinct ?QI;separator="; ") as ?QId) (group_concat(?taxon_authorLabel;separator="; ") as ?author) ?nomencaturalstatus ?nomencaturalstatusLabel ?inaturalist_ID WHERE {
?item wdt:P171 wd:Q1757472;
p:P225 ?stat.
?stat ps:P225 ?taxon_name.
OPTIONAL { ?item wdt:P171 ?parent_taxon. }
OPTIONAL { ?stat pq:P574 ?year_of_taxon_name_publication. }
OPTIONAL { ?stat pq:P405 ?taxon_author.
bind(replace(str(?taxon_author),"http://www.wikidata.org/entity/","") as ?QI)
}
OPTIONAL { ?stat pq:P1135 ?nomencaturalstatus. }
OPTIONAL { ?item wdt:P3151 ?inaturalist_ID. }
BIND(str(YEAR(?year_of_taxon_name_publication)) AS ?year_described).
SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
?taxon_author rdfs:label ?taxon_authorLabel .
?nomencaturalstatus rdfs:label ?nomencaturalstatusLabel .
?parent_taxon rdfs:label ?parent_taxonLabel
}
} GROUP BY ?parent_taxonLabel ?taxon_name ?item ?year_described ?nomencaturalstatus ?nomencaturalstatusLabel ?inaturalist_ID
ORDER BY DESC (?year_described)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v8("?QI"):::projected
v14("?QId")
v15("?author")
v10("?inaturalist_ID"):::projected
v2("?item"):::projected
v9("?nomencaturalstatus"):::projected
v12("?nomencaturalstatusLabel"):::projected
v5("?parent_taxon")
v13("?parent_taxonLabel"):::projected
v3("?stat")
v7("?taxon_author")
v11("?taxon_authorLabel"):::projected
v4("?taxon_name"):::projected
v11("?year_described"):::projected
v6("?year_of_taxon_name_publication")
c10(["bd:serviceParam"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c2(["wd:Q1757472"]):::iri
v2 --"p:direct/P171"--> c2
v2 --"p:P225"--> v3
v3 --"p:statement/P225"--> v4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P171".-> v5
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P574".-> v6
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P405".-> v7
bind0[/"replace(str(?taxon_author),'http://www.wikidata.org/entity/','')"/]
v7 --o bind0
bind0 --as--o v8
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P1135".-> v9
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P3151".-> v10
end
bind1[/"str(year-from-dateTime(?year_of_taxon_name_publication))"/]
v6 --o bind1
bind1 --as--o v11
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
v7 --"rdfs:label"--> v11
v9 --"rdfs:label"--> v12
v5 --"rdfs:label"--> v13
end
bind4[/"?QI"/]
v8 --o bind4
bind4 --as--o v14
bind5[/"?taxon_authorLabel"/]
v11 --o bind5
bind5 --as--o v15