Ejemplo n.º 1
0
def collections():
    g = ProvDocument()
    ex = Namespace("ex", "http://example.org/")

    c1 = g.collection(ex["c1"])
    e1 = g.entity("ex:e1")
    g.hadMember(c1, e1)

    return g
Ejemplo n.º 2
0
def collections():
    g = ProvDocument()
    ex = Namespace('ex', 'http://example.org/')

    c1 = g.collection(ex['c1'])
    e1 = g.entity('ex:e1')
    g.hadMember(c1, e1)

    return g
Ejemplo n.º 3
0
def collections():
    g = ProvDocument()
    ex = Namespace('ex', 'http://example.org/')

    c1 = g.collection(ex['c1'])
    e1 = g.entity('ex:e1')
    g.hadMember(c1, e1)

    return g
Ejemplo n.º 4
0
def release_tag_model(graph: ProvDocument, packages: ReleaseTagPackage):
    for package in packages:
        if package.release_package is not None:
            r_user, release, release_event, release_evidence, assets = package.release_package
            graph.agent(*r_user)
            graph.entity(*release)
            graph.activity(*release_event)
            graph.entity(*release_evidence)
            for asset in assets:
                graph.entity(*asset)
                graph.hadMember(asset.id, release.id)

            graph.hadMember(release_evidence.id, release.id)
            graph.wasGeneratedBy(release.id, release_event.id)
            graph.wasAttributedTo(release.id, r_user.id)
            graph.wasAssociatedWith(release_event.id, r_user.id)

        if package.tag_package is not None:
            t_user, tag, tag_event = package.tag_package
            graph.agent(*t_user)
            graph.entity(*tag)
            graph.activity(*tag_event)

            if package.release_package is not None:
                graph.hadMember(tag.id, release.id)
            graph.wasGeneratedBy(tag.id, tag_event.id)
            graph.wasAttributedTo(tag.id, t_user.id)
            graph.wasAssociatedWith(tag_event.id, t_user.id)

        if package.commit_package is not None:
            author, commit_event, _, commit, _ = package.commit_package
            graph.agent(*author)
            graph.activity(*commit_event)
            graph.entity(*commit)

            if package.tag_package is not None:
                graph.hadMember(commit.id, tag.id)
            graph.wasGeneratedBy(commit.id, commit_event.id)
            graph.wasAttributedTo(commit.id, author.id)
            graph.wasAssociatedWith(commit_event.id, author.id)
    return graph
Ejemplo n.º 5
0
        "title": "",
        "message": "",
        "web_url": "",
        "created_at": ""
    })
release_tag_model.entity("Release_Evidence", {
    "sha": "",
    "filepath": "",
    "collected_at": ""
})
release_tag_model.entity("Release_Asset", {
    "uri": "",
    "format": "",
    "filepath": ""
})
release_tag_model.hadMember("Release_Asset", "Release")
release_tag_model.hadMember("Release_Evidence", "Release")
release_tag_model.hadMember("Tag", "Release")
release_tag_model.hadMember("Commit", "Tag")
release_tag_model.wasAssociatedWith("Commit_Event", "User")
release_tag_model.wasAssociatedWith("Release_Event", "User")
release_tag_model.wasAssociatedWith("Tag_Event", "User")
release_tag_model.wasAttributedTo("Release", "User")
release_tag_model.wasAttributedTo("Tag", "User")
release_tag_model.wasAttributedTo("Commit", "User")
release_tag_model.wasGeneratedBy("Release", "Release_Event")
release_tag_model.wasGeneratedBy("Tag", "Tag_Event")
release_tag_model.wasGeneratedBy("Commit", "Commit_Event")

for title, doc in [("git_commit_model_add", add),
                   ("git_commit_model_mod", mod),