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] SWRLQueryAPI - invalid query name

Shepherd, Michael Michael.Shepherd at xerox.com
Wed Oct 8 12:36:41 PDT 2008


OK, great thanks!  We are doing that now and are hitting a different problem. When we programmatically create our rule

SWRLImp _imp_ = factory.createImp("Query", "Box(?p)-> sqwrl:select(?p)");
 
Then when we runSQWRLQueries and then getSQWRLResult, the following error from Jess is returned...

       while executing (invokeSWRLBuiltIn "Query-1" "http://sqwrl.stanford.edu/ontologies/built-ins/3.4/sqwrl.owl#select" 0 false ?http://www.semanticweb.org/ontologies/2008/8/Ontology1222717988080.owl#p)
       while executing rule LHS (Node2)
       while executing rule LHS (TECT)
       while executing (assert (MAIN::http://www.semanticweb.org/ontologies/2008/8/Ontology1222717988080.owl#Box (name http://www.semanticweb.org/ontologies/2008/8/Ontology1222717988080.owl#Golf1GloveBoxA))).
  Message: error invoking built-in from Jess: exception thrown by built-in 'sqwrl:select' in rule 'Query-1': attempt to add data beyond the end of a row.
  Program text: ( assert ( http://www.semanticweb.org/ontologies/2008/8/Ontology1222717988080.owl#Box ( name http://www.semanticweb.org/ontologies/2008/8/Ontology1222717988080.owl#Golf1GloveBoxA ) ) )  at line 1.
Oct 8, 2008 3:24:42 PM com.xerox.packont3.SqwrlTest main
SEVERE: error running SQWRL queries: Jess reported an error in routine invokeSWRLBuiltIn

Thoughts on this one?

~ Mike


-----Original Message-----
From: protege-owl-bounces at mailman.stanford.edu [mailto:protege-owl-bounces at mailman.stanford.edu] On Behalf Of Martin O'Connor
Sent: Wednesday, October 08, 2008 1:25 PM
To: User support for the Protege-OWL editor
Cc: protege-owl at mailman.stanford.edu
Subject: Re: [protege-owl] SWRLQueryAPI - invalid query name

You need to run the queries first:

queryEngine.runSQWRLQueries();

I think this exception is a little confusing. I should probably just 
return an empty result in this case.

Martin


Shepherd, Michael wrote:

> I have a question about the SWRLQueryAPI. I'm trying to use based on 
> web doc http://protege.cim3.net/cgi-bin/wiki.pl?SQWRLQueryAPI.
>
> So I use my code using the latest jars from build 506 and the latest 
> jess.jar. I try to invoke the QueryEngine with a rule I created via 
> the code.
>
> SWRLFactory factory = *new* SWRLFactory(owlModel);
>
> SWRLImp _imp_ = factory.createImp("Query", "Box(?p)-> sqwrl:select(?p)");
>
> SQWRLResult result = queryEngine.getSQWRLResult("Query");
>
> When executing the above rule in the SWRLTab in Protégé 3.4 beta, I 
> get the results I expect (10 individual of type Box). When I execute 
> via the API, I get the following error in the last line above:
>
> Oct 7, 2008 3:30:05 PM com.xerox.packont3.SqwrlTest main
>
> SEVERE: invalid query name 'Query'
>
> _edu.stanford.smi.protegex.owl.swrl.sqwrl.exceptions.InvalidQueryNameException_: 
> invalid query name 'Query'
>
> at 
> edu.stanford.smi.protegex.owl.swrl.bridge.impl.AbstractSWRLRuleEngineBridge.getSQWRLResult(Unknown 
> Source)
>
> at com.xerox.packont3.SqwrlTest.main(_SqwrlTest.java:159_)
>
> _edu.stanford.smi.protegex.owl.swrl.sqwrl.exceptions.InvalidQueryNameException_: 
> invalid query name 'Query'
>
> at 
> edu.stanford.smi.protegex.owl.swrl.bridge.impl.AbstractSWRLRuleEngineBridge.getSQWRLResult(Unknown 
> Source)
>
> at com.xerox.packont3.SqwrlTest.main(_SqwrlTest.java:159_)
>
> Should I need to do something with the SWRLImp? The web documentation 
> doesn't state so.
>
> Thoughts?
>
> Thanks!
>
> * *
>
> ~ Mike
>
> *Michael Shepherd*
> Research Technical Staff, Xerox Corporation
> michael.shepherd at xerox.com <mailto:michael.shepherd at xerox.com>
> *http://www.linkedin.com/in/michaelshepherd*
> *http://www.facebook.com/profile.php?id=634126333*
>
> 	
>
> See who we know in common <http://www.linkedin.com/e/wwk/6125599/>
>
> 	
>
> Want a signature like this? <http://www.linkedin.com/e/sig/6125599/>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>protege-owl mailing list
>protege-owl at lists.stanford.edu
>https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
>Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 
>  
>

_______________________________________________
protege-owl mailing list
protege-owl at lists.stanford.edu
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 



More information about the protege-owl mailing list