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.

Download OpenAPI description
Languages
Servers
Mock server

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

Production

https://api.cdq.com/knowledge-graph/rest/

Concepts

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

Operations

Rules

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

Operations

Request

Fetch rules stored inside a model. Endpoint allows for:

  • full text search - searching inside: id, name, sparql rule, rule url, passing test case, violating test case for string passed in searchedText field
  • sorting - sorting by allowed values of rules and sorting order (default ascending)
  • filtering - gives option to limit query result by country and criticality Each functionality can be combined to create complex usage of this endpoint.
Security
apiKey
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
searchedTextstring

Used to filter objects.

Example: searchedText=Searched Text
searchedCountrystring

Used to filter objects.

Example: searchedCountry=Country
searchedCriticalitystring

Used to filter objects.

Example: searchedCriticality=Criticality
searchedStatusstring

Used to filter objects. Correct values: * ARCHIVED - Archived status. * BLOCKED - Blocked status. * DEACTIVATED - Deactivated status. * DRAFT - Draft status. * HYPERCARE - Hypercare status. * IDEA - Idea status. * IMPLEMENTED - Implemented status. * PLANNED - Planned status. * RELEASED - Released status. * UNDER_REVIEW - Under review status.

Example: searchedStatus=RELEASED
ruleUrlstring

Used to identify rule by its URL.

Example: ruleUrl=https://www.cdq.com/rule/isValidEmail
publicationStatusstring

If enabled, start filtering based on publication status.

Enum ValueDescription
PUBLISHED

Published status.

UNPUBLISHED

Unpublished status.

Example: publicationStatus=PUBLISHED
sortstring

Enables sorting of rules by attributes.

Enum"COUNTRY""CREATED_AT""CREATED_BY""CRITICALITY""LAST_EDITOR""LAST_MODIFICATION""NAME""STATUS"
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
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 \
  https://developer.cdq.com/_mock/apis/knowledge-graph-api/api-v1/knowledgegraphs/1/models/1/rules \
  -H 'X-API-KEY: YOUR_API_KEY_HERE' \
  -H 'X-Credential-Username: 87b1bdb1-ba87-4522-b363-c5a0e6e917b3'

Responses

OK

Bodyapplication/json
pageSizeinteger>= 0required

Number of rules on the page.

Example: "10"
pageinteger>= 0required

Number of the page.

Example: "10"
valuesArray of objects(Rule)required

List of rules.

values[].​idintegerrequired

Rule ID.

Example: "1"
values[].​urlstringrequired

URL of the rule.

Example: "https://www.cdq.com/rule/1"
values[].​namestringrequired

Name of the rule.

Example: "Rule 1"
values[].​statusstringrequired

Represents the status of a rule.

Enum ValueDescription
ARCHIVED

The rule is marked as obsolete, no longer in use.

BLOCKED

The rule is marked as blocked, no longer in use.

DEACTIVATE

The rule is deactivated - either manually or automatically during release because of failed test or quality gate check.

DRAFT

The rule is in draft state.

HYPERCARE

Active rule after transitioning from PLANNED or DEACTIVATED status.

IDEA

The rule is an idea.

IMPLEMENTED

The rule is implemented but not released yet.

PLANNED

The rule is ready to be published.

RELEASED

The rule is activated to use to validate data.

UNDER_REVIEW

The rule is waiting for review to be performed.

Example: "ARCHIVED"
values[].​countrystring

Represents country that rule applies to, valid in ISO-2 format.

Example: "DE"
values[].​criticalitystring

Represents the severity of the rule; based on this property, different actions can be taken when the rule fails.

Enum ValueDescription
NO_DEFECT

No defect.

INFO

Information.

WARNING

Warning.

ERROR

Error.

Example: "NO_DEFECT"
values[].​businessRuleTypestringrequired

Type of business rule.

Enum ValueDescription
AUTOMATION_RULE

Custom automation rule that allows for generating decisions in data maintenance workflows based on data quality rules, automated data enrichments or lookups.

DATA_QUALITY_RULE

Also known as data validation rule, defines business requirements for specific data.

Example: "AUTOMATION_RULE"
values[].​sparqlstringrequired

SPARQL rule that is used for validation of data.

Example: "SELECT * WHERE { ?s ?p ?o }"
values[].​correctRecordstringrequired

Test case containing a record that passes the validation against SPARQL rule.

Example: "SELECT * WHERE { ?s ?p ?o }"
values[].​incorrectRecordstringrequired

Test case containing a record that does not pass the validation against SPARQL rule.

Example: "SELECT WHERE { ?s ?p ?"
values[].​descriptionstring

Description of the rule.

Example: "Rule description"
values[].​violationMessagestring

Message to display when rule fails.

Example: "Rule failed"
values[].​createdAtstring(CreatedAt)required

Date of creation (ISO 8601-compliant).

Example: "2025-08-29T09:46:59Z"
values[].​createdBystring(CreatedBy)required

Creator of a resource.

Example: "76248934691294444"
values[].​lastModifierstring(UserId)required

Unique ID of a user.

Example: "johndoe"
values[].​lastModificationDatestring(ModifiedAt)required

Date of modification (ISO 8601-compliant).

Example: "2025-08-29T09:46:59Z"
values[].​publicationStatusstring

Publication status of the rule.

Enum ValueDescription
PUBLISHED

Published status.

UNPUBLISHED

Unpublished status.

Example: "PUBLISHED"
values[].​categorystring

Category of the rule.

Example: "Category"
totalintegerrequired

Total number of rules.

Example: "10"
Response
application/json
{ "summary": "Example response of fetching rules", "value": "{\"pageSize\":10,\"page\":0,\"values\":[{\"id\":110,\"name\":\"Email validation\",\"status\":\"IDEA\",\"country\":\"WORLD\",\"criticality\":\"ERROR\",\"businessRuleType\":\"DATA_QUALITY_RULE\",\"sparql\":\"SELECT ?recordId WHERE {\\n ?s <https://cdq.com/KG/Property-3AEMail> ?email .\\n ?s <https://cdq.com/KG/Property-3AHas_record_id> ?recordId .\\n FILTER (!regex(str(?email), \\\"^(.+)@(.+)$\\\")) .\\n}\",\"correctRecord\":\"{ \\\"email\\\": \\\"demouser@cdq.com\\\" }\",\"incorrectRecord\":\"{ \\\"email\\\": \\\"incorre! ct@gmail.com\\\"}\",\"description\":\"Validates email against allowed characters\",\"violationMessage\":\"Email is incorrect\",\"createdAt\":\"2021-12-30T10:46:29\",\"createdBy\":\"demo_user\",\"lastModifier\":\"demo_user\",\"lastModificationDate\":\"2021-12-30T10:46:29\"}],\"total\":1}\n" }