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

Can't get ontospy to work from python/ipython #7

Closed Heroico closed 8 years ago

Heroico commented 8 years ago

Hi there!

I installed via pip install ontospy, and I can't use anything from the module.

In [1]: import ontospy

In [2]: g = ontospy.Graph("efo.owl")
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-2-c74a73d08095> in <module>()
----> 1 g = ontospy.Graph("efo.owl")

AttributeError: 'module' object has no attribute 'Graph'

The only thing that seems exported from the module is a subpackage called logging.

Should I be doing something different?

Edit: I am using python 2.7.11

lambdamusic commented 8 years ago

Hi, this should work:

from ontospy import ontospy
lambdamusic commented 8 years ago

Hi, i've just published verson 1.6.5. Just to pip install ontospy --upgrade, then import ontospy will work as expected.

Heroico commented 8 years ago

Hey!

I didn't reply earlier because I was testing some stuff out. The new version is working for me, thanks!

P.S:

The suggestion:

from ontospy import ontospy

Didn't work for me in the previous version. But I guess it is pretty irrelevant since ontospy worked for me in the new version.