> Is it possible to use RDF reasoners with rdflib?
Sure! Although most reasoners would need you to serialize the rdflib
data to some syntax (like xml) and then reason on it, and then
de-serialize it back into a graph. For very large graphs this is
probably inefficient, but a reasoner that interfaced directly with the
Graph API would be very cool.
BTW, If you are interested in using reasoners with rdflib, then you
might want to check out FuXi (see: http://metacognition.info/FuXi).
It's a library that allows you to execute Versa (an RDF querying
language) on a graph after it has been 'expanded' with inferred
statements using a forward-chaining reasoner (Pychinko). After
dispatching the query, it returns the rdflib Graph to it's original
size. It's meant to be an 'on-demand' reasoner and was my attempt to
provide a platform for doing N3 reasoning with rdflib using Versa as
the host querying language. Theoretically (i have yet to try this) ,
it can work the same way with SPARQL queries (using sparql-p).
If your interest is more light weight (you want to work with Pychinko
/ rdflib directly) then you might just want to browse the main
'engine' for an example of how to programatically 1) load N3 rules
from an rdflib graph into Pychinko 2) load facts from an rdflib graph
into Pychinko 3) execute Pychinko's reasoner 4) load the inferred
facts into an rdflib Graph:
http://metacognition.info/FuXi/lib/FuXi.py
_______________________________________________
Dev mailing list
[email protected]
http://rdflib.net/mailman/listinfo/dev