Eep RDF API, Inference Engine, and NTriples/N3 Parser


This is a beta-release of a little RDF API that I've been hacking on
for a couple of weeks: Eep. It's written in Python [1], and as long as
you have a fairly recent version of Python installed (I have 2.2 [2]),
it should run right out of the box. The latest distribution is
available from:-

and the current version is:-

you can also browse the source on the Web at:-

So, what can it do? Well, it's a sub-CWM clone, although it wasn't
originally intended that way. Here's a general list of things that it
can do:-

   * Parse the NTriples format
   * Parse Notation3, excluding DAML lists and formulae
   * Perform (small) queries
   * Do forwards chaining inferences
   * Perform builtins (tests and variables)
   * Template results as HTML etc.

Documentation is very sparse... I apologize for that, but it is very
easy to run. There are serveral test files in the distribution:,,,, and,
that can be run simply by doing "python filename".

It's meant as a very small, fast, and extensible toolkit for
performing small RDF operations. It is stunningly fast on small
queries, but at the moment can break on larger queries. I envisage
that it will be used for running RDF bots, weblogs, etc.; things that
handle small inputs at a time, or need to perform searches with a
handful of variables on large databases.

The API should be very easy to get into, and was designed to be
*used* - even through IDLE - and not just to look pretty. The main
modules to import when performing some operation are: eep, query,
infer, n3, and bi. Here's an example of what Eep can do...

>>> import eep, query, infer, n3, bi
>>> import re, urllib2
>>> EARLSchema = ''
>>> EARL095 = n3.parse(urllib2.urlopen(EARLSchema).read())
>>> len(EARL095)
>>> RDFSLabel = ''
>>> for result in query.rquery(eep.parse('?x <%s> ?y .' % \
   RDFSLabel)[0], EARL095): print result[0][2]

"EARL (Evaluation And Report Language)"
>>> rule = infer.rule(
"""?x <> ?z .
    ?z <> "A".""",
    '?z <#type> <#ALabel> .'
>>> for result in bi.bfilter(rule, EARL095):
   print eep.serialize(result)

"Assertor" <#type> <#ALabel> .
"Assertion" <#type> <#ALabel> .

Many thanks to deltab, redmonk (Steve Ivy), and Bijan Parsia for their
praise, comments, feedback, and tests.


Kindest Regards,
Sean B. Palmer
@prefix : <> .
:Sean :homepage <> .

Received on Sunday, 3 March 2002 18:57:02 UTC