Perhaps parse it as a Jena Literal (e.g. using 
ResourceFactory.createTypedLiteral() ), then use Literal.getString() to get the 
value you seek.

---
A. Soroka
The University of Virginia Library

> On Jan 11, 2017, at 9:55 AM, George News <george.n...@gmx.net> wrote:
> 
> Hi,
> 
> I have this literal:
> http://hola^^http://www.w3.org/2001/XMSchema#anyURI
> 
> And I want to create a URI from it. Is there any way to do so?
> 
> I have tried
> URI z = (URI) XSDDatatype.XSDanyURI.parseValidated(literalString);
> 
> but I get:
> java.lang.ClassCastException: java.lang.String cannot be cast to
> java.net.URI
> 
> I don't know if I should take the shortcut, that is, remove everything
> after ^^ using substring, and then URI.create(shortenedLiteralString).
> 
> Any help is welcome.
> Jorge

Reply via email to