Skip to content

Commit

Permalink
kif_lib.store.mapping.pubchem: Use applies_to_taxon for LD50
Browse files Browse the repository at this point in the history
  • Loading branch information
gflima committed Mar 16, 2024
1 parent df2df23 commit 5c39985
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
34 changes: 17 additions & 17 deletions examples/pubchem.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -841,14 +841,14 @@
"- (**AnnotationRecord**\n",
" - (**SnakSet**\n",
" - (**ValueSnak** (**Property** [has effect](http://www.wikidata.org/entity/P1542)) \"BEHAVIORAL: TREMOR; BEHAVIORAL: CONVULSIONS OR EFFECT ON SEIZURE THRESHOLD\"@en)\n",
" - (**ValueSnak** (**Property** [route of administration](http://www.wikidata.org/entity/P636)) (**Item** [oral administration](http://www.wikidata.org/entity/Q285166)))\n",
" - (**ValueSnak** (**Property** [afflicts](http://www.wikidata.org/entity/P689)) (**Item** [laboratory rat](http://www.wikidata.org/entity/Q3089676))))\n",
" - (**ValueSnak** (**Property** [applies to taxon](http://www.wikidata.org/entity/P2352)) (**Item** [laboratory rat](http://www.wikidata.org/entity/Q3089676)))\n",
" - (**ValueSnak** (**Property** [route of administration](http://www.wikidata.org/entity/P636)) (**Item** [oral administration](http://www.wikidata.org/entity/Q285166))))\n",
" - (**ReferenceRecord**\n",
" - (**ValueSnak** (**Property** [stated in](http://www.wikidata.org/entity/P248)) \"Toxicology and Applied Pharmacology., 7(767), 1965 \\[PMID:5895051]\"@en))\n",
" - **NormalRank**))"
],
"text/plain": [
"AnnotationRecordSet(AnnotationRecord(SnakSet(ValueSnak(Property(IRI('http://www.wikidata.org/entity/P1542')), Text('BEHAVIORAL: TREMOR; BEHAVIORAL: CONVULSIONS OR EFFECT ON SEIZURE THRESHOLD', 'en')), ValueSnak(Property(IRI('http://www.wikidata.org/entity/P636')), Item(IRI('http://www.wikidata.org/entity/Q285166'))), ValueSnak(Property(IRI('http://www.wikidata.org/entity/P689')), Item(IRI('http://www.wikidata.org/entity/Q3089676')))), ReferenceRecord(ValueSnak(Property(IRI('http://www.wikidata.org/entity/P248')), Text('Toxicology and Applied Pharmacology., 7(767), 1965 [PMID:5895051]', 'en'))), NormalRank()))"
"AnnotationRecordSet(AnnotationRecord(SnakSet(ValueSnak(Property(IRI('http://www.wikidata.org/entity/P1542')), Text('BEHAVIORAL: TREMOR; BEHAVIORAL: CONVULSIONS OR EFFECT ON SEIZURE THRESHOLD', 'en')), ValueSnak(Property(IRI('http://www.wikidata.org/entity/P2352')), Item(IRI('http://www.wikidata.org/entity/Q3089676'))), ValueSnak(Property(IRI('http://www.wikidata.org/entity/P636')), Item(IRI('http://www.wikidata.org/entity/Q285166')))), ReferenceRecord(ValueSnak(Property(IRI('http://www.wikidata.org/entity/P248')), Text('Toxicology and Applied Pharmacology., 7(767), 1965 [PMID:5895051]', 'en'))), NormalRank()))"
]
},
"metadata": {},
Expand All @@ -872,14 +872,14 @@
"(**AnnotationRecordSet**\n",
"- (**AnnotationRecord**\n",
" - (**SnakSet**\n",
" - (**ValueSnak** (**Property** [route of administration](http://www.wikidata.org/entity/P636)) (**Item** [intraperitoneal injection](http://www.wikidata.org/entity/Q1400536)))\n",
" - (**ValueSnak** (**Property** [afflicts](http://www.wikidata.org/entity/P689)) (**Item** [laboratory rat](http://www.wikidata.org/entity/Q3089676))))\n",
" - (**ValueSnak** (**Property** [applies to taxon](http://www.wikidata.org/entity/P2352)) (**Item** [laboratory rat](http://www.wikidata.org/entity/Q3089676)))\n",
" - (**ValueSnak** (**Property** [route of administration](http://www.wikidata.org/entity/P636)) (**Item** [intraperitoneal injection](http://www.wikidata.org/entity/Q1400536))))\n",
" - (**ReferenceRecord**\n",
" - (**ValueSnak** (**Property** [stated in](http://www.wikidata.org/entity/P248)) \"Acta Physiologica Polonica., 12(173), 1961 \\[PMID:13789227]\"@en))\n",
" - **NormalRank**))"
],
"text/plain": [
"AnnotationRecordSet(AnnotationRecord(SnakSet(ValueSnak(Property(IRI('http://www.wikidata.org/entity/P636')), Item(IRI('http://www.wikidata.org/entity/Q1400536'))), ValueSnak(Property(IRI('http://www.wikidata.org/entity/P689')), Item(IRI('http://www.wikidata.org/entity/Q3089676')))), ReferenceRecord(ValueSnak(Property(IRI('http://www.wikidata.org/entity/P248')), Text('Acta Physiologica Polonica., 12(173), 1961 [PMID:13789227]', 'en'))), NormalRank()))"
"AnnotationRecordSet(AnnotationRecord(SnakSet(ValueSnak(Property(IRI('http://www.wikidata.org/entity/P2352')), Item(IRI('http://www.wikidata.org/entity/Q3089676'))), ValueSnak(Property(IRI('http://www.wikidata.org/entity/P636')), Item(IRI('http://www.wikidata.org/entity/Q1400536')))), ReferenceRecord(ValueSnak(Property(IRI('http://www.wikidata.org/entity/P248')), Text('Acta Physiologica Polonica., 12(173), 1961 [PMID:13789227]', 'en'))), NormalRank()))"
]
},
"metadata": {},
Expand All @@ -903,14 +903,14 @@
"(**AnnotationRecordSet**\n",
"- (**AnnotationRecord**\n",
" - (**SnakSet**\n",
" - (**ValueSnak** (**Property** [route of administration](http://www.wikidata.org/entity/P636)) (**Item** [oral administration](http://www.wikidata.org/entity/Q285166)))\n",
" - (**ValueSnak** (**Property** [afflicts](http://www.wikidata.org/entity/P689)) (**Item** [laboratory rat](http://www.wikidata.org/entity/Q3089676))))\n",
" - (**ValueSnak** (**Property** [applies to taxon](http://www.wikidata.org/entity/P2352)) (**Item** [laboratory rat](http://www.wikidata.org/entity/Q3089676)))\n",
" - (**ValueSnak** (**Property** [route of administration](http://www.wikidata.org/entity/P636)) (**Item** [oral administration](http://www.wikidata.org/entity/Q285166))))\n",
" - (**ReferenceRecord**\n",
" - (**ValueSnak** (**Property** [stated in](http://www.wikidata.org/entity/P248)) \"Hygiene and Sanitation, 32(3)(349), 1967\"@en))\n",
" - **NormalRank**))"
],
"text/plain": [
"AnnotationRecordSet(AnnotationRecord(SnakSet(ValueSnak(Property(IRI('http://www.wikidata.org/entity/P636')), Item(IRI('http://www.wikidata.org/entity/Q285166'))), ValueSnak(Property(IRI('http://www.wikidata.org/entity/P689')), Item(IRI('http://www.wikidata.org/entity/Q3089676')))), ReferenceRecord(ValueSnak(Property(IRI('http://www.wikidata.org/entity/P248')), Text('Hygiene and Sanitation, 32(3)(349), 1967', 'en'))), NormalRank()))"
"AnnotationRecordSet(AnnotationRecord(SnakSet(ValueSnak(Property(IRI('http://www.wikidata.org/entity/P2352')), Item(IRI('http://www.wikidata.org/entity/Q3089676'))), ValueSnak(Property(IRI('http://www.wikidata.org/entity/P636')), Item(IRI('http://www.wikidata.org/entity/Q285166')))), ReferenceRecord(ValueSnak(Property(IRI('http://www.wikidata.org/entity/P248')), Text('Hygiene and Sanitation, 32(3)(349), 1967', 'en'))), NormalRank()))"
]
},
"metadata": {},
Expand Down Expand Up @@ -945,13 +945,13 @@
"(**AnnotationRecordSet**\n",
"- (**AnnotationRecord**\n",
" - (**SnakSet**\n",
" - (**ValueSnak** (**Property** [afflicts](http://www.wikidata.org/entity/P689)) (**Item** [man](http://www.wikidata.org/entity/Q8441))))\n",
" - (**ValueSnak** (**Property** [applies to taxon](http://www.wikidata.org/entity/P2352)) (**Item** [man](http://www.wikidata.org/entity/Q8441))))\n",
" - (**ReferenceRecord**\n",
" - (**ValueSnak** (**Property** [stated in](http://www.wikidata.org/entity/P248)) \"Poisoning; Toxicology, Symptoms, Treatments, 2nd ed., Arena, J.M., Springfield, IL, C.C. Thomas, 1970, 2(73), 1970\"@en))\n",
" - **NormalRank**))"
],
"text/plain": [
"AnnotationRecordSet(AnnotationRecord(SnakSet(ValueSnak(Property(IRI('http://www.wikidata.org/entity/P689')), Item(IRI('http://www.wikidata.org/entity/Q8441')))), ReferenceRecord(ValueSnak(Property(IRI('http://www.wikidata.org/entity/P248')), Text('Poisoning; Toxicology, Symptoms, Treatments, 2nd ed., Arena, J.M., Springfield, IL, C.C. Thomas, 1970, 2(73), 1970', 'en'))), NormalRank()))"
"AnnotationRecordSet(AnnotationRecord(SnakSet(ValueSnak(Property(IRI('http://www.wikidata.org/entity/P2352')), Item(IRI('http://www.wikidata.org/entity/Q8441')))), ReferenceRecord(ValueSnak(Property(IRI('http://www.wikidata.org/entity/P248')), Text('Poisoning; Toxicology, Symptoms, Treatments, 2nd ed., Arena, J.M., Springfield, IL, C.C. Thomas, 1970, 2(73), 1970', 'en'))), NormalRank()))"
]
},
"metadata": {},
Expand All @@ -975,14 +975,14 @@
"(**AnnotationRecordSet**\n",
"- (**AnnotationRecord**\n",
" - (**SnakSet**\n",
" - (**ValueSnak** (**Property** [route of administration](http://www.wikidata.org/entity/P636)) (**Item** [oral administration](http://www.wikidata.org/entity/Q285166)))\n",
" - (**ValueSnak** (**Property** [afflicts](http://www.wikidata.org/entity/P689)) (**Item** [dog](http://www.wikidata.org/entity/Q144))))\n",
" - (**ValueSnak** (**Property** [applies to taxon](http://www.wikidata.org/entity/P2352)) (**Item** [dog](http://www.wikidata.org/entity/Q144)))\n",
" - (**ValueSnak** (**Property** [route of administration](http://www.wikidata.org/entity/P636)) (**Item** [oral administration](http://www.wikidata.org/entity/Q285166))))\n",
" - (**ReferenceRecord**\n",
" - (**ValueSnak** (**Property** [stated in](http://www.wikidata.org/entity/P248)) \"Abdernalden's Handbuch der Biologischen Arbeitsmethoden., 4(1313), 1935\"@en))\n",
" - **NormalRank**))"
],
"text/plain": [
"AnnotationRecordSet(AnnotationRecord(SnakSet(ValueSnak(Property(IRI('http://www.wikidata.org/entity/P636')), Item(IRI('http://www.wikidata.org/entity/Q285166'))), ValueSnak(Property(IRI('http://www.wikidata.org/entity/P689')), Item(IRI('http://www.wikidata.org/entity/Q144')))), ReferenceRecord(ValueSnak(Property(IRI('http://www.wikidata.org/entity/P248')), Text(\"Abdernalden's Handbuch der Biologischen Arbeitsmethoden., 4(1313), 1935\", 'en'))), NormalRank()))"
"AnnotationRecordSet(AnnotationRecord(SnakSet(ValueSnak(Property(IRI('http://www.wikidata.org/entity/P2352')), Item(IRI('http://www.wikidata.org/entity/Q144'))), ValueSnak(Property(IRI('http://www.wikidata.org/entity/P636')), Item(IRI('http://www.wikidata.org/entity/Q285166')))), ReferenceRecord(ValueSnak(Property(IRI('http://www.wikidata.org/entity/P248')), Text(\"Abdernalden's Handbuch der Biologischen Arbeitsmethoden., 4(1313), 1935\", 'en'))), NormalRank()))"
]
},
"metadata": {},
Expand All @@ -1007,14 +1007,14 @@
"- (**AnnotationRecord**\n",
" - (**SnakSet**\n",
" - (**ValueSnak** (**Property** [has effect](http://www.wikidata.org/entity/P1542)) \"PERIPHERAL NERVE AND SENSATION: SPASTIC PARALYSIS WITH OR WITHOUT SENSORY CHANGE; SENSE ORGANS AND SPECIAL SENSES: HEMORRHAGE: EYE; GASTROINTESTINAL: GASTRITIS\"@en)\n",
" - (**ValueSnak** (**Property** [route of administration](http://www.wikidata.org/entity/P636)) (**Item** [intravenous injection](http://www.wikidata.org/entity/Q1369403)))\n",
" - (**ValueSnak** (**Property** [afflicts](http://www.wikidata.org/entity/P689)) (**Item** [rabbit](http://www.wikidata.org/entity/Q9394))))\n",
" - (**ValueSnak** (**Property** [applies to taxon](http://www.wikidata.org/entity/P2352)) (**Item** [rabbit](http://www.wikidata.org/entity/Q9394)))\n",
" - (**ValueSnak** (**Property** [route of administration](http://www.wikidata.org/entity/P636)) (**Item** [intravenous injection](http://www.wikidata.org/entity/Q1369403))))\n",
" - (**ReferenceRecord**\n",
" - (**ValueSnak** (**Property** [stated in](http://www.wikidata.org/entity/P248)) \"Journal of Toxicology and Environmental Health., (Suppl\"@en))\n",
" - **NormalRank**))"
],
"text/plain": [
"AnnotationRecordSet(AnnotationRecord(SnakSet(ValueSnak(Property(IRI('http://www.wikidata.org/entity/P1542')), Text('PERIPHERAL NERVE AND SENSATION: SPASTIC PARALYSIS WITH OR WITHOUT SENSORY CHANGE; SENSE ORGANS AND SPECIAL SENSES: HEMORRHAGE: EYE; GASTROINTESTINAL: GASTRITIS', 'en')), ValueSnak(Property(IRI('http://www.wikidata.org/entity/P636')), Item(IRI('http://www.wikidata.org/entity/Q1369403'))), ValueSnak(Property(IRI('http://www.wikidata.org/entity/P689')), Item(IRI('http://www.wikidata.org/entity/Q9394')))), ReferenceRecord(ValueSnak(Property(IRI('http://www.wikidata.org/entity/P248')), Text('Journal of Toxicology and Environmental Health., (Suppl', 'en'))), NormalRank()))"
"AnnotationRecordSet(AnnotationRecord(SnakSet(ValueSnak(Property(IRI('http://www.wikidata.org/entity/P1542')), Text('PERIPHERAL NERVE AND SENSATION: SPASTIC PARALYSIS WITH OR WITHOUT SENSORY CHANGE; SENSE ORGANS AND SPECIAL SENSES: HEMORRHAGE: EYE; GASTROINTESTINAL: GASTRITIS', 'en')), ValueSnak(Property(IRI('http://www.wikidata.org/entity/P2352')), Item(IRI('http://www.wikidata.org/entity/Q9394'))), ValueSnak(Property(IRI('http://www.wikidata.org/entity/P636')), Item(IRI('http://www.wikidata.org/entity/Q1369403')))), ReferenceRecord(ValueSnak(Property(IRI('http://www.wikidata.org/entity/P248')), Text('Journal of Toxicology and Environmental Health., (Suppl', 'en'))), NormalRank()))"
]
},
"metadata": {},
Expand Down
2 changes: 1 addition & 1 deletion kif_lib/store/mapping/pubchem.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ def _parse_toxicity_annotations(
quals.append(wd.has_effect(Text(entry['effect'])))
if 'organism' in entry:
organism_key = entry['organism']
quals.append(wd.afflicts(_organism.get(
quals.append(wd.applies_to_taxon(_organism.get(
organism_key, organism_key)))
if 'route' in entry:
route_key = entry['route']
Expand Down
4 changes: 3 additions & 1 deletion kif_lib/vocabulary/wd.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def get_entity_description(entity: Entity) -> Optional[str]:


# items
acetone = Q(49546, 'acetone')
Adam = Q(70899, 'Adam')
aromatic_hydrocarbon = Q(230731, 'aromatic hydrocarbon')
Atlantic_Ocean = Q(97, 'Atlantic Ocean')
Expand Down Expand Up @@ -65,7 +66,7 @@ def get_entity_description(entity: Entity) -> Optional[str]:
gram_per_cubic_centimetre = Q(13147228, 'gram per cubic centimetre')
gram_per_kilogram = Q(21061369, 'gram per kilogram')
gram_per_mole = Q(28924752, 'gram per mole')
Guinea_pig = Q(286088, 'Guinea pig')
Guinea_pig = Q(79803, 'Guinea pig')
Hazardous_Substances_Data_Bank = Q(5687720, 'Hazardous Substances Data Bank')
human = Q(5, 'human')
IBM = Q(37156, 'IBM')
Expand Down Expand Up @@ -127,6 +128,7 @@ def get_entity_description(entity: Entity) -> Optional[str]:
# properties
afflicts = P(689)
applies_to_part = P(518)
applies_to_taxon = P(2352)
assessment = P(5021)
author_name_string = P(2093)
based_on_heuristic = P(887)
Expand Down

0 comments on commit 5c39985

Please sign in to comment.