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-rdf-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-rdf-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-rdf-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