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.
Knowledge Graph API (1)
https://developer.cdq.com/_mock/apis/knowledge-graph-api/api-v1/
https://api.cdq.com/knowledge-graph/rest/
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.
The number of the page to read. Parameter isn't required, by default, set to '0'.
Maximum number of elements on the page to read. Parameter isn't required. Can't be negative, by default, set to 10
.
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.
Used to identify rule by its URL.
If enabled, start filtering based on publication status.
Enum Value | Description |
---|---|
PUBLISHED | Published status. |
UNPUBLISHED | Unpublished status. |
Enables sorting of rules by attributes.
- Mock server
https://developer.cdq.com/_mock/apis/knowledge-graph-api/api-v1/knowledgegraphs/{knowledgeGraphId}/models/{modelId}/rules
- Production
https://api.cdq.com/knowledge-graph/rest/knowledgegraphs/{knowledgeGraphId}/models/{modelId}/rules
- cURL
- Java
- JavaScript
- Python
- Node.js
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'
OK
List of rules.
Represents the status of a rule.
Enum Value | Description |
---|---|
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 |
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. |
Represents country that rule applies to, valid in ISO-2 format.
Represents the severity of the rule; based on this property, different actions can be taken when the rule fails.
Enum Value | Description |
---|---|
NO_DEFECT | No defect. |
INFO | Information. |
WARNING | Warning. |
ERROR | Error. |
Type of business rule.
Enum Value | Description |
---|---|
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. |
SPARQL rule that is used for validation of data.
Test case containing a record that passes the validation against SPARQL rule.
Test case containing a record that does not pass the validation against SPARQL rule.
Date of creation (ISO 8601-compliant).
Date of modification (ISO 8601-compliant).
Publication status of the rule.
Enum Value | Description |
---|---|
PUBLISHED | Published status. |
UNPUBLISHED | Unpublished status. |
{ "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" }