INCATools / ontology-access-kit

Ontology Access Kit: A python library and command line application for working with ontologies
https://incatools.github.io/ontology-access-kit/
Apache License 2.0
125 stars 29 forks source link

`diff` in KGCL format generates `create None`. #790

Closed hrshdhgd closed 3 months ago

hrshdhgd commented 3 months ago

I ran a diff between 2 MONDO files:

adapter used : get_adapter("simpleobo:XXX")

The output for KGCL output format looks like this:

changes:
  - create None
  - create edge MONDO:0971175 rdfs:subClassOf MONDO:0016333
  - create None
  - create edge MONDO:0971170 rdfs:subClassOf MONDO:0015356
  - create edge MONDO:0031062 rdfs:subClassOf MONDO:0004691
  - create synonym 'deafness, autosomal recessive 121' for MONDO:0957825
  - rename MONDO:0957825 from 'deafness, autosomal recessive 121' to 'hearing loss,
    autosomal recessive 121'
  - create edge MONDO:0010132 RO:0000053 MONDO:0021152
  - create None
  - create edge MONDO:0971173 rdfs:subClassOf MONDO:0003847
  - create None
  - create edge MONDO:0971171 rdfs:subClassOf MONDO:0015152
  - create None
  - create edge MONDO:0971172 rdfs:subClassOf MONDO:0003847
  - create edge MONDO:0971172 rdfs:subClassOf MONDO:0700092
  - create None
  - create edge MONDO:0971178 rdfs:subClassOf MONDO:0004691
  - create edge MONDO:0971178 rdfs:subClassOf MONDO:0020642
  - create None
  - create edge MONDO:0971174 rdfs:subClassOf MONDO:0017338
  - create None
  - create edge MONDO:0971176 rdfs:subClassOf MONDO:0009299
  - create None
  - create edge MONDO:0971149 rdfs:subClassOf MONDO:0019064
  - create None
  - create edge MONDO:0971177 rdfs:subClassOf MONDO:0021094
  - create None
  - create edge MONDO:0971151 rdfs:subClassOf MONDO:0021094
  - create None
  - create edge MONDO:0971150 rdfs:subClassOf MONDO:0015363
  - create None
  - create edge MONDO:0971179 rdfs:subClassOf MONDO:0002254
  - create None
  - create synonym 'deafness, autosomal recessive 125' for MONDO:0971152
  - create edge MONDO:0971152 rdfs:subClassOf MONDO:0019588
  - create edge MONDO:0971152 excluded_from_qc_check http://purl.obolibrary.org/obo/mondo/sparql/qc/mondo/qc-omim-subsumption.sparql
  - rename MONDO:0020716 from 'familial thyroid dyshormonogenesis 1' to 'thyroid dyshormonogenesis
    1'
  - remove synonym 'thyroid dyshormonogenesis 1' for MONDO:0020716
  - create synonym 'familial thyroid dyshormonogenesis 1' for MONDO:0020716
cmungall commented 3 months ago

looks like these should be "create class"

hrshdhgd commented 3 months ago

You're spot on! The bug is in kgcl-shcema

if type(kgcl_instance) is ClassCreation:
        subject = render_entity(kgcl_instance.node_id, "uri")
        return "create " + subject

~node_id~ => about_node

Fixing it there

hrshdhgd commented 3 months ago

https://github.com/INCATools/kgcl/pull/81