[Pellet-users] Importing SPARQL in Jython?

Kendall Grant Clark kendall at clarkparsia.com
Tue Apr 22 13:22:18 UTC 2008


Excerpts from Margaret A Mitchell's message of Sat Apr 19 21:56:07 -0400 2008:
> Hello,
> 
> I'm trying to access Pellet with Python, so I'm using Jython, but it doesn't
> seem to be working very well...
> 
> 
> This is what I have so far.
> 
> import sys
> import java
> from java import *
> 
> print "**********************"
> print
> print java.lang.System.getProperties()['java.class.path']
> print
> print sys.path
> print
> print "***********************"
> print
> 
> import jena
> from jena import sparql
> 
> 
> It chokes on that last line.
> 'sparql' here is the 'sparql.java' file.
> 
> Any ideas?

Margaret,

One reason I stopped using Java a million years ago and became a
Python programmer is CLASSPATH hell. Which has gotten better, of
course, but none of us here has used Java via Jython, so we can't
offer any specific advice. Sorry.

However, this is something we've internally identified as a priority,
so if you happen to figure this out, we'd love to make a FAQ entry out
of what you discover.

There's also this alternate method for using Pellet from Python:

http://seth-scripting.sourceforge.net/

It uses JPype.

-- 
Cheers,
Kendall


More information about the Pellet-users mailing list