{
  "openapi": "3.0.0",
  "info": {
    "version": "1",
    "title": "Knowledge Graph API",
    "description": "A Knowledge Graph is a graph-based data model representation of knowledge within a domain. In other words, it contains \nnodes and edges that represent entities and the relationships between them. The API should then enable the creation, \nupdate, or query with regard to these graphs and their models.\n"
  },
  "servers": [
    {
      "description": "Production",
      "url": "https://api.cdq.com/knowledge-graph/rest",
      "x-cdq-soap-url": "https://api.corporate-data-league.ch/knowledge-graph/soap/v1"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "name": "Concepts",
      "description": "Operations related to Concepts. A concept is a unit of knowledge that is created and managed within a model.\n"
    },
    {
      "name": "Rules",
      "description": "Operations related to Rules. A rule is a statement that defines or constrains some aspect of the business.\n"
    }
  ],
  "paths": {
    "/knowledgegraphs/{knowledgeGraphId}/models/{modelId}/concepts": {
      "get": {
        "tags": [
          "Concepts"
        ],
        "summary": "List Concepts",
        "description": "Get concepts saved inside a model.\n",
        "operationId": "getConcepts",
        "parameters": [
          {
            "$ref": "#/components/parameters/page"
          },
          {
            "$ref": "#/components/parameters/pageSize"
          },
          {
            "$ref": "#/components/parameters/knowledgeGraphId"
          },
          {
            "$ref": "#/components/parameters/modelId"
          },
          {
            "$ref": "#/components/parameters/conceptIdQueryParam"
          },
          {
            "$ref": "#/components/parameters/xCredentialUsername"
          },
          {
            "$ref": "#/components/parameters/searchedText"
          },
          {
            "$ref": "#/components/parameters/classTypeId"
          },
          {
            "$ref": "#/components/parameters/ConceptSort"
          },
          {
            "$ref": "#/components/parameters/sortType"
          },
          {
            "$ref": "#/components/parameters/fetchModificationDate"
          },
          {
            "$ref": "#/components/parameters/publicationStatus"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConceptsPage"
                },
                "example": {
                  "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"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        }
      }
    },
    "/knowledgegraphs/{knowledgeGraphId}/models/{modelId}/rules": {
      "get": {
        "operationId": "getRules",
        "tags": [
          "Rules"
        ],
        "summary": "Read Rules",
        "description": "Fetch rules stored inside a model. Endpoint allows for:\n* full text search - searching inside: id, name, sparql rule, rule url, passing test case, violating test case for string passed in `searchedText` field\n* sorting - sorting by allowed values of rules and sorting order (default ascending)\n* filtering - gives option to limit query result by country and criticality\nEach functionality can be combined to create complex usage of this endpoint.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/page"
          },
          {
            "$ref": "#/components/parameters/pageSize"
          },
          {
            "$ref": "#/components/parameters/knowledgeGraphId"
          },
          {
            "$ref": "#/components/parameters/modelId"
          },
          {
            "$ref": "#/components/parameters/xCredentialUsername"
          },
          {
            "$ref": "#/components/parameters/searchedText"
          },
          {
            "$ref": "#/components/parameters/searchedCountry"
          },
          {
            "$ref": "#/components/parameters/searchedCriticality"
          },
          {
            "$ref": "#/components/parameters/searchedStatus"
          },
          {
            "$ref": "#/components/parameters/ruleUrl"
          },
          {
            "$ref": "#/components/parameters/publicationStatus"
          },
          {
            "$ref": "#/components/parameters/RuleSort"
          },
          {
            "$ref": "#/components/parameters/sortType"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RulesPage"
                },
                "example": {
                  "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"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-KEY"
      }
    },
    "parameters": {
      "page": {
        "name": "page",
        "description": "The number of the page to read. Parameter isn't required, by default, set to '0'.\n",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 0,
          "default": 0,
          "example": "0"
        }
      },
      "pageSize": {
        "name": "pageSize",
        "description": "Maximum number of elements on the page to read. Parameter isn't required. Can't be negative, by default, set to `10`.\n",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 0,
          "default": 10,
          "example": "10"
        }
      },
      "releaseSort": {
        "name": "sort",
        "description": "Sorting by release ID(`DESC` or `ASC`).",
        "in": "query",
        "schema": {
          "type": "string",
          "example": "DESC",
          "enum": [
            "DESC",
            "ASC"
          ],
          "x-enumDescriptions": {
            "DESC": "Sort in descending order.",
            "ASC": "Sort in ascending order."
          }
        }
      },
      "KnowledgeGraphSort": {
        "name": "sort",
        "description": "Enables sorting on Knowledge Graph's attributes: * `URL` - sorting by url of knowledge graph. * `DESCRIPTION` - sorting by description of knowledge graph. * `CREATOR` - sorting by creator of knowledge graph. * `CREATED_AT` - sorting by username of creator. * `LAST_MODIFICATION_DATE` - sorting by last modification date. * `LAST_MODIFIER` - sorting by username of last modifier.\n",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "example": "URL"
        }
      },
      "xCredentialUsername": {
        "name": "X-Credential-Username",
        "description": "Username that is passed as header parameter with the name X-Credential-Username.\nThe header can take a form of:\n  * username (e.g. \"johnjoe\")\n  * user id (e.g. \"87b1bdb1-ba87-4522-b363-c5a0e6e917b3\")\n",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string",
          "example": "87b1bdb1-ba87-4522-b363-c5a0e6e917b3"
        }
      },
      "searchedText": {
        "name": "searchedText",
        "description": "Used to filter objects.\n",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "example": "Searched Text"
        }
      },
      "classTypeId": {
        "name": "classTypeId",
        "description": "Used to filter concepts only of a specific type.\n",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "example": "1"
        }
      },
      "searchedCountry": {
        "name": "searchedCountry",
        "description": "Used to filter objects.\n",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "example": "Country"
        }
      },
      "searchedStatus": {
        "name": "searchedStatus",
        "description": "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.\n",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "example": "RELEASED"
        }
      },
      "searchedCriticality": {
        "name": "searchedCriticality",
        "description": "Used to filter objects.\n",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "example": "Criticality"
        }
      },
      "RuleSort": {
        "name": "sort",
        "description": "Enables sorting of rules by attributes.\n",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "example": "NAME",
          "enum": [
            "COUNTRY",
            "CREATED_AT",
            "CREATED_BY",
            "CRITICALITY",
            "LAST_EDITOR",
            "LAST_MODIFICATION",
            "NAME",
            "STATUS"
          ],
          "x-enumDEscriptions": {
            "COUNTRY": "Sort by country scope of rule.",
            "CREATED_AT": "Sort by date and time when rule was created.",
            "CREATED_BY": "Sort by username who created rule.",
            "CRITICALITY": "Sort by criticality of the rule.",
            "LAST_EDITOR": "Sort by username of who is the last editor.",
            "LAST_MODIFICATION": "Sort by the date of the last modification.",
            "NAME": "Sort by name of the rule.",
            "STATUS": "Sort by status of rule."
          }
        }
      },
      "ConceptSort": {
        "name": "sort",
        "description": "Sort concepts.\n",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "example": "NAME",
          "enum": [
            "LAST_EDITOR",
            "LAST_MODIFICATION",
            "NAME",
            "URL"
          ],
          "x-enumDEscriptions": {
            "LAST_EDITOR": "Sort by username of who is the last editor.",
            "LAST_MODIFICATION": "Sort by the date of the last modification.",
            "NAME": "Sort by name of the concept.",
            "URL": "Sort by url of the concept."
          }
        }
      },
      "ConceptValueSort": {
        "name": "sort",
        "in": "query",
        "required": false,
        "description": "Sort concept values.\n",
        "schema": {
          "type": "string",
          "description": "Sort concept values.",
          "example": "VALUE",
          "enum": [
            "URL",
            "VALUE"
          ],
          "x-enumDescriptions": {
            "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)."
          }
        }
      },
      "publicationStatus": {
        "name": "publicationStatus",
        "description": "If enabled, start filtering based on publication status.",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "description": "Publication status.",
          "example": "PUBLISHED",
          "enum": [
            "PUBLISHED",
            "UNPUBLISHED"
          ],
          "x-enumDescriptions": {
            "PUBLISHED": "Published status.",
            "UNPUBLISHED": "Unpublished status."
          }
        }
      },
      "fetchModificationDate": {
        "name": "fetchModificationDate",
        "description": "If enabled modification date will be determined against concept values.\n",
        "in": "query",
        "required": false,
        "schema": {
          "type": "boolean",
          "default": false,
          "example": "false"
        }
      },
      "sortType": {
        "name": "sortType",
        "description": "Allows changing the default sorting order (ASC) to desire by user.\n",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "example": "ASC",
          "enum": [
            "DESC",
            "ASC"
          ],
          "x-enumDescriptions": {
            "DESC": "Sort in descending order.",
            "ASC": "Sort in ascending order."
          },
          "default": "ASC"
        }
      },
      "modelId": {
        "name": "modelId",
        "description": "Used to identify model and objects inside it.",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "example": "1"
        }
      },
      "modelIdQueryParam": {
        "name": "modelId",
        "description": "Used to identify model.",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "example": "1"
        }
      },
      "conceptId": {
        "name": "conceptId",
        "description": "Used to identify concept.",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "example": "1"
        }
      },
      "conceptIdQueryParam": {
        "name": "conceptId",
        "description": "Used to identify concept by passing the ID in the URL link.",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "example": "1"
        }
      },
      "conceptIdList": {
        "name": "conceptIdList",
        "description": "Used to retrieve a list of concepts by their ID's.",
        "in": "query",
        "required": false,
        "schema": {
          "type": "array",
          "description": "List of concept IDs.",
          "items": {
            "type": "integer",
            "description": "Concept ID.",
            "example": "1"
          }
        }
      },
      "valueId": {
        "name": "valueId",
        "description": "Used to identify value (url or literal).",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "example": "1"
        }
      },
      "valueIdQueryParam": {
        "name": "valueId",
        "description": "Used to identify value (url or literal), by passing the ID in URL link.",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "example": "1"
        }
      },
      "knowledgeGraphId": {
        "name": "knowledgeGraphId",
        "description": "Used to identify Knowledge Graph and objects inside it.",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "example": "1"
        }
      },
      "knowledgeGraphIdQueryParam": {
        "name": "knowledgeGraphId",
        "description": "Knowledge Graph ID to search in a database.",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "example": "1"
        }
      },
      "ruleIdList": {
        "name": "ruleIdList",
        "description": "Used to retrieve a list of rules by their id's.",
        "in": "query",
        "required": false,
        "schema": {
          "type": "array",
          "description": "List of rule IDs.",
          "items": {
            "type": "integer",
            "description": "Rule ID.",
            "example": "1"
          }
        }
      },
      "ruleId": {
        "name": "ruleId",
        "description": "Used to identify Rule.",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "example": "1"
        }
      },
      "ruleUrl": {
        "name": "ruleUrl",
        "description": "Used to identify rule by its URL.",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "example": "https://www.cdq.com/rule/isValidEmail"
        }
      },
      "releaseIdQuery": {
        "name": "releaseId",
        "description": "Used to identify release, passed in URL.",
        "in": "query",
        "required": false,
        "schema": {
          "type": "array",
          "description": "List of release IDs.",
          "items": {
            "type": "integer",
            "description": "Release ID.",
            "example": "1"
          }
        }
      },
      "releaseId": {
        "name": "releaseId",
        "description": "Used to identify release.",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "example": "1"
        }
      },
      "editStatus": {
        "name": "editStatus",
        "description": "Filter validationgraph releases by edit status.\n",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "example": "ACTIVE"
        }
      },
      "editId": {
        "name": "editId",
        "description": "Used to identify edit.",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "example": "1"
        }
      },
      "status": {
        "name": "status",
        "description": "Filter knowledge graphs models by status value.\n",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "example": "ACTIVE",
          "enum": [
            "ACTIVE",
            "DEACTIVATED"
          ],
          "x-enumDescriptions": {
            "ACTIVE": "Active status.",
            "DEACTIVATED": "Deactivated status."
          }
        }
      },
      "knowledgeGraphUrl": {
        "name": "knowledgeGraphUrl",
        "description": "Filter knowledge graphs by url.",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "example": "https://www.cdq.com/kg/1"
        }
      },
      "kgFullTextSearch": {
        "name": "fullTextSearch",
        "description": "Full-text search for KG > * `URL` - URL of knowledge graph. * `Description` - Description of knowledge graph. * `Creator` - Creator of knowledge graph.",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "example": "Description"
        }
      },
      "modelFullTextSearch": {
        "name": "modelFullTextSearch",
        "description": "Full-text search for a model > * `Description` - Description of a model. * `Creator` - Creator of a model.",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "example": "Description"
        }
      },
      "modelFeaturesOn": {
        "name": "featuresOn",
        "description": "Additional options for fetching models.",
        "in": "query",
        "schema": {
          "type": "array",
          "description": "List of additional options for fetching models.",
          "items": {
            "type": "string",
            "description": "Additional options for fetching models.",
            "example": "SHOW_PUBLICATION_STATUS",
            "enum": [
              "SHOW_PUBLICATION_STATUS"
            ],
            "x-enumDescriptions": {
              "SHOW_PUBLICATION_STATUS": "Show model release status."
            }
          }
        },
        "required": false
      },
      "jobStatus": {
        "name": "jobStatus",
        "description": "Describes the status of a job.\n",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "example": "FINISHED",
          "enum": [
            "RUNNING",
            "FINISHED",
            "FAILED"
          ],
          "x-enumDescriptions": {
            "RUNNING": "Job is still running.",
            "FINISHED": "Job finished with success.",
            "FAILED": "Job failed or finished with no success."
          }
        }
      },
      "jobTypeFilter": {
        "name": "importType",
        "description": "Parameter used to filter import jobs by type.",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "example": "CSV_IMPORT",
          "enum": [
            "CSV_IMPORT",
            "MODEL_IMPORT",
            "RDF_IMPORT"
          ],
          "x-enumDescriptions": {
            "CSV_IMPORT": "Import a job for CSV file.",
            "MODEL_IMPORT": "Import a job for a model.",
            "RDF_IMPORT": "Import job for an RDF file."
          }
        }
      }
    },
    "schemas": {
      "RulesPage": {
        "type": "object",
        "description": "Represents a number of rules fetched from the service.\n",
        "properties": {
          "pageSize": {
            "type": "integer",
            "description": "Number of rules on the page.",
            "minimum": 0,
            "example": "10"
          },
          "page": {
            "type": "integer",
            "description": "Number of the page.",
            "minimum": 0,
            "example": "10"
          },
          "values": {
            "type": "array",
            "description": "List of rules.",
            "items": {
              "$ref": "#/components/schemas/Rule"
            }
          },
          "total": {
            "type": "integer",
            "description": "Total number of rules.",
            "example": "10"
          }
        },
        "required": [
          "pageSize",
          "page",
          "values",
          "total"
        ]
      },
      "TestcaseResponse": {
        "type": "object",
        "description": "Represents a response to a test case.",
        "properties": {
          "testCaseName": {
            "type": "string",
            "description": "Name of the test case.",
            "example": "Test case 1"
          },
          "status": {
            "type": "string",
            "description": "Status of the test case.",
            "example": "PASSED"
          },
          "sparqlMessage": {
            "type": "string",
            "description": "Message to display when SPARQL query fails.",
            "example": "SPARQL query failed"
          }
        }
      },
      "Rule": {
        "type": "object",
        "description": "Represents a rule fetched from service.",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Rule ID.",
            "example": "1"
          },
          "url": {
            "type": "string",
            "description": "URL of the rule.",
            "example": "https://www.cdq.com/rule/1"
          },
          "name": {
            "type": "string",
            "description": "Name of the rule.",
            "example": "Rule 1"
          },
          "status": {
            "type": "string",
            "description": "Represents the status of a rule.",
            "example": "ARCHIVED",
            "enum": [
              "ARCHIVED",
              "BLOCKED",
              "DEACTIVATED",
              "DRAFT",
              "HYPERCARE",
              "IDEA",
              "IMPLEMENTED",
              "PLANNED",
              "RELEASED",
              "UNDER_REVIEW"
            ],
            "x-enumDescriptions": {
              "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."
            }
          },
          "country": {
            "type": "string",
            "description": "Represents country that rule applies to, valid in ISO-2 format.",
            "example": "DE"
          },
          "criticality": {
            "type": "string",
            "description": "Represents the severity of the rule; based on this property, different actions can be taken when the rule fails.",
            "example": "NO_DEFECT",
            "enum": [
              "NO_DEFECT",
              "INFO",
              "WARNING",
              "ERROR"
            ],
            "x-enumDescriptions": {
              "NO_DEFECT": "No defect.",
              "INFO": "Information.",
              "WARNING": "Warning.",
              "ERROR": "Error."
            }
          },
          "businessRuleType": {
            "type": "string",
            "description": "Type of business rule.",
            "example": "AUTOMATION_RULE",
            "enum": [
              "AUTOMATION_RULE",
              "DATA_QUALITY_RULE"
            ],
            "x-enumDescriptions": {
              "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": {
            "type": "string",
            "description": "SPARQL rule that is used for validation of data.",
            "example": "SELECT * WHERE { ?s ?p ?o }"
          },
          "correctRecord": {
            "type": "string",
            "description": "Test case containing a record that passes the validation against SPARQL rule.",
            "example": "SELECT * WHERE { ?s ?p ?o }"
          },
          "incorrectRecord": {
            "type": "string",
            "description": "Test case containing a record that does not pass the validation against SPARQL rule.",
            "example": "SELECT WHERE { ?s ?p ?"
          },
          "description": {
            "type": "string",
            "description": "Description of the rule.",
            "example": "Rule description"
          },
          "violationMessage": {
            "type": "string",
            "description": "Message to display when rule fails.",
            "example": "Rule failed"
          },
          "createdAt": {
            "$ref": "#/components/schemas/CreatedAt"
          },
          "createdBy": {
            "$ref": "#/components/schemas/CreatedBy"
          },
          "lastModifier": {
            "$ref": "#/components/schemas/UserId"
          },
          "lastModificationDate": {
            "$ref": "#/components/schemas/ModifiedAt"
          },
          "publicationStatus": {
            "type": "string",
            "description": "Publication status of the rule.",
            "example": "PUBLISHED",
            "enum": [
              "PUBLISHED",
              "UNPUBLISHED"
            ],
            "x-enumDescriptions": {
              "PUBLISHED": "Published status.",
              "UNPUBLISHED": "Unpublished status."
            }
          },
          "category": {
            "type": "string",
            "description": "Category of the rule.",
            "example": "Category"
          }
        },
        "required": [
          "id",
          "url",
          "name",
          "status",
          "sparql",
          "correctRecord",
          "incorrectRecord",
          "createdAt",
          "createdBy",
          "lastModifier",
          "lastModificationDate",
          "businessRuleType"
        ]
      },
      "RuleCriticalityEnum": {
        "type": "string",
        "description": "Criticality enum.",
        "example": "NO_DEFECT",
        "enum": [
          "NO_DEFECT",
          "INFO",
          "WARNING",
          "ERROR"
        ],
        "x-enumDescriptions": {
          "NO_DEFECT": "No defect",
          "INFO": "Information",
          "WARNING": "Warning",
          "ERROR": "Error"
        }
      },
      "RuleStatusEnum": {
        "type": "string",
        "description": "Rule status enum.",
        "example": "ARCHIVED",
        "enum": [
          "ARCHIVED",
          "BLOCKED",
          "DEACTIVATED",
          "DRAFT",
          "HYPERCARE",
          "IDEA",
          "IMPLEMENTED",
          "PLANNED",
          "RELEASED",
          "UNDER_REVIEW"
        ],
        "x-enumDescriptions": {
          "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 by during release because of failed testing or quality gate check",
          "DRAFT": "Rule is in draft state",
          "HYPERCARE": "Active rule after transitioning from `PLANNED` or `DEACTIVATED` status",
          "IDEA": "Rule is an idea",
          "IMPLEMENTED": "Rule is implemented but not released yet",
          "PLANNED": "The Rule is ready to be published",
          "RELEASED": "Rule is activated to use to validate data",
          "UNDER_REVIEW": "Rule is waiting for review to be done"
        }
      },
      "ModelClassResult": {
        "type": "object",
        "description": "Represents concept id and class.",
        "properties": {
          "id": {
            "type": "integer",
            "description": "ID of the concept.",
            "example": "1"
          },
          "modelClass": {
            "type": "string",
            "description": "Class of the concept.",
            "example": "https://www.cdq.com/knowledgeGraph/Configuration_parameter"
          }
        }
      },
      "KnowledgeGraph": {
        "type": "object",
        "description": "Knowledge Graph.",
        "properties": {
          "id": {
            "type": "integer",
            "description": "ID of the Knowledge Graph.",
            "example": "1"
          },
          "url": {
            "type": "string",
            "description": "Base URL.",
            "example": "https://example.com"
          },
          "description": {
            "type": "string",
            "description": "Description of the Knowledge Graph.",
            "example": "Knowledge Graph"
          },
          "creator": {
            "$ref": "#/components/schemas/UserId"
          },
          "creationDate": {
            "$ref": "#/components/schemas/CreatedAt"
          },
          "modificationDate": {
            "$ref": "#/components/schemas/ModifiedAt"
          },
          "status": {
            "type": "string",
            "description": "Status of the Knowledge Graph.",
            "example": "ACTIVE",
            "enum": [
              "ACTIVE",
              "DEACTIVATED"
            ],
            "x-enumDescriptions": {
              "ACTIVE": "Knowledge Graph is active.",
              "DEACTIVATED": "Knowledge Graph is deactivated."
            }
          }
        },
        "required": [
          "id",
          "url",
          "description",
          "creator",
          "status"
        ]
      },
      "ModelPublicationStatus": {
        "type": "string",
        "description": "Describes model published status.",
        "example": "CREATED",
        "enum": [
          "CREATED",
          "PUBLISHED",
          "UNPUBLISHED",
          "PUBLISHING_IN_PROGRESS",
          "PUBLISHED_HAS_UNPUBLISHED_CHANGES",
          "PUBLISHING_PROCESS_HAS_FAILED",
          "UNKNOWN"
        ],
        "x-enumDescriptions": {
          "CREATED": "The model is created and initialized in Knowledge Graph browser but not published.",
          "PUBLISHED": "The model is published and does not contain any unreleased changes.",
          "UNPUBLISHED": "The model is created in Knowledge Graph browser but not published.",
          "PUBLISHING_IN_PROGRESS": "The model is being published at the moment.",
          "PUBLISHED_HAS_UNPUBLISHED_CHANGES": "The model is published but contains unpublished changes.",
          "PUBLISHING_PROCESS_HAS_FAILED": "Can't compute model release status.",
          "UNKNOWN": "Unknown status."
        }
      },
      "ModelClearStatus": {
        "type": "string",
        "description": "Describes clear model status.",
        "example": "SUCCESS",
        "enum": [
          "SUCCESS",
          "FAILED"
        ],
        "x-enumDescriptions": {
          "SUCCESS": "The model has been cleared to created state successfully.",
          "FAILED": "Could not clear model to create state successfully."
        }
      },
      "Model": {
        "type": "object",
        "description": "Knowledge Graph Data Model.",
        "properties": {
          "id": {
            "type": "integer",
            "description": "ID of the model.",
            "example": "1"
          },
          "knowledgeGraphId": {
            "type": "integer",
            "description": "ID of the Knowledge Graph.",
            "example": "1"
          },
          "description": {
            "type": "string",
            "description": "Description of the model.",
            "example": "Model"
          },
          "creator": {
            "$ref": "#/components/schemas/UserId"
          },
          "status": {
            "type": "string",
            "description": "Status of the model.",
            "example": "ACTIVE",
            "enum": [
              "ACTIVE",
              "DEACTIVATED",
              "PENDING"
            ],
            "x-enumDescriptions": {
              "ACTIVE": "The model is active.",
              "DEACTIVATED": "The model is deactivated.",
              "PENDING": "The model is pending."
            }
          },
          "publicationStatus": {
            "$ref": "#/components/schemas/ModelPublicationStatus"
          },
          "creationDate": {
            "$ref": "#/components/schemas/CreatedAt"
          },
          "modificationDate": {
            "$ref": "#/components/schemas/ModifiedAt"
          },
          "modelConfigProperties": {
            "type": "array",
            "description": "List of model configuration properties.",
            "items": {
              "$ref": "#/components/schemas/ModelConfigProperties"
            }
          }
        },
        "required": [
          "id",
          "url",
          "description",
          "creator",
          "status",
          "creationDate",
          "modificationDate"
        ]
      },
      "ModelConfigProperties": {
        "type": "object",
        "description": "Represents a configuration of a model. \nSupported properties:\n* `BASEURL` - default value: url of Knowledge Graph that created model belongs to\n* `CDQ_BASEURL` - constant value, points to CDQ's meta wiki, default value: https://meta.cdq.com\n* `EXTERNAL_ID_SELECTOR` - field used for extracting external ID out of records, default value: /recordId\n* `EXTERNAL_ID_TAG` - tag for records external ID, should be the same as `EXTERNAL_ID_SELECTOR` with no '/' at the beginning, default value: recordId\n* `KNOWLEDGE_GRAPH_LABEL` - label of Knowledge Graph, generated at time of dataset creation, default value: kg_`knowledgeGraphId`_m_`modelId`\n* `ROOT_PREFIX` - prefix used to recognize records, default value: Record\n* `VALIDATION_GRAPH` - name of validation graph that records will be validated against to, default value: empty\n",
        "properties": {
          "key": {
            "type": "string",
            "description": "Key of the property.",
            "example": "BASEURL",
            "enum": [
              "BASEURL",
              "CDQ_BASEURL",
              "EXTERNAL_ID_SELECTOR",
              "EXTERNAL_ID_TAG",
              "KNOWLEDGE_GRAPH_LABEL",
              "ROOT_PREFIX",
              "VALIDATION_GRAPH"
            ],
            "x-enumDescriptions": {
              "BASEURL": "URL of Knowledge Graph that created model belongs to.",
              "CDQ_BASEURL": "Constant value, points to CDQ's meta wiki.",
              "EXTERNAL_ID_SELECTOR": "Field used for extracting external ID out of records.",
              "EXTERNAL_ID_TAG": "Tag for records external ID.",
              "KNOWLEDGE_GRAPH_LABEL": "Label of Knowledge Graph.",
              "ROOT_PREFIX": "Prefix used to recognize records.",
              "VALIDATION_GRAPH": "Name of validation graph that records will be validated against to."
            }
          },
          "value": {
            "type": "string",
            "description": "Value of the property.",
            "example": "https://meta.cdq.com"
          }
        }
      },
      "ConceptsPage": {
        "type": "object",
        "description": "Represents a number of concepts fetched from the service.\n",
        "properties": {
          "pageSize": {
            "$ref": "#/components/schemas/PageSize"
          },
          "page": {
            "$ref": "#/components/schemas/Page"
          },
          "values": {
            "type": "array",
            "description": "List of concepts.",
            "items": {
              "$ref": "#/components/schemas/Concept"
            }
          },
          "total": {
            "$ref": "#/components/schemas/PageTotal"
          }
        },
        "required": [
          "pageSize",
          "page",
          "values",
          "total"
        ]
      },
      "Concept": {
        "type": "object",
        "description": "The Concept is a part of the CDQ data model. For example, `Address` is a concept of the `Business Partner` and \nhave many subconcepts as `Locality`, `Thoroughfare`, `Administrative Area` etc.\n",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the concept.",
            "example": "1"
          },
          "url": {
            "$ref": "#/components/schemas/ConceptUrl"
          },
          "lastModifier": {
            "type": "string",
            "description": "Username of the last modifier.",
            "example": "user"
          },
          "lastModificationDate": {
            "type": "string",
            "description": "Date of the last modification.",
            "example": "2026-03-13T12:23:00Z"
          },
          "publicationStatus": {
            "type": "string",
            "description": "Publication status of the concept.",
            "example": "PUBLISHED"
          }
        },
        "required": [
          "id",
          "url"
        ]
      },
      "ConceptProperties": {
        "type": "object",
        "description": "Represents a property of the concept.\n",
        "properties": {
          "propertyConcept": {
            "$ref": "#/components/schemas/ConceptParam"
          },
          "value": {
            "$ref": "#/components/schemas/ValueObject"
          }
        },
        "required": [
          "propertyConcept",
          "value"
        ]
      },
      "Value": {
        "type": "object",
        "description": "Represents a value fetched from service.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the value.",
            "example": "1"
          },
          "subjectConcept": {
            "$ref": "#/components/schemas/Concept"
          },
          "propertyConcept": {
            "$ref": "#/components/schemas/Concept"
          },
          "object": {
            "$ref": "#/components/schemas/ValueObject"
          }
        },
        "required": [
          "id",
          "subjectConcept",
          "propertyConcept",
          "object"
        ]
      },
      "LiteralValue": {
        "type": "object",
        "description": "Represents the value of an RDF literal with its optional datatype and language specifications.",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier of the literal value.",
            "example": "1"
          },
          "literal": {
            "type": "string",
            "description": "Value of the literal.",
            "example": "Berlin"
          },
          "datatypeUrl": {
            "type": "string",
            "description": "URL of the literal's datatype.",
            "example": "http://www.w3.org/2001/XMLSchema#string"
          },
          "lang": {
            "type": "string",
            "description": "Language of the literal.",
            "example": "en"
          },
          "creator": {
            "$ref": "#/components/schemas/UserId"
          },
          "creationDate": {
            "$ref": "#/components/schemas/CreatedAt"
          },
          "deletionDate": {
            "$ref": "#/components/schemas/DeletedAt"
          },
          "unmodifiable": {
            "type": "boolean",
            "description": "Indicates if the literal value is unmodifiable. If true, the literal value is unmodifiable.\n",
            "example": "true"
          }
        }
      },
      "ConceptParam": {
        "type": "object",
        "description": "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.",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier of the concept.",
            "example": "1"
          },
          "url": {
            "$ref": "#/components/schemas/ConceptUrl"
          },
          "creator": {
            "$ref": "#/components/schemas/UserId"
          },
          "creationDate": {
            "$ref": "#/components/schemas/CreatedAt"
          },
          "deletionDate": {
            "$ref": "#/components/schemas/DeletedAt"
          },
          "unmodifiable": {
            "type": "boolean",
            "description": "Indicates if the concept is unmodifiable. If true, the concept is unmodifiable.\n",
            "example": true
          }
        }
      },
      "ConceptsIdList": {
        "type": "array",
        "description": "List of concept (or rule) IDs.",
        "items": {
          "type": "integer",
          "description": "Concept or rule IDs",
          "example": "1"
        }
      },
      "Release": {
        "type": "object",
        "description": "Represents a release.",
        "properties": {
          "releaseId": {
            "type": "integer",
            "description": "Release unique ID.",
            "example": "1"
          },
          "releaseJobId": {
            "type": "string",
            "description": "Release job UUID.",
            "example": "1"
          },
          "status": {
            "type": "string",
            "description": "Release status.",
            "example": "RUNNING",
            "enum": [
              "RUNNING",
              "FINISHED",
              "FAILED"
            ],
            "x-enumDescriptions": {
              "RUNNING": "The release is still running.",
              "FINISHED": "The release finished with success.",
              "FAILED": "The release failed or finished with no success."
            }
          },
          "outputFile": {
            "type": "string",
            "description": "S3 path to a file containing data associated with this release (TTL file with in case of Validation Graph release).",
            "example": "s3://cdq-data/1.ttl"
          },
          "releasedFile": {
            "type": "string",
            "description": "Shows the released file - might be null if the status is not FINISHED or FAILED.",
            "example": "knowledgegraphs/customPathToFolderOnS3/userName-2022-04-14T09-04-01.082706266.ttl.gz"
          },
          "startDate": {
            "type": "string",
            "description": "Release start date in ISO-8601 format.",
            "example": "2026-03-13T12:23:00Z"
          },
          "endDate": {
            "type": "string",
            "description": "Release end date in ISO-8601 format.",
            "example": "2026-03-13T12:23:00Z"
          },
          "user": {
            "type": "string",
            "description": "User who submitted the release.",
            "example": "user"
          },
          "description": {
            "type": "string",
            "description": "Release description.",
            "example": "Release of the validation graph."
          },
          "logMessage": {
            "type": "string",
            "description": "Optional system message (for example error log).",
            "example": "Error message"
          }
        },
        "required": [
          "releaseId",
          "releaseJobId",
          "status",
          "user"
        ]
      },
      "RulesReleaseDetails": {
        "type": "object",
        "description": "Represents a rule fetched from the service.",
        "properties": {
          "ruleId": {
            "type": "integer",
            "description": "Rule unique ID.",
            "example": "1"
          },
          "ruleUrl": {
            "type": "string",
            "description": "Rule URL.",
            "example": "https://www.cdq.com/rule/1"
          },
          "ruleStatus": {
            "type": "string",
            "description": "Rule status.",
            "example": "RELEASED"
          },
          "isCurrentStatus": {
            "type": "boolean",
            "description": "Indicates if the rule is in the current status.",
            "example": "true"
          },
          "currentStatus": {
            "type": "string",
            "description": "Current status of the rule.",
            "example": "RELEASED",
            "enum": [
              "ARCHIVED",
              "BLOCKED",
              "DEACTIVATED",
              "DRAFT",
              "HYPERCARE",
              "IDEA",
              "IMPLEMENTED",
              "PLANNED",
              "RELEASED",
              "UNDER_REVIEW"
            ],
            "x-enumDescriptions": {
              "ARCHIVED": "The rule is marked as obsolete, no longer in use.",
              "BLOCKED": "The rule is marked as blocked, no longer in use.",
              "DEACTIVATED": "The rule has been manually or automatically deactivated during release.",
              "DRAFT": "The rule is in draft state.",
              "HYPERCARE": "The 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 done."
            }
          }
        },
        "required": [
          "releaseId",
          "ruleId",
          "ruleUrl",
          "ruleStatus",
          "currentStatus",
          "isCurrentStatus"
        ]
      },
      "ImportJob": {
        "type": "object",
        "description": "Import job.",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Import job id.",
            "example": "1"
          },
          "editId": {
            "type": "integer",
            "description": "Edit id.",
            "example": "1"
          },
          "startDate": {
            "type": "string",
            "description": "Start date.",
            "example": "2026-03-13T12:23:00Z"
          },
          "endDate": {
            "type": "string",
            "description": "End date.",
            "example": "2026-03-13T12:23:00Z"
          },
          "user": {
            "$ref": "#/components/schemas/UserId"
          },
          "status": {
            "type": "string",
            "description": "Import job status.",
            "example": "RUNNING"
          },
          "inputFile": {
            "type": "string",
            "description": "Input file.",
            "example": "file.csv"
          },
          "jobUuid": {
            "$ref": "#/components/schemas/JobId"
          },
          "type": {
            "type": "string",
            "description": "Import a job type.",
            "example": "CSV_IMPORT"
          }
        }
      },
      "SubmittedImport": {
        "type": "object",
        "description": "Submitted import.",
        "properties": {
          "importId": {
            "type": "integer",
            "description": "Import id in a given model.",
            "example": "1"
          },
          "importJobId": {
            "type": "string",
            "description": "Import job UUID.",
            "example": "1"
          },
          "importMode": {
            "$ref": "#/components/schemas/ImportMode"
          },
          "separatorType": {
            "$ref": "#/components/schemas/SeparatorType"
          }
        },
        "required": [
          "importId",
          "importJobId",
          "importMode",
          "separatorType"
        ]
      },
      "ImportMode": {
        "type": "string",
        "description": "Import mode.",
        "example": "MERGE",
        "default": "MERGE",
        "enum": [
          "MERGE",
          "REPLACE"
        ],
        "x-enumDescriptions": {
          "MERGE": "Merge.",
          "REPLACE": "Replace."
        }
      },
      "SeparatorType": {
        "type": "string",
        "description": "Separator type.",
        "example": "COMMA",
        "enum": [
          "COMMA",
          "SEMICOLON"
        ],
        "default": "COMMA",
        "x-enumDescriptions": {
          "COMMA": "Comma",
          "SEMICOLON": "Semicolon"
        }
      },
      "ValueObject": {
        "type": "object",
        "description": "Represents value of: \n* an RDF object property (value refers to another concept by its URL)\n* an RDF data property/literal value\n",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier of the concept.",
            "example": "1"
          },
          "url": {
            "$ref": "#/components/schemas/ConceptUrl"
          },
          "creator": {
            "$ref": "#/components/schemas/UserId"
          },
          "creationDate": {
            "$ref": "#/components/schemas/CreatedAt"
          },
          "deletionDate": {
            "$ref": "#/components/schemas/DeletedAt"
          },
          "unmodifiable": {
            "type": "boolean",
            "description": "Indicates if the concept is unmodifiable. If true, the concept is unmodifiable.\n",
            "example": true
          },
          "literal": {
            "type": "string",
            "description": "Value of the literal.",
            "example": "Berlin"
          },
          "datatypeUrl": {
            "type": "string",
            "description": "URL of the literal's datatype.",
            "example": "http://www.w3.org/2001/XMLSchema#string"
          },
          "lang": {
            "type": "string",
            "description": "Language of the literal.",
            "example": "en"
          }
        }
      },
      "ConceptValue": {
        "type": "object",
        "description": "Represents a property with values assigned to it.",
        "properties": {
          "propertyConcept": {
            "$ref": "#/components/schemas/ConceptParam"
          },
          "urlPropertyValues": {
            "$ref": "#/components/schemas/UrlPropertyValue"
          },
          "literalPropertyValues": {
            "$ref": "#/components/schemas/LiteralPropertyValue"
          }
        }
      },
      "UrlPropertyValue": {
        "type": "object",
        "description": "List of url values assigned to property.",
        "properties": {
          "value": {
            "type": "array",
            "description": "List of URL values assigned to property.",
            "items": {
              "$ref": "#/components/schemas/ConceptParam"
            }
          }
        }
      },
      "LiteralPropertyValue": {
        "type": "object",
        "description": "List of literal values assigned to property.",
        "properties": {
          "value": {
            "type": "array",
            "description": "List of literal values assigned to property.",
            "items": {
              "$ref": "#/components/schemas/LiteralValue"
            }
          }
        }
      },
      "PageTotal": {
        "description": "Total number of items which can be paged.",
        "example": "67",
        "type": "integer"
      },
      "UserId": {
        "type": "string",
        "description": "Unique ID of a user.",
        "example": "johndoe"
      },
      "CreatedAt": {
        "type": "string",
        "description": "Date of creation (ISO 8601-compliant).",
        "example": "2026-03-13T12:23:00Z"
      },
      "ModifiedAt": {
        "type": "string",
        "description": "Date of modification (ISO 8601-compliant).",
        "example": "2026-03-13T12:23:00Z"
      },
      "Page": {
        "type": "integer",
        "description": "Current page number.",
        "example": "1",
        "default": 0,
        "minimum": 0
      },
      "PageSize": {
        "type": "integer",
        "description": "Number of items per page.",
        "example": "100",
        "default": 10,
        "minimum": 1,
        "maximum": 1000
      },
      "ConceptUrl": {
        "type": "string",
        "description": "URL to the documentation which summarizes all details of the Business Partner [Concepts](https://meta.cdq.com/Business_partner).",
        "example": "https://meta.cdq.com/Business_partner"
      },
      "DeletedAt": {
        "type": "string",
        "description": "Date of deletion (ISO 8601-compliant).",
        "example": "2026-03-13T12:23:00Z"
      },
      "CreatedBy": {
        "type": "string",
        "description": "Creator of a resource.",
        "example": "76248934691294444"
      },
      "JobId": {
        "type": "string",
        "description": "Unique identifier of a job.",
        "example": "35f23c03-1c22-45fe-9484-3ffe769325de"
      },
      "ApiErrorTimestamp": {
        "type": "string",
        "deprecated": true,
        "description": "ISO 8601 representation of the timestamp.",
        "example": "2026-03-13T12:23:00Z"
      },
      "ApiErrorMessage": {
        "type": "string",
        "deprecated": true,
        "description": "Details about the error.",
        "example": "This user is not allowed to access this service."
      },
      "HttpError": {
        "type": "string",
        "description": "RFC 7231 error which belongs to the status code.",
        "example": "BAD_REQUEST",
        "deprecated": true
      },
      "HttpPath": {
        "type": "string",
        "description": "Requested path which caused this error.",
        "example": "/v2/businesspartners/lookup"
      },
      "HttpStatus": {
        "type": "integer",
        "description": "RFC 7231 status code for this error.",
        "example": "400",
        "deprecated": true
      }
    }
  }
}