Services

Read Services

The basic read services are being provided by Pyramid Skosprovider.

Write Services

POST /conceptschemes/{scheme_id}/c

Add a concept or collection to a conceptscheme. The response body will contain a representation of the concept or collection after is has been added to the conceptscheme.

Example request:

POST /conceptschemes/TREES/c HTTP/1.1
Host: demo.atramhasis.org
Accept: application/json

{
    "type": "concept",
    "broader": [],
    "narrower": [],
    "related": [],
    "labels": [
        {
            "type": "prefLabel",
            "language": "en",
            "label": "The Larch"
        }
    ],
    "notes": []
}

Example response:

HTTP/1.1 201 Created
Location: http://demo.atramhasis.org/conceptschemes/TREES/c/1
Content-Type: application/json

{
    "id": 1,
    "uri": "urn:x-atramhasis-demo:TREES:1",
    "type": "concept",
    "broader": [],
    "narrower": [],
    "related": [],
    "labels": [
        {
            "type": "prefLabel",
            "language": "en",
            "label": "The Larch"
        }
    ],
    "notes": []
}

Example request:

POST /conceptschemes/TAUNTS/c HTTP/1.1
Host: demo.atramhasis.org
Accept: application/json

{
    "type": "concept",
    "broader": [],
    "narrower": [],
    "related": [],
    "labels": [
        {
            "type": "tauntLabel",
            "language": "en-FR",
            "label": "Your mother was a Hamster!"
        }
    ],
    "notes": []
}

Example response:

HTTP/1.1 400 Bad Request
Location: http://demo.atramhasis.org/conceptschemes/TREES/c/1
Content-Type: application/json

{
    "errors": [
                {"labels": "Invalid labeltype."},
                {"labels": "Invalid language."}
              ],
    "message": "Concept could not be validated"
}
Parameters:
  • scheme_id – The identifier for a certain concept scheme.
Request Headers:
 
  • Accept – The response content type depends on this header. Currently only application/json is supported.
Response Headers:
 
  • Content-Type – This service currently always returns application/json
  • Location – The url where the newly added concept or collection can be found.
Status Codes:
  • 201 – The concept or collection was added succesfully.
  • 400 – The concept or collection could not be added because the submitted json was invalid due to eg. validation errors.
  • 404 – The conceptscheme scheme_id does not exist.
PUT /conceptschemes/{scheme_id}/c/{c_id}

Edit the concept or collection with id c_id. The response body will contain a representation of the concept or collection after the modifications.

Example request:

PUT /conceptschemes/TREES/c/1 HTTP/1.1
Host: demo.atramhasis.org
Accept: application/json

{
    "type": "concept",
    "broader": [],
    "narrower": [],
    "related": [],
    "labels": [
        {
            "type": "prefLabel",
            "language": "en",
            "label: "The Larch"
        }, {
            "type": "prefLabel",
            "language": "nl",
            "label": "De Lariks"
        }
    ],
    "notes": []
}

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "id": 1,
    "uri": "urn:x-atramhasis-demo:TREES:1",
    "type": "concept",
    "broader": [],
    "narrower": [],
    "related": [],
    "labels": [
        {
            "type": "prefLabel",
            "language": "en",
            "label: "The Larch"
        }, {
            "type": "prefLabel",
            "language": "nl",
            "label": "De Lariks"
        }
    ],
    "notes": []
}
Parameters:
  • scheme_id – The identifier for a certain concept scheme.
  • c_id – The identifier for a certain concept or collection.
Request Headers:
 
  • Accept – The response content type depends on this header. Currently only application/json is supported.
Response Headers:
 
  • Content-Type – This service currently always returns application/json
Status Codes:
  • 200 – The concept or collection was edited succesfully.
  • 400 – The concept or collection could not be edited because the submitted json was invalid due to eg. validation errors.
  • 404 – The conceptscheme scheme_id or the concept or collection c_id does not exist.
DELETE /conceptschemes/{scheme_id}/c/{c_id}

Remove the concept with id c_id. The response body will contain the last representation known by the service.

Example request:

DELETE /conceptschemes/TREES/c/1 HTTP/1.1
Host: demo.atramhasis.org
Accept: application/json

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "id": 1,
    "uri": "urn:x-atramhasis-demo:TREES:1",
    "type": "concept",
    "broader": [],
    "narrower": [],
    "related": [],
    "labels": [
        {
            "type": "prefLabel",
            "language": "en",
            "label: "The Larch"
        }, {
            "type": "prefLabel",
            "language": "nl",
            "label": "De Lariks"
        }
    ],
    "notes": []
}
Parameters:
  • scheme_id – The identifier for a certain concept scheme.
  • c_id – The identifier for a certain concept or collection.
Request Headers:
 
  • Accept – The response content type depends on this header. Currently only application/json is supported.
Response Headers:
 
  • Content-Type – This service currently always returns application/json
Status Codes:
  • 200 – The concept or collection was deleted succesfully.
  • 400 – The concept or collection could not be edited because the submitted json was invalid due to eg. validation errors.
  • 404 – The conceptscheme scheme_id or the concept or collection c_id does not exist.