Re: Jena rules not working

2016-09-21 Thread Lorenz B.
> model.getProperty(ns,"GPA"); I think this works for me and store the data > property GPA in the file. > > Actually I do not need this: Model::createProperty(String nameSpace, String > localName) > as I have already created the property in my owl file and just needs > getProperty() method. > >

Re: Jena rules not working

2016-09-21 Thread javed khan
model.getProperty(ns,"GPA"); I think this works for me and store the data property GPA in the file. Actually I do not need this: Model::createProperty(String nameSpace, String localName) as I have already created the property in my owl file and just needs getProperty() method. If I use this :

Re: Jena rules not working

2016-09-21 Thread javed khan
Hello Andy, I used this: ?x URI#GPA ?score + "greaterThan(?score, 3) ?score will return the scores/GPA of students and if it is greater than 3, it will assign user to GoodStudent class. On Wed, Sep 21, 2016 at 2:18 AM, Andy Seaborne wrote: > The rules have some syntax

Re: Jena rules not working

2016-09-21 Thread Lorenz B.
Are you sure that this code compiles? > Property prop= model.getProperty(ns,"GPA"); ns is a String in your code, the method expects a Resource object is first argument. You totally use the wrong method here, as it returns a Statement. Model::createProperty(String nameSpace, String localName)

Re: Jena rules not working

2016-09-21 Thread Andy Seaborne
The rules have some syntax problems: "( ?x http://www.semanticweb.org#GPA ?score + )" as mentioned earlier in the thread then "greaterThan(?score, userscore) " but userscore is a java variable. Also inf.listResourcesWithProperty(RDF.type, "GoodStudent") uses a string not a URI so if

Re: Jena rules not working

2016-09-21 Thread javed khan
Hello Andy, shouldn't there be the class name to which we assign new individuals.? inf.listResourcesWithProperty(RDF.type, "GoodStudent") Dave run this code and it works for him, but I do not know why, it does not work for me. On Wed, Sep 21, 2016 at 2:18 AM, Andy Seaborne

Re: Jena rules not working

2016-09-21 Thread Andy Seaborne
Classes are identified by URIs, not by strings. On 21/09/16 11:46, javed khan wrote: Hello Andy, shouldn't there be the class name to which we assign new individuals.? inf.listResourcesWithProperty(RDF.type, "GoodStudent") Dave run this code and it works for him, but I do not know why, it does