Data Requirements Consistency Checks

From SemWebQuality.org
(Difference between revisions)
Jump to: navigation, search
(Duplicate Property Requirements)
(Contradictory Unique Value Rules)
Line 4: Line 4:
 
SELECT (?s AS ?uniquevaluereq) (?s2 AS ?nonuniquenessreq)
 
SELECT (?s AS ?uniquevaluereq) (?s2 AS ?nonuniquenessreq)
 
WHERE{
 
WHERE{
?s a dqm:UniqueValueRule .
+
?dr1 a dqm:UniqueValueRule .
?s dqm:testedClass ?class1 .
+
?dr1 dqm:testedClass ?class1 .
 
?class1 dqm:hasURI ?class1URI .
 
?class1 dqm:hasURI ?class1URI .
?s dqm:testedProperty1 ?prop1 .
+
?dr1 dqm:testedProperty1 ?prop1 .
 
?prop1 dqm:hasURI ?prop1URI .
 
?prop1 dqm:hasURI ?prop1URI .
 
OPTIONAL{
 
OPTIONAL{
   ?s2 a dqm:PropertyRequirement .
+
   ?dr2 a dqm:PropertyRequirement .
   ?s2 dqm:testedClass ?class2 .
+
   ?dr2 dqm:testedClass ?class2 .
 
   ?class2 dqm:hasURI ?class2URI .
 
   ?class2 dqm:hasURI ?class2URI .
   ?s2 dqm:testedProperty1 ?prop2 .
+
   ?dr2 dqm:testedProperty1 ?prop2 .
 
   ?prop2 dqm:hasURI ?prop2URI .
 
   ?prop2 dqm:hasURI ?prop2URI .
   FILTER(str(?prop1URI) = str(?prop2URI) && str(?class1URI) = str(?class2URI) && ?s != ?s2)
+
   FILTER(str(?prop1URI) = str(?prop2URI) && str(?class1URI) = str(?class2URI) && dr1 != dr2)
 
   MINUS{
 
   MINUS{
       ?s2 a dqm:UniqueValueRule
+
       dr2 a dqm:UniqueValueRule
 
   }
 
   }
 
}
 
}
Line 23: Line 23:
 
}
 
}
 
</syntaxhighlight>
 
</syntaxhighlight>
 
  
 
==Duplicate Property Requirements==
 
==Duplicate Property Requirements==

Revision as of 16:56, 18 June 2012

Contradictory Unique Value Rules

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

Duplicate Property Requirements

PREFIX dqm:<http://purl.org/dqm-vocabulary/v1.1/dqm#>
SELECT (?tclassURI1 AS ?Class) (?tpropURI1 AS ?Property) (?dr1 AS ?DataRequirement)
WHERE {
   ?dr1 a dqm:PropertyRequirement .
   ?dr1 dqm:testedClass ?tclass1 .
   ?tclass1 dqm:hasURI ?tclassURI1 .   
   ?dr1 dqm:testedProperty1 ?tprop1 .
   ?tprop1 dqm:hasURI ?tpropURI1 .
}
ORDER BY ?tclassURI1 ?tpropURI1 ?dr1
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