query-dac1d70453b2184af9955da9d9a4d83e
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
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 p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?compound ?compoundLabel ?canonical_smiles ?sourceLabel ?publicationDate WHERE {
?compound p:P233 ?statement.
?statement ps:P233 ?canonical_smiles.
OPTIONAL {
?statement prov:wasDerivedFrom/pr:P248 ?source.
OPTIONAL {
?source wdt:P577 ?publicationDate.
}
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY ?compound
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?canonical_smiles"):::projected
v1("?compound"):::projected
v5("?publicationDate"):::projected
v4("?source")
v2("?statement")
a1((" "))
c7(["bd:serviceParam"]):::iri
c9(["en"]):::literal
v1 --"p:P233"--> v2
v2 --"p:statement/P233"--> v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."prov:wasDerivedFrom".-> a1
a1 --"p:reference/P248"--> v4
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:direct/P577".-> v5
end
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end