lambdamusic / Ontospy

Python library and command-line interface for inspecting and visualizing RDF models aka ontologies.
http://lambdamusic.github.io/Ontospy/
MIT License
219 stars 52 forks source link

Example is not working - #11

Closed burkesquires closed 7 years ago

burkesquires commented 7 years ago

Hello, I have installed onto spy on a Mac running 10.10.5. When I try calling "ontospy http://purl.org/spar/frbr" I get the following error: OntoSpy v1.6.8.3

Local library: '/Users/squiresrb/.ontospy/models/'

You passed the argument: http://purl.org/spar/frbr Traceback (most recent call last): File "/Users/squiresrb/anaconda/bin/ontospy", line 11, in sys.exit(main()) File "/Users/squiresrb/anaconda/lib/python3.5/site-packages/ontospy/ontospy.py", line 235, in main g = Graph(args[0]) File "/Users/squiresrb/anaconda/lib/python3.5/site-packages/ontospy/core/graph.py", line 82, in init self.OWLTHING = OntoClass(rdflib.OWL.Thing, rdflib.OWL.Class, self.namespaces) File "/Users/squiresrb/anaconda/lib/python3.5/site-packages/ontospy/core/entities.py", line 259, in init self.slug = "class-" + str(self.id) + "-" + slugify(self.qname) File "/Users/squiresrb/anaconda/lib/python3.5/site-packages/ontospy/core/util.py", line 856, in slugify value = unicode(re.sub('[^\w\s-]', '', value).strip().lower()) File "/Users/squiresrb/anaconda/lib/python3.5/re.py", line 182, in sub return _compile(pattern, flags).sub(repl, string, count) TypeError: cannot use a string pattern on a bytes-like object

lambdamusic commented 7 years ago

Hi - thanks for bringing this up, that was a bug with Python3.

I've fixed it in version 1.6.8.5 - just update the package e.g. pip install ontospy -U