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] SQWRL queries in another OWL file

Ely Edison Matos ely.matos at ufjf.edu.br
Mon Jan 7 12:32:00 PST 2008


Hello,
Sorry by the old and persistent question...

I have a OWL file with my ontology (with individuals) and another OWL file 
with SQWRL queries. This queries are to be applied on the ontology. 
BUT...the ontology is built at runtime...so, I add code to "import" the file 
with queries. A sample code:

owlModel =....already created...
String uriRules = "file:///E:/temp/queries.owl";
//create the ImportHelper
ImportHelper importHelper = new ImportHelper((JenaOWLModel)owlModel);
owlModel.getNamespaceManager().setPrefix(new 
URI("file:///E:/temp/queries.owl#"), "query");
importHelper.addImport(URI.create(uriRules));
try {
        //do the actual import
        importHelper.importOntologies(false);
} catch (Exception e) {
        e.printStackTrace();
}
SQWRLQueryEngine queryEngine = SQWRLQueryEngineFactory.create(owlModel);
SQWRLResult result = queryEngine.getSQWRLResult("QPar");   <-----generate a 
exception...edu.stanford.smi.protegex.owl.swrl.sqwrl.exceptions.InvalidQueryNameException

How can I reference a "QPar" rule defined in rules file 
(file:///E:/temp/queries.owl) ?

Thanks,
Ely




More information about the protege-owl mailing list