Posted by
Haurangi on
URL: http://owlready.306.s1.nabble.com/Error-while-loading-ontologies-tp2151.html
Hi, I'm encountering issues while trying to load these ontologies:
1.
http://purl.obolibrary.org/obo/doid.owl
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\owlready2\driver.py", line 148, in parse
s,p,o = splitter.split(line[:-3], 2)
ValueError: not enough values to unpack (expected 3, got 1)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "./scripts/ontobee_parser.py", line 191, in <module>
ontology = owlready2.get_ontology(file_path).load()
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\owlready2\namespace.py", line 813, in load
imported_ontologies = [self.world.get_ontology(self._unabbreviate(abbrev_iri)).load() for abbrev_iri in self.world._get_obj_triples_sp_o(self.storid, owl_imports)]
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\owlready2\namespace.py", line 813, in <listcomp>
imported_ontologies = [self.world.get_ontology(self._unabbreviate(abbrev_iri)).load() for abbrev_iri in self.world._get_obj_triples_sp_o(self.storid, owl_imports)]
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\owlready2\namespace.py", line 774, in load
try: new_base_iri = self.graph.parse(fileobj, default_base = self.base_iri, **args)
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\owlready2\driver.py", line 182, in parse
raise OwlReadyOntologyParsingError("NTriples parsing error (or unrecognized file format) in %s, line %s." % (getattr(f, "name", getattr(f, "url", "???")), current_line)) from e
owlready2.base.OwlReadyOntologyParsingError: NTriples parsing error (or unrecognized file format) in
https://raw.githubusercontent.com/DiseaseOntology/HumanDiseaseOntology/main/src/ontology/ext.owl, line 1.
2.
http://purl.obolibrary.org/obo/clo.owl
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\owlready2\rdfxml_2_ntriples.py", line 315, in parse
parser.ParseFile(f)
File "c:\a\18\s\modules\pyexpat.c", line 471, in EndElement
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\owlready2\rdfxml_2_ntriples.py", line 278, in endElement
if d in INT_DATATYPES: o = int (o)
ValueError: invalid literal for int() with base 10: '永生的乳腺衍生细胞系细胞'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "./scripts/ontobee_parser.py", line 191, in <module>
ontology = owlready2.get_ontology(file_path).load()
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\owlready2\namespace.py", line 784, in load
try: new_base_iri = self.graph.parse(fileobj, default_base = self.base_iri, **args)
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\owlready2\driver.py", line 197, in parse
raise e
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\owlready2\driver.py", line 193, in parse
owlready2.rdfxml_2_ntriples.parse(f, on_prepare_obj, on_prepare_data, new_blank, default_base)
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\owlready2\rdfxml_2_ntriples.py", line 317, in parse
raise OwlReadyOntologyParsingError("RDF/XML parsing error in file %s, line %s, column %s." % (getattr(f, "name", getattr(f, "url", "???")), parser.CurrentLineNumber, parser.CurrentColumnNumber)) from e
owlready2.base.OwlReadyOntologyParsingError: RDF/XML parsing error in file owl_files/CLO.owl, line 10985, column 71.
Both occur with Python 3.7 and 3.9.
Owlready2 version is 0.25