def test_create_graph():
"""Create new graphFactory Object"""
from sc import graphManager
PROV = Namespace("http://www.w3.org/ns/prov#")
tstregistry = graphManager.VocabularyRegistry()
vocab1 = Vocabulary1()
tstregistry.register(vocab1)
vocab2 = Vocabulary2()
tstregistry.register(vocab2)
tstregistry.build_graph()
print tstregistry.get_turtle()
# Check assertions in global graph store
assert (URIRef("http://orcid.org/000-0003-4901-6059"),
RDF.type, PROV.Person) in tstregistry.global_graph
assert (URIRef(uuidurn),
RDFS.label, Literal(
"Docker: https://www.docker.com/")) in tstregistry.global_graph
# Check Serialization
jsongraph = json.loads(tstregistry.get_json_ld())
assert '@context' in jsongraph
评论列表
文章目录