本文整理汇总了Python中mapper.Mapper.mapping方法的典型用法代码示例。如果您正苦于以下问题:Python Mapper.mapping方法的具体用法?Python Mapper.mapping怎么用?Python Mapper.mapping使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mapper.Mapper
的用法示例。
在下文中一共展示了Mapper.mapping方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: map_result
# 需要导入模块: from mapper import Mapper [as 别名]
# 或者: from mapper.Mapper import mapping [as 别名]
def map_result():
if request.method == 'POST':
rdf = request.form['data']
try:
gg = Graph()
rdf_content = StringIO.StringIO(rdf.encode('utf-8'))
gg.parse(rdf_content, format="xml")
mapper = Mapper(gg)
#TODO-remove this test block after release
batch_json = open("test_mapper_batch.json","r").read()
result = mapper.mapping(batch_json)
#End TODO-remove this test block after release
return Response(result, mimetype='application/rdf+xml')
except:
pass