# Title: 
#    Definition Required
# Constraint Description: 
#    Any class or object property must have a non-empty definition with an English language tag.  
# Severity:
#     Warning

PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>

SELECT DISTINCT ?resource ?label ?error
WHERE {
VALUES ?type {owl:Class owl:ObjectProperty}
    ?resource a ?type .
    OPTIONAL {
        ?resource skos:definition ?englishDefinition .
        FILTER (langMatches(lang(?englishDefinition), "en"))
        }
    FILTER(!bound(?englishDefinition))
    FILTER(!isBlank(?resource))
    BIND (concat("WARNING: Missing definition for ", str(?resource)) AS ?error)
}
ORDER BY ?resource
