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


Python ProvBundle.used方法代码示例

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


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

示例1: create_bundle_mop_sign_form

# 需要导入模块: from prov.model import ProvBundle [as 别名]
# 或者: from prov.model.ProvBundle import used [as 别名]
def create_bundle_mop_sign_form(user_id,
                                session_key,
                                blank_form_serial,
                                signed_form_id,
                                form_data=None):
    bundle_id = 'b:%s/form/signing/%d' % (session_key, signed_form_id)
    b = ProvBundle(namespaces=DEFAULT_NAMESPACES)
    b.add_namespace('ns', b.valid_identifier(bundle_id + '/').get_uri())

    ag = b.agent('mopuser:%d/%s' % (user_id, session_key))
    bf = b.entity('form:blank/%s' % blank_form_serial,
                  [('prov:type', 'asset:BlankForm')])
    now = datetime.datetime.now()
    a = b.activity('ns:sign-form/%s' % blank_form_serial, now, now)
    b.wasAssociatedWith(a, ag)
    b.used(a, bf)
    data = {'prov:type': 'asset:SignedForm'}
    # Add relevant extra data of the form here
    if form_data is not None:
        data['mop:data'] = form_data
    sf = b.entity('form:signed/%s/%d' % (blank_form_serial, signed_form_id),
                  data)
    b.wasGeneratedBy(sf, a)
    b.wasAttributedTo(sf, ag)
    return bundle_id, b
开发者ID:bachour,项目名称:deptx,代码行数:27,代码来源:provlogging.py

示例2: test_non_unifiable_document

# 需要导入模块: from prov.model import ProvBundle [as 别名]
# 或者: from prov.model.ProvBundle import used [as 别名]
    def test_non_unifiable_document(self):
        g = ProvBundle()
        g.add_namespace("ex", "http://www.example.com/")
        g.activity('ex:compose', other_attributes={'prov:role': "ex:dataToCompose1"})
        g.used('ex:compose', 'ex:testEntity')
        with self.assertRaises(ProvExceptionCannotUnifyAttribute):
            g.activity('ex:testEntity')

        h = g.bundle('ex:bundle')
        h.add_namespace("ex", "http://www.example.com/")
        h.entity('ex:compose', other_attributes={'prov:label': "impossible!!!"})

        with self.assertRaises(ProvExceptionCannotUnifyAttribute):
            g.get_flattened()
开发者ID:pombredanne,项目名称:prov,代码行数:16,代码来源:testModel.py

示例3: create_bundle_mop_issue_form

# 需要导入模块: from prov.model import ProvBundle [as 别名]
# 或者: from prov.model.ProvBundle import used [as 别名]
def create_bundle_mop_issue_form(user_id, session_key, signed_form_id, old_blank_form_serial, email_id, new_blank_form_serial, unit_serial):
#     t = long(time.time())
    bundle_id = 'b:%s/form/issue/%s' % (session_key, new_blank_form_serial)
    b = ProvBundle(namespaces=DEFAULT_NAMESPACES)
    b.add_namespace('ns', b.valid_identifier(bundle_id + '/').get_uri())

    ag = b.agent('dept:%s' % unit_serial)
    sf = b.entity('form:signed/%s/%d' % (old_blank_form_serial, signed_form_id))
    em = b.entity('email:%d' % email_id)
    now = datetime.datetime.now()
    a = b.activity('bs:issue-form/%s' % new_blank_form_serial, now, now)
    b.wasAssociatedWith(a, ag)
    b.used(a, em)
    nf = b.entity('form:blank/%s' % new_blank_form_serial)
    b.wasGeneratedBy(nf, a)
    b.wasDerivedFrom(nf, sf)
    return bundle_id, b
开发者ID:pombredanne,项目名称:deptx,代码行数:19,代码来源:provlogging.py

示例4: create_bundle_mop_issue_document

