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

Error when installing ontologies with label languages both defined and undefined, and with duplicate label definitions #749

Closed
kysrpex opened this issue Feb 1, 2022 · 0 comments · Fixed by #750
Assignees
Labels

Comments

@kysrpex
Copy link
Contributor

kysrpex commented Feb 1, 2022

Installing the latest version of the mechanical testing ontology yields the following.

INFO 2022-02-01 14:26:26,945 [osp.core.ontology.installation]: Will install the following namespaces: ['emmo', 'emmo-chemistry', 'emmo-mechanical-testing']
INFO 2022-02-01 14:26:26,962 [osp.core.ontology.namespace_registry]: Loading namespaces mereotopology, http://emmo.info/emmo/top/mereotopology#; physical, http://emmo.info/emmo/top/physical#; top, http://emmo.info/emmo/top#; semiotics, http://emmo.info/emmo/middle/semiotics#; perceptual, http://emmo.info/emmo/middle/perceptual#; reductionistic, http://emmo.info/emmo/middle/reductionistic#; holistic, http://emmo.info/emmo/middle/holistic#; physicalistic, http://emmo.info/emmo/middle/physicalistic#; math, http://emmo.info/emmo/middle/math#; properties, http://emmo.info/emmo/middle/properties#; materials, http://emmo.info/emmo/middle/materials#; metrology, http://emmo.info/emmo/middle/metrology#; models, http://emmo.info/emmo/middle/models#; manufacturing, http://emmo.info/emmo/middle/manufacturing#; isq, http://emmo.info/emmo/middle/isq#; siunits, http://emmo.info/emmo/middle/siunits#.
INFO 2022-02-01 14:26:26,963 [osp.core.ontology.parser.owl.parser]: Downloading https://raw.githubusercontent.com/emmo-repo/emmo-repo.github.io/master/versions/1.0.0-alpha2/emmo-inferred.owl.
INFO 2022-02-01 14:26:30,210 [osp.core.ontology.namespace_registry]: Loading namespaces chemistry, http://emmo.info/emmo/middle/chemistry#.
INFO 2022-02-01 14:26:30,210 [osp.core.ontology.parser.owl.parser]: Downloading https://github.com/emmo-repo/domain-mechanical-testing/raw/master/chemistry.owl.
WARNING 2022-02-01 14:26:30,740 [osp.core.ontology.ontology]: Specified relationship http://emmo.info/emmo/top/mereotopology#EMMO_8c898653_1118_4682_9bbf_6cc334d16a99 as active relationship, which is not a valid object property in the ontology.If such relationship belongs to anotherontology, and such ontology is installed, then you may safely ignore this warning.
WARNING 2022-02-01 14:26:30,741 [osp.core.ontology.ontology]: Specified relationship http://emmo.info/emmo/middle/semiotics#EMMO_60577dea_9019_4537_ac41_80b0fb563d41 as active relationship, which is not a valid object property in the ontology.If such relationship belongs to anotherontology, and such ontology is installed, then you may safely ignore this warning.
http://emmo.info/emmo/top/mereotopology#EMMO_17e27c22_37e1_468c_9dd7_95e137f73e7f
INFO 2022-02-01 14:26:30,803 [osp.core.ontology.namespace_registry]: Loading namespaces mechanical, http://emmo.info/emmo/domain/mechanical-testing#.
INFO 2022-02-01 14:26:30,803 [osp.core.ontology.parser.owl.parser]: Downloading https://github.com/emmo-repo/domain-mechanical-testing/raw/master/emmo-mechanical-testing.owl.
ERROR 2022-02-01 14:26:32,075 [osp.core.pico]: An Exception occurred during installation.
Traceback (most recent call last):
  File "/home/jovyan/.local/lib/python3.9/site-packages/osp/core/pico.py", line 63, in install_from_terminal
    ontology_installer.install_overwrite(*args.files)
  File "/home/jovyan/.local/lib/python3.9/site-packages/osp/core/ontology/installation.py", line 45, in install_overwrite
    self._install(files, self._get_replaced_packages, True)
  File "/home/jovyan/.local/lib/python3.9/site-packages/osp/core/ontology/installation.py", line 151, in _install
    self.namespace_registry.load_parser(parser)
  File "/home/jovyan/.local/lib/python3.9/site-packages/osp/core/ontology/namespace_registry.py", line 375, in load_parser
    ontology = Ontology(from_parser=parser)
  File "/home/jovyan/.local/lib/python3.9/site-packages/osp/core/ontology/ontology.py", line 121, in __init__
    self._ontology_overlay = self._overlay_from_parser(parser)
  File "/home/jovyan/.local/lib/python3.9/site-packages/osp/core/ontology/ontology.py", line 150, in _overlay_from_parser
    _check_duplicate_labels(graph, iri)
  File "/home/jovyan/.local/lib/python3.9/site-packages/osp/core/ontology/ontology.py", line 239, in _check_duplicate_labels
    results = sorted(((label.toPython(), label.language), iri)
TypeError: '<' not supported between instances of 'str' and 'NoneType'
ERROR 2022-02-01 14:26:32,076 [osp.core.pico]: Consider running 'pico --log-level debug install ...'

Moreover, if such bug is fixed, pico complains again about duplicate labels for an ontology entity, because both an RDFS label and an SKOS.prefLabel have been defined for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant