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 : OntModel::getDatatypeProperty( String uri ) which property (data property) will be returned ? Because the argument only contains the namespace and not the actual property. I tried this but it gives me error: DataProperty property=ontModel::getDatatypeProperty( String uri, "Score ) On Wed, Sep 21, 2016 at 1:21 AM, Lorenz B. < [email protected]> 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 ) > > > -- > Lorenz Bühmann > AKSW group, University of Leipzig > Group: http://aksw.org - semantic web research center >
