E-Business + Web Science Research Group

The Data Quality Constraints Library Language Reference

The Data Quality Constraints Library Metadata (rdf:type owl:Ontology)

V 1.1 Release 2011-03-28

Latest version: http://semwebquality.org/ontologies/dq-constraints (2011-03-28)

Author: Christian Fuerber, Martin Hepp, and Markus Wischnewski

URI http://semwebquality.org/ontologies/dq-constraints

rdfs:label The Data Quality Constraints Library
rdfs:comment This RDF document contains a library of data quality constraints represented as SPARQL query templates based on the SPARQL Inferencing Framework (SPIN). The data quality constraint templates are especially useful for the identification of data quality problems during data entry and for periodic quality checks during data usage.

dc:subject Semantic Data Quality Management

dcterms:license http://www.gnu.org/licenses/lgpl.html

DISCLAIMER

The constraints library and documentation are provided as they are, without warranty of any kind, expressed or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the constraint library or its documentation or the use or other dealings in the constraint library or documentation.

RELATED DOCUMENTS

[back to top]

Table of Contents

  1. SPIN templates
  2. Contact Information
  3. License
  4. Acknowledgments

[back to top]

SPIN templates

[back to top]

dqc:ConstraintTemplates (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#ConstraintTemplates
rdfs:subClassOf http://spinrdf.org/spin#Templates

rdfs:label data quality constraint templates
rdfs:comment Constraint templates are generalized SPARQL query templates based on the SPARQL Inferencing Framework (SPIN). The query templates represent generic data quality rules that may be used to identify data quality problems, i.e. violations of previously defined constraints.

Subclasses

[back to top]

dqc:EAN-13All (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#EAN-13All
rdfs:subClassOf dqc:SyntaxConstraints

rdfs:label EAN-13 All
rdfs:comment This query flags wrong EAN-13 values.

CONSTRUCT{ _:c0 rdf:type spin:ConstraintViolation .
    _:c0 spin:violationRoot ?instance .
    _:c0 spin:violationPath ?arg1 .}
WHERE{ ?instance ?arg1 ?ean
    LET (?1 := afn:substr(str(?ean), 0, 1))
    LET (?2 := afn:substr(str(?ean), 1, 2))
    LET (?3 := afn:substr(str(?ean), 2, 3))
    LET (?4 := afn:substr(str(?ean), 3, 4))
    LET (?5 := afn:substr(str(?ean), 4, 5))
    LET (?6 := afn:substr(str(?ean), 5, 6))
    LET (?7 := afn:substr(str(?ean), 6, 7))
    LET (?8 := afn:substr(str(?ean), 7, 8))
    LET (?9 := afn:substr(str(?ean), 8, 9))
    LET (?10 := afn:substr(str(?ean), 9, 10))
    LET (?11 := afn:substr(str(?ean), 10, 11))
    LET (?12 := afn:substr(str(?ean), 11, 12))
    LET (?13 := afn:substr(str(?ean), 12, 13))
    LET (?value := ( ( ( ( ( ( ( xsd:int(?2) + xsd:int(?4) ) + xsd:int(?6) ) + xsd:int(?8) ) + xsd:int(?10) ) + xsd:int(?12) ) * 3 ) + ( ( ( ( ( xsd:int(?1) + xsd:int(?3) ) + xsd:int(?5) ) + xsd:int(?7) ) + xsd:int(?9) ) + xsd:int(?11) ) ))
    LET (?check := afn:substr(str(?value), ( fn:string-length(str(?value)) - 1 ), fn:string-length(str(?value))))
    FILTER ( ( ( ( xsd:int(?check) + xsd:int(?13) ) != 0 ) && ( ( xsd:int(?check) + xsd:int(?13) ) != 10 ) ) || ( ! regex(str(?ean), "^[0-9]{13}$") ) )
  }

Label template: Incorrect EAN-13 in {?arg1}!

Constraints:

[back to top]

dqc:EAN-13Class (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#EAN-13Class
rdfs:subClassOf dqc:SyntaxConstraints

rdfs:label EAN-13 Class
rdfs:comment This query flags wrong EAN-13 values in instances of a specified class.

CONSTRUCT{ _:c0 rdf:type spin:ConstraintViolation .
    _:c0 spin:violationRoot ?instance .
    _:c0 spin:violationPath ?arg2 .}
WHERE{ ?instance rdf:type ?arg1 .
    ?instance ?arg2 ?ean
    LET (?1 := afn:substr(str(?ean), 0, 1))
    LET (?2 := afn:substr(str(?ean), 1, 2))
    LET (?3 := afn:substr(str(?ean), 2, 3))
    LET (?4 := afn:substr(str(?ean), 3, 4))
    LET (?5 := afn:substr(str(?ean), 4, 5))
    LET (?6 := afn:substr(str(?ean), 5, 6))
    LET (?7 := afn:substr(str(?ean), 6, 7))
    LET (?8 := afn:substr(str(?ean), 7, 8))
    LET (?9 := afn:substr(str(?ean), 8, 9))
    LET (?10 := afn:substr(str(?ean), 9, 10))
    LET (?11 := afn:substr(str(?ean), 10, 11))
    LET (?12 := afn:substr(str(?ean), 11, 12))
    LET (?13 := afn:substr(str(?ean), 12, 13))
    LET (?value := ( ( ( ( ( ( ( xsd:int(?2) + xsd:int(?4) ) + xsd:int(?6) ) + xsd:int(?8) ) + xsd:int(?10) ) + xsd:int(?12) ) * 3 ) + ( ( ( ( ( xsd:int(?1) + xsd:int(?3) ) + xsd:int(?5) ) + xsd:int(?7) ) + xsd:int(?9) ) + xsd:int(?11) ) ))
    LET (?check := afn:substr(str(?value), ( fn:string-length(str(?value)) - 1 ), fn:string-length(str(?value))))
    FILTER ( ( ( ( xsd:int(?check) + xsd:int(?13) ) != 0 ) && ( ( xsd:int(?check) + xsd:int(?13) ) != 10 ) ) || ( ! regex(str(?ean), "^[0-9]{13}$") ) )
  }

Label template: Incorrect EAN-13 in {?arg2} of {?arg1} class instances!

Constraints:

[back to top]

dqc:ExclusiveFunctionalDependencyAll (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#ExclusiveFunctionalDependencyAll
rdfs:subClassOf dqc:FunctionalDependencyConstraints

rdfs:label exclusive functional dependency check in all instances
rdfs:comment This query flags instances with property ?arg1 and value ?arg2 that do not have value ?arg4 with property ?arg3. It is only suitable for value dependencies with one to one cardinality. The query does not tolerate homonyms and is not restricted to a specific class.

CONSTRUCT{
    _:b0 a spin:ConstraintViolation .
    _:b0 spin:violationRoot ?s .
    _:b0 spin:violationPath ?arg3 .
}
WHERE{
    ?s ?arg1 ?arg2 .
    FILTER (!spl:hasValue(?s, ?arg3, ?arg4)) 
}

Label template: Value "{?arg2}" of {?arg1} must only have value "{?arg4}" in {?arg3} in all instances!

Constraints:

[back to top]

dqc:ExclusiveFunctionalDependencyClass (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#ExclusiveFunctionalDependencyClass
rdfs:subClassOf dqc:FunctionalDependencyConstraints

rdfs:label exclusive functional dependency check in class instances
rdfs:comment This query flags instances of class ?arg1 with property ?arg2 and value ?arg3 that do not have value ?arg5 with property ?arg4. It is only suitable for value dependencies with one to one cardinality. The query does not tolerate homonyms. Not defined dependencies will not be flagged.

CONSTRUCT{
    _:b0 a spin:ConstraintViolation .
    _:b0 spin:violationRoot ?this .
    _:b0 spin:violationPath ?arg4 .
}
WHERE{
    ?this a ?arg1 .
    ?this ?arg2 ?arg3 .
    FILTER (!spl:hasValue(?this, ?arg4, ?arg5)) 
}

Label template: Value "{?arg3}" of {?arg2} must only have value "{?arg5}" in {?arg4} in instances of class {?arg1}!

Constraints:

[back to top]

dqc:FiveDigitNumericAll (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#FiveDigitNumericAll
rdfs:subClassOf dqc:SyntaxConstraints

rdfs:label syntax check in all instances: 5 digit numeric values
rdfs:comment This query flags all instances that do not have a five digit numeric value for property ?arg1.

CONSTRUCT{
    _:b0 a spin:ConstraintViolation .
    _:b0 spin:violationRoot ?s .
    _:b0 spin:violationPath ?arg1 .
}
WHERE{
    ?s ?arg1 ?value .
    FILTER (!regex(str(?value), "^[0-9]{5}$"^^xsd:string)) 
}

Label template: Syntax rule: {?arg1} must contain 5-digit numeric value in all instances!

Constraints:

[back to top]

dqc:FunctionalDependencyConstraints (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#FunctionalDependencyConstraints
rdfs:subClassOf dqc:ConstraintTemplates

rdfs:label functional dependency constraints
rdfs:comment Functional dependencies are dependencies between the values of two or more different properties. Functional dependency constraints check the abidance of functional dependencies.

Subclasses

[back to top]

dqc:FunctionalDependencyTrustedReference_ClassOverBlankNode (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#FunctionalDependencyTrustedReference_ClassOverBlankNode
rdfs:subClassOf dqc:FunctionalDependencyConstraints

rdfs:label Functional dependency check in blank node instances of a class with trusted reference
rdfs:comment This query is designed to test (blank node) instances of the property-and-node element (rdf:parseType="Resource") ?arg2 that are part of the instances of class ?arg 1. The query flags instances of property ?arg2 with properties ?arg3 and ?arg4 that do not have the exact value combination in instances of the trusted reference in class ?arg5. The semantics of property ?arg3 should be equal with property ?arg6, and the semantics of property ?arg4 should be equal with ?arg7. The query tolerates homonymous values, i.e. the same value may be assigned to different dependent values. Value combinations that cannot be found in the trusted reference will also be flagged. The query will also test the existence of a single value in the trusted reference when one property of the tested data is missing.

CONSTRUCT{ 
    _:b0 a spin:ConstraintViolation .
    _:b0 spin:violationRoot ?s .
    _:b0 spin:violationPath ?arg3 .
    _:b0 spin:violationPath ?arg4 .
}
WHERE{
    ?s a ?arg1 .
    OPTIONAL {
        ?s ?arg2 ?node .
        OPTIONAL {
            ?node ?arg3 ?value1 .
        } 
        OPTIONAL{
            ?s ?arg4 ?value2 .
        } 
    } 
    NOT EXISTS{
        ?s2 a ?arg5 .
        ?s2 ?arg6 ?value1 .
        ?s2 ?arg7 ?value2 .
    } 
}

Label template: Value combinations of properties {?arg3} and {?arg4} must always be identical with value combinations of properties {?arg6} and {?arg7} of class {?arg5} for all instances of class {?arg1}!

Constraints:

[back to top]

dqc:FunctionalDependencyTrustedReferenceAll (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#FunctionalDependencyTrustedReferenceAll
rdfs:subClassOf dqc:FunctionalDependencyConstraints

rdfs:label Functional dependency check in all instances with trusted reference
rdfs:comment This query flags instances with properties ?arg1 and ?arg2 that do not have a corresponding value combination in instances of the trusted reference in class ?arg3. The semantics of property ?arg1 should be equal with property ?arg4, and the semantics of property ?arg2 should be equal with ?arg5. The query tolerates homonymous values, i.e. the same value may be assigned to different dependent values by using different instances in the trusted reference. Value combinations that cannot be found in the trusted reference will also be flagged as incorrect. The query will also test the existence of a single value in the trusted reference when one property of the tested data is missing.

CONSTRUCT{
    _:b0 a spin:ConstraintViolation .
    _:b0 spin:violationRoot ?s .
    _:b0 spin:violationPath ?arg1 .
    _:b0 spin:violationPath ?arg2 .
}
WHERE{
    OPTIONAL{
        ?s ?arg1 ?value1 .
        OPTIONAL {
            ?s ?arg2 ?value2 .
        } 
    } 
    NOT EXISTS{
        ?s2 a ?arg3 .
        ?s2 ?arg4 ?value1 .
        ?s2 ?arg5 ?value2 .
    } 
}

Label template: Value combinations of properties {?arg1} and {?arg2} must always be identical with value combinations of properties {?arg4} and {?arg5} in class {?arg3} for all instances!

Constraints:

[back to top]

dqc:FunctionalDependencyTrustedReferenceClass (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#FunctionalDependencyTrustedReferenceClass
rdfs:subClassOf dqc:FunctionalDependencyConstraints

rdfs:label Functional dependency check in class instances with trusted reference
rdfs:comment This query flags instances of class ?arg 1 with properties ?arg2 and ?arg3 that do not have the exact value combination in instances of the trusted reference in class ?arg4. The semantics of property ?arg2 should be equal with property ?arg5, and the semantics of property ?arg3 should be equal with ?arg6. The query tolerates homonymous values, i.e. the same value may be assigned to different dependent values. Value combinations that cannot be found in the trusted reference will also be flagged. The query will also test the existence of a single value in the trusted reference when one property of the tested data is missing.

CONSTRUCT{
    _:b0 a spin:ConstraintViolation .
    _:b0 spin:violationRoot ?s .
    _:b0 spin:violationPath ?arg2 .
    _:b0 spin:violationPath ?arg3 .
}
WHERE{
    ?s a ?arg1 .
    OPTIONAL {
        ?s ?arg2 ?value1 .
        OPTIONAL {
            ?s ?arg3 ?value2 .
        } 
    } 
    NOT EXISTS{
        ?s2 a ?arg4 .
        ?s2 ?arg5 ?value1 .
        ?s2 ?arg6 ?value2 .
    } 
}

Label template: Value combinations of properties {?arg2} and {?arg3} must always be identical with value combinations of properties {?arg5} and {?arg6} of class {?arg4} for all instances of class {?arg1}!

Constraints:

[back to top]

dqc:FunctionalDependentEmptyValueAll (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#FunctionalDependentEmptyValueAll
rdfs:subClassOf dqc:FunctionalDependencyConstraints

rdfs:label None
rdfs:comment This query returns all instances with value ?arg2 for property ?arg1 that do not have an empty literal string for property ?arg3.

CONSTRUCT{
    _:b0 a spin:ConstraintViolation .
    _:b0 spin:violationRoot ?s .
    _:b0 spin:violationPath ?arg3 .
}
WHERE{
    ?s ?arg1 ?arg2 .
    FILTER (!spl:hasValue(?s, ?arg3, ""^^xsd:string)) 
}

Label template: When {?arg1} has value {?arg2}, then {?arg3} has to be empty!

Constraints:

[back to top]

dqc:InconsistentValueRangeAll (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#InconsistentValueRangeAll
rdfs:subClassOf dqc:ValueRangeConstraints

rdfs:label Inconsistent value range all
rdfs:comment This query flags all instances with inconsistant value ranges. Among others it is suitable for value ranges with datatypes xsd:integer, xsd:int, xsd:float, xsd:date, and xsd:dateTime. The literals must be typed.

CONSTRUCT{ _:c0 rdf:type spin:ConstraintViolation .
    _:c0 spin:violationRoot ?instance .
    _:c0 spin:violationPath ?arg1 .
    _:c0 spin:violationPath ?arg2 .}
WHERE{ ?instance ?arg1 ?from .
    ?instance ?arg2 ?through
    FILTER ( ?from >= ?through )
  }

Label template: Value in {?arg1} cannot be greater than value of {?arg2}!

Constraints:

[back to top]

dqc:LegalValueConstraints (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#LegalValueConstraints
rdfs:subClassOf dqc:ConstraintTemplates

rdfs:label legal value constraints
rdfs:comment Legal value constraints identify values that are either not explicitly allowed or explicitly illegal.

Subclasses

[back to top]

dqc:LettersAll (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#LettersAll
rdfs:subClassOf dqc:SyntaxConstraints

rdfs:label syntax check in all instances: only letters allowed
rdfs:comment This query flags all instances with property ?arg1 that do not have letters as literal values. The query tolerates language tags.

CONSTRUCT{
    _:b0 a spin:ConstraintViolation .
    _:b0 spin:violationRoot ?s .
    _:b0 spin:violationPath ?arg1 .
}
WHERE{
    ?s ?arg1 ?value .
    FILTER (!regex(str(?value), "^([A-Za-z])*$"^^xsd:string)) 
}

Label template: Syntax rule: only letters allowed in {?arg1}!

Constraints:

[back to top]

dqc:LettersAndDotsAll (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#LettersAndDotsAll
rdfs:subClassOf dqc:SyntaxConstraints

rdfs:label syntax check in all instances: only letters and dots allowed
rdfs:comment This query flags all instances with property ?arg1 that have characters other than letters or dots in literal values. The query tolerates language tags.

CONSTRUCT{
    _:b0 a spin:ConstraintViolation .
    _:b0 spin:violationRoot ?s .
    _:b0 spin:violationPath ?arg1 .
}
WHERE{
    ?s ?arg1 ?value .
    FILTER (!regex(str(?value), "^([A-Za-z\\. ])*$"^^xsd:string)) 
}

Label template: Syntax rule: only letters and dots allowed in {?arg1}!

Constraints:

[back to top]

dqc:ListedIllegalValueAll (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#ListedIllegalValueAll
rdfs:subClassOf dqc:LegalValueConstraints

rdfs:label Illegal value check in all instances
rdfs:comment This query flags all instances with property ?arg1 that have values which are contained in property ?arg3 of instances of class ?arg2. The query tolerates chaotic assignments of language tags.

CONSTRUCT{ _:c0 rdf:type spin:ConstraintViolation .
    _:c0 spin:violationRoot ?s .
    _:c0 spin:violationPath ?arg1 .}
WHERE{ ?s ?arg1 ?value
    OPTIONAL
      { ?s2 rdf:type ?arg2 .
        ?s2 ?arg3 ?value1
        FILTER ( str(?value1) = str(?value) )
      }
    FILTER bound(?value1)
  }

Label template: Property {?arg1} cannot have the same values as property {?arg3} in class {?arg2}!

Constraints:

[back to top]

dqc:ListedIllegalValueClass (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#ListedIllegalValueClass
rdfs:subClassOf dqc:LegalValueConstraints

rdfs:label Illegal value check in class instances
rdfs:comment This query flags all instances of class ?arg1 with property ?arg2 that have values which are contained in property ?arg4 of instances of class ?arg3. The query tolerates chaotic assignments of language tags.

CONSTRUCT{   _:c0 rdf:type spin:ConstraintViolation .
    _:c0 spin:violationRoot ?s .
    _:c0 spin:violationPath ?arg2 .
}
WHERE{ ?s rdf:type ?arg1 .
    ?s ?arg2 ?value
    OPTIONAL
      { ?s2 rdf:type ?arg3 .
        ?s2 ?arg4 ?value1
        FILTER ( str(?value1) = str(?value) )
      }
    FILTER bound(?value1)
  }

Label template: Instances of class {?arg1} cannot have the same values for property {?arg2} as property {?arg4} in class {?arg3}!

Constraints:

[back to top]

dqc:ListedLegalValueAll (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#ListedLegalValueAll
rdfs:subClassOf dqc:LegalValueConstraints

rdfs:label Legal value check in all instances
rdfs:comment This query flags all instances with property ?arg1 that have values which are not contained in property ?arg3 of instances of class ?arg2. The query tolerates chaotic assignments of language tags.

CONSTRUCT{ _:c0 rdf:type spin:ConstraintViolation .
    _:c0 spin:violationRoot ?s .
    _:c0 spin:violationPath ?arg1 .}
WHERE{ ?s ?arg1 ?value
    OPTIONAL
      { ?s2 rdf:type ?arg2 .
        ?s2 ?arg3 ?value1
        FILTER ( str(?value1) = str(?value) )
      }
    FILTER ( ! bound(?value1) )
  }

Label template: Property {?arg1} can only contain the same values as property {?arg3} in instances of class {?arg2}!

Constraints:

[back to top]

dqc:ListedLegalValueClass (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#ListedLegalValueClass
rdfs:subClassOf dqc:LegalValueConstraints

rdfs:label Legal value check in class instances
rdfs:comment This query flags all instances of class ?arg1 with property ?arg2 that have values which are not contained in property ?arg4 of instances of class ?arg3. The query tolerates chaotic assignments of language tags.

CONSTRUCT{ _:c0 rdf:type spin:ConstraintViolation .
    _:c0 spin:violationRoot ?s .
    _:c0 spin:violationPath ?arg2 .}
WHERE{ ?s rdf:type ?arg1 .
    ?s ?arg2 ?value
    OPTIONAL
      { ?s2 rdf:type ?arg3 .
        ?s2 ?arg4 ?value1
        FILTER ( str(?value1) = str(?value) )
      }
    FILTER ( ! bound(?value1) )
  }

Label template: Instances of class {?arg1} can only contain the same values for property {?arg2} as property {?arg4} in instances of class {?arg3}!

Constraints:

[back to top]

dqc:ListedLegalValueClassOverBlankNode (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#ListedLegalValueClassOverBlankNode
rdfs:subClassOf dqc:LegalValueConstraints

rdfs:label Legal value check in blank node instances of a class
rdfs:comment This query flags all instances of property-and-node element ?arg2 (rdf:parseType="Resource") with property ?arg3 in class ?arg1 that have values which are not contained in property ?arg5 of instances of class ?arg3. The query tolerates chaotic assignments of language tags.

CONSTRUCT{ _:c0 rdf:type spin:ConstraintViolation .
    _:c0 spin:violationRoot ?s .
    _:c0 spin:violationPath ?arg2 .
    _:c0 spin:violationPath ?arg3 .}
WHERE{ ?s rdf:type ?arg1 .
    ?s ?arg2 ?node .
    ?node ?arg3 ?value
    OPTIONAL
      { ?s2 rdf:type ?arg4 .
        ?s2 ?arg5 ?value1
        FILTER ( str(?value) = str(?value1) )
      }
    FILTER ( ! bound(?value1) )
  }

Label template: Instances of property-and-node element {?arg2} in class {?arg1} can only contain the same values for property {?arg3} as property {?arg5} in instances of class {?arg4}!

Constraints:

[back to top]

dqc:LowerLimitAll (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#LowerLimitAll
rdfs:subClassOf dqc:ValueRangeConstraints

rdfs:label Lower limit check in all instances
rdfs:comment This query returns all instances that have a value for property ?arg1 below the user defined limit ?arg2. The query tolerates chaotic datatype assignments.

CONSTRUCT{
    _:b0 a spin:ConstraintViolation .
    _:b0 spin:violationRoot ?s .
    _:b0 spin:violationPath ?arg1 .
}
WHERE{
    ?s ?arg1 ?value .
    FILTER (smf:cast(?value, xsd:decimal) < ?arg2) 
}

Label template: Values in {?arg1} must be greater than {?arg2}!

Constraints:

[back to top]

dqc:LowerLimitClass (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#LowerLimitClass
rdfs:subClassOf dqc:ValueRangeConstraints

rdfs:label Lower limit check in all instances of a class
rdfs:comment This query returns all instances of class ?arg1 that have a value for property ?arg2 below the user defined limit ?arg3. The query tolerates chaotic datatype assignments.

CONSTRUCT{
    _:b0 a spin:ConstraintViolation .
    _:b0 spin:violationRoot ?s .
    _:b0 spin:violationPath ?arg2 .
}
WHERE{
    ?s a ?arg1 .
    ?s ?arg2 ?value .
    FILTER (smf:cast(?value, xsd:decimal) < ?arg3) 
}

Label template: Values in {?arg2} for instances of class {?arg1} must be greater than {?arg3}!

Constraints:

[back to top]

dqc:MissingElementConstraints (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#MissingElementConstraints
rdfs:subClassOf dqc:ConstraintTemplates

rdfs:label missing element constraints
rdfs:comment Missing element constraints identify elements in the data set that are missing but required.

Subclasses

[back to top]

dqc:MissingLiterals (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#MissingLiterals
rdfs:subClassOf dqc:MissingElementConstraints

rdfs:label mandatory literal value check in instances of a class
rdfs:comment This query returns all instances of class ?arg1 where the literal for ?arg2 is empty. It does not return instances where the whole property ?arg2 is missing.

CONSTRUCT{
    _:b0 a spin:ConstraintViolation .
    _:b0 spin:violationRoot ?s .
    _:b0 spin:violationPath ?arg2 .
}
WHERE{
    ?s a ?arg1 .
    ?s ?arg2 ""^^xsd:string .
}

Label template: Mandatory literals in {?arg2} of class {?arg1}!

Constraints:

[back to top]

dqc:MissingLiteralsAndProperties (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#MissingLiteralsAndProperties
rdfs:subClassOf dqc:MissingElementConstraints

rdfs:label Mandatory literal value and property check in instances of a class
rdfs:comment This query returns all instances of class ?arg1 where the literal for ?arg2 is empty or the whole property ?arg2 is missing.

CONSTRUCT{
    _:b0 a spin:ConstraintViolation .
    _:b0 spin:violationRoot ?this .
    _:b0 spin:violationPath ?arg2 .
}
WHERE{
{
        ?this a ?arg1 .
        ?this ?arg2 "" .
    }
    UNION{
        ?this a ?arg1 .
        NOT EXISTS {
            ?this ?arg2 ?value .
        } 
    } 
}

Label template: Property {?arg2} is mandatory and must not contain empty literals for instances of class {?arg1}!

Constraints:

[back to top]

dqc:MissingProperties (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#MissingProperties
rdfs:subClassOf dqc:MissingElementConstraints

rdfs:label Mandatory property check in instances of a class
rdfs:comment This query returns all instances of class ?arg1 where property ?arg2 is missing. It explicitly tolerates empty literal values in property ?arg2.

CONSTRUCT{
    _:b0 a spin:ConstraintViolation .
    _:b0 spin:violationRoot ?s .
    _:b0 spin:violationPath ?arg2 .
}
WHERE{
    ?s a ?arg1 .
    NOT EXISTS {
        ?s ?arg2 ?value .
    } 
}

Label template: Property {?arg2} is mandatory but may contain empty literals for instances of class {?arg1}!

Constraints:

[back to top]

dqc:NumbersAll (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#NumbersAll
rdfs:subClassOf dqc:SyntaxConstraints

rdfs:label syntax check in all instances: only numbers allowed
rdfs:comment This query flags all instances with property ?arg1 that have characters other than numbers as literal values.

CONSTRUCT{
    _:b0 a spin:ConstraintViolation .
    _:b0 spin:violationRoot ?s .
    _:b0 spin:violationPath ?arg1 .
}
WHERE{
    ?s ?arg1 ?value .
    FILTER (!regex(str(?value), "^([0-9])*$"^^xsd:string)) 
}

Label template: Syntax rule: only numbers allowed in {?arg1}!

Constraints:

[back to top]

dqc:SyntaxConstraints (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#SyntaxConstraints
rdfs:subClassOf dqc:ConstraintTemplates

rdfs:label syntax constraints
rdfs:comment Syntax constraints identify values that do not adhere to syntactical rules. {@en}

Subclasses

[back to top]

dqc:UniquenessConstraints (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#UniquenessConstraints
rdfs:subClassOf dqc:ConstraintTemplates

rdfs:label uniqueness constraints
rdfs:comment Uniqueness constraints identify values that shall be unique, but are redundant within a certain data set.

Subclasses

[back to top]

dqc:UniqueValueAll (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#UniqueValueAll
rdfs:subClassOf dqc:UniquenessConstraints

rdfs:label Uniqueness check for all values in a property
rdfs:comment This query returns all instances where the value for property ?arg1 is not unique in the tested data set. The query tolerates chaotic language tag assignments.

CONSTRUCT{
    _:b0 a spin:ConstraintViolation .
    _:b0 spin:violationRoot ?a .
    _:b0 spin:violationPath ?arg1 .
}
WHERE{
    ?a ?arg1 ?uniqueValue1 .
    ?b ?arg1 ?uniqueValue2 .
    FILTER ((str(?uniqueValue1) = str(?uniqueValue2)) && (?a != ?b)) 
}

Label template: Values in {?arg1} must be unique!

Constraints:

[back to top]

dqc:UniqueValueClass (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#UniqueValueClass
rdfs:subClassOf dqc:UniquenessConstraints

rdfs:label Uniqueness check for all values in instances of a class
rdfs:comment This query returns all instances of class ?arg1 where the value for property ?arg2 is not unique in the tested data set. The query tolerates chaotic language tag assignments.

CONSTRUCT{
    _:b0 a spin:ConstraintViolation .
    _:b0 spin:violationRoot ?a .
    _:b0 spin:violationPath ?arg2 .
}
WHERE{
    ?a a ?arg1 .
    ?a ?arg2 ?uniqueValue1 .
    ?b a ?arg1 .
    ?b ?arg2 ?uniqueValue2 .
    FILTER ((str(?uniqueValue1) = str(?uniqueValue2)) && (?a != ?b)) 
}

Label template: {?arg2} in {?arg1} must be unique!

Constraints:

[back to top]

dqc:UpperLimitAll (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#UpperLimitAll
rdfs:subClassOf dqc:ValueRangeConstraints

rdfs:label Upper limit check in all instances
rdfs:comment This query returns all instances that have a value for property ?arg1 above the user defined limit ?arg2. The query tolerates chaotic datatype assignments.

CONSTRUCT{
    _:b0 a spin:ConstraintViolation .
    _:b0 spin:violationRoot ?s .
    _:b0 spin:violationPath ?arg1 .
}
WHERE{
    ?s ?arg1 ?value .
    FILTER (smf:cast(?value, xsd:decimal) > ?arg2) 
}

Label template: Values in {?arg1} must be lower than {?arg2}!

Constraints:

[back to top]

dqc:UpperLimitClass (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#UpperLimitClass
rdfs:subClassOf dqc:ValueRangeConstraints

rdfs:label Upper limit check in all instances of a class
rdfs:comment This query returns all instances of class ?arg1 that have a value for property ?arg2 above the user defined limit ?arg3. The query tolerates chaotic datatype assignments.

CONSTRUCT{
    _:b0 a spin:ConstraintViolation .
    _:b0 spin:violationRoot ?s .
    _:b0 spin:violationPath ?arg2 .
}
WHERE{
    ?s a ?arg1 .
    ?s ?arg2 ?value .
    FILTER (smf:cast(?value, xsd:decimal) > ?arg3) 
}

Label template: Values in {?arg2} for instances of class {?arg1} must be lower than {?arg3}!

Constraints:

[back to top]

dqc:ValueRangeConstraints (rdf:type spin:Template)

URI http://semwebquality.org/ontologies/dq-constraints#ValueRangeConstraints
rdfs:subClassOf dqc:ConstraintTemplates

rdfs:label value range constraints
rdfs:comment Value range constraints allow the identification of values that do not obey a certain upper and/or lower limit.

Subclasses

[back to top]

Contact Information

Christian Fürber

E-Business and Web Science Research Group
Chair of General Management and E-Business
Universität der Bundeswehr München
Werner-Heisenberg-Weg 39
D-85579 Neubiberg, Germany

Phone: +49 89 6004-4218
eMail: christian (AT) fuerber.com (preferred mode of communication)
Blog: http://www.fuerber.com/
Twitter: cfuerber
Web: http://www.unibw.de/ebusiness/

[back to top]

License

The Data Quality Constraints Library is available under the GNU Lesser General Public License (LGPL) license.

[back to top]

Acknowledgments

This documentation has been generated automatically from the most recent library specification in RDF/XML using a Python script written by Alex Stolz and Martin Hepp. Our script uses the RDFlib library for parsing and handling RDF and the Jinja template engine for generating the HTML document.