# 需要导入模块: from prov.model import ProvBundle [as 别名]
# 或者: from prov.model.ProvBundle import used [as 别名]
def create_bundle_mop_issue_document(user_id, session_key, email_id, blank_form_serial, signed_form_id, document_serial, document_instance_id, unit_serial):
    bundle_id = 'b:%s/document/issue/%s' % (session_key, document_instance_id)
    b = ProvBundle(namespaces=DEFAULT_NAMESPACES)
    b.add_namespace('ns', b.valid_identifier(bundle_id + '/').get_uri())

    ag = b.agent('dept:%s' % unit_serial)
    sf = b.entity('form:signed/%s/%d' % (blank_form_serial, signed_form_id))
    em = b.entity('email:%d' % email_id)
    now = datetime.datetime.now()
    a = b.activity('bs:issue-document/%d' % document_instance_id, now, now)
    b.wasAssociatedWith(a, ag)
    b.used(a, em)
    d = b.entity('document:%s' % document_serial, [('prov:type', 'asset:Document')])
    b.used(a, d)
    di = b.entity('document:%s/%d' % (document_serial, document_instance_id), [('prov:type', 'asset:MopDocumentInstance')])
    b.wasGeneratedBy(di, a)
    b.wasDerivedFrom(di, sf)
    b.wasDerivedFrom(di, d)
    return bundle_id, b
开发者ID:pombredanne,项目名称:deptx,代码行数:21,代码来源:provlogging.py

示例5: example_graph

# 需要导入模块: from prov.model import ProvBundle [as 别名]
# 或者: from prov.model.ProvBundle import used [as 别名]
def example_graph():
    FOAF = Namespace("foaf","http://xmlns.com/foaf/0.1/")
    EX = Namespace("ex","http://www.example.com/")
    DCTERMS = Namespace("dcterms","http://purl.org/dc/terms/")
    
    # create a provenance _container
    g = ProvBundle()
    
    # Set the default _namespace name
    g.set_default_namespace(EX.get_uri())
    g.add_namespace(DCTERMS)
    
    # add entities, first define the _attributes in a dictionary
    e0_attrs = {PROV["type"]: "File",
                EX["path"]: "/shared/crime.txt",
                EX["creator"]: "Alice"}
    # then create the entity
    # If you give the id as a string, it will be treated as a localname
    # under the default _namespace
    e0 = g.entity(EX["e0"], e0_attrs)
    
    # define the _attributes for the next entity
    lit0 = Literal("2011-11-16T16:06:00", XSD["dateTime"])
    attrdict ={PROV["type"]: EX["File"],
               EX["path"]: "/shared/crime.txt",
               DCTERMS["creator"]: FOAF['Alice'],
               EX["content"]: "",
               DCTERMS["create"]: lit0}
    # create the entity, note this time we give the id as a PROVQname
    e1 = g.entity(FOAF['Foo'], attrdict)
    
    # add activities
    # You can give the _attributes during the creation if there are not many
    a0 = g.activity(EX['a0'], datetime.datetime(2008, 7, 6, 5, 4, 3), None, {PROV["type"]: EX["create-file"]})
    
    g0 = g.wasGeneratedBy(e0, a0, None, "g0", {EX["fct"]: "create"})
    
    attrdict={EX["fct"]: "load",
              EX["typeexample"] : Literal("MyValue", EX["MyType"])}
    u0 = g.used(a0, e1, None, "u0", attrdict)
    
    # The id for a relation is an optional argument, The system will generate one
    # if you do not specify it 
    g.wasDerivedFrom(e0, e1, a0, g0, u0)

    return g
开发者ID:YilinHao,项目名称:w3-prov,代码行数:48,代码来源:examples.py

示例6: w3c_publication_2

