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
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), mimetype='application/rdf+xml') return response
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'])