You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Andy Seaborne (Jira)" <ji...@apache.org> on 2021/04/28 08:37:00 UTC

[jira] [Commented] (JENA-2097) UUID IRIs cause RiotException

    [ https://issues.apache.org/jira/browse/JENA-2097?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17334573#comment-17334573 ] 

Andy Seaborne commented on JENA-2097:
-------------------------------------

Workarounds:
 # Rename the file to have extension ".ttl".
 # Parse the files as Turtle - either {{RDFParser.source(...).forceLang(Lang.TTL).parse(...)}}, and give a base URI if reading from an {{InputStream}}.
 # Change the error handler: {{RDFParser.source(...).errorHandler(eh)....parse(...)}} to one that does not throw an exception on error.

> UUID IRIs cause RiotException
> -----------------------------
>
>                 Key: JENA-2097
>                 URL: https://issues.apache.org/jira/browse/JENA-2097
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: IRI, RIOT
>    Affects Versions: Jena 4.0.0
>            Reporter: Andy Seaborne
>            Assignee: Andy Seaborne
>            Priority: Critical
>             Fix For: Jena 4.1.0
>
>
> Report: [users@ 2021-04-27|https://lists.apache.org/thread.html/r5acdd3ab9338b99408992511620421b1602bbb4c4cfcaabcf57aae74%40%3Cusers.jena.apache.org%3E].
> {code:java}
> Model model = ModelFactory.createDefaultModel();
> String data = "<urn:uuid:4f115b8c-5300-4e4d-84f4-1a7593e5fd57> <
> http://ex.org/a> <http://ex.org/b> .";
> try (ByteArrayInputStream in = new
> ByteArrayInputStream(data.getBytes(StandardCharsets.UTF_8))) {
>     RDFDataMgr.read(model, in, Lang.NTRIPLES);
> }
> {code}
> Gives error:
> {noformat}
> org.apache.jena.riot.RiotException: [line: 1, col: 1 ] Bad IRI: Not a valid
> UUID string: urn:uuid:4f115b8c-5300-4e4d-84f4-1a7593e5fd57 
> at org.apache.jena.riot.system.ErrorHandlerFactory$ErrorHandlerStd.error(ErrorHandlerFactory.java:146)
> ...
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)