# 需要导入模块: from prov.model import ProvBundle [as 别名]
# 或者: from prov.model.ProvBundle import used [as 别名]
def w3c_publication_2():
    # https://github.com/lucmoreau/ProvToolbox/blob/master/asn/src/test/resources/prov/w3c-publication2.prov-asn
    #===========================================================================
    # bundle
    # 
    # prefix ex <http://example.org/>
    # prefix rec <http://example.org/record>
    # 
    # prefix w3 <http://www.w3.org/TR/2011/>
    # prefix hg <http://dvcs.w3.org/hg/prov/raw-file/9628aaff6e20/model/releases/WD-prov-dm-20111215/>
    # 
    # 
    # entity(hg:Overview.html, [ prov:type="file in hg" ])
    # entity(w3:WD-prov-dm-20111215, [ prov:type="html4" ])
    # 
    # 
    # activity(ex:rcp,-,-,[prov:type="copy directory"])
    # 
    # wasGeneratedBy(rec:g; w3:WD-prov-dm-20111215, ex:rcp, -)
    # 
    # entity(ex:req3, [ prov:type="http://www.w3.org/2005/08/01-transitions.html#pubreq" %% xsd:anyURI ])
    # 
    # used(rec:u; ex:rcp,hg:Overview.html,-)
    # used(ex:rcp, ex:req3, -)
    # 
    # 
    # wasDerivedFrom(w3:WD-prov-dm-20111215, hg:Overview.html, ex:rcp, rec:g, rec:u)
    # 
    # agent(ex:webmaster, [ prov:type='prov:Person' ])
    # 
    # wasAssociatedWith(ex:rcp, ex:webmaster, -)
    # 
    # endBundle
    #===========================================================================

    ex = Namespace('ex', 'http://example.org/')
    rec = Namespace('rec', 'http://example.org/record')
    w3 = Namespace('w3', 'http://www.w3.org/TR/2011/')
    hg = Namespace('hg', 'http://dvcs.w3.org/hg/prov/raw-file/9628aaff6e20/model/releases/WD-prov-dm-20111215/')
    
    
    g = ProvBundle()
    
    g.entity(hg['Overview.html'], {'prov:type': "file in hg"})
    g.entity(w3['WD-prov-dm-20111215'], {'prov:type': "html4"})

    g.activity(ex['rcp'], None, None, {'prov:type': "copy directory"})

    g.wasGeneratedBy('w3:WD-prov-dm-20111215', 'ex:rcp', identifier=rec['g'])

    g.entity('ex:req3', {'prov:type': Identifier("http://www.w3.org/2005/08/01-transitions.html#pubreq")})
    
    g.used('ex:rcp', 'hg:Overview.html', identifier='rec:u')
    g.used('ex:rcp', 'ex:req3')
    
    g.wasDerivedFrom('w3:WD-prov-dm-20111215', 'hg:Overview.html', 'ex:rcp', 'rec:g', 'rec:u')

    g.agent('ex:webmaster', {'prov:type': "Person"})

    g.wasAssociatedWith('ex:rcp', 'ex:webmaster')
        
    return g
开发者ID:YilinHao,项目名称:w3-prov,代码行数:64,代码来源:examples.py

示例7: w3c_publication_1

# 需要导入模块: from prov.model import ProvBundle [as 别名]
# 或者: from prov.model.ProvBundle import used [as 别名]
def w3c_publication_1():
    # https://github.com/lucmoreau/ProvToolbox/blob/master/asn/src/test/resources/prov/w3c-publication1.prov-asn
    #===========================================================================
    # bundle
    # 
    # prefix ex  <http://example.org/>
    # 
    # prefix w3      <http://www.w3.org/>
    # prefix tr      <http://www.w3.org/TR/2011/>
    # prefix process <http://www.w3.org/2005/10/Process-20051014/tr.html#>
    # prefix email   <https://lists.w3.org/Archives/Member/w3c-archive/>
    # prefix chairs  <https://lists.w3.org/Archives/Member/chairs/>
    # prefix trans   <http://www.w3.org/2005/08/01-transitions.html#>
    # prefix rec54   <http://www.w3.org/2001/02pd/rec54#>
    # 
    # 
    #  entity(tr:WD-prov-dm-20111018, [ prov:type='rec54:WD' ])
    #  entity(tr:WD-prov-dm-20111215, [ prov:type='rec54:WD' ])
    #  entity(process:rec-advance,    [ prov:type='prov:Plan' ])
    # 
    # 
    #  entity(chairs:2011OctDec/0004, [ prov:type='trans:transreq' ])
    #  entity(email:2011Oct/0141,     [ prov:type='trans:pubreq' ])
    #  entity(email:2011Dec/0111,     [ prov:type='trans:pubreq' ])
    # 
    # 
    #  wasDerivedFrom(tr:WD-prov-dm-20111215, tr:WD-prov-dm-20111018)
    # 
    # 
    #  activity(ex:act1,-,-,[prov:type="publish"])
    #  activity(ex:act2,-,-,[prov:type="publish"])
    # 
    #  wasGeneratedBy(tr:WD-prov-dm-20111018, ex:act1, -)
    #  wasGeneratedBy(tr:WD-prov-dm-20111215, ex:act2, -)
    # 
    #  used(ex:act1, chairs:2011OctDec/0004, -)
    #  used(ex:act1, email:2011Oct/0141, -)
    #  used(ex:act2, email:2011Dec/0111, -)
    # 
    #  agent(w3:Consortium, [ prov:type='prov:Organization' ])
    # 
    #  wasAssociatedWith(ex:act1, w3:Consortium, process:rec-advance)
    #  wasAssociatedWith(ex:act2, w3:Consortium, process:rec-advance)
    # 
    # endBundle
    #===========================================================================
    
    g = ProvBundle()
    g.add_namespace('ex', 'http://example.org/')
    g.add_namespace('w3', 'http://www.w3.org/')
    g.add_namespace('tr', 'http://www.w3.org/TR/2011/')
    g.add_namespace('process', 'http://www.w3.org/2005/10/Process-20051014/tr.html#')
    g.add_namespace('email', 'https://lists.w3.org/Archives/Member/w3c-archive/')
    g.add_namespace('chairs', 'https://lists.w3.org/Archives/Member/chairs/')
    g.add_namespace('trans', 'http://www.w3.org/2005/08/01-transitions.html#')
    g.add_namespace('rec54', 'http://www.w3.org/2001/02pd/rec54#')

    g.entity('tr:WD-prov-dm-20111018', {'prov:type': 'rec54:WD'})
    g.entity('tr:WD-prov-dm-20111215', {'prov:type': 'rec54:WD'})
    g.entity('process:rec-advance',    {'prov:type': 'prov:Plan'})

    g.entity('chairs:2011OctDec/0004', {'prov:type': 'trans:transreq'})
    g.entity('email:2011Oct/0141', {'prov:type': 'trans:pubreq'})
    g.entity('email:2011Dec/0111', {'prov:type': 'trans:pubreq'})

    g.wasDerivedFrom('tr:WD-prov-dm-20111215', 'tr:WD-prov-dm-20111018')

    g.activity('ex:act1', other_attributes={'prov:type': "publish"})
    g.activity('ex:act2', other_attributes={'prov:type': "publish"})

    g.wasGeneratedBy('tr:WD-prov-dm-20111018', 'ex:act1')
    g.wasGeneratedBy('tr:WD-prov-dm-20111215', 'ex:act2')

    g.used('ex:act1', 'chairs:2011OctDec/0004')
    g.used('ex:act1', 'email:2011Oct/0141')
    g.used('ex:act2', 'email:2011Dec/0111')

    g.agent('w3:Consortium', other_attributes= {'prov:type': "Organization"})

    g.wasAssociatedWith('ex:act1', 'w3:Consortium', 'process:rec-advance')
    g.wasAssociatedWith('ex:act2', 'w3:Consortium', 'process:rec-advance')
    

    return g
