File size: 925 Bytes
38b6321
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
prefix owl:   <http://www.w3.org/2002/07/owl#> 
prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#>
prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 

##
# banner We should avoid punning object and datatype properties

SELECT DISTINCT ?error ?property1 ?property2
WHERE
{
    ?property1 owl:equivalentProperty ?property2.
    FILTER (regex(str(?property1), <HYGIENE_TESTS_FILTER_PARAMETER>) || regex(str(?property2), <HYGIENE_TESTS_FILTER_PARAMETER>))
    {
        ?property1 rdfs:subPropertyOf*/rdf:type owl:DatatypeProperty.
        ?property2 rdfs:subPropertyOf*/rdf:type owl:ObjectProperty.
    }
    UNION
    {
        ?property2 rdfs:subPropertyOf*/rdf:type owl:DatatypeProperty.
        ?property1 rdfs:subPropertyOf*/rdf:type owl:ObjectProperty.
    }
    BIND (concat ("ERROR: Equivalent property axiom for ", str(?property1), str(?property2), " mixes up object and datatype properties.") AS ?error)
}