def test_publisher_ref(self):
data = '''<?xml version="1.0" encoding="utf-8" ?>
<rdf:RDF
xmlns:dct="http://purl.org/dc/terms/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<rdfs:SomeClass rdf:about="http://example.org">
<dct:publisher rdf:resource="http://orgs.vocab.org/some-org" />
</rdfs:SomeClass>
</rdf:RDF>
'''
g = Graph()
g.parse(data=data)
p = RDFProfile(g)
publisher = p._publisher(URIRef('http://example.org'), DCT.publisher)
eq_(publisher['uri'], 'http://orgs.vocab.org/some-org')
评论列表
文章目录