All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rule.owlrl.rul Maven / Gradle / Ivy


 
  
  
  
  
  
]>






  
CONSTRUCT {
	owl:Thing a owl:Class .
	owl:Nothing a owl:Class .
}
WHERE {}










  
prefix sp:   <http://spinrdf.org/sp#>
CONSTRUCT {
    _:b0 a sp:ConstraintViolation .
    _:b0 sp:arg1 ?x ; sp:arg2 ?y .
    _:b0 sp:violationPath owl:sameAs .
    _:b0 rdfs:label "Violates owl:differentFrom" .
}
WHERE {
    ?x owl:sameAs ?y .
    ?x owl:differentFrom ?y .
}








  
prefix sp:   <http://spinrdf.org/sp#>
CONSTRUCT {
    _:b0 a sp:ConstraintViolation .
    _:b0 sp:violationRoot ?x .
    _:b0 sp:violationPath owl:sameAs .
    _:b0 sp:arg1 ?zi ; sp:arg2 ?zj .
    _:b0 rdfs:label "Violation of owl:AllDifferent" .
}
WHERE {
    ?x a owl:AllDifferent .
    ?x owl:members|owl:distinctMembers ?list1 .
    ?list1 rdf:rest* ?list2 .
    ?list2 rdf:first ?zi .
    ?list2 rdf:rest+ ?list3 .
    ?list3 rdf:first ?zj .
    ?zi owl:sameAs ?zj .
}






  
CONSTRUCT {
    ?x a ?c .
}
WHERE {
    ?p rdfs:domain ?c .
    ?x ?p ?y .
}






  
CONSTRUCT {
    ?y a ?c .
}
WHERE {
    ?p rdfs:range ?c .
    ?x ?p ?y . filter (! isLiteral(?y))
}




  
CONSTRUCT {
    ?y1 owl:sameAs ?y2 .
}
WHERE {
    ?p a owl:FunctionalProperty .
    ?x ?p ?y1 .
    ?x ?p ?y2 .
 FILTER (?y1 != ?y2) . 
}




  
CONSTRUCT {
    ?x1 owl:sameAs ?x2 .
}
WHERE {
    ?p a owl:InverseFunctionalProperty .
    ?x1 ?p ?y .
    ?x2 ?p ?y .
   FILTER (?x1 != ?x2) . 
}





  
prefix sp:   <http://spinrdf.org/sp#>
CONSTRUCT {
    _:b0 a sp:ConstraintViolation .
    _:b0 sp:violationRoot ?x .
    _:b0 sp:violationPath ?p .
    _:b0 rdfs:label "Irreflexive property" .
}
WHERE {
    ?p a owl:IrreflexiveProperty .
    ?x ?p ?x .
}




  
CONSTRUCT {
    ?y ?p ?x .
}
WHERE {
    ?p a owl:SymmetricProperty .
    ?x ?p ?y .
}





  
prefix sp:   <http://spinrdf.org/sp#>
CONSTRUCT {
    _:b0 a sp:ConstraintViolation .
    _:b0 sp:violationPath ?p .
    _:b0 rdfs:label "Asymmetric property" .
    _:b0 sp:arg1 ?x ; sp:arg2 ?y .
}
WHERE {
    ?p a owl:AsymmetricProperty .
    ?x ?p ?y .
    ?y ?p ?x .
}






  
CONSTRUCT {
    ?x ?p ?z .
}
WHERE {
    ?p a owl:TransitiveProperty .
    ?x ?p ?y .
    ?y ?p ?z .
}






basic
   
