Hello Dave, I am sorry but I think this is the problem of emailer because I just copied and pasted it. I have used it single time and also in my Netbeans IDE I used WorstStudent for second rules, not GoodStudent.
The first rule you knows as you have answered it in previous emails and my second rule is same but used lessThan(?marks,2) instead of greaterThan(?marks,2) and assign the student to WorstStudent if GPA/marks less than 2. I then used SPARQL query: ?x rdf:type std:GoodStudent . ?y rdf:type std:WorstStudent GoodStudent works and WorstStudent simply doesn't. On Sat, Sep 24, 2016 at 1:09 AM, Dave Reynolds <[email protected]> wrote: > On 23/09/16 13:05, javed khan wrote: > >> The first rule here works and save the individual as GoodStudent when >> marks >> is greater than 2 but not assign individual to WorstStudent when marks are >> less than 2? Where I am doing mistake here ? >> > > It's hard to tell without a clean copy of your rules. Your emailer (or > something) seems to be trying to expand the URIs and there inconsistencies > ... > > String rule = "[rule1:(?x http://www.w3.org/1999/02/22-r >> df-syntax-ns#type >> http://www.semanticweb.org#Student <http://www.semanticweb.org/#Student>) >> " >> + "( ?x http://www.semanticweb.org#GPA >> <http://www.semanticweb.org/#GPA> ?marks )" >> + "greaterThan(?marks, 2) " >> + " -> (?x http://www.w3.org/1999/02/22-r >> df-syntax-ns#type >> http://www.semanticweb.org#GoodStudent >> <http://www.semanticweb.org/#GoodStudent> )]"; >> > > Each URI here is shown twice, e.g. > > http://www.semanticweb.org#GPA > <http://www.semanticweb.org/#GPA> > > I presume those aren't in your source file and were added by you emailer > or by whatever you did the cut/paste from/to. > > String rule = "[rule2:(?y http://www.w3.org/1999/02/22-rdf-syntax-ns#type >> http://www.semanticweb.org#Student <http://www.semanticweb.org/#Student>) >> " >> + "( ?y http://www.semanticweb.org#GPA >> <http://www.semanticweb.org/#GPA> ?marks )" >> + "lessThan(?marks, 2) " >> + " -> (?y http://www.w3.org/1999/02/22-r >> df-syntax-ns#type >> http://www.semanticweb.org#WorstStudent >> <http://www.semanticweb.org/#GoodStudent> )]"; >> > > This is suspicious. Note that the expansion says "GoodStudent" instead of > WorstStudent. > > Dave > >
