As we discussed yesterday* I believe the way forward for creating
Dataverse 4.0 datasets with more metadata than dcterms is to try
kicking the tires on the new JSON-based "native" API.
Here's how I use it in an integration test:
curl -X POST -H "Content-type:application/json" -d
@scripts/search/data/dataset01-create-new.json
http://localhost:8080/api/dvs/11/datasets/?key=pete
And the JSON looks something like this (truncated but attached and
also available at
https://github.com/IQSS/dataverse/blob/master/scripts/search/data/dataset01…
):
{
"initialVersion": {
"metadataBlocks": {
"citation": {
"fields": [
{
"value": "Rings of Trees and Other Observations",
"typeClass": "primitive",
"multiple": false,
"typeName": "title"
},
{
"value": [
{
"authorName": {
"value": "Tree, Tony",
"typeClass": "primitive",
"multiple": false,
"typeName": "authorName"
},
"authorAffiliation": {
"value": "Trees Inc.",
"typeClass": "primitive",
"multiple": false,
"typeName": "authorAffiliation"
}
}
],
...
I hope this gives a sense of how to use the "native" API. The docs
(for now) are at
https://github.com/IQSS/dataverse/tree/master/scripts/api but we'll
eventually merge them into the API Guide for Dataverse 4.0.
I've developed parts of the native API but this endpoint having to do
with creating and editing datasets I have not. So we can learn
together how best to take advantage of it and I can certainly help
work on any bugs we might find.
The alternative to using the native API is to try to shoehorn more of
our metadata blocks into SWORD but this seems complicated and probably
not the best use of time. For more on that approach, please see this
thread I started on the SWORD mailing list: [sword-app-tech] client
SHOULD add Dublin Core terms to the Atom Entry, MAY add any other
metadata formats or foreign markup -
http://www.mail-archive.com/sword-app-tech@lists.sourceforge.net/msg00384.h…
While I'm excited about the native API I'd like to emphasize that it
is still very much in beta. The place to try it out is
http://dataverse-demo.iq.harvard.edu
I hope this makes what I was saying a little more concrete. Please let
me know if there are any questions!
Phil
p.s. Another potentially useful native API call would be creating
dataverses. This would mean the dataverse wouldn't have to be created
manually for each OJS journal, like it is now under DVN 3.x. See this
script for how we create the root dataverse and some children:
https://github.com/IQSS/dataverse/blob/master/scripts/api/setup-dvs.sh
* https://docs.google.com/document/d/1DCm8rkuUQOlUY1lHqLeHsp26dPd9GwsspLabcCo…
--
Philip Durbin
Software Developer for http://thedata.orghttp://www.iq.harvard.edu/people/philip-durbin