You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Benson Margulies <bi...@gmail.com> on 2010/12/30 21:21:25 UTC

Retrieving the 'derived' value when listing statement with inference

I make the following java call. None of the triples is literally a
Rex.relationship; they are all written with some sub prop or another.

I was hoping / expecting that the triples that I got back would be the
actual triples with the actual specific property in them, but, as it
were, no such luck. They all come back with, yup, Rex.relationship, in
the middle slot. So, um, what's the right way?


            StmtIterator sameAsStmts = model.listStatements(item,
Rex.relationship, (RDFNode)null);

Re: Retrieving the 'derived' value when listing statement with inference

Posted by Dave Reynolds <da...@gmail.com>.
On Thu, 2010-12-30 at 15:21 -0500, Benson Margulies wrote: 
> I make the following java call. None of the triples is literally a
> Rex.relationship; they are all written with some sub prop or another.
> 
> I was hoping / expecting that the triples that I got back would be the
> actual triples with the actual specific property in them, but, as it
> were, no such luck. They all come back with, yup, Rex.relationship, in
> the middle slot. So, um, what's the right way?
> 
> 
>             StmtIterator sameAsStmts = model.listStatements(item,
> Rex.relationship, (RDFNode)null);

There isn't a direct way to that. 

Easiest approach is probably the brute force query such as:

  SELECT ?p WHERE 
  {
       ?item   ?p    ?obj .
       ?p   rdfs:subPropertyOf   rex:relationship .
  }

Dave