开发者ID:YilinHao,项目名称:w3-prov,代码行数:86,代码来源:examples.py

示例8: primer_example

# 需要导入模块: from prov.model import ProvBundle [as 别名]
# 或者: from prov.model.ProvBundle import used [as 别名]
def primer_example():
    # https://github.com/lucmoreau/ProvToolbox/blob/master/asn/src/test/resources/prov/primer.pn
    #===========================================================================
    # bundle
    # 
    #   prefix ex <http://example/>
    # 
    #   entity(ex:article, [dcterms:title="Crime rises in cities"])
    #   entity(ex:dataSet1)
    #   entity(ex:dataSet2)
    #   entity(ex:regionList)
    #   entity(ex:composition)
    #   entity(ex:chart1)
    #   entity(ex:chart2)
    # 
    # 
    #   activity(ex:compile)
    #   activity(ex:compose)
    #   activity(ex:illustrate)
    # 
    # 
    #   used(ex:compose, ex:dataSet1, -)
    #   used(ex:compose, ex:regionList, -)
    #   wasGeneratedBy(ex:composition, ex:compose, -)
    # 
    #   used(ex:illustrate, ex:composition, -)
    #   wasGeneratedBy(ex:chart1, ex:illustrate, -)
    # 
    # 
    #   agent(ex:derek, [ prov:type="prov:Person", foaf:givenName = "Derek", 
    #          foaf:mbox= "<mailto:[email protected]>"])
    #   wasAssociatedWith(ex:compose, ex:derek, -)
    #   wasAssociatedWith(ex:illustrate, ex:derek, -)
    # 
    #   agent(ex:chartgen, [ prov:type="prov:Organization",
    #          foaf:name = "Chart Generators Inc"])
    #   actedOnBehalfOf(ex:derek, ex:chartgen, ex:compose)
    # 
    #   wasAttributedTo(ex:chart1, ex:derek)
    # 
    # 
    #   used(ex:compose, ex:dataSet1, -,   [ prov:role = "ex:dataToCompose"])
    #   used(ex:compose, ex:regionList, -, [ prov:role = "ex:regionsToAggregteBy"])
    # 
    # 
    #   wasRevisionOf(ex:dataSet2, ex:dataSet1, -)
    #   wasDerivedFrom(ex:chart2, ex:dataSet2)
    # 
    # endBundle
    #===========================================================================
    ex = Namespace('ex', 'http://example/')
    
    g = ProvBundle()
    g.add_namespace("dcterms","http://purl.org/dc/terms/")
    
    g.entity(ex['article'], {'dcterms:title': "Crime rises in cities"})
    g.entity(ex['dataSet1'])
    g.entity(ex['dataSet2'])
    g.entity(ex['regionList'])
    g.entity(ex['composition'])
    g.entity(ex['chart1'])
    g.entity(ex['chart2'])

    g.activity(ex['compile'])
    g.activity(ex['compose'])
    g.activity(ex['illustrate'])

    g.used('ex:compose', 'ex:dataSet1', other_attributes={'prov:role' : "ex:dataToCompose"})
    g.used('ex:compose', 'ex:regionList', other_attributes={'prov:role' : "ex:regionsToAggregateBy"})
    g.wasGeneratedBy('ex:composition', 'ex:compose')
    
    g.used('ex:illustrate', 'ex:composition')
    g.wasGeneratedBy('ex:chart1', 'ex:illustrate')
    
    g.agent('ex:derek', {'prov:type': "prov:Person", 'foaf:givenName': "Derek", 'foaf:mbox': "<mailto:[email protected]>"})
    g.wasAssociatedWith('ex:compose', 'ex:derek')
    g.wasAssociatedWith('ex:illustrate', 'ex:derek')
    
    g.agent('ex:chartgen', {'prov:type': "prov:Organization", 'foaf:name' : "Chart Generators Inc"})
    g.actedOnBehalfOf('ex:derek', 'ex:chartgen', 'ex:compose')
    g.wasAttributedTo('ex:chart1', 'ex:derek')

    g.wasRevisionOf('ex:dataSet2', 'ex:dataSet1')
    g.wasDerivedFrom('ex:chart2', 'ex:dataSet2')
    
    return g
