Our data isn’t amenable to transformation to a tabular format,
so after building a custom conversion script this is an example of a JSON create item request;
{
“dcterms:identifier”: [{
“dcterms:identifier”: [{
“type”: “literal”,
“lang”: “en-CA”,
“property_id”: 10,
"@value": “http://www.nflibrary.ca/nfplindex/show.asp?b=1&ref=oo&id=102576”
}],
“dcterms:title”: [{
“type”: “literal”,
“lang”: “en-CA”,
“property_id”: 1,
"@value": “Picking up American Wounded - Battle of Lundy’s Lane”
}],
“dcterms:creator”: [{
“type”: “literal”,
“lang”: “en-CA”,
“property_id”: 2,
"@value": “Campbell, Donna Marie”
}],
“dcterms:type”: [{
“type”: “literal”,
“lang”: “en-CA”,
“property_id”: 8,
"@value": “Still Image”
}],
“dcterms:medium”: [{
“type”: “literal”,
“lang”: “en-CA”,
“property_id”: 26,
"@value": “Watercolour”
}],
“dcterms:date”: [{
“type”: “literal”,
“lang”: “en-CA”,
“property_id”: 7,
"@value": “18140725”
}],
“dcterms:created”: [{
“type”: “literal”,
“lang”: “en-CA”,
“property_id”: 20,
"@value": “1975”
}],
“dcterms:isPartOf”: [{
“type”: “literal”,
“lang”: “en-CA”,
“property_id”: 33,
"@value": “Watercolour Collection”
}],
“dcterms:subject”: [{
“type”: “literal”,
“lang”: “en-CA”,
“property_id”: 3,
"@value": “War - War of 1812 - Battle of Lundy’s Lane”
}],
“dcterms:subject”: [{
“type”: “literal”,
“lang”: “en-CA”,
“property_id”: 3,
"@value": “Military”
}],
“dcterms:spaital”: [{
“type”: “literal”,
“lang”: “en-CA”,
“property_id”: 40,
"@value": “Canada”
}],
“dcterms:spaital”: [{
“type”: “literal”,
“lang”: “en-CA”,
“property_id”: 40,
"@value": “Canada - Ontario - Niagara Falls”
}]
}]
}
Does that look okay? It keeps sending back this error; “error”:“The API request resource must be a string. Type \u0022NULL\u0022 given.”} I can post my full code if needed.
I’m not sure what is meant to be used for main element. And php really does not like duplicate key names, but does omeka s take them via the api? And I wasn’t sure what to use for the top level element name. Ended up just using the same one in the xml I’m exporting from.
Also the next step will be adding the photo to the item, just want to make sure to add the item info first. I assume the api will return an item id when it’s created?