query-47c2d8dd8d83683596c86512b81cd707
Elements, their discoverers and years of discovery
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 bd: <http://www.bigdata.com/rdf#>
SELECT ?element ?elementLabel ?atomicno (GROUP_CONCAT(?discovererLabel; separator=", ") AS ?discoverers) (MIN(YEAR(?discovery)) AS ?year) WHERE {
?element wdt:P31 wd:Q11344; # chemical element
wdt:P1086 ?atomicno
OPTIONAL{?element wdt:P61 ?discoverer}
OPTIONAL{?element wdt:P575 ?discovery}
MINUS{?element wdt:P279|wdt:P31 wd:Q1299291} # Remove hypothetical elements
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
?element rdfs:label ?elementLabel. ?discoverer rdfs:label ?discovererLabel }
} GROUP BY ?element ?elementLabel ?atomicno
ORDER BY ?atomicno
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?atomicno"):::projected
v3("?discoverer")
v6("?discovererLabel"):::projected
v7("?discoverers")
v4("?discovery"):::projected
v2("?element"):::projected
v5("?elementLabel"):::projected
v8("?year")
c9(["bd:serviceParam"]):::iri
c7(["wd:Q1299291"]):::iri
c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c2(["wd:Q11344"]):::iri
v2 --"wdt:P31"--> c2
v2 --"wdt:P1086"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P61".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P575".-> v4
end
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P31"--> c7
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P279"--> c7
end
union0r <== or ==> union0l
end
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
v2 --"rdfs:label"--> v5
v3 --"rdfs:label"--> v6
end
bind3[/"?discovererLabel"/]
v6 --o bind3
bind3 --as--o v7
bind4[/"min(year-from-dateTime(?discovery))"/]
v4 --o bind4
bind4 --as--o v8