SWORD API Dataset Entry with atom error

61 views
Skip to first unread message

Agus Sudiarto

unread,
Sep 24, 2017, 6:31:49 AM9/24/17
to Dataverse Users Community
Dear All Master, 
Here some problem while i execute command :
curl -u b450deff-a0bf-4407-88ec-244d42a4d5c6: --data-binary "http://xxx.xxx.xxx.194/swordapi/xml/kebumian_1506243960.xml" -H "Content-Type: application/atom+xml" http://xxx.xxx.xxx.194:8080/dvn/api/data-deposit/v1.1/swordv2/collection/dataverse/kebumian


<?xml version="1.0" encoding="ISO-8859-1"?>
<sword:error href="Unable to parse SWORD entry: org.apache.abdera.parser.ParseException: org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'h' (code 104) in prolog; expected '&lt;'&#x0A; at [row,col {unknown-source}]: [1,1]" xmlns:sword="http://purl.org/net/sword/terms/"><atom:title xmlns:atom="http://www.w3.org/2005/Atom">ERROR</atom:title><atom:updated xmlns:atom="http://www.w3.org/2005/Atom">2017-09-24T17:25:35Z</atom:updated><atom:generator uri="http://www.swordapp.org/" version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"/><sword:treatment>Processing failed</sword:treatment><atom:summary xmlns:atom="http://www.w3.org/2005/Atom">Unable to parse SWORD entry: org.apache.abdera.parser.ParseException: org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'h' (code 104) in prolog; expected '&lt;'
 at [row,col {unknown-source}]: [1,1]</atom:summary></sword:error>

what kind of these error , how i spouse to fix that .....
Thanks in Advance












Philip Durbin

unread,
Sep 24, 2017, 7:19:15 AM9/24/17
to dataverse...@googlegroups.com
Before attempting to get your XML file working, please try the example XML at http://guides.dataverse.org/en/4.7.1/api/sword.html#create-a-dataset-with-an-atom-entry

If the example XML doesn't work, please let us know.

If the example XML does work, please try adding your changes (the actual data you want to use) bit by bit, line by line, until your data replaces the sample data in the example XML.

I hope this helps!

Phil

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsub...@googlegroups.com.
To post to this group, send email to dataverse-community@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dataverse-community/b44ce916-a499-4c88-b8d9-4c0720a48bc4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Agus Sudiarto

unread,
Sep 24, 2017, 8:42:50 AM9/24/17
to Dataverse Users Community
Dear Mr. Durbin ..,
this is copy paste of example of atom entry on to file kebumian_1506255100.xml
and then I execute the command on command line :

 curl -u e9ba30e7-0856-40c9-aa79-813177a0e492: --data-binary "http://2x.5x.1x.1xx/swordapi/xml/kebumian_1506255100.xml" -H "Content-Type: application/atom+xml" http://2x.5x.1x.1xx:8080/dvn/api/data-deposit/v1.1/swordv2/collection/dataverse/kebumian

the result :

<?xml version="1.0" encoding="ISO-8859-1"?>
<sword:error href="Unable to parse SWORD entry: org.apache.abdera.parser.ParseException: org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'h' (code 104) in prolog; expected '&lt;'&#x0A; at [row,col {unknown-source}]: [1,1]" xmlns:sword="http://purl.org/net/sword/terms/"><atom:title xmlns:atom="http://www.w3.org/2005/Atom">ERROR</atom:title><atom:updated xmlns:atom="http://www.w3.org/2005/Atom">2017-09-24T19:41:47Z</atom:updated><atom:generator uri="http://www.swordapp.org/" version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"/><sword:treatment>Processing failed</sword:treatment><atom:summary xmlns:atom="http://www.w3.org/2005/Atom">Unable to parse SWORD entry: org.apache.abdera.parser.ParseException: org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'h' (code 104) in prolog; expected '&lt;'
 at [row,col {unknown-source}]: [1,1]</atom:summary></sword:error>

Thanks in advance ..

Philip Durbin

unread,
Sep 24, 2017, 10:04:15 AM9/24/17
to dataverse...@googlegroups.com
Thanks for providing the XML file you're using. Can you please try creating a dataset with it on https://demo.dataverse.org ? Do you get the same error?

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsub...@googlegroups.com.
To post to this group, send email to dataverse-community@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Jess Whyte

unread,
Mar 7, 2018, 12:37:57 PM3/7/18
to Dataverse Users Community
Hello,

I am getting the same error, using the example XML at http://guides.dataverse.org/en/4.7.1/api/sword.html#create-a-dataset-with-an-atom-entry (attached as atomtest.xml)

Command: curl -u <token>: --data-binary "atomtest.xml" -H "Content-Type: application/atom+xml" https://demodv.scholarsportal.info/dvn/api/data-deposit/v1.1/swordv2/collection/dataverse/<alias> (note: using the scholars portal demo dataverse, not demo.dataverse.org)

