pwin / owlready2

GNU Lesser General Public License v3.0
137 stars 22 forks source link

Problem loading ontology from an N-triples file #23

Open moissinac opened 2 years ago

moissinac commented 2 years ago

Hello I'm testing owlready2 which seems interesting. But, I'm encoutering problem with the loading phase of one of my files with senneville_ontology= get_ontology("file://c://wamp64/www/barbules/ontologies/test.nt").load() where test.nt contains only one line <http://barbules.givingsense.eu/ontologies/barbules/SENNEVILLE> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#NamedIndividual> . I'm getting the following error: ... File "C:\wamp64\www\CPD\trials\venv\lib\site-packages\owlready2\rdfxml_2_ntriples.py", line 315, 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 c://wamp64/www/barbules/ontologies/test.nt, line 1, column 7. So, the file is recognized as being an N-triples file, but the parser fails to parse it.

seankim658 commented 10 months ago

Also getting this issue, can't load any owl files. Interestingly, if you try this in a jupyter notebook it always fails but then if I run the cell again it loads. Quite frustrating as I can't use this module in python files at all, only in notebooks with that weird workaround.