On Sat, Sep 3, 2011 at 11:57 AM, Dave Reynolds
<[email protected]> wrote:

> That all sounds plausible and is easy to implement but as I say, I don't
> see that is compatible with the published spec. SKOS did change quite a
> bit between its initial submission (out of the SWADE project) and the
> final Rec so it's possible this is an area that changed.

Probably so.  The book is from 2007/2008 or so, so it's not super current.
Unfortunately w3.org seems to be down right this minute, so I can't even
read the spec.  Oh well, time to go do some shopping and get away
from computers for a little while anyway!  :-)

>
> A basic set up is very easy:
>
> [[[
>        Model data = FileManager.get().loadModel("data/test.rdf");
>        List<Rule> rules = Rule.rulesFromURL("file:data/test.rules");
>        GenericRuleReasoner reasoner = new GenericRuleReasoner(rules);
>        InfModel inf = ModelFactory.createInfModel(reasoner, data);
>        inf.setNsPrefixes( data );
>        inf.write(System.out, "Turtle");
> ]]]
>
> where data/test.rdf is your file with entities defined and
> data/test.rules is:
>
> [[[
> @prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
> @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
> @prefix owl:  <http://www.w3.org/2002/07/owl#> .
> @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
> @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
>
<snip>
>
> example:Milk
>      a       skos:Concept ;
>      skos:narrower example:MilkBySourceAnimal , example:SheepMilk ,
> example:BuffaloMilk , example:CowMilk , example:GoatMilk .
> ...

Cool, thanks!  One question though... from what I read on the jena docs page on
using the GenericRuleReasoner[1], I got the impression that if you
wanted to combine
custom rules with the "stock" rules, you had to do some sort of import in the
rule file (eg, your "test.rules").

Is that still the case? If so, do you happen to know how that @import bit works
that they mention?  In particular, how would I know what the value of
the @import
would be? I'm guessing a path, but not sure where the "stock"
rdfs/owl/etc. rules
are stored...


[1]: http://jena.sourceforge.net/inference/#RDFSPlusRules


Thanks,


Phil

Reply via email to