Data Quality Monitoring Reports
From SemWebQuality.org
(Difference between revisions)
(→Example 1: Property Completeness Violations) |
(→Example 1: Property Completeness Violations) |
||
Line 12: | Line 12: | ||
===Example 1: Property Completeness Violations=== | ===Example 1: Property Completeness Violations=== | ||
<syntaxhighlight lang="sparql"> | <syntaxhighlight lang="sparql"> | ||
− | SELECT ?i | + | SELECT ?i ?dqr |
WHERE { | WHERE { | ||
− | ?dqr a dqm: | + | ?dqr a dqm:PropertyCompletenessRule . |
− | ?dqr dqm: | + | ?dqr dqm:testedClass ?tclass . |
− | + | ?dqr dqm:testedProperty1 ?tprop . | |
+ | ?dqr dqm:requiredValue "true"^^xsd:boolean . | ||
+ | ?dqr dqm:requiredProperty "true"^^xsd:boolean . | ||
?tclass dqm:hasURI ?tclassreal . | ?tclass dqm:hasURI ?tclassreal . | ||
?tprop dqm:hasURI ?tpropreal . | ?tprop dqm:hasURI ?tpropreal . | ||
BIND (smf:buildURI(?tpropreal) AS ?tpropURI) . | BIND (smf:buildURI(?tpropreal) AS ?tpropURI) . | ||
BIND (smf:buildURI(?tclassreal) AS ?tclassURI) . | BIND (smf:buildURI(?tclassreal) AS ?tclassURI) . | ||
− | ?i a ?tclassURI . | + | { |
− | NOT EXISTS{ | + | ?i a ?tclassURI . |
− | + | NOT EXISTS{ | |
− | } | + | ?i ?tpropURI ?value . |
+ | } | ||
+ | }UNION{ | ||
+ | ?i a ?tclassURI . | ||
+ | ?i ?tpropURI "" . | ||
+ | } | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 17:37, 10 October 2011
Prerequisites
With the DQM-Vocabulary you can easily create reports that show you the instances that violate your previously specified data requirements. 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. 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
SELECT ?i ?dqr 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 (smf:buildURI(?tpropreal) AS ?tpropURI) . BIND (smf:buildURI(?tclassreal) AS ?tclassURI) . { ?i a ?tclassURI . NOT EXISTS{ ?i ?tpropURI ?value . } }UNION{ ?i a ?tclassURI . ?i ?tpropURI "" . } }