akokai / commongroups-archived

(archived) Molecular structure-based classification of chemicals in known hazard groups
MIT License
1 stars 0 forks source link

Finding substance identifiers #31

Closed akokai closed 7 years ago

akokai commented 7 years ago

This is not an issue now, but if we need to pull specific database IDs out of text (synonyms, etc.), here's a potentially useful resource: a Wikidata query showing the regular expression patterns for all chemical identifiers.

Here it is as a SPARQL query in case that link breaks.

SELECT ?item ?itemLabel ?_format_as_a_regular_expression WHERE {
  ?item wdt:P31 wd:Q19833835.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
  OPTIONAL { ?item wdt:P1793 ?_format_as_a_regular_expression. }
}