Skip to content

Updating a container's metadata removes all references to existing contents #2

@mtrevor

Description

@mtrevor

I'm using the python sword2 client to first create an item from a zip file, then to provide the metadata. The zip file along with its extracted contents is visible in the Item view after the initial creation, but the contents disappear once an update is done.

This is what I'm trying:

from sword2 import Connection, Entry
conn = Connection(SD_URI, user_name='sword', user_pass='sword')
conn.get_service_document()
coll = conn.workspaces[0][1][0]
data = open('test.zip', 'rb').read()
meta = Entry(title='Some title')

receipt_c = conn.create(
    col_iri=coll.href,
    filename='test.zip',
    payload=data,
    mimetype='application/zip',
    packaging='http://purl.org/net/sword/package/SimpleZip',
    in_progress=True,
)
receipt_u = conn.update_metadata_for_resource(
    dr=receipt_c, metadata_entry=meta, in_progress=False,
)

I'm seeing no warning or error in the logs during the creation or update, but once the update is done, the files are no longer visible. They're still present in the backend but the statement.xml isn't being updated correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions