Skip to content

Knowledge Graph API (1)

A Knowledge Graph is a graph-based data model representation of knowledge within a domain. In other words, it contains nodes and edges that represent entities and the relationships between them. The API should then enable the creation, update, or query with regard to these graphs and their models.

Languages
Servers
Mock server

https://idp.cdq.com/_mock/apis/knowledge-graph-api/api-v1/

Production SOAP

https://api.corporate-data-league.ch/knowledge-graph-api/soap/v1/

Production

https://api.corporate-data-league.ch/knowledge-graph-api/

Concepts

Operations related to Concepts. A concept is a unit of knowledge that is created and managed within a model.

Operations

List Concepts

Request

Get concepts saved inside a model.

Security
basicAuth
Path
knowledgeGraphIdintegerrequired

Used to identify Knowledge Graph and objects inside it.

Example: 1
modelIdintegerrequired

Used to identify model and objects inside it.

Example: 1
Query
pageinteger>= 0

The number of the page to read. Parameter isn't required, by default, set to '0'.

Default 0
Example: page=0
pageSizeinteger>= 0

Maximum number of elements on the page to read. Parameter isn't required. Can't be negative, by default, set to 10.

Default 10
Example: pageSize=10
conceptIdinteger

Used to identify concept by passing the ID in the URL link.

Example: conceptId=1
searchedTextstring

Used to filter objects.

Example: searchedText=Searched Text
classTypeIdinteger

Used to filter concepts only of a specific type.

Example: classTypeId=1
sortstring

Sort concepts.

Enum"LAST_EDITOR""LAST_MODIFICATION""NAME""URL"
Example: sort=NAME
sortTypestring

Allows changing the default sorting order (ASC) to desire by user.

Default "ASC"
Enum ValueDescription
DESC

Sort in descending order.

ASC

Sort in ascending order.

Example: sortType=ASC
fetchModificationDateboolean

If enabled modification date will be determined against concept values.

Default false
Example: fetchModificationDate=false
publicationStatusstring

If enabled, start filtering based on publication status.

Enum ValueDescription
PUBLISHED

Published status.

UNPUBLISHED

Unpublished status.

Example: publicationStatus=PUBLISHED
Headers
X-Credential-Usernamestringrequired

Username that is passed as header parameter with the name X-Credential-Username. The header can take a form of:

  • username (e.g. "johnjoe")
  • user id (e.g. "87b1bdb1-ba87-4522-b363-c5a0e6e917b3")
Example: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3
curl -i -X GET \
  -u <username>:<password> \
  https://idp.cdq.com/_mock/apis/knowledge-graph-api/api-v1/knowledgegraphs/1/models/1/concepts \
  -H 'X-Credential-Username: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3'

Responses

OK

Bodyapplication/json
pageSizeinteger(PageSize)[ 1 .. 1000 ]required

Number of items per page.

Default 10
Example: "100"
pageinteger(Page)>= 0required

Current page number.

Default 0
Example: "1"
valuesArray of objects(Concept)required

List of concepts.

values[].​idstringrequired

Unique identifier of the concept.

Example: "1"
values[].​urlstring(ConceptUrl)required

URL to the documentation which summarizes all details of the Business Partner Concepts.

Example: "https://meta.cdq.com/Business_partner"
values[].​lastModifierstring

Username of the last modifier.

Example: "user"
values[].​lastModificationDatestring

Date of the last modification.

Example: "2020-07-06T12:14:03.204Z"
values[].​publicationStatusstring

Publication status of the concept.

Example: "PUBLISHED"
totalinteger(PageTotal)required

Total number of items which can be paged.

Example: "67"
Response
application/json
{ "summary": "Paginated response of concepts saved inside a model.", "value": "{\"pageSize\":10,\"page\":0,\"values\":[{\"id\":\"101\",\"url\":\"https://www.cdq.com/Configuration_parameters/CDQ_BASEURL\",\"lastModifier\":\"database-creation\",\"lastModificationDate\":\"2021-12-29T13:56:50\"},{\"id\":\"102\",\"url\":\"https://www.cdq.com/Has_value\",\"lastModifier\":\"database-creation\",\"lastModificationDate\":\"2021-12-29T13:56:50\"}],\"total\":2}\n" }

