File size: 832 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
24
prefix owl:   <http://www.w3.org/2002/07/owl#>
prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#>
prefix skos: <http://www.w3.org/2004/02/skos/core#>
prefix xsd:   <http://www.w3.org/2001/XMLSchema#>

##
# banner Definitions shouldn't be circular - this finds direct circularities therein.

SELECT DISTINCT ?error ?definition ?label
WHERE {
  ?subject rdfs:label ?label .
  FILTER NOT EXISTS {?subject owl:deprecated "true"^^xsd:boolean} .
  ?subject skos:definition ?definition .
  FILTER NOT EXISTS {?subject a owl:NamedIndividual} .
  FILTER (REGEX(?definition, "\\W"+?label+"\\W"))
  FILTER regex(str(?subject), <HYGIENE_TESTS_FILTER_PARAMETER>)


  BIND (
    concat ("PRODERROR: Definition of ", str(?subject), " is immediately circular ")
      AS ?error
    )
}