예제 #1
0
파일: browse.py 프로젝트: edsu/open-oni
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
예제 #2
0
파일: rdf_tests.py 프로젝트: edsu/open-oni
 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'))