From 1e612229e953de04cfc31018224ee9e4ebea63b4 Mon Sep 17 00:00:00 2001 From: Ali Ariff Date: Fri, 22 Sep 2023 10:23:16 +0200 Subject: [PATCH 1/7] formating Signed-off-by: Ali Ariff --- .../GSRS/gsrs-public-data-substances.rqg | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/etc/transformation/GSRS/gsrs-public-data-substances.rqg b/etc/transformation/GSRS/gsrs-public-data-substances.rqg index 1ec9df14..6e34bf82 100644 --- a/etc/transformation/GSRS/gsrs-public-data-substances.rqg +++ b/etc/transformation/GSRS/gsrs-public-data-substances.rqg @@ -47,7 +47,7 @@ GENERATE { ?Substance idmp-sub:hasMoiety ?SubstanceMoiety; . - ?SubstanceMoiety a idmp-sub:Moiety; + ?SubstanceMoiety a idmp-sub:Moiety; rdfs:label ?moietyFormula; idmp-sub:hasDefiningStructure ?MoietyMolecularStructure; idmp-sub:hasDefiningMolecularWeight ?MoietyStructureMolecularWeight ; @@ -113,17 +113,17 @@ GENERATE { GENERATE{ # Relationships - ?Substance ?SubstancesRelationshipProperty ?RelatedSubstance; + ?Substance ?SubstancesRelationshipProperty ?RelatedSubstance; . # Is Active Moiety Of - ?RelatedSubstance ?IsActiveMoietyOfProperty ?Substance; + ?RelatedSubstance ?IsActiveMoietyOfProperty ?Substance; . } - ITERATOR iter:JSONSurfer(?relationships, + ITERATOR iter:JSONSurfer(?relationships, "$[*]", "$.type", "$.relatedSubstance.approvalID" - ) AS + ) AS ?Relationship ?RelationshipType ?RelatedSubstanceApprovalID From b4b5e5ed780c47c4485d792595bfb435f15b7652 Mon Sep 17 00:00:00 2001 From: Ali Ariff Date: Fri, 22 Sep 2023 12:11:57 +0200 Subject: [PATCH 2/7] use hasStructuralRepresentationText Signed-off-by: Ali Ariff --- etc/transformation/GSRS/gsrs-public-data-substances.rqg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/transformation/GSRS/gsrs-public-data-substances.rqg b/etc/transformation/GSRS/gsrs-public-data-substances.rqg index 6e34bf82..9ce14947 100644 --- a/etc/transformation/GSRS/gsrs-public-data-substances.rqg +++ b/etc/transformation/GSRS/gsrs-public-data-substances.rqg @@ -39,7 +39,7 @@ GENERATE { . ?MolfileURI a idmp-sub:Molfile; - idmp-sub:hasStructuralRepresentationAttachment ?structureMolfile; + idmp-sub:hasStructuralRepresentationText ?structureMolfile; . From a95d0df4af201b71ff10b07e950b96da2bcb8ae8 Mon Sep 17 00:00:00 2001 From: Ali Ariff Date: Fri, 22 Sep 2023 12:21:43 +0200 Subject: [PATCH 3/7] remove generated uuid Signed-off-by: Ali Ariff --- .../GSRS/gsrs-public-data-substances.rqg | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/etc/transformation/GSRS/gsrs-public-data-substances.rqg b/etc/transformation/GSRS/gsrs-public-data-substances.rqg index 9ce14947..06fd3149 100644 --- a/etc/transformation/GSRS/gsrs-public-data-substances.rqg +++ b/etc/transformation/GSRS/gsrs-public-data-substances.rqg @@ -35,10 +35,11 @@ GENERATE { # Molecular Structure ?MolecularStructure a idmp-sub:MolecularStructure ; idmp-sub:hasSMILESValue ?structureSmilesString ; - cmns-dsg:isDescribedBy ?MolfileURI; + cmns-dsg:isDescribedBy ?StructureMolfileURI; . - ?MolfileURI a idmp-sub:Molfile; + # Molecular Structure Molfile + ?StructureMolfileURI a idmp-sub:Molfile; idmp-sub:hasStructuralRepresentationText ?structureMolfile; . @@ -57,7 +58,11 @@ GENERATE { ?MoietyMolecularStructure a idmp-sub:MolecularStructure ; idmp-sub:hasSMILESValue ?MoietyStructureSmilesString ; - cmns-dsg:isDescribedBy ?MoietyStructureMolfile; + cmns-dsg:isDescribedBy ?MoietyMolfileURI; + . + + ?MoietyMolfileURI a idmp-sub:Molfile; + idmp-sub:hasStructuralRepresentationText ?MoietyStructureMolfile; . } # Molecular Structure Moieties @@ -81,10 +86,9 @@ GENERATE { ?MoietyStructureMolecularWeight ?moietyStructureID - BIND(str(StrUUID()) as ?MoietyUUID) - BIND( AS ?SubstanceMoiety ) - - BIND( AS ?MoietyMolecularStructure ) + BIND( AS ?SubstanceMoiety ) + BIND( AS ?MoietyMolecularStructure ) + BIND( AS ?MoietyMolfileURI ) BIND(IF(str(?MoietystructureStereochemistry) = "ABSOLUTE", idmp-sub:Stereochemistry-Absolute , IF(str(?MoietystructureStereochemistry) = "ACHIRAL", idmp-sub:Stereochemistry-Achiral , @@ -174,6 +178,7 @@ ITERATOR iter:JSONSurfer(, BIND( AS ?Substance ) BIND( AS ?MolecularStructure ) +BIND( AS ?StructureMolfileURI ) BIND(IF(contains(str(?structureFormula), "."), idmp-sub:hasDefiningMolecularFormulaByMoiety , ?nothing ) AS ?hasMolecularFormulaByMoietyProperty) @@ -210,6 +215,3 @@ BIND(IF(str(?structureStereochemistry) = "ABSOLUTE", idmp-sub:Stereochemistry-Ab IF(str(?structureStereochemistry) = "UNKNOWN", idmp-sub:Stereochemistry-Unknown , ?structureStereochemistry ))))))))))))))))))))) AS ?Stereochemistry) - - BIND(IF(?structureMolfile != "",, ?unbound) as ?MolfileURI) - From 0d3b584e1b33248e83fde5afe1a220a487a46673 Mon Sep 17 00:00:00 2001 From: Ali Ariff Date: Fri, 22 Sep 2023 15:14:37 +0200 Subject: [PATCH 4/7] Use GSRS URI patterns Signed-off-by: Ali Ariff --- .../GSRS/gsrs-public-data-substances.rqg | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/etc/transformation/GSRS/gsrs-public-data-substances.rqg b/etc/transformation/GSRS/gsrs-public-data-substances.rqg index 06fd3149..17bc9686 100644 --- a/etc/transformation/GSRS/gsrs-public-data-substances.rqg +++ b/etc/transformation/GSRS/gsrs-public-data-substances.rqg @@ -86,9 +86,9 @@ GENERATE { ?MoietyStructureMolecularWeight ?moietyStructureID - BIND( AS ?SubstanceMoiety ) - BIND( AS ?MoietyMolecularStructure ) - BIND( AS ?MoietyMolfileURI ) + BIND( AS ?SubstanceMoiety ) + BIND( AS ?MoietyMolecularStructure ) + BIND( AS ?MoietyMolfileURI ) BIND(IF(str(?MoietystructureStereochemistry) = "ABSOLUTE", idmp-sub:Stereochemistry-Absolute , IF(str(?MoietystructureStereochemistry) = "ACHIRAL", idmp-sub:Stereochemistry-Achiral , @@ -177,8 +177,8 @@ ITERATOR iter:JSONSurfer(, ?relationships BIND( AS ?Substance ) -BIND( AS ?MolecularStructure ) -BIND( AS ?StructureMolfileURI ) +BIND( AS ?MolecularStructure ) +BIND( AS ?StructureMolfileURI ) BIND(IF(contains(str(?structureFormula), "."), idmp-sub:hasDefiningMolecularFormulaByMoiety , ?nothing ) AS ?hasMolecularFormulaByMoietyProperty) From 421c470a045c72f789994714ee21319a161828b1 Mon Sep 17 00:00:00 2001 From: Ali Ariff Date: Fri, 22 Sep 2023 15:25:40 +0200 Subject: [PATCH 5/7] Remove obsolete additional datasets Signed-off-by: Ali Ariff --- .github/workflows/unit_tests_run.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/unit_tests_run.yml b/.github/workflows/unit_tests_run.yml index f85df05f..959e6a41 100644 --- a/.github/workflows/unit_tests_run.yml +++ b/.github/workflows/unit_tests_run.yml @@ -93,10 +93,7 @@ jobs: done - name: Combine GSRS with IDMP run: | - sudo wget --no-verbose -m -nH -nd https://idmp-datasets.s3.eu-central-1.amazonaws.com/GSRS/gsrs-active-moiety.ttl - sudo wget --no-verbose -m -nH -nd https://idmp-datasets.s3.eu-central-1.amazonaws.com/GSRS/gsrs-dct-identifier.ttl - sudo wget --no-verbose -m -nH -nd https://idmp-datasets.s3.eu-central-1.amazonaws.com/GSRS/gsrs-skos-altLabel.ttl - source_files=(gsrs-transformed.ttl AboutIDMPDev-ReferenceIndividuals.ttl gsrs-active-moiety.ttl gsrs-dct-identifier.ttl gsrs-skos-altLabel.ttl) + source_files=(gsrs-transformed.ttl AboutIDMPDev-ReferenceIndividuals.ttl) output_file=gsrs-final.ttl # Loop through the source files and append their contents to the output file for file in "${source_files[@]}"; do From bdd7e304a26f8b90385d940290a2b151626e50b4 Mon Sep 17 00:00:00 2001 From: Ali Ariff Date: Tue, 26 Sep 2023 11:45:11 +0200 Subject: [PATCH 6/7] rename Signed-off-by: Ali Ariff --- etc/transformation/GSRS/gsrs-public-data-substances.rqg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/transformation/GSRS/gsrs-public-data-substances.rqg b/etc/transformation/GSRS/gsrs-public-data-substances.rqg index 17bc9686..66fa7eb6 100644 --- a/etc/transformation/GSRS/gsrs-public-data-substances.rqg +++ b/etc/transformation/GSRS/gsrs-public-data-substances.rqg @@ -58,10 +58,10 @@ GENERATE { ?MoietyMolecularStructure a idmp-sub:MolecularStructure ; idmp-sub:hasSMILESValue ?MoietyStructureSmilesString ; - cmns-dsg:isDescribedBy ?MoietyMolfileURI; + cmns-dsg:isDescribedBy ?MoietyStructureMolfileURI; . - ?MoietyMolfileURI a idmp-sub:Molfile; + ?MoietyStructureMolfileURI a idmp-sub:Molfile; idmp-sub:hasStructuralRepresentationText ?MoietyStructureMolfile; . } @@ -88,7 +88,7 @@ GENERATE { BIND( AS ?SubstanceMoiety ) BIND( AS ?MoietyMolecularStructure ) - BIND( AS ?MoietyMolfileURI ) + BIND( AS ?MoietyStructureMolfileURI ) BIND(IF(str(?MoietystructureStereochemistry) = "ABSOLUTE", idmp-sub:Stereochemistry-Absolute , IF(str(?MoietystructureStereochemistry) = "ACHIRAL", idmp-sub:Stereochemistry-Achiral , From 4691b9710d86bd81d207fac8d24dc6bd3c827dbc Mon Sep 17 00:00:00 2001 From: Ali Ariff Date: Tue, 26 Sep 2023 11:56:30 +0200 Subject: [PATCH 7/7] more renaming Signed-off-by: Ali Ariff --- .../GSRS/gsrs-public-data-substances.rqg | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/etc/transformation/GSRS/gsrs-public-data-substances.rqg b/etc/transformation/GSRS/gsrs-public-data-substances.rqg index 66fa7eb6..bf1016f8 100644 --- a/etc/transformation/GSRS/gsrs-public-data-substances.rqg +++ b/etc/transformation/GSRS/gsrs-public-data-substances.rqg @@ -45,18 +45,18 @@ GENERATE { GENERATE{ - ?Substance idmp-sub:hasMoiety ?SubstanceMoiety; + ?Substance idmp-sub:hasMoiety ?Moiety; . - ?SubstanceMoiety a idmp-sub:Moiety; + ?Moiety a idmp-sub:Moiety; rdfs:label ?moietyFormula; - idmp-sub:hasDefiningStructure ?MoietyMolecularStructure; + idmp-sub:hasDefiningStructure ?MoietyStructure; idmp-sub:hasDefiningMolecularWeight ?MoietyStructureMolecularWeight ; idmp-sub:hasDefiningMolecularFormula ?moietyFormula ; idmp-sub:hasDefiningStereochemistry ?MoietyStereochemistry ; . - ?MoietyMolecularStructure a idmp-sub:MolecularStructure ; + ?MoietyStructure a idmp-sub:MolecularStructure ; idmp-sub:hasSMILESValue ?MoietyStructureSmilesString ; cmns-dsg:isDescribedBy ?MoietyStructureMolfileURI; . @@ -86,8 +86,8 @@ GENERATE { ?MoietyStructureMolecularWeight ?moietyStructureID - BIND( AS ?SubstanceMoiety ) - BIND( AS ?MoietyMolecularStructure ) + BIND( AS ?Moiety ) + BIND( AS ?MoietyStructure ) BIND( AS ?MoietyStructureMolfileURI ) BIND(IF(str(?MoietystructureStereochemistry) = "ABSOLUTE", idmp-sub:Stereochemistry-Absolute ,