gjhiggins/rdflib — Issue #160: Types and dataypes output as plain URI:s in N3 and Turtle serializations
Author: gjhiggins
Created: 2011-10-19 01:32:57+00:00
State: open
Labels: Component-Serializer

Originally filed by lindstr...@gmail.com on 2011-03-21T00:13:37

Since RDFLib 3.1, the N3 and Turtle serializations no longer use prefixed qnames for neither types nor datatypes (i.e. in datatype literals).

The following code illustrates the problem:

{{{
from rdflib import *

graph = Graph().parse(format='n3', data="""
@prefix dct: .
@prefix foaf: .
@prefix xsd: .

a foaf:Document;
dct:created "2011-03-20"^^xsd:date .
""")

print graph.serialize(format='n3')
}}}

Previously the serialization would look basically the same (i.e. using foaf:Document, xsd:date). Now those two are output as plain URI:s.

A fix should also introduce a test for this syntactic nicety.

This is due to the fix of Issue #152 (r1899). I have a fix, attached as a patch. (I did not commit it as I just hacked it together and haven't tested it thoroughly, nor have added a test (as I require above).)