CONSTRUCT {
	?u ?p ?v .
}
WHERE {	
  {
	select ?p
	  (group_concat(concat('<', ?pi, '>'); separator = '/') as ?exp)
	  (concat('select  * where { ?u ', ?exp, ' ?v }') as ?query)
	where {
	  ?p owl:propertyChainAxiom ?x .
	  ?x rdf:rest*/rdf:first ?pi
	}
	group by ?p
  }
  filter bound(?p)
  values (?u ?v) { unnest(kg:sparql(?query)) }
}





  
CONSTRUCT {
    ?x ?p2 ?y .
}
WHERE {
    ?p1 owl:equivalentProperty ?p2 . filter (?p1 != ?p2)
    ?x ?p1 ?y .
}





  
CONSTRUCT {
    ?x ?p1 ?y .
}
WHERE {
    ?p1 owl:equivalentProperty ?p2 . filter (?p1 != ?p2)
    ?x ?p2 ?y .
}






  
prefix sp:   <http://spinrdf.org/sp#>
CONSTRUCT {
    _:b0 a sp:ConstraintViolation .
    _:b0 sp:violationPath ?p1, ?p2 .
    _:b0 rdfs:label "Property declared disjoint with" .
    _:b0 sp:arg1 ?x ; sp:arg2 ?y .
}
WHERE {
    ?p1 owl:propertyDisjointWith ?p2 .
    ?x ?p1 ?y .
    ?x ?p2 ?y .
}






  
prefix sp:   <http://spinrdf.org/sp#>
CONSTRUCT {
    _:b0 a sp:ConstraintViolation .
    _:b0 sp:violationRoot ?x .
    _:b0 sp:violationPath ?pi, ?pj .
    _:b0 rdfs:label "Violation of owl:AllDisjointProperties" .
    _:b0 sp:arg1 ?u ; sp:arg2 ?v .
}
WHERE {
    ?x a owl:AllDisjointProperties .
    ?x owl:members ?list1 .
    ?list1 rdf:rest* ?list2 .
    ?list2 rdf:first ?pi .
    ?list2 rdf:rest+ ?list3 .
    ?list3 rdf:first ?pj .
    ?u ?pi ?v .
    ?u ?pj ?v .
}





  
CONSTRUCT {
    ?y ?p2 ?x .
}
WHERE {
    ?p1 owl:inverseOf ?p2 .
    ?x ?p1 ?y .
}





  
CONSTRUCT {
    ?y ?p1 ?x .
}
WHERE {
    ?p1 owl:inverseOf ?p2 .
    ?x ?p2 ?y .
}






  
prefix sp:   <http://spinrdf.org/sp#>
CONSTRUCT {
    _:b0 a sp:ConstraintViolation .
    _:b0 sp:violationPath ?p .
    _:b0 rdfs:label "Negative Property Assertion" .
    _:b0 sp:arg1 ?i1 ; sp:arg2 ?i2 .
}
WHERE {
    ?x owl:targetIndividual ?i2 .
    ?x owl:sourceIndividual ?i1 .
    ?x owl:assertionProperty ?p .
    ?x a owl:NegativePropertyAssertion .
    ?i1 ?p ?i2 .
}






  
prefix sp:   <http://spinrdf.org/sp#>
CONSTRUCT {
    _:b0 a sp:ConstraintViolation .
    _:b0 sp:violationPath ?p .
    _:b0 rdfs:label "Negative Property Assertion" .
    _:b0 sp:arg1 ?i ; sp:arg2 ?lt .
}
WHERE {
    ?x owl:targetValue ?lt .
    ?x owl:sourceIndividual ?i .
    ?x owl:assertionProperty ?p .
    ?x a owl:NegativePropertyAssertion .
    ?i ?p ?lt .
}








  
prefix sp:   <http://spinrdf.org/sp#>
CONSTRUCT {
    _:b0 a sp:ConstraintViolation .
    _:b0 sp:violationRoot ?x .
    _:b0 rdfs:label "There exists an instance of owl:Nothing" .
}
WHERE {
    ?x a owl:Nothing .
}






  
CONSTRUCT {
	?y a ?c .
}
WHERE {
    ?c owl:intersectionOf ?x .
    ?x rdf:first ?f
    ?y a ?f 
    filter not exists {
      ?x rdf:rest+/rdf:first ?ci
      filter not exists { ?y a ?ci }
    }
}





  
CONSTRUCT {
    ?y a ?ci .
}
WHERE {
    ?c owl:intersectionOf ?x .
    ?x rdf:rest*/rdf:first ?ci .
    ?y a ?c .
}







  
CONSTRUCT {
    ?y a ?c .
}
WHERE {
    ?c owl:unionOf ?x .
    ?x rdf:rest*/rdf:first ?ci .
    ?y a ?ci .
}








  
prefix sp:   <http://spinrdf.org/sp#>
CONSTRUCT {
    _:b0 a sp:ConstraintViolation .
    _:b0 sp:violationRoot ?x .
    _:b0 rdfs:label "Violation of owl:complementOf" .
    _:b0 sp:arg1 ?c1 .
    _:b0 sp:arg2 ?c2 .
}
WHERE {
    ?c1 owl:complementOf ?c2 .
    ?x a ?c1 .
    ?x a ?c2 .
}







  
CONSTRUCT {
    ?u a ?x .
}
WHERE {
    ?x owl:someValuesFrom ?y .
    ?x owl:onProperty ?p .
    ?u ?p ?v .
    ?v a ?y .
}






  
CONSTRUCT {
    ?u a ?x .
}
WHERE {
    ?x owl:someValuesFrom ?y .
    ?x owl:onProperty ?p .
    filter strstarts(?y, xsd:)
    ?u ?p ?v .
    filter isLiteral(?v)
    filter (datatype(?v) = ?y)
}







  
CONSTRUCT {
    ?u a ?x .
}
WHERE {
    ?x owl:someValuesFrom owl:Thing .
    ?x owl:onProperty ?p .
    ?u ?p ?v .
}





  
CONSTRUCT {
    ?v a ?y .
}
WHERE {
    ?x owl:allValuesFrom ?y .
    ?x owl:onProperty ?p .
    ?u a ?x .
    ?u ?p ?v .
}





  
CONSTRUCT {
    ?u ?p ?y .
}
WHERE {
    ?x owl:hasValue ?y .
    ?x owl:onProperty ?p .
    ?u a ?x .
}





  
CONSTRUCT {
    ?u a ?x .
}
WHERE {
    ?x owl:hasValue ?y .
    ?x owl:onProperty ?p .
    ?u ?p ?y .
}






  
prefix sp:   <http://spinrdf.org/sp#>
CONSTRUCT {
    _:b0 a sp:ConstraintViolation .
    _:b0 sp:violationRoot ?x .
    _:b0 sp:violationPath ?p .
    _:b0 rdfs:label "owl:maxCardinality of 0" .
    _:b0 sp:arg1 ?u ; sp:arg2 ?y .
}
WHERE {
    ?x owl:maxCardinality "0"^^xsd:nonNegativeInteger .
    ?x owl:onProperty ?p .
    ?u a ?x .
    ?u ?p ?y .
}





  
CONSTRUCT {
    ?y1 owl:sameAs ?y2 .
}
WHERE {
    ?x owl:maxCardinality "1"^^xsd:nonNegativeInteger .
    ?x owl:onProperty ?p .
    ?u a ?x .
    ?u ?p ?y1 .
    ?u ?p ?y2 .
    filter (?y1 != ?y2)
}






  
prefix sp:   <http://spinrdf.org/sp#>
CONSTRUCT {
    _:b0 a sp:ConstraintViolation .
    _:b0 sp:violationRoot ?c .
    _:b0 sp:violationPath ?p .
    _:b0 rdfs:label "Maximum qualified cardinality of 0" .
    _:b0 sp:arg1 ?u ; sp:arg2 ?y .
}
WHERE {
    ?x owl:maxQualifiedCardinality "0"^^xsd:nonNegativeInteger .
    ?x owl:onProperty ?p .
    ?x owl:onClass ?c .
    ?u a ?x .
    ?u ?p ?y .
    ?y a ?c .
}






  
prefix sp:   <http://spinrdf.org/sp#>
CONSTRUCT {
    _:b0 a sp:ConstraintViolation .
    _:b0 sp:violationRoot owl:Thing .
    _:b0 sp:violationPath ?p .
    _:b0 rdfs:label "Qualified max cardinality 0" .
    _:b0 sp:arg1 ?u ; sp:arg2 ?y .
}
WHERE {
    ?x owl:maxQualifiedCardinality "0"^^xsd:nonNegativeInteger .
    ?x owl:onProperty ?p .
    ?x owl:onClass owl:Thing .
    ?u a ?x .
    ?u ?p ?y .
}





  
CONSTRUCT {
    ?y1 owl:sameAs ?y2 .
}
WHERE {
    ?x owl:maxQualifiedCardinality "1"^^xsd:nonNegativeInteger .
    ?x owl:onProperty ?p .
    ?x owl:onClass ?c .
    ?u a ?x .
    ?u ?p ?y1 .
    ?y1 a ?c .
    ?u ?p ?y2 .
    ?y2 a ?c .
    filter (?y1 != ?y2)
}





  
CONSTRUCT {
    ?y1 owl:sameAs ?y2 .
}
WHERE {
    ?x owl:maxQualifiedCardinality "1"^^xsd:nonNegativeInteger .
    ?x owl:onProperty ?p .
    ?x owl:onClass owl:Thing .
    ?u a ?x .
    ?u ?p ?y1 .
    ?u ?p ?y2 .
}





  
CONSTRUCT {
    ?yi a ?c .
}
WHERE {
    ?c owl:oneOf ?x .
    ?x rdf:rest*/rdf:first ?yi .
    filter (! isLiteral(?yi))
}














