Outdated version

You are browsing the docs for Nexus v1.10.x, the latest release is available here

Type hierarchy

The type hierarchy is a singleton entity that defines a mapping between concrete types and their abstract types.

Authorization notes

When modifying the type hierarchy, the caller must have resources/read permission at root level.

Please visit Authentication & authorization section to learn more about it.

Create using POST

POST /v1/type-hierarchy
  {...}

Example

Request
sourcecurl -X POST \
     -H "Content-Type: application/json" \
     "http://localhost:8080/v1/type-hierarchy" \
     -d \
'{
  "mapping": {
    "https://schema.org/VideoGame": [
      "https://schema.org/SoftwareApplication",
      "https://schema.org/CreativeWork",
      "https://schema.org/Thing"
    ]
  }
}'
Payload
source{
  "mapping": {
    "https://schema.org/VideoGame": [
      "https://schema.org/SoftwareApplication",
      "https://schema.org/CreativeWork",
      "https://schema.org/Thing"
    ]
  }
}
Response
source{
  "@context": [
    "https://bluebrain.github.io/nexus/contexts/type-hierarchy.json",
    "https://bluebrain.github.io/nexus/contexts/metadata.json"
  ],
  "@id": "https://bluebrain.github.io/nexus/vocabulary/TypeHierarchy",
  "@type": "TypeHierarchy",
  "mapping": {
    "https://schema.org/VideoGame": [
      "https://schema.org/SoftwareApplication",
      "https://schema.org/CreativeWork",
      "https://schema.org/Thing"
    ]
  },
  "_constrainedBy": "https://bluebrain.github.io/nexus/schemas/type-hierarchy.json",
  "_createdAt": "1970-01-01T00:00:00Z",
  "_createdBy": "http://localhost/v1/realms/qyjcmbqlkavvsbbo/users/jane-doe",
  "_deprecated": false,
  "_rev": 1,
  "_self": "http://localhost/v1/type-hierarchy",
  "_updatedAt": "1970-01-01T00:00:00Z",
  "_updatedBy": "http://localhost/v1/realms/qyjcmbqlkavvsbbo/users/jane-doe"
}

Update

This operation overrides the payload.

In order to ensure a client does not perform any changes to a resource without having had seen the previous revision of the resource, the last revision needs to be passed as a query parameter.

PUT /v1/type-hierarchy?rev={previous_rev}
  {...}

… where {previous_rev} is the last known revision number for the schema.

Example

Request
sourcecurl -X PUT \
     -H "Content-Type: application/json" \
     "http://localhost:8080/v1/type-hierarchy?rev=1" \
     -d \
'{
  "mapping": {
    "https://schema.org/VideoGame": [
      "https://schema.org/SoftwareApplication",
      "https://schema.org/CreativeWork",
      "https://schema.org/Thing"
    ]
  }
}'
Payload
source{
  "mapping": {
    "https://schema.org/VideoGame": [
      "https://schema.org/SoftwareApplication",
      "https://schema.org/CreativeWork",
      "https://schema.org/Thing"
    ]
  }
}
Response
source{
  "@context": [
    "https://bluebrain.github.io/nexus/contexts/type-hierarchy.json",
    "https://bluebrain.github.io/nexus/contexts/metadata.json"
  ],
  "@id": "https://bluebrain.github.io/nexus/vocabulary/TypeHierarchy",
  "@type": "TypeHierarchy",
  "mapping": {
    "https://schema.org/VideoGame": [
      "https://schema.org/SoftwareApplication",
      "https://schema.org/CreativeWork",
      "https://schema.org/Thing"
    ]
  },
  "_constrainedBy": "https://bluebrain.github.io/nexus/schemas/type-hierarchy.json",
  "_createdAt": "1970-01-01T00:00:00Z",
  "_createdBy": "http://localhost/v1/realms/knntwmnuxprsqrio/users/jane-doe",
  "_deprecated": false,
  "_rev": 2,
  "_self": "http://localhost/v1/type-hierarchy",
  "_updatedAt": "1970-01-01T00:00:00Z",
  "_updatedBy": "http://localhost/v1/realms/knntwmnuxprsqrio/users/jane-doe"
}

Fetch

GET /v1/type-hierarchy

Example

Request
sourcecurl "http://localhost:8080/v1/type-hierarchy
Response
source{
  "@context" : [
    "https://bluebrain.github.io/nexus/contexts/type-hierarchy.json",
    "https://bluebrain.github.io/nexus/contexts/metadata.json"
  ],
  "@id" : "https://bluebrain.github.io/nexus/vocabulary/TypeHierarchy",
  "@type" : "TypeHierarchy",
  "mapping" : {
    "https://schema.org/VideoGame" : [
      "https://schema.org/SoftwareApplication",
      "https://schema.org/CreativeWork",
      "https://schema.org/Thing"
    ]
  },
  "_constrainedBy" : "https://bluebrain.github.io/nexus/schemas/type-hierarchy.json",
  "_createdAt" : "1970-01-01T00:00:00Z",
  "_createdBy" : "http://localhost/v1/realms/sanwxierjnyajvxn/users/jane-doe",
  "_deprecated" : false,
  "_rev" : 1,
  "_self" : "http://localhost/v1/type-hierarchy",
  "_updatedAt" : "1970-01-01T00:00:00Z",
  "_updatedBy" : "http://localhost/v1/realms/sanwxierjnyajvxn/users/jane-doe"
}