Exemplo n.º 1
0
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
Exemplo n.º 2
0
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
Exemplo n.º 3
0
 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'))
Exemplo n.º 4
0
 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'))