On Fri, Nov 8, 2013 at 12:23 PM, Luciane Monteiro <[email protected]> wrote:
> Hi!
>
> I need to dereference *URIs*, like:
>
> http://dbpedia.org/resource/Google
>
>  and
>
>  http://dbpedia.org/resource/American_Airlines
>
>  returned from *Spotlight*, to get their *RDFS:comments* property.
>
>
> Is it something like this? Look:
>
> Model model = ModelFactory.createDefaultModel();
> model.read( "http://dbpedia.org/resource/Google"; );
>
> But how do I get the property?

When you asked this on the DBpedia mailing list, I did include code in
my response, in addition to pointing you to the Jena mailing list.  As
Andy Seaborne mentioned, the Model API (particularly the Model and
Resource interfaces) will help you out here:

Resource google = model.createResource( "http://dbpedia.org/resource/Google"; );
StmtIterator stmts = google.listProperties( RDFS.comment );
while ( stmts.hasNext() ) {
  Statement stmt = stmts.next();
  RDFNode comment = stmt.getObject();
  /* do something with the comment */
}



-- 
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/

Reply via email to