Comments (3)
@ross-spencer you have to supply the XML attributes of the root <premis:event>
element manually, made easier by using premisrw.PREMIS_META
:
>>> premisrw.PREMIS_META
{'xsi:schema_location': 'info:lc/xmlns/premis-v2 http://www.loc.gov/standards/premis/v2/premis-v2-2.xsd',
'version': '2.2'}
Then it should work:
>>> def generate_event_with_meta():
... # Add some new EVENTS to our METS
... return ('event',
... premisrw.PREMIS_META,
... ('event_identifier',
... ('event_identifier_type', "UUID"),
... ('event_identifier_value', uuid.uuid4())),
... ('event_type', "AM CAMP DEMO"),
... ('event_date_time', datetime.now().isoformat()),
... ('event_detail', "Adding new PREMIS EVENTS"),
... ('event_outcome_information',
... ('event_outcome', "SUCCESS"),
... ('event_outcome_detail',
... ('event_outcome_detail_note',
... "dag iedereen!"))),
... ('linking_agent_identifier',
... ('linking_agent_identifier_type', "python script"),
... ('linking_agent_identifier_value', "1.0")))
>>> print(lxml.etree.tostring(premisrw.data_to_premis(generate_event_with_meta()), pretty_print=True).decode('utf8'))
<premis:event xmlns:premis="info:lc/xmlns/premis-v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="info:lc/xmlns/premis-v2 http://www.loc.gov/standards/premis/v2/premis-v2-2.xsd" version="2.2">
<premis:eventIdentifier>
<premis:eventIdentifierType>UUID</premis:eventIdentifierType>
<premis:eventIdentifierValue>1665f868-dff5-4e66-8a32-f38ad7582309</premis:eventIdentifierValue>
</premis:eventIdentifier>
<premis:eventType>AM CAMP DEMO</premis:eventType>
<premis:eventDateTime>2018-04-09T11:53:15.846384</premis:eventDateTime>
<premis:eventDetail>Adding new PREMIS EVENTS</premis:eventDetail>
<premis:eventOutcomeInformation>
<premis:eventOutcome>SUCCESS</premis:eventOutcome>
<premis:eventOutcomeDetail>
<premis:eventOutcomeDetailNote>dag iedereen!</premis:eventOutcomeDetailNote>
</premis:eventOutcomeDetail>
</premis:eventOutcomeInformation>
<premis:linkingAgentIdentifier>
<premis:linkingAgentIdentifierType>python script</premis:linkingAgentIdentifierType>
<premis:linkingAgentIdentifierValue>1.0</premis:linkingAgentIdentifierValue>
</premis:linkingAgentIdentifier>
</premis:event>
from mets-reader-writer.
@ross-spencer can we close this or is it still an issue?
from mets-reader-writer.
@jrwdunham I apologise. I didn't see your response above. I am happy that this isn't an issue based on that. I will get back to my work with metsrw
closer to June before the camp in Baltimore. We can reopen this if need be but it sounds unlikely.
from mets-reader-writer.
Related Issues (17)
- Problem: API for defining metadata plugins is ill-defined HOT 2
- Problem: there are no docs HOT 3
- Problem: linting is disabled HOT 1
- metsrw.METSDocument.fromfile fails over undefined "root" HOT 2
- Problem: `FSEntry` instances can circularly reference themselves in their `derived_from` attributes
- Problem: dependency declaration is overly verbose
- Problem: mets-reader-writer neither reads nor writes
- Problem: Tree or serialize() required as an arg to validate functions when METSDocument would be a nicer abstraction HOT 1
- Problem: Archivematica METS Schematron doesn't support Archivematica 'registration' event type
- Problem: Cannot generate EVENTS through member variables HOT 1
- Problem: it is difficult to access some attributes of `PREMISElement` instances
- Problem: v0.2.2 needs to be released. HOT 1
- Problem: premisrw can't accomodate PREMIS XML files
- METS is invalid according to XMLstarlet due to PREMIS - How do ye validate? HOT 3
- METS file with uppercase PHYSICAL and LOGICAL structMap
- Problem: Characterization tool namespaces in premis:objects prevent serialization to XML HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mets-reader-writer.