I'm not sure there is. There is not a simple way to parse one quad:

https://lists.apache.org/thread.html/a5c19bbe44109e4812f302462840569971aa732d73397bb8c2182aba@%3Cusers.jena.apache.org%3E

But perhaps there is, because I'm not very familiar with the output of 
RDFNode.toString(). In fact, I'm not sure how well-defined it is. Our Javadoc 
on the override of toString in RDFNode is documented thusly:

> Answer a String representation of the node. The form of the string  depends 
> on the type of the node and is intended for human consumption, not machine 
> analysis.

which doesn't imply a good fit for your case. If possible you might want to 
think about working from something like Turtle, which can be concise for the 
case of many triples with the same subject and predicate but different objects:

https://www.w3.org/TR/turtle/#h3_object-lists

ajs6f

> On Sep 4, 2019, at 5:42 AM, Martin G. Skjæveland <m.g.skjaevel...@gmail.com> 
> 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