开发者ID:YilinHao,项目名称:w3-prov,代码行数:88,代码来源:examples.py

示例9: primer_example

# 需要导入模块: from prov.model import ProvBundle [as 别名]
# 或者: from prov.model.ProvBundle import used [as 别名]
def primer_example():
    # https://github.com/lucmoreau/ProvToolbox/blob/master/prov-n/src/test/resources/prov/primer.pn
    # ===========================================================================
    # document
    g = ProvBundle()

    #    prefix ex <http://example/>
    #    prefix dcterms <http://purl.org/dc/terms/>
    #    prefix foaf <http://xmlns.com/foaf/0.1/>
    ex = Namespace("ex", "http://example/")  # namespaces do not need to be explicitly added to a document
    g.add_namespace("dcterms", "http://purl.org/dc/terms/")
    g.add_namespace("foaf", "http://xmlns.com/foaf/0.1/")

    #    entity(ex:article, [dcterms:title="Crime rises in cities"])
    g.entity(
        ex["article"], {"dcterms:title": "Crime rises in cities"}
    )  # first time the ex namespace was used, it is added to the document automatically
    #    entity(ex:articleV1)
    g.entity(ex["articleV1"])
    #    entity(ex:articleV2)
    g.entity(ex["articleV2"])
    #    entity(ex:dataSet1)
    g.entity(ex["dataSet1"])
    #    entity(ex:dataSet2)
    g.entity(ex["dataSet2"])
    #    entity(ex:regionList)
    g.entity(ex["regionList"])
    #    entity(ex:composition)
    g.entity(ex["composition"])
    #    entity(ex:chart1)
    g.entity(ex["chart1"])
    #    entity(ex:chart2)
    g.entity(ex["chart2"])
    #    entity(ex:blogEntry)
    g.entity(ex["blogEntry"])

    #    activity(ex:compile)
    g.activity("ex:compile")  # since ex is registered, it can be used like this
    #    activity(ex:compile2)
    g.activity("ex:compile2")
    #    activity(ex:compose)
    g.activity("ex:compose")
    #    activity(ex:correct, 2012-03-31T09:21:00, 2012-04-01T15:21:00)
    g.activity("ex:correct", "2012-03-31T09:21:00", "2012-04-01T15:21:00")  # date time can be provided as strings
    #    activity(ex:illustrate)
    g.activity("ex:illustrate")

    #    used(ex:compose, ex:dataSet1, -,   [ prov:role = "ex:dataToCompose"])
    g.used("ex:compose", "ex:dataSet1", other_attributes={"prov:role": "ex:dataToCompose"})
    #    used(ex:compose, ex:regionList, -, [ prov:role = "ex:regionsToAggregateBy"])
    g.used("ex:compose", "ex:regionList", other_attributes={"prov:role": "ex:regionsToAggregateBy"})
    #    wasGeneratedBy(ex:composition, ex:compose, -)
    g.wasGeneratedBy("ex:composition", "ex:compose")

    #    used(ex:illustrate, ex:composition, -)
    g.used("ex:illustrate", "ex:composition")
    #    wasGeneratedBy(ex:chart1, ex:illustrate, -)
    g.wasGeneratedBy("ex:chart1", "ex:illustrate")

    #    wasGeneratedBy(ex:chart1, ex:compile,  2012-03-02T10:30:00)
    g.wasGeneratedBy("ex:chart1", "ex:compile", "2012-03-02T10:30:00")
    #    wasGeneratedBy(ex:chart2, ex:compile2, 2012-04-01T15:21:00)
    #
    #
    #    agent(ex:derek, [ prov:type="prov:Person", foaf:givenName = "Derek",
    #           foaf:mbox= "<mailto:[email protected]>"])
    g.agent(
        "ex:derek", {"prov:type": PROV["Person"], "foaf:givenName": "Derek", "foaf:mbox": "<mailto:[email protected]>"}
    )
    #    wasAssociatedWith(ex:compose, ex:derek, -)
    g.wasAssociatedWith("ex:compose", "ex:derek")
    #    wasAssociatedWith(ex:illustrate, ex:derek, -)
    g.wasAssociatedWith("ex:illustrate", "ex:derek")
    #
    #    agent(ex:chartgen, [ prov:type="prov:Organization",
    #           foaf:name = "Chart Generators Inc"])
    g.agent("ex:chartgen", {"prov:type": PROV["Organization"], "foaf:name": "Chart Generators Inc"})
    #    actedOnBehalfOf(ex:derek, ex:chartgen, ex:compose)
    g.actedOnBehalfOf("ex:derek", "ex:chartgen", "ex:compose")
    #    wasAttributedTo(ex:chart1, ex:derek)
    g.wasAttributedTo("ex:chart1", "ex:derek")

    #    wasGeneratedBy(ex:dataSet2, ex:correct, -)
    g.wasGeneratedBy("ex:dataSet2", "ex:correct")
    #    used(ex:correct, ex:dataSet1, -)
    g.used("ex:correct", "ex:dataSet1")
    #    wasDerivedFrom(ex:dataSet2, ex:dataSet1, [prov:type='prov:Revision'])
    g.wasDerivedFrom("ex:dataSet2", "ex:dataSet1", other_attributes={"prov:type": PROV["Revision"]})
    #    wasDerivedFrom(ex:chart2, ex:dataSet2)
    g.wasDerivedFrom("ex:chart2", "ex:dataSet2")

    #    wasDerivedFrom(ex:blogEntry, ex:article, [prov:type='prov:Quotation'])
    g.wasDerivedFrom("ex:blogEntry", "ex:article", other_attributes={"prov:type": PROV["Quotation"]})
    #    specializationOf(ex:articleV1, ex:article)
    g.specializationOf("ex:articleV1", "ex:article")
    #    wasDerivedFrom(ex:articleV1, ex:dataSet1)
    g.wasDerivedFrom("ex:articleV1", "ex:dataSet1")

    #    specializationOf(ex:articleV2, ex:article)
    g.specializationOf("ex:articleV2", "ex:article")
