---
updatedAt: 2025-02-19T22:14:44.000Z
agentTools:
  projectIndex: https://changelog-dzt-kg.readme.io/llms.txt
---

# Retrieve an entity by id

Returns the details for a given entity in the KG (optional as defined in a DS)

This endpoint retrieves an entity using its unique ID (optional as defined in a DS). Entities are identified by a **unique and global URI identifer**. The URI is composed of two parts, the namespace and the ID. The ID is part of the path, and the namespace is included as a query parameter.

## Example

If you have a URI like `http://example.com/ns1/ns2/item123`:

* The namespace (`ns`) is everything before the last slash ("/") or hash ("#"): `http://example.com/ns1/ns2`
* The ID (`id`) is the part after the last slash: `item123`

You would call the endpoint like this:

* Path: `.../things/item123`
* Query parameter: `?ns=http://example.com/ns1/ns2`

So the full URL for the API call would be:

```
https://proxy.opendatagermany.io/api/ts/v1/kg/things/item123?ns=http://example.com/ns1/ns2
```

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Things Service - KG Platform",
    "version": "1.0.0",
    "description": "# General Information\nThe KG Platform API provides a set of services for\n- knowledge management (Create, Update, Delete and Status)\n- knowledge access (Read and Query)\n- graph management (export and delete)\n\nThe Geo Enrichment and Geo Linking Service are currently available as beta status in the pre-production environment\n",
    "termsOfService": "https://onlim.com/en/terms-conditions/",
    "contact": {
      "email": "office@onlim.com",
      "url": "https://onlim.com/en/contact/"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "x-logo": {
      "url": "https://onlim.com/wp-content/uploads/2017/11/logo-header.png"
    }
  },
  "servers": [
    {
      "url": "https://proxy.opendatagermany.io/api/ts/"
    }
  ],
  "paths": {
    "/v1/kg/things/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        },
        {
          "$ref": "#/components/parameters/ns"
        },
        {
          "$ref": "#/components/parameters/x-publisher"
        },
        {
          "$ref": "#/components/parameters/x-datasource"
        }
      ],
      "get": {
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "tags": [
          "Get Thing"
        ],
        "summary": "Retrieve an entity by id\n",
        "operationId": "getThingByID",
        "description": "Returns the details for a given entity in the KG (optional as defined in a DS)\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/projectionDs"
          },
          {
            "$ref": "#/components/parameters/lang"
          },
          {
            "$ref": "#/components/parameters/x-hop"
          },
          {
            "$ref": "#/components/parameters/x-api-key_required"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/ld+json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServerError"
                }
              }
            }
          },
          "404": {
            "description": "Thing id has no domain specification or not query data exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServerError"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServerError"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServerError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "x-api-key_required": {
        "in": "header",
        "name": "X-API-KEY",
        "description": "the api key for authentication and authorization",
        "schema": {
          "type": "string"
        },
        "required": true,
        "x-public": true
      },
      "x-datasource": {
        "in": "header",
        "name": "X-DATASOURCE",
        "description": "the datasource of the graph",
        "schema": {
          "type": "string"
        },
        "required": false
      },
      "x-publisher": {
        "in": "header",
        "name": "X-PUBLISHER",
        "description": "the publisher of the graph",
        "schema": {
          "type": "string"
        },
        "required": false
      },
      "id": {
        "name": "id",
        "in": "path",
        "schema": {
          "type": "string"
        },
        "required": true,
        "description": "The local name of a thing id",
        "example": "faf2896c-8194-11eb-8dcd-0242ac130003"
      },
      "ns": {
        "name": "ns",
        "description": "specify a namespace for the given Id if not in the system namespace",
        "schema": {
          "type": "string",
          "format": "uri",
          "example": "http://example.com/entity/"
        },
        "in": "query",
        "required": false
      },
      "x-hop": {
        "in": "header",
        "name": "X-HOP",
        "description": "return all property-object pairs of N hops for each queried node- Hop=0 returns only rdf:type and ds:compliesWith",
        "schema": {
          "type": "integer",
          "example": 1
        },
        "required": false
      },
      "projectionDs": {
        "in": "query",
        "name": "projectionDs",
        "description": "The domain specification that defines which attributes should be returned",
        "required": false,
        "schema": {
          "type": "string",
          "format": "uri",
          "example": "https://semantify.it/ds/mhpmBCJJt"
        }
      },
      "lang": {
        "in": "query",
        "name": "lang",
        "description": "Specify the return language (2 letter code) for property with langague tagged literals",
        "required": false,
        "schema": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2
          }
        },
        "example": "de"
      }
    },
    "schemas": {
      "ServerError": {
        "allOf": [
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "timestamp": {
                "type": "string",
                "format": "date-time"
              }
            }
          }
        ]
      }
    }
  },
  "x-tagGroups": [
    {
      "name": "Knowledge management",
      "description": "Only data import is implemented",
      "tags": [
        "Import",
        "Import Status",
        "Update Thing",
        "Delete Things"
      ]
    },
    {
      "name": "Knowledge access",
      "description": "Read and query data",
      "tags": [
        "Get Thing",
        "Get Meta",
        "Get Ontology",
        "Get representative super type",
        "Saved Queries",
        "SPARQL",
        "Search Things",
        "Search Things V2"
      ]
    },
    {
      "name": "Named graphs",
      "description": "Managing named graphs",
      "tags": [
        "Named Graphs"
      ]
    },
    {
      "name": "Geo Enrichment Service (BETA Status)",
      "description": "(BETA Status)",
      "tags": [
        "Geo Enrichment Config",
        "Geo Enrichment Job"
      ]
    },
    {
      "name": "Geo Linking Service (BETA Status)",
      "description": "(BETA Status)",
      "tags": [
        "Geo Linking Config",
        "Geo Linking Job"
      ]
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```