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

Bug: Assigning a blank node an rdf:nodeID can lead to duplicates in LDTab #28

Open
ckindermann opened this issue Sep 19, 2024 · 0 comments · May be fixed by #30
Open

Bug: Assigning a blank node an rdf:nodeID can lead to duplicates in LDTab #28

ckindermann opened this issue Sep 19, 2024 · 0 comments · May be fixed by #30

Comments

@ckindermann
Copy link
Contributor

Consider the following example (adapted from UBERON), in which an existential restriction is assigned rdf:nodeID="genid3" that gets referenced three times in the class description of obo:UBERON_0037447:

XML example
 <owl:Class rdf:about="http://purl.obolibrary.org/obo/UBERON_0037447">
       <owl:equivalentClass>
           <owl:Class>
               <owl:intersectionOf rdf:parseType="Collection">
                   <rdf:Description rdf:about="http://purl.obolibrary.org/obo/UBERON_0000060"/>
                   <owl:Restriction rdf:nodeID="genid3">
                       <owl:onProperty rdf:resource="http://purl.obolibrary.org/obo/BFO_0000050"/>
                       <owl:someValuesFrom rdf:resource="http://purl.obolibrary.org/obo/UBERON_0001333"/>
                   </owl:Restriction>
               </owl:intersectionOf>
           </owl:Class>
       </owl:equivalentClass>
       <rdfs:subClassOf>
           <owl:Class>
               <owl:intersectionOf rdf:parseType="Collection">
                   <rdf:Description rdf:about="http://purl.obolibrary.org/obo/UBERON_0000060"/>
                   <owl:Restriction rdf:nodeID="genid3">
                       <owl:onProperty rdf:resource="http://purl.obolibrary.org/obo/BFO_0000050"/>
                       <owl:someValuesFrom rdf:resource="http://purl.obolibrary.org/obo/UBERON_0001333"/>
                   </owl:Restriction>
               </owl:intersectionOf>
           </owl:Class>
       </rdfs:subClassOf>
       <rdfs:subClassOf rdf:nodeID="genid3"/>
  </owl:Class>
  <owl:Restriction rdf:nodeID="genid3">
      <owl:onProperty rdf:resource="http://purl.obolibrary.org/obo/BFO_0000050"/>
      <owl:someValuesFrom rdf:resource="http://purl.obolibrary.org/obo/UBERON_0001333"/>
  </owl:Restriction>

Executing ldtab import results in JSON objects where the values associated with the blank node with rdf:nodeID="genid3" are repeated the same number of times the blank node is referenced. For example, the object of the LDTab triple representing <rdfs:subClassOf rdf:nodeID="genid3"/> looks as follows:

JSON representation in LDTab
{
  "owl:onProperty": [
    {
      "datatype": "_IRI",
      "object": "obo:BFO_0000050"
    },
    {
      "datatype": "_IRI",
      "object": "obo:BFO_0000050"
    },
    {
      "datatype": "_IRI",
      "object": "obo:BFO_0000050"
    }
  ],
  "owl:someValuesFrom": [
    {
      "datatype": "_IRI",
      "object": "obo:UBERON_0001333"
    },
    {
      "datatype": "_IRI",
      "object": "obo:UBERON_0001333"
    },
    {
      "datatype": "_IRI",
      "object": "obo:UBERON_0001333"
    }
  ],
  "rdf:type": [
    {
      "datatype": "_IRI",
      "object": "owl:Restriction"
    },
    {
      "datatype": "_IRI",
      "object": "owl:Restriction"
    },
    {
      "datatype": "_IRI",
      "object": "owl:Restriction"
    }
  ]
}

This bug does not seem to be present when using ldtab import -s.

The bug is also not present when removing rdf:nodeID="genid3".

I suspect the bug to be located in one of these functions:

ckindermann added a commit that referenced this issue Sep 27, 2024
@ckindermann ckindermann linked a pull request Sep 27, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant