def title_rdf(request, lccn): title = get_object_or_404(models.Title, lccn=lccn) graph = title_to_graph(title) response = HttpResponse(graph.serialize(base=_rdf_base(request), include_base=True), content_type='application/rdf+xml') return response
def test_title(self): t = Title.objects.get(lccn='sn83030214') g = rdf.title_to_graph(t) u = URIRef('/lccn/sn83030214#title') self.assertEqual(g.value(u, DCTERMS['title']), Literal('New-York tribune.')) self.assertEqual(g.value(u, ORE.isDescribedBy), URIRef('/lccn/sn83030214.rdf'))