示例#1
0
文件: reports.py 项目: edsu/open-oni
def batch_rdf(request, batch_name):
    batch = get_object_or_404(models.Batch, name=batch_name)
    graph = batch_to_graph(batch)
    response = HttpResponse(graph.serialize(base=_rdf_base(request),
                                            include_base=True),
                            content_type='application/rdf+xml')
    return response
示例#2
0
 def test_batch(self):
     b = Batch.objects.get(name='batch_curiv_ahwahnee_ver01')
     g = rdf.batch_to_graph(b)
     u = URIRef('/batches/batch_curiv_ahwahnee_ver01#batch')
     self.assertEqual(g.value(u, RDF.type), NDNP['Batch'])