query-8063a04b0b2bac7ca9696946d9ee135e
]reply[18:41, 29 April 2019 (UTC)) talk (Snipre: To get your list of WD items with InChIKey and CAS number if available (link to English Wikipedia article), please follow the link above "Try it!", then click the button on the left bottom corner to run the query and wait 2-3 seconds. Once the data appear, you can download them using the button "Download" on the rigth, above the data. Let me know if you have some troubles. ChemConnector@
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT * WHERE {
?compound wdt:P31 wd:Q11173 ;
wdt:P235 ?inchikey.
OPTIONAL { ?compound wdt:P231 ?cas } .
OPTIONAL { ?compound wdt:P234 ?inchi } .
OPTIONAL { ?compound wdt:P683 ?chebi } .
OPTIONAL { ?compound wdt:P592 ?chembl } .
OPTIONAL { ?compound wdt:P662 ?pubchem } .
OPTIONAL { ?compound wdt:P652 ?unii } .
OPTIONAL { ?compound wdt:P715 ?zvg } .
OPTIONAL { ?compound wdt:P661 ?chemspider } .
OPTIONAL { ?compound wdt:P3117 ?DSSTOX } .
OPTIONAL { ?compound wdt:P2062 ?HSDB } .
OPTIONAL { ?compound wdt:P2057 ?HMDB } .
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v11("?DSSTOX"):::projected
v13("?HMDB"):::projected
v12("?HSDB"):::projected
v3("?cas"):::projected
v5("?chebi"):::projected
v6("?chembl"):::projected
v10("?chemspider"):::projected
v1("?compound"):::projected
v4("?inchi"):::projected
v2("?inchikey"):::projected
v7("?pubchem"):::projected
v8("?unii"):::projected
v9("?zvg"):::projected
c2(["wd:Q11173"]):::iri
v1 --"wdt:P31"--> c2
v1 --"wdt:P235"--> v2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P231".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P234".-> v4
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P683".-> v5
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P592".-> v6
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P662".-> v7
end
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P652".-> v8
end
subgraph optional6["(optional)"]
style optional6 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P715".-> v9
end
subgraph optional7["(optional)"]
style optional7 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P661".-> v10
end
subgraph optional8["(optional)"]
style optional8 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P3117".-> v11
end
subgraph optional9["(optional)"]
style optional9 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P2062".-> v12
end
subgraph optional10["(optional)"]
style optional10 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P2057".-> v13
end