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
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 = "
    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());
           } 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

There is no error or strange message in the console.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the protege-owl mailing list