Skip to content

Commit

Permalink
Implement the new chemical entity structure, see https://www.wikidata…
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Aug 16, 2023
1 parent 06c37d9 commit b6a7056
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scholia/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -1211,16 +1211,17 @@ def q_to_class(q):
'Q79529', # chemical substance
'Q407595', # metabolite
'Q2393187', # molecular entity
'Q113145171', # type of a chemical entity
]):
class_ = 'chemical'
elif set(classes).intersection([
'Q11344', # chemical element
]):
class_ = 'chemical_element'
elif set(classes).intersection([
'Q15711994', # family of isomeric compounds
'Q15711994', # group of isomeric compounds
'Q17339814', # group or class of chemical substances
'Q47154513', # structural class of chemical compounds
'Q47154513', # structural class of chemical entities
'Q55499636', # pharmacological class of chemical compounds
'Q55640599', # group of ions
'Q55662456', # group of ortho, meta, para isomers
Expand Down Expand Up @@ -1312,6 +1313,8 @@ def q_to_class(q):
elif set(parents).intersection([
'Q11173', # chemical compound
'Q79529', # chemical substance
'Q15711994', # group of isomeric entities
'Q47154513', # structural class of chemical entities
]):
class_ = 'chemical_class'
elif set(parents).intersection([
Expand Down

0 comments on commit b6a7056

Please sign in to comment.