Create Concept

Request

Create a new concept in a model.

Security
basicAuth
Path
knowledgeGraphIdintegerrequired

Used to identify Knowledge Graph and objects inside it.

Example: 1
modelIdintegerrequired

Used to identify model and objects inside it.

Example: 1
Headers
X-Credential-Usernamestringrequired

Username that is passed as header parameter with the name X-Credential-Username. The header can take a form of:

  • username (e.g. "johnjoe")
  • user id (e.g. "87b1bdb1-ba87-4522-b363-c5a0e6e917b3")
Example: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3
Bodyapplication/jsonrequired
conceptUrlstring(ConceptUrl)required

URL to the documentation which summarizes all details of the Business Partner Concepts.

Example: "https://meta.cdq.com/Business_partner"
propertiesArray of objects(ConceptProperties)

List of properties.

descriptionstring

Description of the concept.

Example: "Address of the business partner."
curl -i -X POST \
  -u <username>:<password> \
  https://idp.cdq.com/_mock/apis/knowledge-graph-api/api-v1/knowledgegraphs/1/models/1/concepts \
  -H 'Content-Type: application/json' \
  -H 'X-Credential-Username: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3' \
  -d '{
    "conceptUrl": "https://cdq.com/concept",
    "properties": [
      {
        "propertyConcept": {
          "url": "https://cdq.com/propertyA"
        },
        "value": {
          "literal": "literal value example 1",
          "datatypeUrl": "xsd:string",
          "lang": "en"
        }
      },
      {
        "propertyConcept": {
          "url": "https://cdq.com/propertyB"
        },
        "value": {
          "literal": "literal value example 2",
          "datatypeUrl": "xsd:string",
          "lang": "en"
        }
      }
    ]
  }'

Responses

Created

Bodyapplication/json
idstringrequired

Unique identifier of the concept.

Example: "1"
urlstring(ConceptUrl)required

URL to the documentation which summarizes all details of the Business Partner Concepts.

Example: "https://meta.cdq.com/Business_partner"
lastModifierstring

Username of the last modifier.

Example: "user"
lastModificationDatestring

Date of the last modification.

Example: "2020-07-06T12:14:03.204Z"
publicationStatusstring

Publication status of the concept.

Example: "PUBLISHED"
Response
application/json
{ "summary": "Create concept response", "value": "{ \"id\": \"110\", \"url\": \"https://cdq.com/concept\", \"lastModifier\": \"demo_user\", \"lastModificationDate\": \"2021-12-30T08:05:00\" }\n" }

Export Concepts

Request

Export concepts to a CSV file.

Security
basicAuth
Path
knowledgeGraphIdintegerrequired

Used to identify Knowledge Graph and objects inside it.

Example: 1
modelIdintegerrequired

Used to identify model and objects inside it.

Example: 1
Query
conceptIdListArray of integers

Used to retrieve a list of concepts by their ID's.

Example: conceptIdList=1
Headers
X-Credential-Usernamestringrequired

Username that is passed as header parameter with the name X-Credential-Username. The header can take a form of:

  • username (e.g. "johnjoe")
  • user id (e.g. "87b1bdb1-ba87-4522-b363-c5a0e6e917b3")
Example: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3
curl -i -X GET \
  -u <username>:<password> \
  https://idp.cdq.com/_mock/apis/knowledge-graph-api/api-v1/knowledgegraphs/1/models/1/concepts/export \
  -H 'X-Credential-Username: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3'

Responses

OK

Bodyapplication/json
linkToCSVPathstring

Path to CSV file.

Example: "https://s3.eu-central-1.amazonaws.com/cdq-kg-exports/1/2/3.csv"
Response
application/json
{ "summary": "Successfully exported the concept as a CSV file.", "value": "{ \"linkToCSVPath\": \"knowledgegraphs/pathToFolder/userName-2022-12-14T09-04-01.082706266.csv\"}\n" }

