import prov.model as prov

def flat_document():
    document = prov.ProvDocument()

    ns = document.add_namespace('ex', 'http://example.com/')

    document.entity(ns['entity-1'])

    return document

def bundle_document():
    doc_json = '{"prefix": {"repo": "https://github.com/johndoe/examplerepo.git#", "default": "http://ddmore.eu/workflow#", "ddmore": "http://ddmore.eu/workflow#"}, "wasAttributedTo": {"_:id1": {"prov:entity": "repo:9d2e4cd9af541a56942aac15272d2a82f7062357", "prov:agent": "bob"}}, "bundle": {"uuid:93b72294-b428-4c20-a001-bf8758fac5b0": {"prefix": {"repo": "https://github.com/johndoe/examplerepo.git#", "default": "http://ddmore.eu/workflow#", "uuid": "urn:uuid:", "ddmore": "http://ddmore.eu/workflow#"}, "wasAttributedTo": {"_:id1": {"prov:entity": "repo:3fed4cd9af54567566942aaceb452c2a82f62357", "prov:agent": "bob"}}, "agent": {"bob": {"prov:type": {"type": "prov:QUALIFIED_NAME", "$": "prov:Person"}}}, "entity": {"repo:3fed4cd9af54567566942aaceb452c2a82f62357": {"prov:type": {"type": "prov:QUALIFIED_NAME", "$": "prov:Bundle"}}}}, "repo:3fed4cd9af54567566942aaceb452c2a82f62357": {"wasAssociatedWith": {"_:id1": {"prov:agent": "bob", "prov:activity": "783562452"}}, "wasDerivedFrom": {"_:id2": {"prov:usedEntity": "5673256", "prov:generatedEntity": "repo:3fed4cd9af54567566942aaceb452c2a82f62357/models/model4.ctl", "prov:type": {"type": "prov:QUALIFIED_NAME", "$": "Specialization"}}}, "used": {"_:id3": {"prov:entity": "5673256", "prov:activity": "783562452"}}, "mentionOf": {"_:id4": {"prov:generalEntity": "repo:1fed4cd9af53456942aac15272d2a82f7062357/models/model2.ctl", "prov:bundle": "repo:1fed4cd9af53456942aac15272d2a82f7062357", "prov:specificEntity": "5673256"}}, "agent": {"bob": {"prov:type": {"type": "prov:QUALIFIED_NAME", "$": "prov:Person"}}}, "entity": {"5673256": {}, "repo:3fed4cd9af54567566942aaceb452c2a82f62357/models/model4.ctl": {"prov:type": {"type": "prov:QUALIFIED_NAME", "$": "model"}, "prov:location": {"type": "prov:QUALIFIED_NAME", "$": "models/model4.ctl"}, "prov:label": "model4.ctl"}}, "prefix": {"repo": "https://github.com/johndoe/examplerepo.git#", "default": "http://ddmore.eu/workflow#", "ddmore": "http://ddmore.eu/workflow#"}, "activity": {"783562452": {"prov:type": {"type": "prov:QUALIFIED_NAME", "$": "clone"}, "prov:label": "clone"}}, "wasGeneratedBy": {"_:id5": {"prov:entity": "repo:3fed4cd9af54567566942aaceb452c2a82f62357/models/model4.ctl", "prov:activity": "783562452"}}}, "uuid:00daa164-1af5-4539-b3c8-1b169b76e1ef": {"prefix": {"repo": "https://github.com/johndoe/examplerepo.git#", "default": "http://ddmore.eu/workflow#", "uuid": "urn:uuid:", "ddmore": "http://ddmore.eu/workflow#"}, "wasAttributedTo": {"_:id1": {"prov:entity": "repo:1fed4cd9af53456942aac15272d2a82f7062357", "prov:agent": "mike"}}, "agent": {"mike": {"prov:type": {"type": "prov:QUALIFIED_NAME", "$": "prov:Person"}}}, "entity": {"repo:1fed4cd9af53456942aac15272d2a82f7062357": {"prov:type": {"type": "prov:QUALIFIED_NAME", "$": "prov:Bundle"}}}}, "repo:9d2e4cd9af541a56942aac15272d2a82f7062357": {"prefix": {"repo": "https://github.com/johndoe/examplerepo.git#", "default": "http://ddmore.eu/workflow#"}, "entity": {"repo:9d2e4cd9af541a56942aac15272d2a82f7062357/models/model1.ctl": {"prov:type": {"type": "prov:QUALIFIED_NAME", "$": "model"}, "prov:location": {"type": "prov:QUALIFIED_NAME", "$": "/models/model1.ctl"}, "prov:label": "model1.ctl"}}}, "repo:1fed4cd9af53456942aac15272d2a82f7062357": {"wasAssociatedWith": {"_:id1": {"prov:agent": "mike", "prov:activity": "67223454235"}}, "wasDerivedFrom": {"_:id2": {"prov:usedEntity": "89475897", "prov:generatedEntity": "repo:1fed4cd9af53456942aac15272d2a82f7062357/models/model2.ctl", "prov:type": {"type": "prov:QUALIFIED_NAME", "$": "Specialization"}}}, "used": {"_:id3": {"prov:entity": "89475897", "prov:activity": "67223454235"}}, "mentionOf": {"_:id4": {"prov:generalEntity": "repo:9d2e4cd9af541a56942aac15272d2a82f7062357/models/model1.ctl", "prov:bundle": "repo:9d2e4cd9af541a56942aac15272d2a82f7062357", "prov:specificEntity": "89475897"}}, "agent": {"mike": {"prov:type": {"type": "prov:QUALIFIED_NAME", "$": "prov:Person"}}}, "entity": {"89475897": {"prov:label": "model1.ctl"}, "repo:1fed4cd9af53456942aac15272d2a82f7062357/models/model2.ctl": {"prov:type": {"type": "prov:QUALIFIED_NAME", "$": "model"}, "prov:location": {"type": "prov:QUALIFIED_NAME", "$": "models/model2.ctl"}, "prov:label": "model2.ctl"}}, "prefix": {"repo": "https://github.com/johndoe/examplerepo.git#", "default": "http://ddmore.eu/workflow#", "ddmore": "http://ddmore.eu/workflow#"}, "activity": {"67223454235": {"prov:type": {"type": "prov:QUALIFIED_NAME", "$": "clone"}, "prov:label": "clone"}}, "wasGeneratedBy": {"_:id5": {"prov:entity": "repo:1fed4cd9af53456942aac15272d2a82f7062357/models/model2.ctl", "prov:activity": "67223454235"}}}, "repo:2fed4cd9af53456942aaceb452c2a82f7062357": {"wasAssociatedWith": {"_:id1": {"prov:agent": "mike", "prov:activity": "48356278"}}, "wasDerivedFrom": {"_:id2": {"prov:usedEntity": "834689", "prov:generatedEntity": "repo:2fed4cd9af53456942aaceb452c2a82f7062357/models/model3.ctl", "prov:type": {"type": "prov:QUALIFIED_NAME", "$": "Specialization"}}}, "used": {"_:id3": {"prov:entity": "834689", "prov:activity": "48356278"}}, "mentionOf": {"_:id4": {"prov:generalEntity": "repo:1fed4cd9af53456942aac15272d2a82f7062357/models/model2.ctl", "prov:bundle": "repo:1fed4cd9af53456942aac15272d2a82f7062357", "prov:specificEntity": "834689"}}, "agent": {"mike": {"prov:type": {"type": "prov:QUALIFIED_NAME", "$": "prov:Person"}}}, "entity": {"repo:2fed4cd9af53456942aaceb452c2a82f7062357/models/model3.ctl": {"prov:type": {"type": "prov:QUALIFIED_NAME", "$": "model"}, "prov:location": {"type": "prov:QUALIFIED_NAME", "$": "models/model3.ctl"}, "prov:label": "model3.ctl"}, "834689": {}}, "prefix": {"repo": "https://github.com/johndoe/examplerepo.git#", "default": "http://ddmore.eu/workflow#", "ddmore": "http://ddmore.eu/workflow#"}, "activity": {"48356278": {"prov:type": {"type": "prov:QUALIFIED_NAME", "$": "clone"}, "prov:label": "clone"}}, "wasGeneratedBy": {"_:id5": {"prov:entity": "repo:2fed4cd9af53456942aaceb452c2a82f7062357/models/model3.ctl", "prov:activity": "48356278"}}}, "uuid:bba6af3f-dd0a-40b1-9ff7-91d20ca52869": {"prefix": {"repo": "https://github.com/johndoe/examplerepo.git#", "default": "http://ddmore.eu/workflow#", "uuid": "urn:uuid:", "ddmore": "http://ddmore.eu/workflow#"}, "wasAttributedTo": {"_:id1": {"prov:entity": "repo:2fed4cd9af53456942aaceb452c2a82f7062357", "prov:agent": "mike"}}, "agent": {"mike": {"prov:type": {"type": "prov:QUALIFIED_NAME", "$": "prov:Person"}}}, "entity": {"repo:2fed4cd9af53456942aaceb452c2a82f7062357": {"prov:type": {"type": "prov:QUALIFIED_NAME", "$": "prov:Bundle"}}}}}, "agent": {"bob": {"prov:type": {"type": "prov:QUALIFIED_NAME", "$": "prov:Person"}}}, "entity": {"repo:9d2e4cd9af541a56942aac15272d2a82f7062357": {"prov:type": {"type": "prov:QUALIFIED_NAME", "$": "prov:Bundle"}}}}'

    return prov.ProvDocument.deserialize(content=doc_json)