Error:
<?xml version="1.0" encoding="ISO-8859-1"?>
<sword:error href="Unable to parse SWORD entry: org.apache.abdera.parser.ParseException: org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '/' (code 47) in prolog; expected '&lt;'&#x0A; at [row,col {unknown-source}]: [1,1]" xmlns:sword="http://purl.org/net/sword/terms/"><atom:title xmlns:atom="http://www.w3.org/2005/Atom">ERROR</atom:title><atom:updated xmlns:atom="http://www.w3.org/2005/Atom">2018-03-07T12:24:58Z</atom:updated><atom:generator uri="http://www.swordapp.org/" version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"/><sword:treatment>Processing failed</sword:treatment><atom:summary xmlns:atom="http://www.w3.org/2005/Atom">Unable to parse SWORD entry: org.apache.abdera.parser.ParseException: org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '/' (code 47) in prolog; expected '&lt;'

 at [row,col {unknown-source}]: [1,1]</atom:summary></sword:error>

My apologies if this has already been answered elsewhere, I tried searching for SWORD in the group.

Thank you,

Jess



atomtest.xml

Sherry Lake

unread,
Mar 7, 2018, 1:11:52 PM3/7/18
to Dataverse Users Community
Try putting "@" in front of your file name. Most of the examples here: http://guides.dataverse.org/en/latest/api/sword.html#create-a-dataset-with-an-atom-entry have "@" in front of paths & filenames. 

I am pretty sure I tried the following command and it worked on UVa's dataverse:

curl -u <token>: --data-binary "@new-dataset.xml" -H "Content-Type: application/atom+xml" https://dvdev.lib.virginia.edu/dvn/api/data-deposit/v1.1/swordv2/collection/dataverse/uvacs

Jess Whyte

unread,
Mar 7, 2018, 1:22:11 PM3/7/18
to dataverse...@googlegroups.com
Now I feel silly, but thank you, this worked.

--
You received this message because you are subscribed to a topic in the Google Groups "Dataverse Users Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dataverse-community/9wvnKk-6cKI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dataverse-community+unsub...@googlegroups.com.

To post to this group, send email to dataverse-community@googlegroups.com.

Venkatachalam Kannadasan

unread,
May 2, 2018, 11:08:48 AM5/2/18
to Dataverse Users Community
Dear all

I tried to create dataset using the following command and it get the error as shown below


curl -u <token>: —-data-binary "@atomtest.xml" -H "Content-Type: application/atom+xml"  http://localhost:8080/dvn/api/data-deposit/v1.1/swordv2/collection/dataverse/tsapi


Error 


curl: (6) Could not resolve host: —-data-binary; Name or service not known

curl: (6) Could not resolve host: atomtest.xml; Name or service not known

<feed xmlns="http://www.w3.org/2005/Atom"><title type="text">Kannadasan Venkatachalam Dataverse</title><dataverseHasBeenReleased xmlns="http://purl.org/net/sword/terms/state">false</dataverseHasBeenReleased><generator uri="http://www.swordapp.org/" version="2.0"/></feed>




Can anyone let me know what is going wrong here.

Thanks
Venki
To post to this group, send email to dataverse...@googlegroups.com.

Philip Durbin

unread,
May 2, 2018, 11:46:14 AM5/2/18
to dataverse...@googlegroups.com
I'm a little worried you're using a long dash ("—-") when what's needed is two dashes ("--").

The command I use while running API test is the following:

curl -s --insecure --data-binary @scripts/search/tests/data/dataset-trees1.xml -H 'Content-Type: application/atom+xml' -u $SPRUCEKEY: https://localhost:8181/dvn/api/data-deposit/v1.1/swordv2/collection/dataverse/spruce

That's from https://github.com/IQSS/dataverse/blob/v4.8.6/scripts/search/tests/create-all-and-test#L9 but you probably don't want that port (":8181") in there. I hope this helps and doesn't introduce more confusion!

Phil

To unsubscribe from this group and all its topics, send an email to dataverse-community+unsubscribe...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsub...@googlegroups.com.
To post to this group, send email to dataverse-community@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dataverse-community/93807813-709f-4b9a-a046-ae5624192ff0%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Venkatachalam Kannadasan

unread,
May 2, 2018, 6:07:54 PM5/2/18
to Dataverse Users Community
Hi Phil

Thanks a lot for pointing out the two dashes. I used evernote to copy and paste the command from dataverse guide and it changed the double dash to long dash. It works perfectly fine now with the command as given in the guide. 

curl -u <token>: --data-binary "@atomtest.xml" -H "Content-Type: application/atom+xml"  http://localhost:8080/dvn/api/data-deposit/v1.1/swordv2/collection/dataverse/tsapi


Regards
Venki 
To unsubscribe from this group and all its topics, send an email to dataverse-community+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsub...@googlegroups.com.
To post to this group, send email to dataverse...@googlegroups.com.

Philip Durbin

unread,
May 2, 2018, 6:11:20 PM5/2/18
to dataverse...@googlegroups.com
Phew! Thanks for letting us know that all is well, Venki.

To unsubscribe from this group and all its topics, send an email to dataverse-community+unsubscribe...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsubscribe...@googlegroups.com.

To post to this group, send email to dataverse...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages