This path allows API users with valid keys to create new RMap DiSCOs.
POST /discos
Example URL: https://test.rmap-hub.org/api/discos
| Header | Value |
|---|---|
| Basic Auth * | Your API key and secret (key:secret) |
| Content-Type * (choose one) |
text/turtle application/vnd.rmap-project.disco+rdf+turtle application/rdf+xml application/vnd.rmap-project.disco+rdf+xml application/ld+json application/vnd.rmap-project.disco+ld+json |
* Required
The body should contain a new RMap DiSCO. See the DiSCO media type for the correct format, and view the example below to see a full request/response. Also consider reviewing the DiSCO Design Best Practices for some guidance on how to form the ideal RMap DiSCO.
| Header | Value |
|---|---|
| Location* | https://{api-path}/discos/{new-disco-uri} |
| Link* | <https://{api-path}/events/{disco-creation-event-uri}>; rel= "http://www.w3.org/ns/prov#wasGeneratedBy" |
* Appear on every Created response.
The body will vary depending on your ID minter, but should looks something like this:
ark:/12345/new-disco-uri
| Code | Description |
|---|---|
| 201 | Successfully created |
| 400 | Bad request (DiSCO is not correctly formatted) |
| 401 | Unauthorized (agent does not have rights to create a DiSCO |
| 413 | Request too large |
| 415 | Unsupported media type (if something other than a DiSCO is posted) |
| 500 | Internal server error |
| 503 | Service unavailable |
- The user provides a DiSCO as RDF, an API key, and the content-type of the request.
- The system checks the API key. Insufficient authorization will result in failed transaction and request to check API key credentials.
- Once successfully authenticated, RMap checks whether this is the first DiSCO created by the Agent.
- If it is the first DiSCO, and the Agent doesn't already exist in the triplestore, a new
rmap:Agentgraph is created based on information provided at sign up, along with anrmap:Eventcapturing information about the Agent creation. - If the Agent already exists, the Agent information is loaded into memory.
- If it is the first DiSCO, and the Agent doesn't already exist in the triplestore, a new
- RMap verifies that the
Content-Typeprovided is a supported type, if not an Unsupported Media Type notification is returned. - If the media type is correct, RMap verifies that the DiSCO is valid according to the
Content-Typecited. If it is not, a Bad Request response is returned. - If the DiSCO is correctly formed, the system assigns a unique
rmap:DiSCOURI to the package received. - The graph provided by the client is captured as an
rmap:DiSCOin the RMap triplestore. - A new
rmap:Eventis generated for the RMap DiSCO creation. This captures the URI of the new DiSCO, the URI of the authenticatedrmap:Agentthat made the assertion (and the key ID if configured to do so), the date/time of the event, the event type (creation), and the target object type (rmap:DiSCO). - If any errors result in this process not being completed successfully, the entire transaction will be rolled back and the triplestore will be unchanged. The user will receive an appropriate error message.
- If successful, the client receives a Created HTTP response containing links to the new DiSCO and Event URI.
curl -u $(<rmap.key)
-X POST
-d @disco.rdf
--header "Content-Type:text/turtle"
https://test.rmap-hub.org/api/discos
rmap.key file:
key:secret
disco.rdf file:
@prefix dc: <http://purl.org/dc/terms/> .
@prefix cito: <http://purl.org/spar/cito/> .
@prefix ore: <http://www.openarchives.org/ore/terms/> .
<> a <http://purl.org/ontology/rmap#DiSCO> ;
<dc:creator> <http://orcid.org/0000-0002-9354-8328> ;
<ore:aggregates> <https://doi.org/10.1109/InPar.2012.6339604> ;
<ore:aggregates> <https://doi.org/10.5281/zenodo.10307> .
<https://doi.org/10.1109/InPar.2012.6339604>
a <http://purl.org/spar/fabio/JournalArticle> .
<https://doi.org/10.5281/zenodo.10307>
a <http://purl.org/dc/dcmitype/Software> ;
<cito:cites> <https://doi.org/10.1109/InPar.2012.6339604> .
HTTP/1.1 201 Created
Location: https://test.rmap-hub.org/api/discos/rmap%3A03aj4d92sv
Link: <https://test.rmap-hub.org/api/events/rmap%3Az2c75hqlc8>;rel="http://www.w3.org/ns/prov#wasGeneratedBy"
rmap:03aj4d92sv