[Pellet-users] how to load rules from separate file
Evren Sirin
evren at clarkparsia.com
Thu Feb 21 17:25:25 UTC 2008
On 2/20/08 10:12 AM, Thurn, Martin wrote:
> I found the following sample code posted by Evren last year. I'm trying
> to use it, but RuleUtils is not found. I have pellet 1.5.1. Is this
> code still accurate?
No, the rule loading feature has been improved and completely integrated
with the rest of the system. With version 1.5.1 you can load rules as
you load normal ontologies; they don't even have to be in a separate
ontology. You can do this using either Jena or OWLAPI interface.
Cheers,
Evren
> Where is RuleUtils defined? (what do I need to
> import?) TIA
>
> // load the ontology
> Reasoner reasoner = new Reasoner();
> OWLOntology ont = OntologyHelper.getOntology(URI.create(ontFile));
> reasoner.setOntology(ont);
> // load the rules
> Set rules = RuleUtils.parseRules(rulesFile);
> reasoner.getKB().setRules(rules);
>
> - - Martin
>
> _______________________________________________
> Pellet-users mailing list
> Pellet-users at lists.owldl.com
> http://lists.owldl.com/mailman/listinfo/pellet-users
> _______________________________________________
>
> Sponsored by Clark & Parsia, LLC http://clarkparsia.com/
>
More information about the Pellet-users
mailing list