コード例 #1
0
ファイル: rdf.py プロジェクト: lab9k/atramhasis
 def rdf_conceptscheme_export_turtle(self):
     graph = utils.rdf_conceptscheme_dumper(self.provider)
     response = Response(content_type='text/turtle')
     response.body = graph.serialize(format='turtle')
     response.content_disposition = 'attachment; filename="%s.ttl"' % (str(
         self.scheme_id), )
     return response
コード例 #2
0
ファイル: rdf.py プロジェクト: lab9k/atramhasis
 def rdf_conceptscheme_export(self):
     graph = utils.rdf_conceptscheme_dumper(self.provider)
     response = Response(content_type='application/rdf+xml')
     response.body = graph.serialize(format='xml')
     response.content_disposition = 'attachment; filename="%s.rdf"' % (str(
         self.scheme_id), )
     return response
コード例 #3
0
ファイル: test_utils.py プロジェクト: JoelCa/skosprovider_rdf
 def test_dump_conceptscheme_tree_to_rdf(self):
     graph_dump = utils.rdf_conceptscheme_dumper(self.tree_provider)
     cs = URIRef('http://id.trees.org')
     assert (cs, RDF.type, SKOS.ConceptScheme) in graph_dump
     assert (cs, SKOS.definition,
             Literal('<p xml:lang="en">Trees as used by Monthy Python.</p>',
                     datatype=RDF.HTML)) in graph_dump
     assert (cs, SKOS.prefLabel, Literal('Pythonic trees.',
                                         lang='en')) in graph_dump
コード例 #4
0
 def test_dump_conceptscheme_tree_to_rdf(self):
     graph_dump = utils.rdf_conceptscheme_dumper(self.tree_provider)
     cs = URIRef('http://id.trees.org')
     assert (cs, RDF.type, SKOS.ConceptScheme) in graph_dump
     assert (cs, SKOS.definition, Literal('<p xml:lang="en">Trees as used by Monthy Python.</p>', datatype=RDF.HTML)) in graph_dump
     assert (cs, SKOS.prefLabel, Literal('Pythonic trees.', lang='en')) in graph_dump
コード例 #5
0
ファイル: rdf.py プロジェクト: OnroerendErfgoed/atramhasis
 def rdf_conceptscheme_export_turtle(self):
     graph = utils.rdf_conceptscheme_dumper(self.provider)
     response = Response(content_type='text/turtle')
     response.body = graph.serialize(format='turtle')
     response.content_disposition = 'attachment; filename="%s.ttl"' % (str(self.scheme_id),)
     return response
コード例 #6
0
ファイル: rdf.py プロジェクト: OnroerendErfgoed/atramhasis
 def rdf_conceptscheme_export(self):
     graph = utils.rdf_conceptscheme_dumper(self.provider)
     response = Response(content_type='application/rdf+xml')
     response.body = graph.serialize(format='xml')
     response.content_disposition = 'attachment; filename="%s.rdf"' % (str(self.scheme_id),)
     return response