0

我正在尝试使用 OwlReady python 库加载本体http://semrob-ontology.mpi.aass.oru.se/OntoCity.owl

from owlready2 import *
onto = get_ontology("http://semrob-ontology.mpi.aass.oru.se/OntoCity.owl").load()

回溯线程如下:

---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/owlready2/namespace.py in load(self, only_local, fileobj, reload, reload_if_newer, **args)
    769         if _LOG_LEVEL: print("* Owlready2 *     ...loading ontology %s from %s..." % (self.name, f), file = sys.stderr)
--> 770         try:     fileobj = urllib.request.urlopen(f)
    771         except:  raise OwlReadyOntologyParsingError("Cannot download '%s'!" % f)

HTTPError: HTTP Error 308: Permanent Redirect

During handling of the above exception, another exception occurred:

OwlReadyOntologyParsingError              Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/owlready2/namespace.py in load(self, only_local, fileobj, reload, reload_if_newer, **args)
    769         if _LOG_LEVEL: print("* Owlready2 *     ...loading ontology %s from %s..." % (self.name, f), file = sys.stderr)
    770         try:     fileobj = urllib.request.urlopen(f)
--> 771         except:  raise OwlReadyOntologyParsingError("Cannot download '%s'!" % f)
    772         try:     new_base_iri = self.graph.parse(fileobj, default_base = self.base_iri, **args)
    773         finally: fileobj.close()

OwlReadyOntologyParsingError: Cannot download 'http://purl.org/dc/elements/1.1'!

如何解决此错误?

4

0 回答 0