Data Quality Monitoring Reports
(→SPARQL-Problem-Reports) |
(→Example 1: Property Completeness Violations (OWL DL Design)) |
||
Line 36: | Line 36: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | [[Create Data Requirements#Example 1: PropertyCompletenessRule (Minimal Input)|See here how a requirement was defined for this]] | + | [[Create Data Requirements#Example 1: PropertyCompletenessRule (Minimal Input)|See here how a data requirement was defined for this]] |
− | + | ||
− | + | ||
===Example 2: Property Completeness Violations (OWL Full Design)=== | ===Example 2: Property Completeness Violations (OWL Full Design)=== |
Revision as of 19:59, 10 October 2011
Problem reports are an excellent instrument to quickly identify instances with requirement violations.
Contents |
Prerequisites
With the DQM-Vocabulary you can easily create problem reports. All you need is a SPARQL-Endpoint. Before you can automatically analyze your data for requirement violations, you need to perform the following steps:
- Declare the elements of your ontology that shall be used in the DQM-Vocabulary
- Create Data Requirements
SPARQL-Problem-Reports
Each type of data requirement has different problem reports, since the nature of data requirements differs. Moreover, the actual SPARQL query you can use depends on the design option you have chosen to make your ontology elements an instance of dqm:TestedClass and dqm:TestedProperty (See Create Data Requirements#Define Tested Elements for an explanation). In the following you find several SPARQL queries that make use of your data requirements to identify class instances with requirement violations.
Example 1: Property Completeness Violations (OWL DL Design)
SELECT ?dqr ?i WHERE { ?dqr a dqm:PropertyCompletenessRule . ?dqr dqm:testedClass ?tclass . ?dqr dqm:testedProperty1 ?tprop . ?dqr dqm:requiredValue "true"^^xsd:boolean . ?dqr dqm:requiredProperty "true"^^xsd:boolean . ?tclass dqm:hasURI ?tclassreal . ?tprop dqm:hasURI ?tpropreal . BIND (IRI(str(?tpropreal)) AS ?tpropURI) . BIND (IRI(str(?tclassreal)) AS ?tclassURI) . { ?i a ?tclassURI . NOT EXISTS{ ?i ?tpropURI ?value . } }UNION{ ?i a ?tclassURI . ?i ?tpropURI "" . } }
See here how a data requirement was defined for this
Example 2: Property Completeness Violations (OWL Full Design)
SELECT ?dqr ?i WHERE { ?dqr a dqm:PropertyCompletenessRule . ?dqr dqm:testedClass ?tclass . ?dqr dqm:testedProperty1 ?tprop . ?dqr dqm:requiredValue "true"^^xsd:boolean . ?dqr dqm:requiredProperty "true"^^xsd:boolean . { ?i a ?tclass . NOT EXISTS{ ?i ?tprop ?value . } }UNION{ ?i a ?tclass . ?i ?tprop "" . } }
See here how a requirement was defined for this
Example 3: Syntax Rule Violations (OWL DL Design)
SELECT ?dqr ?regex ?i WHERE { ?dqr a dqm:SyntaxRule . ?dqr dqm:testedProperty1 ?tprop . ?dqr dqm:testedClass ?tclass . ?dqr dqm:regex ?regex . ?tclass dqm:hasURI ?tclassreal . ?tprop dqm:hasURI ?tpropreal . BIND (IRI(str(?tpropreal)) AS ?tpropURI) . BIND (IRI(str(?tclassreal)) AS ?tclassURI) . ?i a ?tclassURI . ?i ?tpropURI ?value . FILTER (!regex(str(?value), ?regex)) . }