CONSTRUCT {
    ?x a ?c2 .
}
WHERE {
    ?c1 owl:equivalentClass ?c2 . filter (?c1 != ?c2)
    ?x a ?c1 .
}





  
CONSTRUCT {
    ?x a ?c1 .
}
WHERE {
    ?c1 owl:equivalentClass ?c2 . filter (?c1 != ?c2)
    ?x a ?c2 .
}






  
prefix sp:   <http://spinrdf.org/sp#>
CONSTRUCT {
    _:b0 a sp:ConstraintViolation .
    _:b0 sp:violationRoot ?x .
    _:b0 rdfs:label "Violates owl:disjointWith" .
    _:b0 sp:arg1 ?c1 ;
      sp:arg2 ?c2
}
WHERE {
    ?c1 owl:disjointWith ?c2 .
    ?x a ?c1 .
    ?x a ?c2 .
}






  
prefix sp:   <http://spinrdf.org/sp#>
CONSTRUCT {
    _:b0 a sp:ConstraintViolation .
    _:b0 sp:violationRoot ?x .
    _:b0 rdfs:label "Violates owl:AllDisjointClasses" .
    _:b0 sp:arg1 ?ci ;
      sp:arg2 ?cj
      }
WHERE {
    ?y a owl:AllDisjointClasses .
	?y owl:members ?list1 .
    ?list1 rdf:rest* ?list2 .
    ?list2 rdf:first ?ci .
    ?list2 rdf:rest+ ?list3 .
    ?list3 rdf:first ?cj .
    ?x a ?ci .
    ?x a ?cj .
}








  
CONSTRUCT {
    ?c rdfs:subClassOf ?c .
    ?c owl:equivalentClass ?c .
    ?c rdfs:subClassOf owl:Thing .
    owl:Nothing rdfs:subClassOf ?c .
}
WHERE {
    ?c a owl:Class .
}






  
CONSTRUCT {
    ?x a owl:Thing .
}
WHERE {
    _:b a owl:Restriction 
    ?x a _:b
    filter isURI(?x)
}





  
CONSTRUCT {
    ?c1 rdfs:subClassOf ?c2 .
    ?c2 rdfs:subClassOf ?c1 .
}
WHERE {
    ?c1 owl:equivalentClass ?c2 . filter (?c1 != ?c2)
}




  
CONSTRUCT {
    ?c rdfs:subClassOf ?ci .
}
WHERE {
    ?c owl:intersectionOf ?x .
    ?x rdf:rest*/rdf:first ?ci .
}





  
CONSTRUCT {
    ?ci rdfs:subClassOf ?c .
}
WHERE {
    ?c owl:unionOf ?x .
    ?x rdf:rest*/rdf:first ?ci .
}







  
CONSTRUCT {
    ?c1 owl:equivalentClass ?c2 .
}
WHERE {
    ?c1 rdfs:subClassOf ?c2 . filter (?c1 != ?c2)
    ?c2 rdfs:subClassOf ?c1 .
}





  
CONSTRUCT {
    ?p rdfs:subPropertyOf ?p .
    ?p owl:equivalentProperty ?p .
}
WHERE {
    ?p a owl:ObjectProperty 
    # use case: owl:onProperty [ owl:inverseOf ex:hasFriend ]
    filter isURI(?p)
}





  
CONSTRUCT {
    ?p owl:equivalentProperty ?p .
}
WHERE {
    ?p a owl:DatatypeProperty .
}





  
CONSTRUCT {
    ?p1 rdfs:subPropertyOf ?p2 .
    ?p2 rdfs:subPropertyOf ?p1 .
}
WHERE {
    ?p1 owl:equivalentProperty ?p2 . filter (?p1 != ?p2)
}





  
CONSTRUCT {
    ?p1 owl:equivalentProperty ?p2 .
}
WHERE {
    ?p1 rdfs:subPropertyOf ?p2 . filter (?p1 != ?p2)
    ?p2 rdfs:subPropertyOf ?p1 .
}





  
CONSTRUCT {
    ?p1 rdfs:subPropertyOf ?p3 .
}
WHERE {
    ?p1 rdfs:subPropertyOf ?p2 .
    ?p2 rdfs:subPropertyOf ?p3 .
}





  
CONSTRUCT {
    ?x ?p2 ?y .
}
WHERE {
    ?p1 rdfs:subPropertyOf ?p2 . filter (?p1 != ?p2)
    ?x ?p1 ?y .
}





  
CONSTRUCT {
    ?p rdfs:domain ?c2 .
}
WHERE {
    ?p rdfs:domain ?c1 .
    ?c1 rdfs:subClassOf ?c2 . filter (?c1 != ?c2)
}





  
CONSTRUCT {
    ?p1 rdfs:domain ?c .
}
WHERE {
    ?p2 rdfs:domain ?c .
    ?p1 rdfs:subPropertyOf ?p2 . filter (?p1 != ?p2)
}







  
CONSTRUCT {
    ?p rdfs:range ?c2 .
}
WHERE {
    ?p rdfs:range ?c1 .
    ?c1 rdfs:subClassOf ?c2 . filter (?c1 != ?c2)
}







  
CONSTRUCT {
    ?p1 rdfs:range ?c .
}
WHERE {
    ?p2 rdfs:range ?c .
    ?p1 rdfs:subPropertyOf ?p2 . filter (?p1 != ?p2)
}








  
CONSTRUCT {
    ?c1 rdfs:subClassOf ?c2 .
}
WHERE {
    ?p1 rdfs:subPropertyOf ?p2 . filter (?p1 != ?p2)    
    ?c1 owl:hasValue ?i .
    ?c1 owl:onProperty ?p1 .
    ?c2 owl:hasValue ?i .
    ?c2 owl:onProperty ?p2 .
}





  
CONSTRUCT {
    ?c1 rdfs:subClassOf ?c2 .
}
WHERE {
    ?p1 rdfs:subPropertyOf ?p2 . filter (?p1 != ?p2)
    ?c1 owl:someValuesFrom ?y .
    ?c1 owl:onProperty ?p1 .
    ?c2 owl:someValuesFrom ?y .
    ?c2 owl:onProperty ?p2 .
}





  

