I have a file describing people with the help of FOAF. In Jena I am trying to parse all ages from the profiles and noticed that my listStatements and listObjectsOfProperty gives me different results. I could not easily find any help from the javadocs or other documentation.
I have the following code for querying with listStatments:
StmtIterator iter = this.foafmodel.listStatements(
(Resource) null,
this.foafmodel.createProperty("http://xmlns.com/foaf/0.1/age"),
(RDFNode) null);
And this is the code for listObjectsOfProperty:
Property foafAge = this.foafmodel.createProperty("http://xmlns.com/foaf/0.1/age");
NodeIterator iter = this.foafmodel.listObjectsOfProperty(foafAge);
In this case listStatements iterator iterates 38 times while the listObjectsOfProperty only 20 times. Can someone explain to me what is the difference between these two implementations?