Data Requirements Consistency Checks

From SemWebQuality.org
Revision as of 16:10, 18 June 2012 by Cfuerber (Talk | contribs)
Jump to: navigation, search

Contradictory Unique Value Rules

PREFIX dqm:<http://purl.org/dqm-vocabulary/v1.1/dqm#>
SELECT (?s AS ?uniquevaluereq) (?s2 AS ?nonuniquenessreq)
WHERE{
?s a dqm:UniqueValueRule .
?s dqm:testedClass ?class1 .
?class1 dqm:hasURI ?class1URI .
?s dqm:testedProperty1 ?prop1 .
?prop1 dqm:hasURI ?prop1URI .
OPTIONAL{
   ?s2 a dqm:PropertyRequirement .
   ?s2 dqm:testedClass ?class2 .
   ?class2 dqm:hasURI ?class2URI .
   ?s2 dqm:testedProperty1 ?prop2 .
   ?prop2 dqm:hasURI ?prop2URI .
   FILTER(str(?prop1URI) = str(?prop2URI) && str(?class1URI) = str(?class2URI) && ?s != ?s2)
   MINUS{
      ?s2 a dqm:UniqueValueRule
   }
}
FILTER(bound(?prop2URI))
}


Duplicate Property Requirements

PREFIX dqm:<http://purl.org/dqm-vocabulary/v1.1/dqm#>
PREFIX xsd:<http://www.w3.org/2001/XMLSchema#>
SELECT ?dr1 ?dr2
WHERE {
?dr1 a dqm:PropertyRequirement .
?dr1 dqm:testedClass ?tclass1 .
?tclass1 dqm:hasURI ?tclassURI1 .   
?dr1 dqm:testedProperty1 ?tprop1 .
?tprop1 dqm:hasURI ?tpropURI1 .
OPTIONAL{
?dr2 a dqm:PropertyRequirement .
?dr2 dqm:testedClass ?tclass2 .
?tclass2 dqm:hasURI ?tclassURI2 .   
?dr2 dqm:testedProperty1 ?tprop2 .
?tprop2 dqm:hasURI ?tpropURI2 .
FILTER(?dr1!=?dr2 && str(?tclassURI1) = str(?tclassURI2) && str(?tpropURI1) = str(?tpropURI2))
}
}
<syntaxhighlight>
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox