Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-owl] SWRL rule -- infer(string)

Koosha koosha.g at gmail.com
Tue Oct 28 20:11:49 PDT 2008


Hi Everyone,

How can we infer a SWRL rule in our code instead of having that written in
advance and just run(). the following code is not doing any inference:

String uri = "
http://www.ualberta.ca/~golmoham/SW/music%20ontology/moProject/Oct152008/KGmo/mo.owl
";
    OWLModel owlModel;
try {
       owlModel = ProtegeOWL.createJenaOWLModelFromURI(uri);
       SWRLRuleEngineBridge bridge= bridgeFactory.createBridge(owlModel);

       bridge.infer("Profile(?p) -> Weblog(?p) "); // this is the
problematic line

       OWLNamedClass WeblogClass = owlModel.getOWLNamedClass("Weblog");
       Collection tt = WeblogClass.getInstances(false);
       System.out.println("the weblog includes:"+tt.toString());
       System.exit(100);
           } catch

but when I replace   bridge.infer("Profile(?p) -> Weblog(?p) ") with the
following it work fine (having SWRL rules defined in the ontology using the
swrlTab)
       bridge.reset();
       bridge.importSWRLRulesAndOWLKnowledge();
       bridge.run();
       bridge.writeInferredKnowledge2OWL();

There is no error or strange message in the console.

Bests,
--Koosha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-owl/attachments/20081028/8b9caf56/attachment.html>


More information about the protege-owl mailing list