示例#1
0
__author__ = 'szednik'

"""
This example was taken from http://www.w3.org/TR/prov-primer
"""

from datetime import datetime
import rdflib
from kleio import prov

DCT = prov.ns("dct", "http://purl.org/dc/terms/")
FOAF = prov.ns("foaf", "http://xmlns.com/foaf/0.1/")
prov.ns("ex", "http://www.example.org#")

# Entities

article = prov.Entity("ex:article")
article.add(DCT.title, rdflib.Literal("Crime rises in cities"))

dataset1 = prov.Entity("ex:dataset1")

regionList = prov.Entity("ex:regionList")

composition1 = prov.Entity("ex:composition1")

chart1 = prov.Entity("ex:chart1")

# Activities

compile1 = prov.Activity("ex:compile1")
示例#2
0
__author__ = 'szednik'
"""
This example was taken from http://www.w3.org/TR/prov-primer
"""

from datetime import datetime
import rdflib
from kleio import prov

DCT = prov.ns("dct", "http://purl.org/dc/terms/")
FOAF = prov.ns("foaf", "http://xmlns.com/foaf/0.1/")
prov.ns("ex", "http://www.example.org#")

# Entities

article = prov.Entity("ex:article")
article.add(DCT.title, rdflib.Literal("Crime rises in cities"))

dataset1 = prov.Entity("ex:dataset1")

regionList = prov.Entity("ex:regionList")

composition1 = prov.Entity("ex:composition1")

chart1 = prov.Entity("ex:chart1")

# Activities

compile1 = prov.Activity("ex:compile1")

compose1 = prov.Activity("ex:compose1")
示例#3
0
 def setUp(self):
     prov.clear_graph()
     prov.ns("test", "http://tw.rpi.edu/ns/test#")
示例#4
0
__author__ = 'szednik'

from kleio import prov

prov.ns("test", "http://test.com/ns#")

my_bundle = prov.bundle(id="test:bundle")
bundle_entity = prov.bundle_entity(bundle=my_bundle)
bundle_entity.set_label("bundle entity")

entity = prov.Entity(id="test:entity-in-bundle", bundle=my_bundle)
entity.set_label("entity in bundle")

entity_not_in_bundle = prov.Entity(id="test:entity-not-in-bundle")
entity_not_in_bundle.set_label("entity not in bundle")

# Serialize using TriG to see the bundle container as a named graph
# and PROV assertions not associated with a bundle in the default graph
print(prov.serialize(format="trig"))

# Serialize using the bundle parameter to see only PROV
# assertions associated with the specified bundle
print(prov.serialize(format="trig", bundle=my_bundle))