Skip to content

Quality documentation

Riccardo Albertoni edited this page Nov 24, 2018 · 12 revisions

This page is for proposals related to the milestone Description of quality in DCAT. The relevent issues are listed here.

Introducing the DQV

The Data Quality Vocabulary (DQV) is defined as a W3C Working Group Note and it offers common modelling patterns for different aspects of Data Quality.

For those who are not familiar with DQV, the DQV can relate any items with different types of quality statements including

  • dqv:QualityAnnotation, which represents feedback and quality certificates given about the dataset or its distribution.
  • dcterms:Standard, which represents a standard to which the dataset or its distribution conforms.
  • dqv:QualityPolicy, which represents a policy or agreement that is chiefly governed by data quality concerns.
  • dqv:QualityMeasurement, which represents a metric value providing quantitative or qualitative information about the dataset or distribution.

Each type of quality statement can be related to one or more quality dimensions, namely, quality characteristics relevant to the consumer. The practice to see the quality as a multi-dimensional space is consolidated in the field of quality management, it is a sort of pattern which helps in splitting the quality management into addressable chunks. DQV does not define a normative list of quality dimensions. Starting from use cases included in the DWBP Use Cases & Requirements document, DQV offers the quality dimensions proposed in ISO 25012 and Zaveri et al. as two possible starting points. It also provides an RDF representation for the quality dimensions and categories defined in the latter. Ultimately, implementers will need to choose themselves the collection of quality dimensions that best fits their needs.

