aehrc / fhir-owl

Transforms OWL ontologies into FHIR code systems.
Other
20 stars 13 forks source link

Synonyms not in output #10

Open joeflack4 opened 2 years ago

joeflack4 commented 2 years ago

Overview

I'm trying to convert Mondo from OWL to FHIR. However, synonyms are not appearing.

Example current output

{
    "code": "MONDO_0002776",
    "display": "external ear disorder",
    "property": [ {
      "code": "imported",
      "valueBoolean": false
    }, {
      "code": "parent",
      "valueCode": "MONDO_0021205"
    }, {
      "code": "parent",
      "valueCode": "MONDO_0002409"
    }, {
      "code": "root",
      "valueBoolean": false
    }, {
      "code": "deprecated",
      "valueBoolean": false
    } ]
}

Example expected output

I expect something like this. Leaving out irrelevant properties and only including 1 of the 11 synonyms here:

{
    "code": "MONDO_0002776",
    "display": "external ear disorder",
    "property": [ {
      "code": "http://www.geneontology.org/formats/oboInOwl#hasRelatedSynonym",
      "valueString": "preauricular sinus or fistula NOS (disorder)"
    }, {
    ...
    } ]
  }

Reproducing

  1. Download mondo: https://github.com/monarch-initiative/mondo/releases/download/v2022-07-01/mondo.owl
  2. Runfhir-owl with the synonym flag -s:
    java -jar .../fhir-owl.jar -i .../mondo.owl -o .../mondo.json -s ,"http://www.geneontology.org/formats/oboInOwl#hasSynonym","http://www.geneontology.org/formats/oboInOwl#hasExactSynonym","http://www.geneontology.org/formats/oboInOwl#hasNarrowSynonym","http://www.geneontology.org/formats/oboInOwl#hasBroadSynonym","http://www.geneontology.org/formats/oboInOwl#hasRelatedSynonym"

Additional info

Examples of synonym usage in `mondo.owl

    <!-- The whole class with all the synonyms -->

    <owl:Class rdf:about="http://purl.obolibrary.org/obo/MONDO_0002776">
        <owl:equivalentClass>
            <owl:Class>
                <owl:intersectionOf rdf:parseType="Collection">
                    <rdf:Description rdf:about="http://purl.obolibrary.org/obo/MONDO_0000001"/>
                    <owl:Restriction>
                        <owl:onProperty rdf:resource="http://purl.obolibrary.org/obo/RO_0004026"/>
                        <owl:someValuesFrom rdf:resource="http://purl.obolibrary.org/obo/UBERON_0001691"/>
                    </owl:Restriction>
                </owl:intersectionOf>
            </owl:Class>
        </owl:equivalentClass>
        <rdfs:subClassOf rdf:resource="http://purl.obolibrary.org/obo/MONDO_0002409"/>
        <rdfs:subClassOf rdf:resource="http://purl.obolibrary.org/obo/MONDO_0021205"/>
        <rdfs:subClassOf>
            <owl:Restriction>
                <owl:onProperty rdf:resource="http://purl.obolibrary.org/obo/RO_0004026"/>
                <owl:someValuesFrom rdf:resource="http://purl.obolibrary.org/obo/UBERON_0001691"/>
            </owl:Restriction>
        </rdfs:subClassOf>
        <obo:IAO_0000115 rdf:datatype="http://www.w3.org/2001/XMLSchema#string">A disease involving the external ear.</obo:IAO_0000115>
        <terms:conformsTo rdf:resource="http://purl.obolibrary.org/obo/mondo/patterns/location.yaml"/>
        <terms:conformsTo rdf:resource="http://purl.obolibrary.org/obo/mondo/patterns/location_top.yaml"/>
        <oboInOwl:hasDbXref rdf:datatype="http://www.w3.org/2001/XMLSchema#string">DOID:379</oboInOwl:hasDbXref>
        <oboInOwl:hasDbXref rdf:datatype="http://www.w3.org/2001/XMLSchema#string">ICD10CM:H60-H62</oboInOwl:hasDbXref>
        <oboInOwl:hasDbXref rdf:datatype="http://www.w3.org/2001/XMLSchema#string">ICD9:380</oboInOwl:hasDbXref>
        <oboInOwl:hasDbXref rdf:datatype="http://www.w3.org/2001/XMLSchema#string">ICD9:380.9</oboInOwl:hasDbXref>
        <oboInOwl:hasDbXref rdf:datatype="http://www.w3.org/2001/XMLSchema#string">ICD9:744.47</oboInOwl:hasDbXref>
        <oboInOwl:hasDbXref rdf:datatype="http://www.w3.org/2001/XMLSchema#string">NCIT:C26972</oboInOwl:hasDbXref>
        <oboInOwl:hasDbXref rdf:datatype="http://www.w3.org/2001/XMLSchema#string">SCTID:49130001</oboInOwl:hasDbXref>
        <oboInOwl:hasDbXref rdf:datatype="http://www.w3.org/2001/XMLSchema#string">UMLS:C0155388</oboInOwl:hasDbXref>
        <oboInOwl:hasExactSynonym rdf:datatype="http://www.w3.org/2001/XMLSchema#string">disease of external ear</oboInOwl:hasExactSynonym>
        <oboInOwl:hasExactSynonym rdf:datatype="http://www.w3.org/2001/XMLSchema#string">disease or disorder of external ear</oboInOwl:hasExactSynonym>
        <oboInOwl:hasExactSynonym rdf:datatype="http://www.w3.org/2001/XMLSchema#string">disorder of external ear</oboInOwl:hasExactSynonym>
        <oboInOwl:hasExactSynonym rdf:datatype="http://www.w3.org/2001/XMLSchema#string">external ear disease</oboInOwl:hasExactSynonym>
        <oboInOwl:hasExactSynonym rdf:datatype="http://www.w3.org/2001/XMLSchema#string">external ear disease or disorder</oboInOwl:hasExactSynonym>
        <oboInOwl:hasExactSynonym rdf:datatype="http://www.w3.org/2001/XMLSchema#string">external ear disorder</oboInOwl:hasExactSynonym>
        <oboInOwl:hasExactSynonym rdf:datatype="http://www.w3.org/2001/XMLSchema#string">preauricular sinus and fistula</oboInOwl:hasExactSynonym>
        <oboInOwl:hasRelatedSynonym rdf:datatype="http://www.w3.org/2001/XMLSchema#string">preauricular cyst</oboInOwl:hasRelatedSynonym>
        <oboInOwl:hasRelatedSynonym rdf:datatype="http://www.w3.org/2001/XMLSchema#string">preauricular cyst (disorder)</oboInOwl:hasRelatedSynonym>
        <oboInOwl:hasRelatedSynonym rdf:datatype="http://www.w3.org/2001/XMLSchema#string">preauricular sinus and fistula (disorder)</oboInOwl:hasRelatedSynonym>
        <oboInOwl:hasRelatedSynonym rdf:datatype="http://www.w3.org/2001/XMLSchema#string">preauricular sinus or fistula</oboInOwl:hasRelatedSynonym>
        <oboInOwl:hasRelatedSynonym rdf:datatype="http://www.w3.org/2001/XMLSchema#string">preauricular sinus or fistula NOS (disorder)</oboInOwl:hasRelatedSynonym>
        <oboInOwl:id rdf:datatype="http://www.w3.org/2001/XMLSchema#string">MONDO:0002776</oboInOwl:id>
        <rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string">external ear disorder</rdfs:label>
        <skos:exactMatch rdf:resource="http://identifiers.org/snomedct/49130001"/>
        <skos:exactMatch rdf:resource="http://linkedlifedata.com/resource/umls/id/C0155388"/>
        <skos:exactMatch rdf:resource="http://purl.obolibrary.org/obo/DOID_379"/>
        <skos:exactMatch rdf:resource="http://purl.obolibrary.org/obo/NCIT_C26972"/>
        <skos:exactMatch rdf:resource="https://icd.codes/icd10cm/H60-H62"/>
    </owl:Class>

    <!-- Not primary problem of this issue; just illustrative: One of a dozen or more axioms on the class. Shows additional annotation props for a particular synonym. -->

    <owl:Axiom>
        <owl:annotatedSource rdf:resource="http://purl.obolibrary.org/obo/MONDO_0002776"/>
        <owl:annotatedProperty rdf:resource="http://www.geneontology.org/formats/oboInOwl#hasRelatedSynonym"/>
        <owl:annotatedTarget rdf:datatype="http://www.w3.org/2001/XMLSchema#string">preauricular sinus or fistula NOS (disorder)</owl:annotatedTarget>
        <oboInOwl:hasDbXref rdf:datatype="http://www.w3.org/2001/XMLSchema#string">DOID:379</oboInOwl:hasDbXref>
        <oboInOwl:hasSynonymType rdf:resource="http://purl.obolibrary.org/obo/mondo#DUBIOUS"/>
    </owl:Axiom>

    <!-- Not primary problem of this issue; just illustrative: The annotation prop definition used int he above axiom example. --> 

    <owl:AnnotationProperty rdf:about="http://purl.obolibrary.org/obo/mondo#DUBIOUS">
        <rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string">dubious synonym</rdfs:label>
        <rdfs:subPropertyOf rdf:resource="http://www.geneontology.org/formats/oboInOwl#SynonymTypeProperty"/>
    </owl:AnnotationProperty>

Terminal output

It appears to say that it is loading the synonyms (near the bottom). I see messages about some mappings found, but none of them appear to be related to the synonyms namespace I am using, http://www.geneontology.org/formats/oboInOwl#.

/Users/joeflack4/virtualenvs/mondo-on-fhir/bin/python3.10 /Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py --multiprocess --qt-support=auto --client 127.0.0.1 --port 55557 --file /Users/joeflack4/projects/mondo-on-fhir/mondo_on_fhir/mondo_on_fhir.py 
2022-10-13 17:17:38.281  INFO 52511 --- [           main] au.csiro.fhir.owl.Application            : Starting Application v1.1.0 using Java 18.0.1.1 on Elizabeths-MacBook-Pro.local with PID 52511 (/Users/joeflack4/projects/mondo-on-fhir/data/fhir-owl.jar started by joeflack4 in /Users/joeflack4/projects/mondo-on-fhir/mondo_on_fhir)
2022-10-13 17:17:38.291  INFO 52511 --- [           main] au.csiro.fhir.owl.Application            : No active profile set, falling back to default profiles: default
2022-10-13 17:17:40.332  INFO 52511 --- [           main] ca.uhn.fhir.util.VersionUtil             : HAPI FHIR version 5.3.0 - Rev 919c1dbddc
2022-10-13 17:17:40.343  INFO 52511 --- [           main] ca.uhn.fhir.context.FhirContext          : Creating new FHIR context for FHIR version [R4]
2022-10-13 17:17:40.411  INFO 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Checking for IRI mappings in home directory /Users/joeflack4
2022-10-13 17:17:40.428  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_upheno_imports_pr_import_owl.owl does not exist.
2022-10-13 17:17:40.428  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_wbbt_owl.owl does not exist.
2022-10-13 17:17:40.429  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_doid_imports_omim_susc_import_owl.owl does not exist.
2022-10-13 17:17:40.430  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_upheno_imports_uberon_import_owl.owl does not exist.
2022-10-13 17:17:40.430  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_upheno_imports_ro_import_owl.owl does not exist.
2022-10-13 17:17:40.430  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_doid_imports_cl_import_owl.owl does not exist.
2022-10-13 17:17:40.430  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_uberon_owl.owl does not exist.
2022-10-13 17:17:40.430  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_doid_obo_ext_owl.owl does not exist.
2022-10-13 17:17:40.430  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_doid_imports_uberon_import_owl.owl does not exist.
2022-10-13 17:17:40.430  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_symp_owl.owl does not exist.
2022-10-13 17:17:40.431  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_upheno_imports_doid_import_owl.owl does not exist.
2022-10-13 17:17:40.431  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_upheno_imports_mpath_import_owl.owl does not exist.
2022-10-13 17:17:40.431  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_upheno_imports_go_import_owl.owl does not exist.
2022-10-13 17:17:40.432  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_pr_owl.owl does not exist.
2022-10-13 17:17:40.432  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_doid_imports_hp_import_owl.owl does not exist.
2022-10-13 17:17:40.432  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_doid_owl.owl does not exist.
2022-10-13 17:17:40.432  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_upheno_imports_extra_owl.owl does not exist.
2022-10-13 17:17:40.432  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_upheno_imports_ro_extra_owl.owl does not exist.
2022-10-13 17:17:40.432  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_upheno_imports_chebi_import_owl.owl does not exist.
2022-10-13 17:17:40.433  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_trans_owl.owl does not exist.
2022-10-13 17:17:40.433  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_upheno_imports_hsapdv_import_owl.owl does not exist.
2022-10-13 17:17:40.433  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_doid_imports_ncbitaxon_import_owl.owl does not exist.
2022-10-13 17:17:40.433  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_upheno_imports_pato_import_owl.owl does not exist.
2022-10-13 17:17:40.433  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_chebi_owl.owl does not exist.
2022-10-13 17:17:40.433  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_upheno_imports_nbo_import_owl.owl does not exist.
2022-10-13 17:17:40.433  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_go_owl.owl does not exist.
2022-10-13 17:17:40.433  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_pato_owl.owl does not exist.
2022-10-13 17:17:40.433  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_doid_imports_relations_owl.owl does not exist.
2022-10-13 17:17:40.434  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_nbo_owl.owl does not exist.
2022-10-13 17:17:40.434  WARN 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Mapping was not added because file /Users/joeflack4/CSIRO/resources/ontologies/iri_maps/http___purl_obolibrary_org_obo_ncbitaxon_owl.owl does not exist.
2022-10-13 17:17:40.875  INFO 52511 --- [           main] au.csiro.fhir.owl.Application            : Started Application in 8.423 seconds (JVM running for 9.8)
2022-10-13 17:17:40.893  INFO 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Creating code systems
2022-10-13 17:17:40.893  INFO 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Loading ontology from file /Users/joeflack4/projects/mondo-on-fhir/mondo_on_fhir/../data/mondo.owl
2022-10-13 17:18:14.394  INFO 52511 --- [           main] au.csiro.fhir.owl.OwlProperties          : Loading value from OWL annotation property http://www.w3.org/2000/01/rdf-schema#label
...
2022-10-13 17:18:14.782  INFO 52511 --- [           main] au.csiro.fhir.owl.OwlProperties          : Loading value from OWL annotation property http://www.w3.org/2000/01/rdf-schema#label
2022-10-13 17:18:14.789  INFO 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Classifying ontology http://purl.obolibrary.org/obo/mondo.owl with elk
log4j:WARN No appenders could be found for logger (org.semanticweb.elk.config.ConfigurationFactory).
log4j:WARN Please initialize the log4j system properly.
2022-10-13 17:18:15.247  INFO 52511 --- [           main] au.csiro.fhir.owl.OwlProperties          : Loading value from OWL annotation property http://www.w3.org/2000/01/rdf-schema#label
2022-10-13 17:18:15.249  INFO 52511 --- [           main] au.csiro.fhir.owl.OwlProperties          : Loading synonyms from OWL annotation property http://purl.org/dc/elements/1.1/publisher
2022-10-13 17:18:15.249  INFO 52511 --- [           main] au.csiro.fhir.owl.OwlProperties          : Loading synonyms from OWL annotation property http://purl.org/dc/elements/1.1/subject
2022-10-13 17:18:15.249  INFO 52511 --- [           main] au.csiro.fhir.owl.OwlProperties          : Loading synonyms from OWL annotation property http://www.w3.org/2000/01/rdf-schema#comment
2022-10-13 17:18:15.256  INFO 52511 --- [           main] au.csiro.fhir.owl.OwlProperties          : Loading value from OWL annotation property http://www.w3.org/2000/01/rdf-schema#label
2022-10-13 17:18:15.256  INFO 52511 --- [           main] au.csiro.fhir.owl.OwlProperties          : Loading synonyms from OWL annotation property 
2022-10-13 17:18:15.256  INFO 52511 --- [           main] au.csiro.fhir.owl.OwlProperties          : Loading synonyms from OWL annotation property "http://www.geneontology.org/formats/oboInOwl#hasSynonym"
2022-10-13 17:18:15.256  INFO 52511 --- [           main] au.csiro.fhir.owl.OwlProperties          : Loading synonyms from OWL annotation property "http://www.geneontology.org/formats/oboInOwl#hasExactSynonym"
2022-10-13 17:18:15.257  INFO 52511 --- [           main] au.csiro.fhir.owl.OwlProperties          : Loading synonyms from OWL annotation property "http://www.geneontology.org/formats/oboInOwl#hasNarrowSynonym"
2022-10-13 17:18:15.257  INFO 52511 --- [           main] au.csiro.fhir.owl.OwlProperties          : Loading synonyms from OWL annotation property "http://www.geneontology.org/formats/oboInOwl#hasBroadSynonym"
2022-10-13 17:18:15.257  INFO 52511 --- [           main] au.csiro.fhir.owl.OwlProperties          : Loading synonyms from OWL annotation property "http://www.geneontology.org/formats/oboInOwl#hasRelatedSynonym"
2022-10-13 17:18:52.681  INFO 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Writing code system to file: /Users/joeflack4/projects/mondo-on-fhir/mondo_on_fhir/../mondo.json
2022-10-13 17:18:58.947  INFO 52511 --- [           main] au.csiro.fhir.owl.FhirOwlService         : Done!

Process finished with exit code 0
andrewpatto commented 2 years ago

Hi @joeflack4 - was visiting here because I similarly was attempting to get extra properties out of OWL across into the FHIR.

With regards synonyms however - I could get 'designations' outputted.

   "code": "MONDO:0002776",
    "display": "external ear disorder",
    "designation": [ {
      "use": {
        "system": "http://snomed.info/sct",
        "code": "900000000000013009",
        "display": "Synonym (core metadata concept)"
      },
      "value": "preauricular cyst"
    }, {
      "use": {
        "system": "http://snomed.info/sct",
        "code": "900000000000013009",
        "display": "Synonym (core metadata concept)"
      },
      "value": "preauricular sinus or fistula NOS (disorder)"
    }, {
      "use": {
        "system": "http://snomed.info/sct",
        "code": "900000000000013009",
        "display": "Synonym (core metadata concept)"
      },
      "value": "preauricular sinus or fistula"
    }, {
      "use": {
        "system": "http://snomed.info/sct",
        "code": "900000000000013009",
        "display": "Synonym (core metadata concept)"
      },
      "value": "disease of external ear"
    }, {
      "use": {
        "system": "http://snomed.info/sct",
        "code": "900000000000013009",
        "display": "Synonym (core metadata concept)"
      },
      "value": "external ear disease or disorder"
    }, {

I think possibly your 'comma splitting' syntax for the invoke is incorrect? I always assumed it meant to split the uris by comma within the shell quotes

e.g.

java -jar fhir-owl-v1.1.jar -i mondo.owl -o mondo.json \
                -id mondo \
                -name "Mondo" \
                -content complete \
                -mainNs 'http://purl.obolibrary.org/obo/MONDO_' \
                -s 'http://www.geneontology.org/formats/oboInOwl#hasExactSynonym,http://www.geneontology.org/formats/oboInOwl#hasRelatedSynonym' \
                -dateRegex "(?<year>\\d{4})-(?<month>\\d{2})-(?<day>\\d{2})" \
                -status active \
                -codeReplace '_,:'
joeflack4 commented 2 years ago

@andrewpatto Thanks for the suggestion! I'm guessing you are on the money. I'll give this a go and if it works I'll close this issue.

lawley commented 2 years ago

@andrewpatto 's suggestion also works for me - does it meet your requirements @joeflack4 ?

joeflack4 commented 2 years ago

Hey @lawley the syntax of the -s flag is fine. As for my experience with it, I did just use @andrewpatto's suggestion regarding how to use the arg in a syntactically correct way, and exactSynonyms do appear as I expect (in designation)!

Remaining issues:

  1. Non-exact synonyms not appearing. (e.g. the hasRelatedSynonym in my example in my original post of the issue).
  2. Documentation: This is me being nit-picky probably, but either the documentation for the -s flag, or in the examples, if we could show that the correct syntax is -s "<synonym_uri1>,<synonym_uri2>" rather thatn -s "<synonym_uri1>","synonym_uri2>", I'd like that.

Here's the result after my recent conversion using aehrc/fhir-owl:

{
    "code": "MONDO_0002776",
    "display": "external ear disorder",
    "designation": [ {
      "use": {
        "system": "http://snomed.info/sct",
        "code": "900000000000013009",
        "display": "Synonym (core metadata concept)"
      },
      "value": "preauricular cyst"
    }, {
      "use": {
        "system": "http://snomed.info/sct",
        "code": "900000000000013009",
        "display": "Synonym (core metadata concept)"
      },
      "value": "preauricular sinus or fistula NOS (disorder)"
    }, {
      "use": {
        "system": "http://snomed.info/sct",
        "code": "900000000000013009",
        "display": "Synonym (core metadata concept)"
      },
      "value": "preauricular sinus or fistula"
    }, {
      "use": {
        "system": "http://snomed.info/sct",
        "code": "900000000000013009",
        "display": "Synonym (core metadata concept)"
      },
      "value": "disease of external ear"
    }, {
      "use": {
        "system": "http://snomed.info/sct",
        "code": "900000000000013009",
        "display": "Synonym (core metadata concept)"
      },
      "value": "external ear disease or disorder"
    }, {
      "use": {
        "system": "http://snomed.info/sct",
        "code": "900000000000013009",
        "display": "Synonym (core metadata concept)"
      },
      "value": "preauricular cyst (disorder)"
    }, {
      "use": {
        "system": "http://snomed.info/sct",
        "code": "900000000000013009",
        "display": "Synonym (core metadata concept)"
      },
      "value": "external ear disease"
    }, {
      "use": {
        "system": "http://snomed.info/sct",
        "code": "900000000000013009",
        "display": "Synonym (core metadata concept)"
      },
      "value": "preauricular sinus and fistula (disorder)"
    }, {
      "use": {
        "system": "http://snomed.info/sct",
        "code": "900000000000013009",
        "display": "Synonym (core metadata concept)"
      },
      "value": "disorder of external ear"
    }, {
      "use": {
        "system": "http://snomed.info/sct",
        "code": "900000000000013009",
        "display": "Synonym (core metadata concept)"
      },
      "value": "preauricular sinus and fistula"
    }, {
      "use": {
        "system": "http://snomed.info/sct",
        "code": "900000000000013009",
        "display": "Synonym (core metadata concept)"
      },
      "value": "disease or disorder of external ear"
    } ],
    "property": [ {
      "code": "imported",
      "valueBoolean": false
    }, {
      "code": "parent",
      "valueCode": "MONDO_0021205"
    }, {
      "code": "parent",
      "valueCode": "MONDO_0002409"
    }, {
      "code": "root",
      "valueBoolean": false
    }, {
      "code": "deprecated",
      "valueBoolean": false
    } ]
  }

For comparison, here's the tentative output for this in the current version of my tool:

    {
      "code": "0002776",
      "property": [
        {
          "code": "hasExactSynonym",
          "valueCoding": {
            "system": "NCIT",
            "code": "C26972",
            "display": "external ear disorder"
          }
        },
        {
          "code": "hasExactSynonym",
          "valueCoding": {
            "system": "MONDO",
            "code": "design_pattern",
            "display": "external ear disease or disorder"
          }
        },
        {
          "code": "hasExactSynonym",
          "valueCoding": {
            "system": "MONDO",
            "code": "patterns/location",
            "display": "external ear disease or disorder"
          }
        },
        {
          "code": "hasRelatedSynonym",
          "valueCoding": {
            "system": "DOID",
            "code": "379",
            "display": "preauricular cyst"
          }
        },
        {
          "code": "hasRelatedSynonym",
          "valueCoding": {
            "system": "DOID",
            "code": "379",
            "display": "preauricular sinus or fistula NOS (disorder)"
          }
        },
        {
          "code": "hasExactSynonym",
          "valueCoding": {
            "system": "MONDO",
            "code": "patterns/location_top",
            "display": "disorder of external ear"
          }
        },
        {
          "code": "hasRelatedSynonym",
          "valueCoding": {
            "system": "DOID",
            "code": "379",
            "display": "preauricular cyst (disorder)"
          }
        },
        {
          "code": "hasRelatedSynonym",
          "valueCoding": {
            "system": "DOID",
            "code": "379",
            "display": "preauricular sinus or fistula"
          }
        },
        {
          "code": "hasExactSynonym",
          "valueCoding": {
            "system": "MONDO",
            "code": "patterns/location_top",
            "display": "disease of external ear"
          }
        },
        {
          "code": "hasExactSynonym",
          "valueCoding": {
            "system": "MONDO",
            "code": "patterns/location",
            "display": "external ear disease"
          }
        },
        {
          "code": "hasRelatedSynonym",
          "valueCoding": {
            "system": "DOID",
            "code": "379",
            "display": "preauricular sinus and fistula (disorder)"
          }
        },
        {
          "code": "hasExactSynonym",
          "valueCoding": {
            "system": "DOID",
            "code": "379",
            "display": "preauricular sinus and fistula"
          }
        },
        {
          "code": "parent",
          "valueCode": "http://purl.obolibrary.org/obo/UBERON_0001691"
        },
        {
          "code": "parent",
          "valueCode": "0002776"
        },
        {
          "code": "parent",
          "valueCode": "0002776"
        }
      ],
      "display": "external ear disorder",
      "definition": "A disease involving the external ear.",
      "designation": [
        {
          "use": {
            "system": "NCIT",
            "code": "C26972",
            "display": "Synonym (core metadata concept)"
          },
          "value": "external ear disorder"
        },
        {
          "use": {
            "system": "MONDO",
            "code": "design_pattern",
            "display": "Synonym (core metadata concept)"
          },
          "value": "external ear disease or disorder"
        },
        {
          "use": {
            "system": "MONDO",
            "code": "patterns/location",
            "display": "Synonym (core metadata concept)"
          },
          "value": "external ear disease or disorder"
        },
        {
          "use": {
            "system": "MONDO",
            "code": "patterns/location_top",
            "display": "Synonym (core metadata concept)"
          },
          "value": "disorder of external ear"
        },
        {
          "use": {
            "system": "MONDO",
            "code": "patterns/location_top",
            "display": "Synonym (core metadata concept)"
          },
          "value": "disease of external ear"
        },
        {
          "use": {
            "system": "MONDO",
            "code": "patterns/location",
            "display": "Synonym (core metadata concept)"
          },
          "value": "external ear disease"
        },
        {
          "use": {
            "system": "DOID",
            "code": "379",
            "display": "Synonym (core metadata concept)"
          },
          "value": "preauricular sinus and fistula"
        }
      ]
    },