CONSTRUCT {
    ?c2 rdfs:subClassOf ?c1 .
}
WHERE {
    ?p1 rdfs:subPropertyOf ?p2 . filter (?p1 != ?p2)
    ?c1 owl:allValuesFrom ?y .
    ?c1 owl:onProperty ?p1 .
    ?c2 owl:allValuesFrom ?y .
    ?c2 owl:onProperty ?p2 .
}






  
CONSTRUCT  {
    ?c1 rdfs:subClassOf ?c2 .
}
WHERE {
    ?y1 rdfs:subClassOf ?y2 . filter (?y1 != ?y2)
    ?c1 owl:someValuesFrom ?y1 .
    ?c1 owl:onProperty ?p .
    ?c2 owl:someValuesFrom ?y2 .
    ?c2 owl:onProperty ?p .
}







  
CONSTRUCT {
    ?c1 rdfs:subClassOf ?c2 .
}
WHERE {
    ?y1 rdfs:subClassOf ?y2 . filter (?y1 != ?y2)
    ?c1 owl:allValuesFrom ?y1 .
    ?c1 owl:onProperty ?p .
    ?c2 owl:allValuesFrom ?y2 .
    ?c2 owl:onProperty ?p .
}













  
CONSTRUCT {
    ?c1 rdfs:subClassOf ?c3 .
}
WHERE {
    ?c1 rdfs:subClassOf ?c2 .
    ?c2 rdfs:subClassOf ?c3 .
}






