Thank 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. <
buehm...@informatik.uni-leipzig.de> wrote:

> 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.
> The methods:
>
> 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
>
> > Thank you Chris and Soroka.
> >
> > I have read this and could not understand it properly, that is why I
> asked
> > the question here. I will be happy if some one give an example with
> > model.listResourcesWithProperty()
> > used in it.
> >
> >
> >
> > On Thu, Nov 10, 2016 at 5:35 PM, A. Soroka <aj...@virginia.edu> wrote:
> >
> >> https://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
> >>
> >>> On Nov 10, 2016, at 10:32 AM, kumar rohit <kumar.en...@gmail.com>
> wrote:
> >>>
> >>> What 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
>
>

Reply via email to