Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obographs: Class declarations w/out further assertions not in serialization #1082

Open
1 task done
joeflack4 opened this issue Jan 9, 2023 · 3 comments
Open
1 task done
Labels

Comments

@joeflack4
Copy link

joeflack4 commented Jan 9, 2023

Overview

My team is doing some conversions from OWL -> Obographs JSON -> FHIR JSON, and we noticed that some concepts were missing from the output.

I took a look, and these are all root nodes; they are all rdfs:subClassOf owl:Thing.

Edges that reference these nodes exist, but the declaration of the nodes themselves do not. It's not just a FHIR JSON issue. I looked in my Obographs JSON (downloadable here), and the declarations are missing there as well.

I imagine this is an issue for the other ontologies I'm working with, but for this particular ontology, comploinc.owl, these are the declarations of the root nodes that are missing from the Obographs JSON:

    <owl:Class rdf:about="https://loinc.org/LP70625-6A">
        <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
    </owl:Class>
    <owl:Class rdf:about="https://loinc.org/lc0000001">
        <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
    </owl:Class>
    <owl:Class rdf:about="https://loinc.org/LP33117-0">
        <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
    </owl:Class>
    <owl:Class rdf:about="https://loinc.org/LP33103-0">
        <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
    </owl:Class>

Expected vs Actual

Expected
I would expect to see something like this in my Obographs JSON:

{
  "id": "https://loinc.org/LP33117-0",
  "type": "CLASS"
}

Or maybe something like this, with one or more nulls for missing properties:

{
  "id": "https://loinc.org/LP33117-0",
  "type": "CLASS",
  "lbl": null,
  "meta": {
    "definition": null,
    ...
  }
}

Actual
No declarations appear.

Reproducibility

  1. Download merged_reasoned_loinc.owl
  2. Download robot 1.9.1 if not already present
  3. Run : `java -jar robot convert -i path/to/merged_reasoned_loinc.owl -o path/to/outfile.json --format json'

What I tried

I examined the CLI to see if there was an option dealing with root nodes, but I didn't see anything in java -jar bin/robot.jar convert -h that seems like it could help with this.

Additional information

In this example, only root nodes (subClassOf owl:Thing) were missing, but in some other ontologies I looked at, there may have been other cases missing. Will update if I have more time to get concrete examples.

Blocked by

@joeflack4 joeflack4 changed the title Root concepts missing from output Root concepts (& perhaps others) missing from output Jan 9, 2023
@joeflack4
Copy link
Author

It's possible as well that there's something we are misunderstanding. I need to double check if this is really blocking us from uploading to our FHIR server, but OAK is not letting me load/convert these Obographs after I wrote a patch to manually add them back into the JSON:

key = 'https://loinc.org/lc0000001'
cooked_entry = Node(id="JsonObj(id='https://loinc.org/lc0000001')", lbl=None, type=None, meta=None)

    def order_up(key: Any, cooked_entry: YAMLRoot) -> None:
        """ A cooked entry is ready to be added to the return slot """
        if cooked_entry[key_name] != key:
>           raise ValueError(
                f"Slot: {loc(slot_name)} - attribute {loc(key_name)} " \
                f"value ({loc(cooked_entry[key_name])}) does not match key ({loc(key)})")
E           ValueError: Slot: nodes - attribute id value (JsonObj(id='https://loinc.org/lc0000001')) does not match key (https://loinc.org/lc0000001)

@matentzn
Copy link
Contributor

ROBOT just uses the obographs parser, all obographs related issues should be reported / mirrored there as well.

I find this issue worrying though - the way you describe it there is definitely something wrong with obographs serialisation. The way to phrase it is: "class declarations without further assertions are not included by obographs serialisation". If you can add a minimum example and make an issue on the obographs tracker, as well as tagging Jules and me, that would be great.

@joeflack4 joeflack4 changed the title Root concepts (& perhaps others) missing from output Obographs: Class declarations w/out further assertions not in serialization Jan 15, 2023
@joeflack4
Copy link
Author

@matentzn Glad to have your eyes on this! I went ahead and opened and tagged you and Jules. Also added the minimal reproducibility steps.

joeflack4 added a commit to timsbiomed/owl-on-fhir that referenced this issue Apr 15, 2023
- Update: Upgraded oaklib (OAK). This was a necessary, requisite upgrade, and now owl-on-fhir should be functional.
- Bugfix: Removed some Obographs JSON patching that I believe was necessary prior. I think what changed is that now OAK is handling something that was causing an error before, but now that it is handling it, the patching I'm doing is causing an OAK error. See: ontodev/robot#1082
joeflack4 added a commit to timsbiomed/owl-on-fhir that referenced this issue Apr 15, 2023
- Update: Upgraded oaklib (OAK). This was a necessary, requisite upgrade, and now owl-on-fhir should be functional.
- Bugfix: Removed some Obographs JSON patching that I believe was necessary prior. I think what changed is that now OAK is handling something that was causing an error before, but now that it is handling it, the patching I'm doing is causing an OAK error. See: ontodev/robot#1082
- Bugfix: Fixed outdir if it started with ~ (tilde; 'home' shortcut character')
- Bugfix: If --retain-intermediaries is present, will now save contents in --out-dir location, rather than cache/
- Update: .gitignore: Added some missing things
joeflack4 added a commit to timsbiomed/owl-on-fhir that referenced this issue Apr 15, 2023
- Update: Upgraded oaklib (OAK). This was a necessary, requisite upgrade, and now owl-on-fhir should be functional.
- Bugfix: Removed some Obographs JSON patching that I believe was necessary prior. I think what changed is that now OAK is handling something that was causing an error before, but now that it is handling it, the patching I'm doing is causing an OAK error. See: ontodev/robot#1082
- Bugfix: Fixed outdir if it started with ~ (tilde; 'home' shortcut character')
- Bugfix: If --retain-intermediaries is present, will now save contents in --out-dir location, rather than cache/
- Update: .gitignore: Added some missing things
joeflack4 added a commit to timsbiomed/owl-on-fhir that referenced this issue Apr 15, 2023
- Update: Upgraded oaklib (OAK). This was a necessary, requisite upgrade, and now owl-on-fhir should be functional.
- Bugfix: Removed some Obographs JSON patching that I believe was necessary prior. I think what changed is that now OAK is handling something that was causing an error before, but now that it is handling it, the patching I'm doing is causing an OAK error. See: ontodev/robot#1082
- Bugfix: Fixed outdir if it started with ~ (tilde; 'home' shortcut character')
- Bugfix: If --retain-intermediaries is present, will now save contents in --out-dir location, rather than cache/
- Update: .gitignore: Added some missing things
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants