21 | | I had a look at the Sesame RDFS implementation, which is quite nice: |
22 | | they use a set of rules (implemented in Java!) for a forward rule |
23 | | engine (probably using some Rete algorithm). |
24 | | |
25 | | The rules (for Sesame2) are here: |
26 | | |
27 | | http://www.openrdf.org/doc/sesame2/api/org/openrdf/sesame/sailimpl/inferencer/RDFSRules.html |
28 | | |
29 | | If you don't want the complete inferences, |
30 | | simply remove some of them, e.g. the rules |
31 | | for adding types: |
32 | | |
33 | | rule rdfs9_1: xxx rdfs:subClassOf yyy && (nt) aaa rdf:type xxx |
34 | | --> (t1) aaa rdf:type yyy (t2) |
35 | | |
36 | | rule rdfs9_2: aaa rdf:type xxx && (nt) xxx rdfs:subClassOf yyy |
37 | | --> (t1) aaa rdf:type yyy (t2) |
38 | | |
39 | | I could imagine that creating a subclass of RDFSRules and removing these |
40 | | rules will do the magic already, but I have never looked at the code. |
41 | | Anyway, should be trivial ... |
42 | | |
43 | | At least you could start with this implementation -- doing the |
44 | | entailment stuff from scratch is really nasty (you need |
45 | | something like a semi-naive bottom-up evaluation, otherwise |
46 | | you will derive the same new triples over and over again). |
47 | | |
48 | | = Comment by Florian Mittag = |
49 | | |
50 | | We tried to do just this, but it turned out to be anything else than trivial. The inference engine of sesame described above is only applicable on !MemoryStore, but we need it for a !NativeStore. Converting the code to do this would mean to implement an inferencer on the native sail, which is quite complicated due to many dependencies on the inner working of the !MemoryStore. |
51 | | |
52 | | Gunnar hacked an improvement of the Jena inferencer, that will do what we want with little transactions (ie only one). Additionaly we will try to create all necessary triples on creation or deletion of classes and things, so an inference engine hopefully won't be needed. Still, it is good to have a backup ;-) |