[ exstu: (?stu rdf:type Student), (?stu marks ?m), greaterThan(?m, 60) -> (?stu 
rdf:type ExcellentStudents) ]

is one way to do this. Please look at the examples on that same page.

---
A. Soroka
The University of Virginia Library

> On Sep 6, 2016, at 3:30 PM, javed khan <[email protected]> wrote:
> 
> Thanks Soroka.
> 
> I do not know how to use* greaterThan(?x, ?y) here in my case? How can I
> compare the marks data property with this?*
> 
> On Tue, Sep 6, 2016 at 12:09 PM, A. Soroka <[email protected]> wrote:
> 
>> https://jena.apache.org/documentation/inference/index.html#RULEbuiltins
>> 
>> ---
>> A. Soroka
>> The University of Virginia Library
>> 
>>> On Sep 6, 2016, at 3:05 PM, javed khan <[email protected]> wrote:
>>> 
>>> I have *Student* class, having *ExcellentStudents* and *PoorStudents* as
>>> subclasses.
>>> My ontology contains Student *marks* (*marks is data property*) and based
>>> on marks students can be assigned to ExcellentStudents and PoorStudents.
>>> 
>>> My requirements is to achieve it using Jena rules. I need some help in
>>> getting to this.  I want something like :
>>> 
>>> If Student X marks>60, assign Student X to ExcellentStudent class else
>>> assign to PoorStudents class. I have attempted the following but could
>> not
>>> succeeded.
>>> 
>>> 
>>> String rule = "[rule1:"(?x
>>> http://www.w3.org/1999/02/22-rdf-syntax-ns#type
>>> http://www.owlontologies.com/Student.owl#*Student*)+
>>> 
>>> (?x http://www.owl-ontologies.com/Student.owl#marks  *>60*)" +
>>> 
>>> 
>>>        "->(?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type
>>> http://www.owlontologies.com/Student.owl#*ExcellentStudent*)]";
>>> 
>>> 
>>> I think the problem will be in marks>60 because I do not know how to
>>> compare things inside Jena rules.
>> 
>> 

Reply via email to