CONSTRUCT {
    ?x a ?c2 .
}
WHERE {
    ?x a ?c1 .
    ?c1 rdfs:subClassOf ?c2 
}








construct {
    ?x owl:sameAs ?y
}
where {
    ?c owl:hasKey ?list 
    ?x a ?c
    ?y a ?c
    filter (?x != ?y)
    
    filter not exists { 
        ?list rdf:rest*/rdf:first ?p
        filter not exists { 
            ?x ?p ?v .
            ?y ?p ?v
        }
    }
}







   
CONSTRUCT {
    ?s  owl:sameAs ?s .
    ?pp owl:sameAs ?pp .
    ?oo owl:sameAs ?oo
}
WHERE {
	graph ?g {?s ?p ?o}
    filter (?g != kg:constraint)
    # do not modify the ontology:
    filter (! strstarts(?p, owl:))
    filter (! strstarts(?p, rdfs:))
    filter (! strstarts(?p, xsd:))
    filter (! strstarts(?p, rdf:) || ?p = rdf:type)
    
    filter (! strstarts(?s, owl:))
    filter (! strstarts(?s, xsd:))
    filter (! strstarts(?s, rdf:))
    filter (! strstarts(?s, rdfs:))
    
    filter (! strstarts(?o, owl:))
    filter (! strstarts(?o, xsd:))
    filter (! strstarts(?o, rdf:))
    filter (! strstarts(?o, rdfs:))
    
    bind (if (isLiteral(?o), error(),
        # exclude bnode object of us:James a [ a owl:Restriction ... ]
        if (isBlank(?o) && ?p = rdf:type, error(), ?o)) 
        as ?oo)
    # protect from bnode property
    bind (if (isBlank(?p), error(), ?p) as ?pp)
}





    
CONSTRUCT {
    ?y owl:sameAs ?x .
}
WHERE {
    ?x owl:sameAs ?y . filter (?x != ?y)
}




  
CONSTRUCT {
    ?x owl:sameAs ?z .
}
WHERE {
    ?x owl:sameAs ?y . 
    ?y owl:sameAs ?z .
    filter (?x != ?z)
}




  
CONSTRUCT {
    ?s ?p2 ?o .
}
WHERE {
    ?p owl:sameAs ?p2 .
    filter (?p != ?p2)
    ?s ?p ?o .
}





  
CONSTRUCT {
    ?s2 ?p ?o .
}
WHERE {
    ?s owl:sameAs ?s2 .
    ?s ?p ?o 
    filter (?s != ?s2)
    # do not modify list structure and ontology statement
    filter (?p not in (rdf:first))
    filter (! strstarts(?p, owl:))
    filter (! strstarts(?p, rdfs:))
}






  
CONSTRUCT {
    ?s ?p ?o2 .
}
WHERE {
    ?o owl:sameAs ?o2 .
    ?s ?p ?o .
    filter (?o != ?o2)
    # do not modify list structure and ontology statement
    filter (?p not in (rdf:first))
    filter (! strstarts(?p, owl:))
    filter (! strstarts(?p, rdfs:))
}











© 2015 - 2025 Weber Informatics LLC | Privacy Policy