#.........这里部分代码省略.........
开发者ID:satra,项目名称:prov,代码行数:103,代码来源:examples.py

示例10: w3c_publication_2

# 需要导入模块: from prov.model import ProvBundle [as 别名]
# 或者: from prov.model.ProvBundle import used [as 别名]
def w3c_publication_2():
    # https://github.com/lucmoreau/ProvToolbox/blob/master/asn/src/test/resources/prov/w3c-publication2.prov-asn
    # ===========================================================================
    # bundle
    #
    # prefix ex <http://example.org/>
    # prefix rec <http://example.org/record>
    #
    # prefix w3 <http://www.w3.org/TR/2011/>
    # prefix hg <http://dvcs.w3.org/hg/prov/raw-file/9628aaff6e20/model/releases/WD-prov-dm-20111215/>
    #
    #
    # entity(hg:Overview.html, [ prov:type="file in hg" ])
    # entity(w3:WD-prov-dm-20111215, [ prov:type="html4" ])
    #
    #
    # activity(ex:rcp,-,-,[prov:type="copy directory"])
    #
    # wasGeneratedBy(rec:g; w3:WD-prov-dm-20111215, ex:rcp, -)
    #
    # entity(ex:req3, [ prov:type="http://www.w3.org/2005/08/01-transitions.html#pubreq" %% xsd:anyURI ])
    #
    # used(rec:u; ex:rcp,hg:Overview.html,-)
    # used(ex:rcp, ex:req3, -)
    #
    #
    # wasDerivedFrom(w3:WD-prov-dm-20111215, hg:Overview.html, ex:rcp, rec:g, rec:u)
    #
    # agent(ex:webmaster, [ prov:type='prov:Person' ])
    #
    # wasAssociatedWith(ex:rcp, ex:webmaster, -)
    #
    # endBundle
    # ===========================================================================

    ex = Namespace("ex", "http://example.org/")
    rec = Namespace("rec", "http://example.org/record")
    w3 = Namespace("w3", "http://www.w3.org/TR/2011/")
    hg = Namespace("hg", "http://dvcs.w3.org/hg/prov/raw-file/9628aaff6e20/model/releases/WD-prov-dm-20111215/")

    g = ProvBundle()

    g.entity(hg["Overview.html"], {"prov:type": "file in hg"})
    g.entity(w3["WD-prov-dm-20111215"], {"prov:type": "html4"})

    g.activity(ex["rcp"], None, None, {"prov:type": "copy directory"})

    g.wasGeneratedBy("w3:WD-prov-dm-20111215", "ex:rcp", identifier=rec["g"])

    g.entity("ex:req3", {"prov:type": Identifier("http://www.w3.org/2005/08/01-transitions.html#pubreq")})

    g.used("ex:rcp", "hg:Overview.html", identifier="rec:u")
    g.used("ex:rcp", "ex:req3")

    g.wasDerivedFrom("w3:WD-prov-dm-20111215", "hg:Overview.html", "ex:rcp", "rec:g", "rec:u")

    g.agent("ex:webmaster", {"prov:type": "Person"})

    g.wasAssociatedWith("ex:rcp", "ex:webmaster")

    return g
