Thanks everyone for pointers and ideas!

I found

  Node NodeFactoryExtra.parseNode(String nodeString, PrefixMap pmap)

which might be what I am looking for:

  https://jena.apache.org/documentation/javadoc/arq/org/apache/jena/sparql/util/NodeFactoryExtra.html

Initial tests reveal that it correctly detects if strings are URIs, literals or blanks.

Martin

On 05/09/2019 12:51, Claude Warren wrote:
I am not certain, but I think that the QueryBuilder AbstractQueryBuilder
class has static methods that take objects and create nodes from them.  I
think that passing the string representation the '<' and '>' prefix and
suffix will work for URLs.  If you have names like dc:name and "dc"  is
prefixmapped to dublin core than that would also be parsed if you pass the
prefix map.  Anyway, take a look at the querybuilder to see if will do what
you want.

Claude

On Wed, Sep 4, 2019 at 10:42 AM Martin G. Skjæveland <
[email protected]> wrote:

Hi all,

in my application there is special support for lists (without going into
further detail), and I would like to be able to have SPARQL queries that
return lists. Since this is not supported in SPARQL, my idea is to
exploit and consider GROUP_CONCAT "columns" in SPARQL result sets as
lists and split and parse these part of the split to an RDFList (of
RDFNodes).

Does this sound reasonable? Is there parsing functionality in Jena to
handle this already? Perhaps there is something like  RDFNode
parse(String)  which parses strings on the same format as
RDFNode.toString() would produce back to an RDFNode?

Thanks!

Martin



Reply via email to