RE: Question about Jena RDQL and blank nodes.

[[There is a mailing list for Jena - jena-dev@groups.yahoo.com - that might get you answers quicker than this list.]]

The return of a RDFNode from get(var) is actually a Resource (a subclass of RDFNode).  You can cast to Resource after a test of instanceof - it could be a Literal.

Resource has .isAnon() to test for a blank node or a resource with a URI.

> Is there any way to have a unique identifier for blank nodes to use in
> other queries ? (in Protégé OWL API there is).

There is an Jena-internal id for blank nodes given by .getId().  In general, looking at a blank node id is a bad idea.  For example, they change each time you read an RDF/XML file.

> Another question:
> is there a way to ask for an approximate matching of literals ?

There is regular expression testing in RDQL using =~
There isn't stemming or other more text focused operations.

	Andy

-------- Original Message --------
> From: Andrea Splendiani <>
> Date: 28 April 2005 13:44
> 
> Hi,
> I apologize if this message reached the list twice, there may be some
> problem with the network here.
> 
> I'm trying to build a tool to interactively visualize RDF graphs.
> The idea is to allow the user to start from a resource/literal (or from
> a graph pattern) and dynamically explore the content of an ontology/RDF
> graph, basically choosing how to expand the graphs and
> selecting/distinguishing namespaces (and with the ability of displaying
> large graphs).
> I'm using the Protégé OWL API to parse the ontology (really this
> project is part of something else that may address the owl level),
> generate an OntModel and use RDQL Jena support to make queries.
> 
> When I make a query and get(Var) out of ReslutBinding, I only have a
> method to string (even if I cast it to RDFNode). This gives a URI for
> resources or properties, but just a representation of the pointer for
> blank nodes.
> Is there any way to have a unique identifier for blank nodes to use in
> other queries ? (in Protégé OWL API there is).
> Is there any method to know if a variable has a blank node as value ?
> (I may test if it is a well formed URI...)
> 
> Another question:
> is there a way to ask for an approximate matching of literals ?
> 
> best,
> Andrea Splendiani

Received on Tuesday, 3 May 2005 16:06:17 UTC