List Concept Values

Request

Gets url values and literal values related to concept.

Security
basicAuth
Path
knowledgeGraphIdintegerrequired

Used to identify Knowledge Graph and objects inside it.

Example: 1
modelIdintegerrequired

Used to identify model and objects inside it.

Example: 1
conceptIdintegerrequired

Used to identify concept.

Example: 1
Query
pageinteger>= 0

The number of the page to read. Parameter isn't required, by default, set to '0'.

Default 0
Example: page=0
pageSizeinteger>= 0

Maximum number of elements on the page to read. Parameter isn't required. Can't be negative, by default, set to 10.

Default 10
Example: pageSize=10
sortstring

Sort concept values.

Enum ValueDescription
URL

Sort by url of the concept value. Sorts by URLs of properties.

VALUE

Sort by value of the concept. In case of literal value sorts by literals, in case of URL value sorts by url (object).

Example: sort=VALUE
sortTypestring

Allows changing the default sorting order (ASC) to desire by user.

Default "ASC"
Enum ValueDescription
DESC

Sort in descending order.

ASC

Sort in ascending order.

Example: sortType=ASC
searchedTextstring

Used to filter objects.

Example: searchedText=Searched Text
Headers
X-Credential-Usernamestringrequired

Username that is passed as header parameter with the name X-Credential-Username. The header can take a form of:

  • username (e.g. "johnjoe")
  • user id (e.g. "87b1bdb1-ba87-4522-b363-c5a0e6e917b3")
Example: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3
curl -i -X GET \
  -u <username>:<password> \
  https://idp.cdq.com/_mock/apis/knowledge-graph-api/api-v1/knowledgegraphs/1/models/1/concepts/1/values \
  -H 'X-Credential-Username: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3'

Responses

OK

Bodyapplication/json
pageSizeinteger(PageSize)[ 1 .. 1000 ]required

Number of items per page.

Default 10
Example: "100"
pageinteger(Page)>= 0required

Current page number.

Default 0
Example: "1"
subjectConceptobject(ConceptParam)

To be used when creating/editing of a new concept (or its associated values). It is expected in most cases only either of the properties will be set.

valuesArray of objects(ConceptValue)required

List of values assigned to the concept.

values[].​propertyConceptobject(ConceptParam)

To be used when creating/editing of a new concept (or its associated values). It is expected in most cases only either of the properties will be set.

values[].​urlPropertyValuesobject(UrlPropertyValue)

List of url values assigned to property.

values[].​literalPropertyValuesobject(LiteralPropertyValue)

List of literal values assigned to property.

totalinteger(PageTotal)required

Total number of items which can be paged.

Example: "67"
Response
application/json
{ "summary": null, "value": "{\"pageSize\":10,\"page\":0,\"subjectConcept\":{\"id\":110,\"url\":\"https://cdq.com/concept/1\",\"creator\":\"demo_user\",\"creationDate\":\"2021-12-22T13:13:40\"},\"values\":[{\"propertyConcept\":{\"id\":111,\"url\":\"https://cdq.com/hasName\",\"creator\":\"demo_user\",\"creationDate\":\"2021-12-22T08:45:56\"},\"urlPropertyValues\":null,\"literalPropertyValues\":{\"value\":[{\"id\":139,\"literal\":\"Detailed name of concept\",\"datatypeUrl\":\"xsd:string\",\"lang\":\"en\",\"creator\":\"demo_user\",\"creationDate\":\"2021-12-22T09:31:39\"}]}},{\"propertyConcept\":{\"id\":112,\"url\":\"https://cdq.com/hasColour\",\"creator\":\"demo_user\",\"creationDate\":\"2021-12-22T08:46:03\"},\"urlPropertyValues\":{\"value\":[{\"id\":141,\"url\":\"https://cdq.com/colors/red\",\"creator\":\"demo_user\",\"creationDate\":\"2021-12-22T13:13:40\"}]},\"literalPropertyValues\":null}],\"total\":2}\n" }