开发者ID:satra,项目名称:prov,代码行数:63,代码来源:examples.py

示例11: w3c_publication_1

# 需要导入模块: from prov.model import ProvBundle [as 别名]
# 或者: from prov.model.ProvBundle import used [as 别名]
def w3c_publication_1():
    # https://github.com/lucmoreau/ProvToolbox/blob/master/asn/src/test/resources/prov/w3c-publication1.prov-asn
    # ===========================================================================
    # bundle
    #
    # prefix ex  <http://example.org/>
    #
    # prefix w3      <http://www.w3.org/>
    # prefix tr      <http://www.w3.org/TR/2011/>
    # prefix process <http://www.w3.org/2005/10/Process-20051014/tr.html#>
    # prefix email   <https://lists.w3.org/Archives/Member/w3c-archive/>
    # prefix chairs  <https://lists.w3.org/Archives/Member/chairs/>
    # prefix trans   <http://www.w3.org/2005/08/01-transitions.html#>
    # prefix rec54   <http://www.w3.org/2001/02pd/rec54#>
    #
    #
    #  entity(tr:WD-prov-dm-20111018, [ prov:type='rec54:WD' ])
    #  entity(tr:WD-prov-dm-20111215, [ prov:type='rec54:WD' ])
    #  entity(process:rec-advance,    [ prov:type='prov:Plan' ])
    #
    #
    #  entity(chairs:2011OctDec/0004, [ prov:type='trans:transreq' ])
    #  entity(email:2011Oct/0141,     [ prov:type='trans:pubreq' ])
    #  entity(email:2011Dec/0111,     [ prov:type='trans:pubreq' ])
    #
    #
    #  wasDerivedFrom(tr:WD-prov-dm-20111215, tr:WD-prov-dm-20111018)
    #
    #
    #  activity(ex:act1,-,-,[prov:type="publish"])
    #  activity(ex:act2,-,-,[prov:type="publish"])
    #
    #  wasGeneratedBy(tr:WD-prov-dm-20111018, ex:act1, -)
    #  wasGeneratedBy(tr:WD-prov-dm-20111215, ex:act2, -)
    #
    #  used(ex:act1, chairs:2011OctDec/0004, -)
    #  used(ex:act1, email:2011Oct/0141, -)
    #  used(ex:act2, email:2011Dec/0111, -)
    #
    #  agent(w3:Consortium, [ prov:type='prov:Organization' ])
    #
    #  wasAssociatedWith(ex:act1, w3:Consortium, process:rec-advance)
    #  wasAssociatedWith(ex:act2, w3:Consortium, process:rec-advance)
    #
    # endBundle
    # ===========================================================================

    g = ProvBundle()
    g.add_namespace("ex", "http://example.org/")
    g.add_namespace("w3", "http://www.w3.org/")
    g.add_namespace("tr", "http://www.w3.org/TR/2011/")
    g.add_namespace("process", "http://www.w3.org/2005/10/Process-20051014/tr.html#")
    g.add_namespace("email", "https://lists.w3.org/Archives/Member/w3c-archive/")
    g.add_namespace("chairs", "https://lists.w3.org/Archives/Member/chairs/")
    g.add_namespace("trans", "http://www.w3.org/2005/08/01-transitions.html#")
    g.add_namespace("rec54", "http://www.w3.org/2001/02pd/rec54#")

    g.entity("tr:WD-prov-dm-20111018", {"prov:type": "rec54:WD"})
    g.entity("tr:WD-prov-dm-20111215", {"prov:type": "rec54:WD"})
    g.entity("process:rec-advance", {"prov:type": "prov:Plan"})

    g.entity("chairs:2011OctDec/0004", {"prov:type": "trans:transreq"})
    g.entity("email:2011Oct/0141", {"prov:type": "trans:pubreq"})
    g.entity("email:2011Dec/0111", {"prov:type": "trans:pubreq"})

    g.wasDerivedFrom("tr:WD-prov-dm-20111215", "tr:WD-prov-dm-20111018")

    g.activity("ex:act1", other_attributes={"prov:type": "publish"})
    g.activity("ex:act2", other_attributes={"prov:type": "publish"})

    g.wasGeneratedBy("tr:WD-prov-dm-20111018", "ex:act1")
    g.wasGeneratedBy("tr:WD-prov-dm-20111215", "ex:act2")

    g.used("ex:act1", "chairs:2011OctDec/0004")
    g.used("ex:act1", "email:2011Oct/0141")
    g.used("ex:act2", "email:2011Dec/0111")

    g.agent("w3:Consortium", other_attributes={"prov:type": "Organization"})

    g.wasAssociatedWith("ex:act1", "w3:Consortium", "process:rec-advance")
    g.wasAssociatedWith("ex:act2", "w3:Consortium", "process:rec-advance")

    return g
