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

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

Import RDF File

Request

Import an RDF file to a model. The file is expected to be in RDF format.

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
Bodymultipart/form-datarequired
inputFilestring(binary)required

Path to file.

Example: "file.csv"
importModestring

Import mode.

Enum ValueDescription
MERGE

Merge.

REPLACE

Replace.

Example: "MERGE"
separatorTypestring

Separator type.

Enum ValueDescription
COMMA

Comma

SEMICOLON

Semicolon

Example: "COMMA"
curl -i -X POST \
  -u <username>:<password> \
  https://idp.cdq.com/_mock/apis/knowledge-graph-api/api-v1/knowledgegraphs/1/models/1/import/rdf \
  -H 'Content-Type: multipart/form-data' \
  -H 'X-Credential-Username: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3' \
  -F inputFile=file.csv \
  -F importMode=MERGE \
  -F separatorType=COMMA

Responses

OK

Bodyapplication/json
importIdintegerrequired

Import id in a given model.

Example: "1"
importJobIdstringrequired

Import job UUID.

Example: "1"
importModestring(ImportMode)required

Import mode.

Default "MERGE"
Enum ValueDescription
MERGE

Merge.

REPLACE

Replace.

Example: "MERGE"
separatorTypestring(SeparatorType)required

Separator type.

Default "COMMA"
Enum ValueDescription
COMMA

Comma

SEMICOLON

Semicolon

Example: "COMMA"
inputFilestringrequired

Path to file.

Example: "file.csv"
Response
application/json
{ "importId": "1", "importJobId": "1", "importMode": "MERGE", "separatorType": "COMMA", "inputFile": "file.csv" }

List Import Jobs

Request

Get a list of import jobs that were executed in the context of a model. The endpoint allows:

  • filter - gives an option to limit a query result by job type
  • pagination - gives an option to limit a query result by page and page size
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
importTypestring

Parameter used to filter import jobs by type.

Enum ValueDescription
CSV_IMPORT

Import a job for CSV file.

MODEL_IMPORT

Import a job for a model.

RDF_IMPORT

Import job for an RDF file.

Example: importType=CSV_IMPORT
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
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/import \
  -H 'X-Credential-Username: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3'

Responses

OK

Bodyapplication/json
valuesArray of objects(ImportJob)

List of import jobs.

pageinteger(Page)>= 0

Current page number.

Default 0
Example: "1"
pageSizeinteger(PageSize)[ 1 .. 1000 ]

Number of items per page.

Default 10
Example: "100"
totalinteger(PageTotal)

Total number of items which can be paged.

Example: "67"
Response
application/json
{ "summary": "List of executed CSV import jobs", "value": "{ values: [{ \"id\": 1, \"editId\": 1, \"startDate\": \"2022-01-12T17:32:00\", \"endDate\": \"2022-01-12T17:32:00\", \"user\": \"user\", \"status\": \"FINISHED\", \"inputFile\": \"path/to/file.csv\", \"jobUuid\": \"0000-00000-00000-00000\", \"type\": \"CSV_IMPORT\" }], page: 0, pageSize: 10, total: 1 }\n" }

Import CSV File

Request

Import a CSV file to 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
Bodymultipart/form-datarequired
inputFilestring(binary)required

Path to file.

Example: "file.csv"
importModestring

Import mode.

Enum ValueDescription
MERGE

Merge.

REPLACE

Replace.

Example: "MERGE"
separatorTypestring

Separator type.

Enum ValueDescription
COMMA

Comma

SEMICOLON

Semicolon

Example: "COMMA"
curl -i -X POST \
  -u <username>:<password> \
  https://idp.cdq.com/_mock/apis/knowledge-graph-api/api-v1/knowledgegraphs/1/models/1/import/csv \
  -H 'Content-Type: multipart/form-data' \
  -H 'X-Credential-Username: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3' \
  -F inputFile=file.csv

Responses

OK

Bodyapplication/json
importIdintegerrequired

Import id in a given model.

Example: "1"
importJobIdstringrequired

Import job UUID.

Example: "1"
importModestring(ImportMode)required

Import mode.

Default "MERGE"
Enum ValueDescription
MERGE

Merge.

REPLACE

Replace.

Example: "MERGE"
separatorTypestring(SeparatorType)required

Separator type.

Default "COMMA"
Enum ValueDescription
COMMA

Comma

SEMICOLON

Semicolon

Example: "COMMA"
inputFilestringrequired

Path to file.

Example: "file.csv"
Response
application/json
{ "summary": "Successful CSV file import response. \"jobId\" is the uuid of the created job, returned from services.", "value": "{ \"importId\": null, \"importJobId\": \"jobId\", \"importMode\": \"MERGE\", \"inputFile\": null, \"separatorType\": \"COMMA\" }\n" }

Import Content

Request

NOT IMPLEMENTED. TODO - check if needed. Import content of another 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
srcModelIdintegerrequired

Source model ID.

Example: "1"
srcKnowledgeGraphIdinteger

Source knowledge graph ID.

Example: "1"
importModestring(ImportMode)

Import mode.

Default "MERGE"
Enum ValueDescription
MERGE

Merge.

REPLACE

Replace.

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

Responses

OK

Bodyapplication/json
importIdintegerrequired

Import id in a given model.

Example: "1"
importJobIdstringrequired

Import job UUID.

Example: "1"
importModestring(ImportMode)required

Import mode.

Default "MERGE"
Enum ValueDescription
MERGE

Merge.

REPLACE

Replace.

Example: "MERGE"
separatorTypestring(SeparatorType)required

Separator type.

Default "COMMA"
Enum ValueDescription
COMMA

Comma

SEMICOLON

Semicolon

Example: "COMMA"
srcModelIdintegerrequired

Source model ID.

Example: "1"
Response
application/json
{ "summary": "Successful submitted request", "value": "{ \"importId\": 1, \"importJobId\": \"job-uuid\", \"importMode\": \"MERGE\", \"srcModelId\": 1 }\n" }

Import Concepts

Request

NOT IMPLEMENTED. TODO - check if needed. Import concepts from another 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
conceptsIdListArray of integers(ConceptsIdList)required

List of concept (or rule) IDs.

Example: ["1"]
srcModelIdintegerrequired

Source model ID.

Example: "1"
srcKnowledgeGraphIdinteger

Source knowledge graph ID.

Example: "1"
importModestring(ImportMode)required

Import mode.

Default "MERGE"
Enum ValueDescription
MERGE

Merge.

REPLACE

Replace.

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

Responses

OK

Bodyapplication/json
importIdintegerrequired

Import id in a given model.

Example: "1"
importJobIdstringrequired

Import job UUID.

Example: "1"
importModestring(ImportMode)required

Import mode.

Default "MERGE"
Enum ValueDescription
MERGE

Merge.

REPLACE

Replace.

Example: "MERGE"
separatorTypestring(SeparatorType)required

Separator type.

Default "COMMA"
Enum ValueDescription
COMMA

Comma

SEMICOLON

Semicolon

Example: "COMMA"
srcModelIdintegerrequired

Source model ID.

Example: "1"
conceptsIdListArray of integers(ConceptsIdList)required

List of concept (or rule) IDs.

Example: ["1"]
Response
application/json
{ "importId": "1", "importJobId": "1", "importMode": "MERGE", "separatorType": "COMMA", "srcModelId": "1", "conceptsIdList": [ "1" ] }

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