What the hell are you doing here?! Javadoc + Jena documentation is your friend.
It does not fetch any data, but creates a property and a literal with the value that is the property object which is totally wrong. First, use proper variable names. > Is this a proper way to fetch the int value from data property? > > OntProperty value=model.getOntProperty(ns+ "Wins"); Obviously, this line creates a property object, i.e. call it "property" or "p" or "winsProperty" or whatever, but not value. OntProperty winsProperty = model.getOntProperty(ns+ "Wins"); > > Literal myliteral = model.createTypedLiteral(value); This line creates a Literal object whose value is the property object, but that's totally wrong. If you want to create an int literal, use an integer as argument Literal myliteral = model.createTypedLiteral(3); > > int sum=myliteral.getInt(); Again weird naming of Java variables which makes the code unreadable and even more nobody will understand what you want to achieve. The sum of what? > sum=sum+1; It should be clear that data is assigned to RDF resources, that means you need a resource as well ,that's why the RDF data model is made of triples (subject, predicate, object), and from the above code you only have predicate and object. -- Lorenz Bühmann AKSW group, University of Leipzig Group: http://aksw.org - semantic web research center