Hello I revised the question, so that you can better understand what I want to do.
My code consists of some steps that I have to do. On step 1 I am submitting a query and I am getting some results back. However those results have this form: http://dbpedia.org/resource/Peter etc etc etc
This means that if I want to pass those results and use them with the next step (next query) then I have to put each one of the results inside < > in order to avoid getting an Exception from Jena.
My question is, is it possibly with a function from Jena or something similar, that I am not obligated to always add <> and instead the http://dbpedia.org/resource/ part of the URI automatically be changed with its prefix before the new query that contains this URI is submitted?
I know that the complete URI and one possible prefix of this URI are the exact the same thing. I was thinking to find something more efficient than having to parse all my result set and add to each result the <> in order to be parsed as URI from the query.
Thank you for your time :)
I am seeing the problem when using the VALUES clause on my queries. There I have a list of elements, lets say:
and even though the query contains the PREFIX for dbpedia, the URIS are not changed to their prefixes and the query is processed with the above values inside the VALUES clause, causing an exception from Jena since the URIs must be enclosed with < >
I hope this helps even more. Thanks again!
You need to show more code before your question is answerable, for example what does the
There are ways that you can have Jena turn it's internal representation of RDF terms (which are always in the full URI form) back into the human friendly form for presentation purposes, if you show some code we can likely point you in the right direction for this..
answered 08 Jan, 06:05
Rob Vesse ♦
Using prefixes is just about representation - the data always has http://dbpedia.org/resource/Peter in it.
Some of the ResultSetFormatter operations take the query as argument and use the queries prefixes to present the results. In code, when you do .getXXXX("var") you get the real resource, with full URI. Your app then needs to use the prefixes to abbreviate it for presentation.
answered 08 Jan, 07:23