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 <a...@apache.org> wrote: > 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 not going to find anything. > > Andy > > > On 21/09/16 09:21, Lorenz B. wrote: > >> 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) >> >> would be the method to call, or even better as you use an OntModel >> >> OntModel::getDatatypeProperty( String uri ) >> >> >>