This repository is a partial fork of ro-manager in order to
- Separate out core RO python tooling from the ro-manager
- Refactor what was there as a general, re-useable ro library
- Bring the tooling in line with the RO Bundle specification @ https://researchobject.github.io/specifications/bundle/
#!/usr/bin/env python3fromrolib.bundleimport*fromrolib.manifestimport*importdatetimewithBundle("test.bundle.zip",mode='w') asro:
ro.manifest.createdOn=datetime.datetime.now().isoformat()
# Stian created the reserarch object (this collection)stian=Agent(name="Stian Soiland-Reyes", orcid="http://orcid.org/0000-0001-9842-9718")
ro.manifest.createdBy=stianro.writestr("hello.txt", "To be, or not to be, that is the question")
hello=ro.manifest.get_aggregate("hello.txt")
# Stian created the hello.txt resourcehello.createdBy=stianhello.createdOn=datetime.datetime.now().isoformat()
## but someone else authored its content:shakespeare=Agent(name="William Shakespeare", uri="http://dbpedia.org/page/William_Shakespeare")
hello.authoredBy=shakespearehello.authoredOn=datetime.datetime(1604,1,1).isoformat()
# Aggregate an external resource, also different authorquote=ro.manifest.add_aggregate("http://www.folgerdigitaltexts.org/?chapter=5&play=Ham&loc=line-3.1.64")
quote.authoredBy=shakespeare# Folger Shakespeare Library made the digital representationfolger=Agent(name="Folger Shakespeare Library", uri="http://www.folgerdigitaltexts.org/?chapter=0&?target=credit")
quote.createdBy=folger# This wikipage (which we didn't need to aggregate) is somewhat about this quotero.manifest.add_annotation(about=quote.uri, content="https://en.wikipedia.org/wiki/To_be,_or_not_to_be")
# And also about our hello.txt - even if it doesn't mention it by URLro.manifest.add_annotation(about="hello.txt", content="https://en.wikipedia.org/wiki/To_be,_or_not_to_be")