Address is inactive (France)

From CDQ
Jump to navigation Jump to search
Description Informal and comprehensive human-readable definition of a concept. The rule checks whether a given registered company address (establishment) is known to be inactive by means of the French business register (SIREN). The rule searches the register by a given SIRET number and evaluates whether the status of the record found with the SIRET is different from active.
Violation message Information for a human user about a violated business rule. The message should provide a brief but comprehensive text about what is wrong with a defective business partner or address data record, e.g. to be shown in a data entry form that checks for data quality. Address is inactive
Example A simple example supporting the understanding of a concept, business rule, etc. Sorry no example available yet
Status Specifies a release status of a concept, e.g. a data quality rule. The following status levels are defined:<br/><code>IDEA</code>: Informal description of the concept that is to be further detailed.<br/><code>DRAFT</code>: Completely defined concept that is not yet released and still under construction.<br/><code>UNDER REVIEW</code>: Completely defined concept which is "freezed" (i.e. not editable, only comments are allowed) and reviewed by a dedicated Business Rules Steward.<br/><code>PLANNED</code>: The concept is scheduled to be released at a given date.<br/><code>HYPERCARE</code>: The concept is used for data quality rules. A rule is set into hypercare status before it is released. This means the rule was successfully tested and then remains in hypercare state for checking the behaviour in a large number of real world validation requests. <br/><code>RELEASED</code>: The concept is used in stable services.<br/><code>DEACTIVATED</code>: The concept is disabled but may be re-activated in the future.<br/><code>ARCHIVED</code>: The concept is disabled because it is no longer relevant from a business perspective. It is only kept for history purposes.<br/><code>BLOCKED</code>: Implementation or use of the concept not possible due to dependent requirements that are not satisfied.<br/> ARCHIVED, Release date Date and time when a concept, e.g. a data quality rule, is released, i.e. when the status changes to <code>RELEASED</code>.: 01/01/2020, SPARQL Whether or not the technical representation of a data quality rule, i.e. the SPARQL constraint, is implemented, or not.: IMPLEMENTED
Creation / Last edit 16 January 2020 12:25:15 / 14 December 2020 10:15:19
Technical key Defines a unique key by which e.g. data model concepts can be referenced in a technical integration context. These keys are unique in the CDL context.
Country scope Defines a address/country a given concept is used in (or valid in, or relevant for etc.), i.e. the country-specific scope of a concept. FR (Frankreich, France, France, 法国)
Data quality Data quality dimension which is ensured by the data quality rule. For each rule, multiple dimensions can be assigned. The following data quality dimensions are considered in the Corporate Data League:</br>* Accuracy: Input forms contain a lot of mandatory fields where dummy values (i.e. NULL values) have to be entered due to a lack of knowledge about the effects. The available data elements are inadequate for distinguishing between two data objects without any doubt (duplicates). Different systems deliver different data elements for a specific set of facts (inconsistency).</br>* Completeness: The available data elements are inadequate for completing a specific work step. It is not possible to obtain the missing data through other sources (e.g. telephone, other software). Data elements are missing.</br>* Representational consistency: No uniform data format, e.g. of address data in different applications. This can lead to misunderstandings or technical problems with data exchange. Different systems access different databases and provide different representations of data elements in the same context. In some cases, data elements have not been entered in the envisaged input fields and are therefore shown in the wrong place.</br>* Timeliness: Data elements are outdated despite the fact that more current data elements are available or have actually been entered. Reworking or storing data elements takes so long that the impression arises that the input has not yet taken place. For that reason, data is entered several times (possible cause of duplicates).</br> n/a
Feature Specifies which data quality product feature is using this concept n/a
Rule category Categorization of data quality rules according to their focus. Address inactive
Criticality Specifies how critical of the violation of a data quality rule. The following levels are defined:<br/><code>ERROR</code>: The violation (e.g. missing information) puts a CDL process at risk or hinders regular processing of data.<br/><code>WARNING</code>: The violation does not hinder regular processing of data but represents semantically defective data.<br/><code>INFO</code>: The business rule has not uncovered a data defect, but some information is available that might be interesting for the user.<br/> INFO
Primary source The most trusted data source that is first queried for validating a piece of information such as tax identifiers n/a
Secondary source(s) The alternative trusted data source(s) that are queried if the primary source is not accessible or when something else went wrong with querying the primary source n/a
Manages identifier(s) Defines whether there are any identifiers issued or managed by this data source
Concept(s) Specifies concepts which are controlled by a data quality rule or another schema or constraint. Business Partner Status (CDQ.POOL)
Testing Test case Whether or not test cases for a data quality rule are <code>COMPLETE</code> or <code>INCOMPLETE</code>.: COMPLETE Test status Documents whether the test was successful or not.<br/><code>VERIFIED</code>: Test successfully executed.<br/><code>FAILED</code>: Testing did not return the expected results.<br/><code>UNKNOWN</code>: No information on test status.: FAILED

