-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I can fix this - it will be in SVN soon.
I just noticed something weird with the turtle serializer though... It does namespace declarations without < >'s, i.e.: @prefix dc: http://purl.org/dc/terms/. Looking at the turtle grammar this is wrong... Has really no-one noticed this or am I missing something? - - Gunnar Ed Summers wrote: > As discussed with eikeon in #redfoot it appears that the n3 serializer > is ignoring the base option to Graph.serialize...example follows: > > -- > > #!/usr/bin/env python > > from rdflib.Graph import Graph > from rdflib.URIRef import URIRef > from rdflib import Literal, Namespace, RDF > > graph = Graph() > DC = Namespace('http://purl.org/dc/terms/') > SKOS = Namespace('http://www.w3.org/2004/02/skos/core#') > LCCO = Namespace('http://loc.gov/catdir/cpso/lcco/') > > graph.bind('dc', DC) > graph.bind('skos', SKOS) > graph.bind('lcco', LCCO) > > concept = URIRef(LCCO['1']) > graph.add((concept, RDF.type, SKOS['Concept'])) > graph.add((concept, SKOS['prefLabel'], Literal('Scrapbooks'))) > graph.add((concept, DC['LCC'], Literal('AC999.0999 - AC999999.Z9999'))) > > print graph.serialize(format='n3', base=LCCO) > > -- > > Which generates: > > -- > > @prefix dc: <http://purl.org/dc/terms/>. > @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. > @prefix skos: <http://www.w3.org/2004/02/skos/core#>. > > <http://loc.gov/catdir/cpso/lcco/1> a skos:Concept; > dc:LCC "AC999.0999 - AC999999.Z9999"; > skos:prefLabel "Scrapbooks". > > -- > > Notice > > <http://loc.gov/catdir/cpso/lcco/1> a skos:Concept; > > instead of: > > <1> a skos:Concept; > > //Ed > _______________________________________________ > Dev mailing list > Dev@rdflib.net > http://rdflib.net/mailman/listinfo/dev -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGVeFDfD15aMgAOfcRAmz2AJ9KUb8zpBrxFasN/R/+7pcWK3MezwCgjBBh IKuu6rTACHKWOFcH7E1/ExU= =PNAH -----END PGP SIGNATURE----- _______________________________________________ Dev mailing list Dev@rdflib.net http://rdflib.net/mailman/listinfo/dev