Invalid Turtle created for URIs ending in a dot

31 views
Skip to first unread message

Osma Suominen

unread,
May 14, 2013, 2:03:56 AM5/14/13
to rdfli...@googlegroups.com
Hi!

I noticed a problem with rdflib producing Turtle files that cannot be
parsed by Jena. The problem is with URIs ending in a dot.

Minimal test case: parse the following NT file and serialize into Turtle:

<http://example.com/exuri.> <http://example.com/prop>
<http://example.com/value> .

The output with current rdflib 4.0-dev looks like this:

--cut--
@prefix ns1: <http://example.com/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .

ns1:exuri. ns1:prop ns1:value .
--cut--

But Jena gives me this error parsing the Turtle output of rdflib:
org.apache.jena.riot.RiotException: [line: 6, col: 11] Not a valid token
for an RDF term: [DOT]

I think the current Turtle spec forbids a dot as the last character of a
QName. See http://www.w3.org/TR/turtle/#grammar-production-PN_LOCAL

The correct representation would be to spell out the whole URI as
<http://example.com/exuri.> in Turtle instead of trying to abbreviate it.

-Osma

--
Osma Suominen
Information Systems Specialist
National Library of Finland
P.O. Box 26 (Teollisuuskatu 23)
00014 HELSINGIN YLIOPISTO
Tel. +358 50 3199529
osma.s...@helsinki.fi
http://www.nationallibrary.fi

Gunnar Aastrand Grimnes

unread,
May 14, 2013, 2:51:29 AM5/14/13
to rdfli...@googlegroups.com
You are right, I made this:

https://github.com/RDFLib/rdflib/issues/282



- Gunnar
> --
> http://github.com/RDFLib
> --- You received this message because you are subscribed to the Google
> Groups "rdflib-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rdflib-dev+...@googlegroups.com.
> To post to this group, send email to rdfli...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
http://gromgull.net
Reply all
Reply to author
Forward
0 new messages