So it means if we have to get instances of Student, both methods can be
Post by Claude WarrenYour statement
model.listResourcesWithProperty(RDF.type, std)
will list all the studen resources in the graph
model.listStatements(null,RDF.type, "Student");
will probably list nothing given what I think you have in the graph as you
probably don't have any statements where the type is the literal "Student".
model.listStatements(null,RDF.type, std);
would list all the statements (triples) that identify users.
In either case your example does not do anything with the result of the
listStatements() method call, and does not need it to print out the list of
students.
Claude
Post by kumar rohitThank you Lorenz.
I have *OntClass std = model.getOntClass(ns + "Student");*
for (Iterator i = model.listResourcesWithProperty(RDF.type, std);
i.hasNext();) {
model.listStatements(null,RDF.type, "Student");
System.out.println("Student: " + i.next());
}
I read this on the web, here why we use: *model.listStatements(null,
RDF.type,
"Student");*
*Because we can get Subjects of the triple already from this
statement: *model.listResourcesWithProperty(RDF.type,
std);
On Fri, Nov 11, 2016 at 11:34 AM, Lorenz B. <
Post by Lorenz B.I assume that you know what resources and properties in RDF graphs are.
Given the property p, indeed one can check for all triples (s_i, p,
o_j), i.e. all triples that have the property p in predicate position.
listResourcesWithProperty(Property p) returns all resources s_i
listResourcesWithProperty(Property p, RDFNode o) returns all subjects
s_i that occur in triples in which o_j matches o
Lorenz
Post by kumar rohitThank you Chris and Soroka.
I have read this and could not understand it properly, that is why I
asked
Post by kumar rohitthe question here. I will be happy if some one give an example with
model.listResourcesWithProperty()
used in it.
Post by A. Sorokahttps://jena.apache.org/documentation/javadoc/jena/
org/apache/jena/rdf/model/Model.html#listResourcesWithProperty-org.
apache.jena.rdf.model.Property-
Please learn to read Javadocs for software you are using.
---
A. Soroka
The University of Virginia Library
Post by kumar rohitWhat is mean my model.listResourcesWithProperty()?
What it accepts as parameters and what it returns as output?
--
Lorenz BÃŒhmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center
--
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren