Skip to main content

Data Resource API

This API provides an interface for discovering and accessing elements loaded from various DataResources.


Endpoints

1. Retrieve All Registered Element Types

GET /data

This endpoint returns a comprehensive list of all distinct element types that are currently registered in the data registry.

Query Parameters:

  • profile (Optional): Specifies a profile to apply for formatting the returned element type objects. Refer to the Profiles documentation for more details.

Example Response:

{
"data": [
{
"id": "elements::ConcernType",
"label": "ConcernType",
"type": "elements::ElementType",
"format": "default",
"properties": {
"component": "elements",
"name": "ConcernType",
"isAbstract": false,
"canonicalName": "net.democritus.elements.ConcernType"
},
"meta": {
"origin": "dataResource",
"origin.expansionResource": "net.democritus.metamodel:prime-core::2024.4.3",
"origin.dataResource.path": "data/meta/prime/elementTypes.xml"
},
"links": {
"instances": "/data/elements%3A%3AConcernType",
"self": "/data/elements%3A%3AElementType/elements%3A%3AConcernType"
}
},
// ... more element types
]
}

2. Retrieve All Instances of a Specific Element Type

GET /data/{element_type}

This endpoint allows you to retrieve all instances that belong to a specified element_type.

Path Parameters:

  • element_type: The URL-encoded identifier of the element type whose instances you wish to retrieve (e.g., elements%3A%3AConcernType).

Query Parameters:

  • profile (Optional): Specifies a profile to apply for formatting the returned data instances.

Example Usage:

To get all instances of elements::ConcernType:

GET /data/elements%3A%3AConcernType

3. Retrieve a Specific Data Element Instance

GET /data/{element_type}/{element_key}

This endpoint provides direct access to a single data element instance by its type and unique key.

Path Parameters:

  • element_type: The URL-encoded identifier of the element type (e.g., elements%3A%3AConcernType).
  • element_key: The URL-encoded unique identifier for the specific element instance.

Query Parameters:

  • profile (Optional): Specifies a profile to apply for formatting the returned data element.

Example Usage:

To get a specific ConcernType element with key TRANSPORT:

GET /data/elements%3A%3AConcernType/TRANSPORT