Implementation


SPARQL rule

SELECT ?recordId 
  ?errorCode 
  ?content
  ?contentSelector
  ?contentSelectorUrl 
  ?parentConceptId 
  ?parentConceptIdSelector 
  ?parentConceptUrl 
WHERE
{
    ?businessPartner <http://meta.cdq.com/Property-3AHas_record_id> ?record_id ;
        a <http://meta.cdq.com/BusinessPartner> .

?businessPartner <http://meta.cdq.com/Property-3ABusinessPartner/identifiers> ?identifier .

?businessPartner <http://meta.cdq.com/Property-3ABusinessPartner/addresses> ?address.
OPTIONAL { ?address <http://meta.cdq.com/Property-3ABusinessPartner/addresses/addressId> ?addrId . }
?address <http://meta.cdq.com/Property-3ABusinessPartner/addresses/country> ?country .





    <http://meta.cdq.com/> <http://meta.cdq.com/Property-3AHas_technical_key> ?identifierTechnicalKey.
OPTIONAL {
   ?identifier <http://meta.cdq.com/Property-3ABusinessPartner/identifiers/type> ?identifierType;
      <http://meta.cdq.com/Property-3ABusinessPartner/identifiers/value> ?identifierValue .
   ?identifierType <http://meta.cdq.com/Property-3ABusinessPartner/identifiers/type/technicalKey> ?identifierTechnicalKey .
}



FILTER(BOUND(?identifierValue) && str(?identifierValue) != "" && BOUND(?identifierTechnicalKey) && str(?identifierTechnicalKey) != "")
  
    BIND (<java:cdq.cdl.validation.functions.CompanyStatus>(?identifierValue, ?identifierTechnicalKey, "", "FR") AS ?validationResult) .
    FILTER (?validationResult = "Inactive") .





  BIND(?record_id AS ?recordId)
  BIND ("200" AS ?errorCode)

  BIND ("" AS  ?parentConceptId)
  BIND ("businessPartner.id" AS ?parentConceptIdSelector)
  BIND ("https://meta.cdq.com/Business_partner" AS ?parentConceptUrl)

  BIND ("" AS  ?content)
  BIND ("businessPartner" AS  ?contentSelector)
  BIND ("https://meta.cdq.com/Business_partner" AS  ?contentSelectorUrl)
}


}


Test cases

Status

Test status Documents whether the test was successful or not.<br/><code>VERIFIED</code>: Test successfully executed.<br/><code>FAILED</code>: Testing did not return the expected results.<br/><code>UNKNOWN</code>: No information on test status. FAILED
Test message Some message provided by the test, e.g. reasons for failing Rule has not pass testing stage.
Last test date The date when the last time an automated test was executed for this rule 14-04-2020
Runtime How long did the queries last in average 1 ms

Correct record 

{
   "businessPartner": {
       "names": [
           {
               "value": "PHYTEUROP"
           }
       ],
       "identifiers": [
           {
               "value": "66658035200050",
               "type": {
                   "technicalKey": "FR_SIRET"
               }
           }
       ],
       "addresses": [
           {
               "country": {
                   "shortName": "FR",
                   "value": "France"
               }
           }
       ]
   }
}

Invalid record 

{
   "businessPartner": {
       "names": [
           {
               "value": "SNC LEHMAN BROTHERS SERVICES"
           }
       ],
       "identifiers": [
           {
               "value": "34376315700017",
               "type": {
                   "technicalKey": "FR_SIRET"
               }
           }
       ],
       "addresses": [
           {
               "country": {
                   "shortName": "FR",
                   "value": "France"
               }
           }
       ]
   }
}

Additional test cases


Supporting document

no supporting document available