Providing a hook for quality information (issue #57)

The group selected the proposal 1 as arranged in the DCAT document, see Section Providing quality information

Proposal 1: To reuse DQV for describing the quality-related information of DCAT Datasets and Distributions.

The properties dqv:hasQualityAnnotation and dqv:hasQualityMeasurement can connect DCAT dataset/distribution to dqv:QualityAnnotation and dqv:QualityMeasurement. dcterms:Standard, and dqv:QualityPolicy can be considered as well.

Example 1:

(The following excerpts readapt some examples included in DQV Note)

Considering (i) a dataset :busStopInGenoa, which provides an incomplete georeferenced list of bus stops in Genoa; (ii) the quality dimension ldqd:completeness, which refers to "the degree to which all required information is present in a particular dataset"; we can provide information about the completeness of the dataset :busStopInGenoa by the quality annotation :qualityNote included in the following excerpt.

:busStopInGenoa a dcat:Dataset ;
    dqv:hasQualityAnnotation :qualityNote .

:qualityNote  
    a dqv:UserQualityFeedback ;
    oa:hasTarget :busStopInGenoa ;
    oa:hasBody :textBody ;
    oa:motivatedBy dqv:qualityAssessment ;
    dqv:inDimension ldqd:completeness
.

:textBody a oa:TextualBody ;
    rdf:value "This dataset is incomplete, it contains only 20500 out of 30000 existing bus stops" ;
    dc:language "en" ; 
    dc:format "text/plain" 
    . 

The following :myMeasurement quality measurement for the :completenessWRTExpectedNumberOfEntities metric provides the same quality information.

:busStopInGenoa
    dqv:hasQualityMeasurement :myMeasurement .

:myMeasurement
    a dqv:QualityMeasurement ;
    dqv:computedOn :busStopInGenoa ;
    dqv:isMeasurementOf :completenessWRTExpectedNumberOfEntities ;
    dqv:value "0.6833333"^^xsd:decimal  ;
    prov:wasAttributedTo :myQualityChecker ;
    prov:generatedAtTime "2018-05-27T02:52:02Z"^^xsd:dateTime ;
    prov:wasGeneratedBy :myQualityChecking   
    .

:completenessWRTExpectedNumberOfEntities 
    a dqv:Metric ;
    skos:definition " it returns the degree of completeness as ratio between the actual number of entities included in the dataset and the declared expected number of entities."@en ;
    dqv:expectedDataType xsd:decimal ;
    dqv:inDimension ldqd:completeness .

# :myQualityChecker is a service computing some quality metrics 
:myQualityChecker
    a prov:SoftwareAgent ;   
    rdfs:label "A quality assessment service"^^xsd:string .
    # Further details about quality service/software can be provided, for example,
    # deploying  vocabularies such as Dataset Usage Vocabulary (DUV), Dublin Core or ADMS.SW

# :myQualityChecking is the activity that has generated :myMeasurement from :myDatasetDistribution
:myQualityChecking
    a prov:Activity;
    rdfs:label "The checking of myDatasetDistribution's quality"^^xsd:string;
    prov:wasAssociatedWith :myQualityChecker;
    prov:used              :busStopInGenoa;
    prov:generated         :myMeasurement;
    prov:endedAtTime      "2018-05-27T02:52:02Z"^^xsd:dateTime;
    prov:startedAtTime     "2018-05-27T00:52:02Z"^^xsd:dateTime .

Proposal 2: To define new properties for DCAT building upon the DQV

If we want to provide a more specific semantics than in Proposal 1, we might consider specialising dqv:hasQualityMeasurement and dqv:hasQualityAnnotation. For example, we might consider the extension illustrated in the following figure. property hierarchy

This might have sense if we want assuming some sorts of domain restriction for dcat:hasQualityDescription, for example, restricting the property domain to dcat:CatalogItem or an equivalent union of dcat:Dataset, dcat:Distribution, dcat:Catalog and dcat:Service,

Data quality conformance test results (part of issue #58)

This subsection introduces a list of W3C based examples to consider and mix-up in order to help in the discussion of the following intertwined sub-requirements:

  • the degree a dataset conforms to a stated quality standard;
  • details of data quality conformance test results.

W3C-based examples of solution are:

  1. The use of PROV qualified association to specify the conformance test results ;
  2. The use of PROV and Evaluation and Report Language (EARL) 1.0 Schema, W3C Working Group Note 2 February 2017 to state conformance test results;
  3. The use of DQV and PROV to specify compliance metric and the conformance test results.

Example 3: PROV qualified association to specify the conformance test results

This example "specifing the conformance test results" is copied from the wiki page about provenance patterns.

It uses (i) dcterms:type on a:TestResult to state the kind of conformance result; (ii) dcterms:conformsTo to state the conformace to a standard; (iii) prov:Association to bind the a:ConformaceTest as a plan followed by the a:TestingActivity;

    a:Dataset a dcat:Dataset ; 
        dcterms:conformsTo <http://data.europa.eu/eli/reg/2014/1312/oj>
        prov:wasUsedBy a:TestingActivity .
           
    a:TestingActivity a prov:Activity ;
          prov:generated a:TestResult ;
          prov:qualifiedAssociation [ 
              a prov:Association ;
            # Here you can specify which is the agent who did the test, when, etc.
            prov:hadPlan a:ConformanceTest 
            ] .
          
   # Conformance test result
   a:TestResult a prov:Entity ;
       dcterms:type <http://inspire.ec.europa.eu/metadata-codelist/DegreeOfConformity/conformant> .
   
   a:ConformanceTest a prov:Plan ;
        # Here you can specify additional information on the test
        prov:wasDerivedFrom <http://data.europa.eu/eli/reg/2014/1312/oj> .
     
   # Reference standard / specification
    <http://data.europa.eu/eli/reg/2014/1312/oj> a prov:Entity, dct:Standard ;
        dcterms:title "Commission Regulation (EU) No 1089/2010 of 23 November 2010 implementing 
                         Directive 2007/2/EC of the European Parliament and of the Council as regards 
                         interoperability of spatial data sets and services"@en
       dcterms:issued "2010-11-23"^^xsd:date .

Example 4 : PROV and EARL 1.0 to state conformance test results

The following example states the same as Example 3, but using EARL. EARL provides contructs to describe - Assertor, which can include information about who or what ran the test. For example human evaluators, automated accessibility checkers, or combinations of these. - Test Subject, which can include web content (such as web pages, videos, applets, etc.), software (such as authoring tools, user agents, etc.), or other things being tested. - Test Criterion: What are we evaluating the test subject against? This could be a specification, a set of guidelines, a test from a test suite, or some other testable statement. - Test Result: What was the outcome of the test? A test result could also include contextual information such as error messages or relevant locations within the test subject.

The following example
(i) uses dcterms:type on a:TestResult to state the kind of conformance result;
(ii) might have used the dcterms:conformsTo to state the conformace to a standard;

Differently from the previous example, it provides
(iii) the earl:Assertion instead of the qualified association on the PROV activity a:TestingActivity. The earl:Assertion states that the conformace of a dataset a:Dataset has been tested with the conformance test a:ConformanceTest. It also provides (iv) a description of the errors/test failed ( as earl:TestResult) .

a:assertion a earl:Assertion;
    earl:subject a:Dataset;
    earl:test a:ConformanceTest;
    earl:result a:testResult ;
    # let's indicate if the test was manual, automatic, or what ..     
    earl:mode earl:automatic ;
    earl:assertedBy <http://validator.example.org/> ;
    prov:wasAttributedTo <http://validator.example.org/>.   

a:ConformanceTest a earl:TestRequirement, prov:Plan;
         dct:title "Set of conformance test derived by the Commission Regulation (EU) No 1089/2010 of 23 November 2010 implementing  Directive 2007/2/EC of the European Parliament and of the Council as regards interoperability of spatial data sets and services"@en";
         # it includes different subtests
         dct:hasPart a:test1, a:test2, ...,  a:testn.
         #It is derived  by the reference standard
         prov:wasDerivedFrom <http://data.europa.eu/eli/reg/2014/1312/oj>.  

a:testResult ;
        a earl:TestResult;
        #  results in conformancy.
        dcterms:type <http://inspire.ec.europa.eu/metadata-codelist/DegreeOfConformity/conformant>;
        #the overall set of tests have been passed (!?) 
        earl:outcome earl:passed .
        ];

# Reference standard / specification
<http://data.europa.eu/eli/reg/2014/1312/oj> a prov:Entity, dct:Standard ;
      dcterms:title "Commission Regulation (EU) No 1089/2010 of 23 November 2010 implementing  Directive 2007/2/EC of the European Parliament and of the Council as regards interoperability of spatial data sets and services"@en
      dcterms:issued "2010-11-23"^^xsd:date . 

# the description of the validator
<http://validator.example.org/> a earl:Assertor, prov:Agent ;
      dcterms:description "A test execution service that runs conformance test suites."@en ;
      dcterms:title "Validator"@en .

#the testing activity
a:TestingActivity a prov:Activity;
    prov:generated a:TestAssertion, a:TestResult;
    prov:use a:Dataset ;
    prov:wasAssociatedWith  <http://validator.example.org/> .

By using EARL, we might also provide info about the single subtests. The following is derived by a third-party example and it shows how the description would have looked like if the subtest a:test1 had failed. In particular, dcterms:description and earl:info provide additional warnings or error messages in a human-readable form.

a:assertion a earl:Assertion;
    earl:subject a:Dataset;
    earl:test a:ConformanceTest;
    earl:result [ #a:testResult 
        a earl:TestResult;
        #  results in no conformancy. 
        dcterms:type <http://inspire.ec.europa.eu/metadata-codelist/DegreeOfConformity/notConformant>
        #the overall set of tests have not been passed (!?) 
        dcterms:date "2015-09-29T11:50:00+00:00"^^xsd:dateTime ;
        # Some XML encoding of the error
            dcterms:description """
                 <ul xmlns="http://www.w3.org/1999/xhtml">
                 <li> test 1 has failed. Some description of the errors found</li>
                 </ul>"""^^rdf:XMLLiteral;
            earl:info """ 
                <test-method duration-ms="47" finished-at="2015-09-29T11:50:00Z"     name="validate" signature="validate()" started-at="2015-09-29T11:50:00Z" status="FAIL"> 
                <exception class="java.lang.AssertionError">
                    <message>
                     Total validation errors found: 2
                     </message>
               </exception>
             </test-method> """^^rdf:XMLLiteral;
       earl:outcome earl:fail .
        ];
    # we do not know if the test was manual, automatic, or what ..     
    earl:mode earl:automatic.   

a:ConformanceTest a earl:TestRequirement, prov:Plan;
             dct:title "Set of conformance test derived by the Commission Regulation (EU) No 1089/2010 of 23 November 2010 implementing  Directive 2007/2/EC of the European Parliament and of the Council as regards interoperability of spatial data sets and services"@en";
             # it includes different subtests
             dct:hasPart a:test1, a:test2, ...,  a:testn.
             #It is derived by the reference standard
             prov:wasDerivedFrom <http://data.europa.eu/eli/reg/2014/1312/oj>. 

Example 5: DQV and PROV to specify compliance metric and the conformance test result.

This example uses (i) dcterms:type on a:TestResult to state the kind of conformance result;
(ii) dcterms:conformsTo to state the conformance to a standard; (iv) a description of the errors/test failed. (via dqv:QualityAnnotation) (v) association with certificates obtained during the validation ( via dqv:QualityCertificate) (vi) an explicit DQV metric to measure the level Of Compliance (via :levelOfComplianceToTheStandardXXX) It does not explicitly use, but it could use (iii) prov:Association to bind the a:ConformaceTest as a plan followed by the a:TestingActivity, and/or Open Provenance Model for Workflows (OPMW) to provide composite workflows for tests.

Below, a specific metric :levelOfComplianceToTheStandardXXX measures the compliance of a dataset to a standard XXX. iso is a namespace representing the quality dimensions and categories defined in the ISO/IEC25012.

:levelOfComplianceToTheStandardXXX
    a dqv:Metric ;
    skos:definition "It returns the degree of compliance to the standard XXX defined as the percentage of passed compleance tests."@en
    dqv:expectedDataType xsd:double ;
    dqv:inDimension  iso:compliance .

iso:compliance
    a  dqv:Dimension ;
    skos:prefLabel "Compliance"@en ;
    skos:definition "The degree to which data has attributes that adhere to standards, conventions or regulations in force and similar rules relating to data quality in a specific context of use."@en ;
    dqv:inCategory  iso:InherentandSystemDependentDataQuality
    .
iso:inherentandSystemDependentDataQuality
    a  dqv:Category ;
   skos:prefLabel "Inherent and System-Dependent Data Quality"@en.

The quality measurement measurement_complianceToXXX represents the level of compliance for a dataset a:Dataset, namely, measurement of the metric :levelOfComplianceToTheStandardXXX. In case of full compliance, the measurement would look like in the following:

:measurement_complianceToXXX 
           a         dqv:QualityMeasurement;
           dqv:computedOn      a:Dataset;
           dqv:value           "100"^^xsd:double ;
           sdmx-attribute:unitMeasure <http://www.wurvoc.org/vocabularies/om-1.8/Percentage>
           dcterms:date      "2018-01-10"^^xsd:date ;
           dqv:isMeasurementOf    :levelOfComplianceToTheStandardXXX ;

and the dataset can be declared conformat.

a:Dataset  dcterms:conformsTo XXX.

Otherwise, if only a part of the compliance tests succeed ( e.g. half of the compliance tests),

:measurement_complianceToXXX 
       a         dqv:QualityMeasurement;
       dqv:computedOn      a:Dataset;
       dqv:value           "50.0"^^xsd:double ;
       sdmx-attribute:unitMeasure <http://www.wurvoc.org/vocabularies/om-1.8/Percentage>
       dcterms:date      "2018-01-10"^^xsd:date ;
       dqv:isMeasurementOf    :levelOfComplianceToTheStandardXXX ;

and the following dqv:QualityAnnotation embeds the result of compliance test :

 :errors  
    a dqv:QualityAnnotation ;
    #this annotation is derived by the measurement
    prov:wasDerivedFrom  measurement_complianceToXXX ;
    oa:hasTarget a:Dataset ;
    oa:hasBody [
        #errors/failed test description 
          a  oa:TextualBody;
          rdf:value  "<p>description of the errors /failed Test</p>"  ;
          dc:language  "en"  ;
          #it can be in any format suppored by dc
          dc:format  "text/html"
          ]
    oa:motivatedBy dqv:qualityAssessment, oa:assessing ;
    dqv:inDimension iso:compliance
    .

In case that a certificate is released during the validation, for example, an ODI certificate, it can be associated with the dataset.

:certificateAnnotation 
    a dqv:QualityCertificate ;
    prov:wasDerivedFrom  :measurement_complianceToXXX ;
    oa:hasTarget a:Dataset ;
    #example of ODI certificate
    dqv:inDimension iso:compliance ;
    oa:hasBody <https://certificates.theodi.org/en/datasets/393/certificate> ;
    oa:motivatedBy dqv:qualityAssessment;

The quality metadata a:testResult collects the above annotations and the measurements to provide further provenance information. It also states the dcterm:type for the kind of conformance result; .

a:TestResult 
    a dqv:QualityMetadata ;
    #  change the the dcterms:type according to the resulted compliance 
    dcterms:type <http://inspire.ec.europa.eu/metadata-codelist/DegreeOfConformity/conformant> ;
    prov:wasAttributedTo <http://validator.example.org/> ;
    prov:generatedAtTime "2018-05-27T02:52:02Z"^^xsd:dateTime ;
    prov:wasGeneratedBy a:TestingActivity .

# The graph contains the rest of the statements presented in the previous example.
a:testResult {
    a:Dataset
        dqv:hasQualityMeasurement :measurement_complianceToXXX;
        dqv:hasQualityAnnotation :errors, :certificateAnnotation.       
}

#the testing activity
a:TestingActivity a prov:Activity;
    prov:generated  a:TestResult;
    prov:use a:Dataset ;
    prov:wasAssociatedWith  <http://validator.example.org/>
     .

A list of Non-W3C-related vocabularies

The following non-W3C-related Vocabularies are listed below for future reference.

Clone this wiki locally