當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。