当前位置: 首页>>代码示例>>Python>>正文


Python SparqlQueryBuilder.get_delete_query_string方法代码示例

本文整理汇总了Python中askomics.libaskomics.rdfdb.SparqlQueryBuilder.SparqlQueryBuilder.get_delete_query_string方法的典型用法代码示例。如果您正苦于以下问题:Python SparqlQueryBuilder.get_delete_query_string方法的具体用法?Python SparqlQueryBuilder.get_delete_query_string怎么用?Python SparqlQueryBuilder.get_delete_query_string使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在askomics.libaskomics.rdfdb.SparqlQueryBuilder.SparqlQueryBuilder的用法示例。


在下文中一共展示了SparqlQueryBuilder.get_delete_query_string方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: empty

# 需要导入模块: from askomics.libaskomics.rdfdb.SparqlQueryBuilder import SparqlQueryBuilder [as 别名]
# 或者: from askomics.libaskomics.rdfdb.SparqlQueryBuilder.SparqlQueryBuilder import get_delete_query_string [as 别名]
 def empty(self):
     #empty database
     sqb = SparqlQueryBuilder(self.settings, self.request.session)
     ql = QueryLauncher(self.settings, self.request.session)
     namedGraphs = self.list_named_graphs()
     for graph in namedGraphs:
         ql.execute_query(sqb.get_delete_query_string(graph).query)
开发者ID:cbettemb,项目名称:askomics,代码行数:9,代码来源:interface_tps.py

示例2: test_statistics

# 需要导入模块: from askomics.libaskomics.rdfdb.SparqlQueryBuilder import SparqlQueryBuilder [as 别名]
# 或者: from askomics.libaskomics.rdfdb.SparqlQueryBuilder.SparqlQueryBuilder import get_delete_query_string [as 别名]
    def test_statistics(self):
        request = testing.DummyRequest()
        sqb = SparqlQueryBuilder(self.settings, request.session)
        ql = QueryLauncher(self.settings, request.session)

        sqb.get_statistics_number_of_triples()
        sqb.get_statistics_number_of_entities()
        sqb.get_statistics_distinct_classes()
        sqb.get_statistics_list_classes()
        sqb.get_statistics_nb_instances_by_classe()
        sqb.get_statistics_by_startpoint()
        sqb.get_list_named_graphs()
        res = ql.execute_query(sqb.get_list_named_graphs().query)

        for indexResult in range(len(res['results']['bindings'])):
                    sqb.get_delete_query_string(res['results']['bindings'][indexResult]['g']['value'])
                    sqb.get_metadatas(res['results']['bindings'][indexResult]['g']['value'])
开发者ID:cbettemb,项目名称:askomics,代码行数:19,代码来源:sparql_test.py

示例3: empty_database

# 需要导入模块: from askomics.libaskomics.rdfdb.SparqlQueryBuilder import SparqlQueryBuilder [as 别名]
# 或者: from askomics.libaskomics.rdfdb.SparqlQueryBuilder.SparqlQueryBuilder import get_delete_query_string [as 别名]
    def empty_database(self):
        """
        Delete all triples in the triplestore
        """

        self.log.debug("=== DELETE ALL TRIPLES ===")

        sqb = SparqlQueryBuilder(self.settings, self.request.session)
        ql = QueryLauncher(self.settings, self.request.session)

        ql.execute_query(sqb.get_delete_query_string().query)
开发者ID:Piezoid,项目名称:askomics,代码行数:13,代码来源:ask_view.py

示例4: empty_database

# 需要导入模块: from askomics.libaskomics.rdfdb.SparqlQueryBuilder import SparqlQueryBuilder [as 别名]
# 或者: from askomics.libaskomics.rdfdb.SparqlQueryBuilder.SparqlQueryBuilder import get_delete_query_string [as 别名]
    def empty_database(self):
        """
        Delete all triples in the triplestore
        """
        data = {}

        self.log.debug("=== DELETE ALL TRIPLES ===")
        try:
            sqb = SparqlQueryBuilder(self.settings, self.request.session)
            ql = QueryLauncher(self.settings, self.request.session)

            namedGraphs = self.get_list_named_graphs()
            namedGraphs.append(ql.get_param("askomics.graph"))
            for graph in namedGraphs:
                ql.execute_query(sqb.get_delete_query_string(graph).query)

        except Exception as e:
            traceback.print_exc(file=sys.stdout)
            data['error'] = traceback.format_exc(limit=8)+"\n\n\n"+str(e)
            self.log.error(str(e))

        return data
开发者ID:cbettemb,项目名称:askomics,代码行数:24,代码来源:ask_view.py


注:本文中的askomics.libaskomics.rdfdb.SparqlQueryBuilder.SparqlQueryBuilder.get_delete_query_string方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。