pintoch
pintoch

Reputation: 2488

How to submit a document to DSpace with SWORD 2.0?

I am trying to submit a deposit to the demo DSpace instance at http://demo.dspace.org/, using the SWORD 2.0 interface. All my attempts result in various HTTP 500 errors.

It would be great if anyone could provide a curl one-liner to deposit a simple PDF file to this DSpace instance.

Here is my latest attempt (where article.pdf is a random PDF file):

curl -u [email protected]:dspace http://demo.dspace.org/swordv2/collection/10673/2 -X POST -d @article.pdf -H "Content-Disposition: attachment; filename=article.pdf"

which raises the following error:

java.lang.NoSuchMethodError: com.hp.hpl.jena.rdf.model.impl.RDFWriterFImpl.setBaseWriterClassName(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

Upvotes: 1

Views: 529

Answers (1)

schweerelos
schweerelos

Reputation: 2189

That looks like something has gone wrong in the deployment of the DSpace demo instance. You should report this using the official DSpace issue tracker.

Your curl command looks OK though you may wish to include the packaging header (eg -H "Packaging: http://purl.org/net/sword/package/Binary"). I also don't remember whether Swordv2 will let you deposit just a file as a new DSpace item or whether you need to supply some minimal metadata (eg title) in this scenario (edit, no, you should be fine according to the Sword v2 specs).

Have you tried adding -H "X-Verbose: true" for additional error messages? But really this does look like a deployment problem.

Upvotes: 1

Related Questions