Add Values

Request

Adds values to concept identified by conceptId.

Security
basicAuth
Path
knowledgeGraphIdintegerrequired

Used to identify Knowledge Graph and objects inside it.

Example: 1
modelIdintegerrequired

Used to identify model and objects inside it.

Example: 1
conceptIdintegerrequired

Used to identify concept.

Example: 1
Headers
X-Credential-Usernamestringrequired

Username that is passed as header parameter with the name X-Credential-Username. The header can take a form of:

  • username (e.g. "johnjoe")
  • user id (e.g. "87b1bdb1-ba87-4522-b363-c5a0e6e917b3")
Example: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3
Bodyapplication/jsonArray [
propertyConceptobject(ConceptParam)required

To be used when creating/editing of a new concept (or its associated values). It is expected in most cases only either of the properties will be set.

propertyConcept.​idinteger

Unique identifier of the concept.

Example: "1"
propertyConcept.​urlstring(ConceptUrl)

URL to the documentation which summarizes all details of the Business Partner Concepts.

Example: "https://meta.cdq.com/Business_partner"
propertyConcept.​creatorstring(UserId)

Unique ID of a user.

Example: "johndoe"
propertyConcept.​creationDatestring(CreatedAt)

Date of creation (ISO 8601-compliant).

Example: "2020-08-31T16:47+00:00"
propertyConcept.​deletionDatestring(DeletedAt)

Date of deletion (ISO 8601-compliant).

Example: "2020-08-31T16:47+00:00"
propertyConcept.​unmodifiableboolean

Indicates if the concept is unmodifiable. If true, the concept is unmodifiable.

Example: true
valueobject(ValueObject)required

Represents value of:

  • an RDF object property (value refers to another concept by its URL)
  • an RDF data property/literal value
value.​idinteger

Unique identifier of the concept.

Example: "1"
value.​urlstring(ConceptUrl)

URL to the documentation which summarizes all details of the Business Partner Concepts.

Example: "https://meta.cdq.com/Business_partner"
value.​creatorstring(UserId)

Unique ID of a user.

Example: "johndoe"
value.​creationDatestring(CreatedAt)

Date of creation (ISO 8601-compliant).

Example: "2020-08-31T16:47+00:00"
value.​deletionDatestring(DeletedAt)

Date of deletion (ISO 8601-compliant).

Example: "2020-08-31T16:47+00:00"
value.​unmodifiableboolean

Indicates if the concept is unmodifiable. If true, the concept is unmodifiable.

Example: true
value.​literalstring

Value of the literal.

Example: "Berlin"
value.​datatypeUrlstring

URL of the literal's datatype.

Example: "http://www.w3.org/2001/XMLSchema#string"
value.​langstring

Language of the literal.

Example: "en"
]
curl -i -X POST \
  -u <username>:<password> \
  https://idp.cdq.com/_mock/apis/knowledge-graph-api/api-v1/knowledgegraphs/1/models/1/concepts/1/values \
  -H 'Content-Type: application/json' \
  -H 'X-Credential-Username: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3' \
  -d '{}'

Responses

Created

Delete Concept Values

Request

Delete concept values identified by valueId.

Security
basicAuth
Path
knowledgeGraphIdintegerrequired

Used to identify Knowledge Graph and objects inside it.

Example: 1
modelIdintegerrequired

Used to identify model and objects inside it.

Example: 1
conceptIdintegerrequired

Used to identify concept.

Example: 1
Headers
X-Credential-Usernamestringrequired

Username that is passed as header parameter with the name X-Credential-Username. The header can take a form of:

  • username (e.g. "johnjoe")
  • user id (e.g. "87b1bdb1-ba87-4522-b363-c5a0e6e917b3")
Example: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3
Bodyapplication/jsonArray [
integer

Object id.

]
curl -i -X PATCH \
  -u <username>:<password> \
  https://idp.cdq.com/_mock/apis/knowledge-graph-api/api-v1/knowledgegraphs/1/models/1/concepts/1/values \
  -H 'Content-Type: application/json' \
  -H 'X-Credential-Username: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3' \
  -d '[
    "1"
  ]'

Responses

OK

Update Concept Value

Request

Updates concept values. Value cannot change its type (literal value to url value). Update is done by disabling existing value and appending new value to concept.

Security
basicAuth
Path
knowledgeGraphIdintegerrequired

Used to identify Knowledge Graph and objects inside it.

Example: 1
modelIdintegerrequired

Used to identify model and objects inside it.

Example: 1
conceptIdintegerrequired

Used to identify concept.

Example: 1
valueIdintegerrequired

Used to identify value (url or literal).

Example: 1
Headers
X-Credential-Usernamestringrequired

Username that is passed as header parameter with the name X-Credential-Username. The header can take a form of:

  • username (e.g. "johnjoe")
  • user id (e.g. "87b1bdb1-ba87-4522-b363-c5a0e6e917b3")
Example: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3
Bodyapplication/json
idinteger

Unique identifier of the concept.

Example: "1"
urlstring(ConceptUrl)

URL to the documentation which summarizes all details of the Business Partner Concepts.

Example: "https://meta.cdq.com/Business_partner"
creatorstring(UserId)

Unique ID of a user.

Example: "johndoe"
creationDatestring(CreatedAt)

Date of creation (ISO 8601-compliant).

Example: "2020-08-31T16:47+00:00"
deletionDatestring(DeletedAt)

Date of deletion (ISO 8601-compliant).

Example: "2020-08-31T16:47+00:00"
unmodifiableboolean

Indicates if the concept is unmodifiable. If true, the concept is unmodifiable.

Example: true
literalstring

Value of the literal.

Example: "Berlin"
datatypeUrlstring

URL of the literal's datatype.

Example: "http://www.w3.org/2001/XMLSchema#string"
langstring

Language of the literal.

Example: "en"
curl -i -X PUT \
  -u <username>:<password> \
  https://idp.cdq.com/_mock/apis/knowledge-graph-api/api-v1/knowledgegraphs/1/models/1/concepts/1/values/1 \
  -H 'Content-Type: application/json' \
  -H 'X-Credential-Username: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3' \
  -d '{
    "value": {
      "literal": "new literal value",
      "datatypeUrl": "xsd:string",
      "lang": "en"
    }
  }'

Responses

OK

Delete Concept Value

Request

Deletes concept value identified by valueId.

Security
basicAuth
Path
knowledgeGraphIdintegerrequired

Used to identify Knowledge Graph and objects inside it.

Example: 1
modelIdintegerrequired

Used to identify model and objects inside it.

Example: 1
conceptIdintegerrequired

Used to identify concept.

Example: 1
valueIdintegerrequired

Used to identify value (url or literal).

Example: 1
Headers
X-Credential-Usernamestringrequired

Username that is passed as header parameter with the name X-Credential-Username. The header can take a form of:

  • username (e.g. "johnjoe")
  • user id (e.g. "87b1bdb1-ba87-4522-b363-c5a0e6e917b3")
Example: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3
curl -i -X DELETE \
  -u <username>:<password> \
  https://idp.cdq.com/_mock/apis/knowledge-graph-api/api-v1/knowledgegraphs/1/models/1/concepts/1/values/1 \
  -H 'X-Credential-Username: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3'

Responses

OK

Update Concept

Request

Allows for updating the whole concept structure (concept with its values). Overrides all existing concept values, concept URL cannot be changed.

Security
basicAuth
Path
knowledgeGraphIdintegerrequired

Used to identify Knowledge Graph and objects inside it.

Example: 1
modelIdintegerrequired

Used to identify model and objects inside it.

Example: 1
conceptIdintegerrequired

Used to identify concept.

Example: 1
Headers
X-Credential-Usernamestringrequired

Username that is passed as header parameter with the name X-Credential-Username. The header can take a form of:

  • username (e.g. "johnjoe")
  • user id (e.g. "87b1bdb1-ba87-4522-b363-c5a0e6e917b3")
