def test_ns_localname_roundtrip():
XNS = rdflib.Namespace('http://example.net/fs')
g = rdflib.Graph()
g.bind('xns', str(XNS))
g.add((
rdflib.URIRef('http://example.com/thingy'),
XNS['lowecase.xxx-xxx_xxx'], # <- not round trippable
rdflib.Literal("Junk")))
turtledump = g.serialize(format="turtle").decode('utf-8')
xmldump = g.serialize().decode('utf-8')
g1 = rdflib.Graph()
g1.parse(data=xmldump)
g1.parse(data=turtledump, format="turtle")
评论列表
文章目录