...
You can browse all the global ids associated with a specific data provider using the /cloudIds REST endpoint (https://cloud.europeana.eu/docs/now/uis/index.html#1415215404):
Code Block |
---|
curl -X GET -H "Accept: application/json" --user user:password -i https://cloud.europeana.eu/api/data-providers/PSNC/cloudIds |
...
A record is the central entity of the storage system. It has a global identifier and and consists of several representations.
Representations
Lets get back to our example in the Data Model section. Say that you want to create a record out of the three files you have. Each one will be stored in a different representation. Creating new representations is done using the /records REST endpoint:
Code Block |
---|
curl -X POST -H "Accept: application/json" --user user:password -H "Content-Type: application/x-www-form-urlencoded" -d 'providerId= |
...
PSNC' -i https://cloud.europeana.eu/api/records/ |
...
X67WPA7NGCZUKLACPWU3BORRGQUWTKSZNZDICEGZS6IXTRMINOIQ/representations/TIFF |
...
curl -X POST -H "Accept: application/json" --user user:password -H "Content-Type: application/x-www-form-urlencoded" -d 'providerId= |
...
PSNC' -i https://cloud.europeana.eu/api/records/ |
...
X67WPA7NGCZUKLACPWU3BORRGQUWTKSZNZDICEGZS6IXTRMINOIQ/representations/thumbnail |
...
curl -X POST -H "Accept: application/json" --user user:password -H "Content-Type: application/x-www-form-urlencoded" -d 'providerId= |
...
PSNC' -i https://cloud.europeana.eu/api/records/ |
...
X67WPA7NGCZUKLACPWU3BORRGQUWTKSZNZDICEGZS6IXTRMINOIQ/representations/EDM |
When successful, the response will have HTTP status code 201 (Created). Note that when a new representation is created, it is automatically assigned a new version. This new version can be reached directly using a URL which is returned in the location field of the response header. The URL will be of the following format:
Code Block |
---|
https://cloud.europeana.eu/api/records/ |
X67WPA7NGCZUKLACPWU3BORRGQUWTKSZNZDICEGZS6IXTRMINOIQ/representations/thumbnail/versions/ |
cd9f0050- |
3dea- |
11e6- |
b03d- |
fa163e8d4ae3 |
Subsequent versions of a representation can be created further in the future, for example to reflect ongoing work on a file.
...
You just created metadata entries for your data representations. Now it’s time to attach real data to them. For this the /versions REST endpoint is used. For example, to add a thumbnail file to a previously created representation thumbnail:
Code Block |
---|
curl -X POST --user user:password -H "Content-Type: multipart/form-data" -F "mimeType=application/png" -F "data=@thumbnail.png" https://cloud.europeana.eu/api/records/ |
...
X67WPA7NGCZUKLACPWU3BORRGQUWTKSZNZDICEGZS6IXTRMINOIQ/representations/thumbnail/versions/ |
...
cd9f0050- |
...
3dea- |
...
11e6- |
...
b03d- |
...
fa163e8d4ae3/files |
URI of the newly added file will be returned in the location field of the response header:
Code Block |
---|
https://cloud.europeana.eu/api/records/ |
...
X67WPA7NGCZUKLACPWU3BORRGQUWTKSZNZDICEGZS6IXTRMINOIQ/representations/thumbnail/versions/ |
...
cd9f0050- |
...
3dea- |
...
11e6- |
...
b03d- |
...
fa163e8d4ae3/files/ |
...
1df7a491- |
...
8d8a- |
...
4180- |
...
9eb0-cd18c52a4b81 |
You can add multiple files to a version.
The newly created version is a temporary one, which means it can be removed. To make a version persistent, you can use the /persist call:
Code Block |
---|
curl -X POST --user user:password -i https://cloud.europeana.eu/api/records/ |
...
X67WPA7NGCZUKLACPWU3BORRGQUWTKSZNZDICEGZS6IXTRMINOIQ/representations/ |
...
thumbnail/versions/ |
...
cd9f0050- |
...
3dea- |
...
11e6- |
...
b03d- |
...
fa163e8d4ae3/persist |
A successful call will return 201 HTTP Code.
...
Versions can be deleted using the DELETE call as follows:
Code Block |
---|
curl -X DELETE --user user:password |
...
https://cloud.europeana.eu/api/records/ |
...
X67WPA7NGCZUKLACPWU3BORRGQUWTKSZNZDICEGZS6IXTRMINOIQ/representations/thumbnail/versions/ |
...
cd9f0050- |
...
3dea- |
...
11e6- |
...
b03d- |
...
fa163e8d4ae3/ |
You can only delete a temporary version of a representation. If you will try to remove a persistent version you will get HTTP status code 405 (Not Allowed).
...
To create a new dataset, use the /dataset call where you specify the name of the dataset.
Code Block |
---|
curl -X POST --user user:password -H "Content-Type: application/x-www-form-urlencoded" -d 'dataSetId=exampleDataSet' -i https://cloud.europeana.eu/api/data-providers/ |
...
PSNC/data-sets |
Modification
Having created one, you can assign your representation versions to this dataset. To do this use the/assignments call providing the global id, the representation name and the version identifier. If you won't pass the version identifier parameter, the latest persistent version will be assigned to data set.
...