Skip to content

Commit

Permalink
Update Molfile representation
Browse files Browse the repository at this point in the history
Signed-off-by: konradkrebs1411 <[email protected]>
  • Loading branch information
konradkrebs1411 committed Aug 8, 2023
1 parent c494a34 commit 3e7fa25
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions etc/transformation/GSRS/gsrs-public-data-substances.rqg
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,19 @@ GENERATE {
# Molecular Structure
?MolecularStructure a idmp-sub:MolecularStructure ;
idmp-sub:hasSMILESValue ?structureSmilesString ;
cmns-dsg:isDescribedBy ?structureMolfile;
cmns-dsg:isDescribedBy ?MolfileURI;
.

?MolfileURI a idmp-sub:Molfile;
idmp-sub:hasStructuralRepresentationAttachment ?structureMolfile;
.


GENERATE{
?Substance idmp-sub:hasMoiety ?SubstanceMoiety;
.

?SubstanceMoiety
?SubstanceMoiety a idmp-sub:Moiety;
rdfs:label ?moietyFormula;
idmp-sub:hasDefiningStructure ?MoietyMolecularStructure;
idmp-sub:hasDefiningMolecularWeight ?MoietyStructureMolecularWeight ;
Expand Down Expand Up @@ -75,9 +80,10 @@ GENERATE {
?MoietyStructureMolecularWeight
?moietyStructureID

BIND(<https://data.pistoiaalliance.org/idmp/gsrs/moiety/{ ?moietyHash }> AS ?SubstanceMoiety )
BIND(str(StrUUID()) as ?MoietyUUID)
BIND(<https://gsrs.ncats.nih.gov/api/v1/substances/{ ?RelatedSubstanceApprovalID }/{ ?MoietyUUID }> AS ?SubstanceMoiety )

BIND(<https://data.pistoiaalliance.org/idmp/gsrs/structure/{ ?moietyStructureID }> AS ?MoietyMolecularStructure )
BIND(<https://data.pistoiaalliance.org/idmp/gsrs/structure/{ ?MoietyUUID }> AS ?MoietyMolecularStructure )

BIND(IF(str(?MoietystructureStereochemistry) = "ABSOLUTE", idmp-sub:Stereochemistry-Absolute ,
IF(str(?MoietystructureStereochemistry) = "ACHIRAL", idmp-sub:Stereochemistry-Achiral ,
Expand Down Expand Up @@ -139,7 +145,7 @@ GENERATE {

}
# General Substance Info + Molecular Structure
ITERATOR iter:JSONSurfer(<public_data.json>,
ITERATOR iter:JSONSurfer(<result.json>,
"$[*]",
"$.approvalID",
"$.substanceClass",
Expand Down Expand Up @@ -204,4 +210,5 @@ BIND(IF(str(?structureStereochemistry) = "ABSOLUTE", idmp-sub:Stereochemistry-Ab
?structureStereochemistry )))))))))))))))))))))
AS ?Stereochemistry)

BIND(IF(?structureMolfile != "",<https://data.pistoiaalliance.org/idmp/gsrs/molfile/{ StrUUID() }>, ?unbound) as ?MolfileURI)

0 comments on commit 3e7fa25

Please sign in to comment.