Re: Jena rules Error
On 18/09/16 14:37, javed khan wrote: Hello Dave, thank you for your comment but is the semantic (logic) in the rule above correct? Because it does not give me the required result and when I query ?student rdf:type std:GoodStudent, it does not give me any result. It should work if the details are correct. If you can't get it to work then reduce it to a complete minimal example, with actual data and a correct version of the rule, and maybe someone can spot the problem. Dave On Sun, Sep 18, 2016 at 1:11 AM, Dave Reynolds wrote: On 17/09/16 22:31, javed khan wrote: The error goes away but the rules does not work i-e I can not find the rdf type of GoodUser/GoodStudent. Also after result display, it gives me some exception . Exception in thread "AWT-EventQueue-0" com.hp.hpl.jena.reasoner.rulesys.Rule$ParserException: Triple with 4 nodes! At '[ rule1: ( ?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.semanticweb.org/t/ontologies/2016/7/myOWL#User ) ( http://www.semanticweb.org/t/ontologies/2016/7/myOWL#User http://www.semanticweb.org/t/ontologies/2016/7/myOWL#score ?score + ) ' Look closely at the line above. You can see that there's a spurious "+" character in your string. Dave On Sat, Sep 17, 2016 at 12:15 PM, javed khan wrote: String rule="[rule1:(?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.semanticweb.org#Student) " + "( http://www.semanticweb.org#Student http://www.semanticweb.org#GPA ?gpa) + greaterThan(?gpa, 3) " -> (?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.semanticweb.org#GoodUser )]"; GPA is a data property here, but it gives me error. I think the error is in greaterThan(?score, 10) What is the error ?
Re: Jena rules Error
Hello Dave, thank you for your comment but is the semantic (logic) in the rule above correct? Because it does not give me the required result and when I query ?student rdf:type std:GoodStudent, it does not give me any result. Regards On Sun, Sep 18, 2016 at 1:11 AM, Dave Reynolds wrote: > On 17/09/16 22:31, javed khan wrote: > >> The error goes away but the rules does not work i-e I can not find the rdf >> type of GoodUser/GoodStudent. >> Also after result display, it gives me some exception . >> >> Exception in thread "AWT-EventQueue-0" >> com.hp.hpl.jena.reasoner.rulesys.Rule$ParserException: Triple with 4 >> nodes! >> At '[ rule1: ( ?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type >> http://www.semanticweb.org/t/ontologies/2016/7/myOWL#User ) ( >> http://www.semanticweb.org/t/ontologies/2016/7/myOWL#User >> http://www.semanticweb.org/t/ontologies/2016/7/myOWL#score ?score + ) ' >> > > Look closely at the line above. You can see that there's a spurious "+" > character in your string. > > Dave > > > >> On Sat, Sep 17, 2016 at 12:15 PM, javed khan >> wrote: >> >> String rule="[rule1:(?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type >>> http://www.semanticweb.org#Student) " + >>> >>> "( http://www.semanticweb.org#Student >>> http://www.semanticweb.org#GPA ?gpa) + greaterThan(?gpa, 3) >>> >>> " -> (?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type >>> http://www.semanticweb.org#GoodUser )]"; >>> >>> GPA is a data property here, but it gives me error. I think the error is >>> in greaterThan(?score, 10) >>> >>> What is the error ? >>> >>> >> >
Re: Jena rules Error
On 17/09/16 22:31, javed khan wrote: The error goes away but the rules does not work i-e I can not find the rdf type of GoodUser/GoodStudent. Also after result display, it gives me some exception . Exception in thread "AWT-EventQueue-0" com.hp.hpl.jena.reasoner.rulesys.Rule$ParserException: Triple with 4 nodes! At '[ rule1: ( ?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.semanticweb.org/t/ontologies/2016/7/myOWL#User ) ( http://www.semanticweb.org/t/ontologies/2016/7/myOWL#User http://www.semanticweb.org/t/ontologies/2016/7/myOWL#score ?score + ) ' Look closely at the line above. You can see that there's a spurious "+" character in your string. Dave On Sat, Sep 17, 2016 at 12:15 PM, javed khan wrote: String rule="[rule1:(?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.semanticweb.org#Student) " + "( http://www.semanticweb.org#Student http://www.semanticweb.org#GPA ?gpa) + greaterThan(?gpa, 3) " -> (?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.semanticweb.org#GoodUser )]"; GPA is a data property here, but it gives me error. I think the error is in greaterThan(?score, 10) What is the error ?
Re: Jena rules Error
The error goes away but the rules does not work i-e I can not find the rdf type of GoodUser/GoodStudent. Also after result display, it gives me some exception . Exception in thread "AWT-EventQueue-0" com.hp.hpl.jena.reasoner.rulesys.Rule$ParserException: Triple with 4 nodes! At '[ rule1: ( ?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.semanticweb.org/t/ontologies/2016/7/myOWL#User ) ( http://www.semanticweb.org/t/ontologies/2016/7/myOWL#User http://www.semanticweb.org/t/ontologies/2016/7/myOWL#score ?score + ) ' On Sat, Sep 17, 2016 at 12:15 PM, javed khan wrote: > String rule="[rule1:(?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type > http://www.semanticweb.org#Student) " + > > "( http://www.semanticweb.org#Student > http://www.semanticweb.org#GPA ?gpa) + greaterThan(?gpa, 3) > > " -> (?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type > http://www.semanticweb.org#GoodUser )]"; > > GPA is a data property here, but it gives me error. I think the error is > in greaterThan(?score, 10) > > What is the error ? >