开发者ID:satra,项目名称:prov,代码行数:85,代码来源:examples.py

示例12: ProvBundle

# 需要导入模块: from prov.model import ProvBundle [as 别名]
# 或者: from prov.model.ProvBundle import used [as 别名]
g = ProvBundle()
g.add_namespace("dcterms","http://purl.org/dc/terms/")

g.entity(ex['article'], {'dcterms:title': "Crime rises in cities"})
g.entity(ex['dataSet1'])
g.entity(ex['dataSet2'])
g.entity(ex['regionList'])
g.entity(ex['composition'])
g.entity(ex['chart1'])
g.entity(ex['chart2'])

g.activity(ex['compile'])
g.activity(ex['compose'])
g.activity(ex['illustrate'])

g.used('ex:compose', 'ex:dataSet1', other_attributes={'prov:role' : "ex:dataToCompose"})
g.used('ex:compose', 'ex:regionList', other_attributes={'prov:role' : "ex:regionsToAggregateBy"})
g.wasGeneratedBy('ex:composition', 'ex:compose')

g.used('ex:illustrate', 'ex:composition')
g.wasGeneratedBy('ex:chart1', 'ex:illustrate')

g.agent('ex:derek', {'prov:type': "prov:Person", 'foaf:givenName': "Derek", 'foaf:mbox': "<mailto:[email protected]>"})
g.wasAssociatedWith('ex:compose', 'ex:derek')
g.wasAssociatedWith('ex:illustrate', 'ex:derek')

g.agent('ex:chartgen', {'prov:type': "prov:Organization", 'foaf:name' : "Chart Generators Inc"})
g.actedOnBehalfOf('ex:derek', 'ex:chartgen', 'ex:compose')
g.wasAttributedTo('ex:chart1', 'ex:derek')

g.wasRevisionOf('ex:dataSet2', 'ex:dataSet1')
开发者ID:,项目名称:,代码行数:33,代码来源:


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