Example: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3
Bodyapplication/jsonrequired
conceptUrlstring(ConceptUrl)required

URL to the documentation which summarizes all details of the Business Partner Concepts.

Example: "https://meta.cdq.com/Business_partner"
propertiesArray of objects(ConceptProperties)

List of properties.

descriptionstring

Description of the concept.

Example: "Address of the business partner."
curl -i -X PUT \
  -u <username>:<password> \
  https://idp.cdq.com/_mock/apis/knowledge-graph-api/api-v1/knowledgegraphs/1/models/1/concepts/1 \
  -H 'Content-Type: application/json' \
  -H 'X-Credential-Username: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3' \
  -d '{
    "conceptUrl": "https://cdq.com/concept/2",
    "properties": [
      {
        "propertyConcept": {
          "url": "https://cdq.com/hasName",
          "value": "1.842"
        },
        "value": {
          "url": "https://cdq.com/propertyNames"
        }
      },
      {
        "propertyConcept": {
          "url": "https://cdq.com/value/hasType"
        },
        "value": {
          "literal": "custom type",
          "datatypeUrl": "xsd:string",
          "lang": "en"
        }
      },
      {
        "propertyConcept": {
          "url": "https://cdq.com/value/hasSubType"
        },
        "value": {
          "literal": "subtype",
          "datatypeUrl": "xsd:string",
          "lang": "pl"
        }
      }
    ],
    "description": "Concept with updated type and subtype"
  }'

Responses

Concept updated successfully

Bodyapplication/json
idstringrequired

Unique identifier of the concept.

Example: "1"
urlstring(ConceptUrl)required

URL to the documentation which summarizes all details of the Business Partner Concepts.

Example: "https://meta.cdq.com/Business_partner"
lastModifierstring

Username of the last modifier.

Example: "user"
lastModificationDatestring

Date of the last modification.

Example: "2020-07-06T12:14:03.204Z"
publicationStatusstring

Publication status of the concept.

Example: "PUBLISHED"
Response
application/json
{ "summary": null, "value": "{ \"id\": \"110\", \"url\": \"https://cdq.com/concept/2\", \"lastModifier\": \"user\", \"lastModificationDate\": \"2021-12-30T08:51:47\" }\n" }

Delete Concept

Request

Deletes concept with related value objects.

Security
basicAuth
Path
knowledgeGraphIdintegerrequired

Used to identify Knowledge Graph and objects inside it.

Example: 1
modelIdintegerrequired

Used to identify model and objects inside it.

Example: 1
conceptIdintegerrequired

Used to identify concept.

Example: 1
Headers
X-Credential-Usernamestringrequired

Username that is passed as header parameter with the name X-Credential-Username. The header can take a form of:

  • username (e.g. "johnjoe")
  • user id (e.g. "87b1bdb1-ba87-4522-b363-c5a0e6e917b3")
Example: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3
curl -i -X DELETE \
  -u <username>:<password> \
  https://idp.cdq.com/_mock/apis/knowledge-graph-api/api-v1/knowledgegraphs/1/models/1/concepts/1 \
  -H 'X-Credential-Username: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3'

Responses

Concept deleted successfully

Concept history

Operations related to Concept history. A concept history is a record of changes made to a concept.

Operations

Imports

Operations related to Imports. An import is a process of bringing data from an external source into the system.

Operations

Knowledge Graphs

Operations related to Knowledge Graphs and their management. A Knowledge Graph is a graph-based data model

Operations

Models

Operations related to Models. A model is a collection of concepts and their relationships.

Operations

Query

Operations related to Query. A query is a request for information from a database.

Rules

Operations related to Rules. A rule is a statement that defines or constrains some aspect of the business.

Operations

Translation

Operations related to Translation. Translation is the communication of a source language text's meaning through an equivalent target language text.

Operations

Validation Graph

Operations related to Validation Graphs. A Validation Graph is a graph-based data model representation of knowledge within a domain.

Operations

Values

Operations related to Values. A value is a piece of information that is stored in a database.

Operations