當前位置: 首頁>>代碼示例>>Python>>正文


Python Session.store_sizes方法代碼示例

本文整理匯總了Python中Session.Session.store_sizes方法的典型用法代碼示例。如果您正苦於以下問題:Python Session.store_sizes方法的具體用法?Python Session.store_sizes怎麽用?Python Session.store_sizes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Session.Session的用法示例。


在下文中一共展示了Session.store_sizes方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: print

# 需要導入模塊: from Session import Session [as 別名]
# 或者: from Session.Session import store_sizes [as 別名]
                elif txt[0] == "#":
                    pass
                else:
                    rule = rule + txt + "\n"
        meta_key = rdf_session.do_metadata()
        orderOfService.append([file_input, text, name, description, meta_key])

# Checks to make sure all the SPARQL rules are collected.
#
if Config.DEBUG > 0:
    print "SPARQLer Rules Collected:"
    for ob in orderOfService:
        print(ob[0] + "    :    " + ob[1].replace("\n", "")
              .replace("  ", "").replace("\t", ""))

currentObjs = rdf_session.store_sizes()[0]

# Execute each sparql rule over until the number of new objects
# doesn't change. Once the total of objects stabilises, then the
# loop breaks (as rules can inference each other).
#
while currentObjs - initialObjs > 0:
    initialObjs = currentObjs
    for queryObj in orderOfService:
        # if config print rule executuon
        if Config.DEBUG > 0:
            print "Executing query: " + queryObj[0]

        res = rdf_session.sparql_query(queryObj[1], False)
        # if config, print result
        if Config.DEBUG > 0:
開發者ID:benjaminturnbull,項目名稱:ParFor,代碼行數:33,代碼來源:SPARQLer.py

示例2: get_reasoner

# 需要導入模塊: from Session import Session [as 別名]
# 或者: from Session.Session import store_sizes [as 別名]
        key = ontology.metadata.ns + Utils.get_uuid("metadata_")
        rdf_session.make_triple(
            [key,
             ontology.rdf.type,
             ontology.metadata.Reasoner],
            meta_repo=True)
        rdf_session.make_triple(
            [key,
             ontology.base.name,
             INPUTOBJNAME],
            literal=True,
            meta_repo=True)
        reasoner_id = key

    print reasoner_id
    return reasoner_id


if __name__ == "__main__":

    #global INPUTOBJURI
    INPUTOBJURI = get_reasoner(INPUTOBJNAME)
    rdf_session.set_metadata_properties(INPUTOBJNAME, INPUTOBJURI, 0, "date")

    fil = open(fileInput, "r")
    FIL_TEXT = fil.read()
    process_input_file(FIL_TEXT)

    rdf_session.commit()
    print rdf_session.store_sizes()
開發者ID:benjaminturnbull,項目名稱:ParFor,代碼行數:32,代碼來源:DataIngestion_Computers_Disks.py


注:本文中的Session.Session.store_sizes方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。