Skip to content

Hygiene Test - Use of qualified vs. unqualified restrictions #1489

@mereolog

Description

@mereolog

https://github.com/edmcouncil/fibo/blob/master/ONTOLOGY_GUIDE.md#t10--use-of-qualified-vs-unqualified-restrictions recommends for us checking use of unqualified restrictions.

The following test should find these:

prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#>
prefix owl:   <http://www.w3.org/2002/07/owl#>

##
# banner Unqualified OWL restrictions should be avoided.

SELECT DISTINCT ?warning ?resource
WHERE 
{
    ?resource rdfs:subClassOf ?restriction .
    FILTER (CONTAINS(str(?resource), "edmcouncil"))
    ?restriction rdf:type owl:Restriction .
    {
        ?restriction owl:cardinality ?n
        BIND('owl:cardinality' as ?restrictiontype)
    }
    UNION
    {
        ?restriction owl:minCardinality ?n
        BIND('owl:minCardinality' as ?restrictiontype)
    }
    UNION
    {
        ?restriction owl:maxCardinality ?n
        BIND('owl:maxCardinality' as ?restrictiontype)
    }
    
    BIND (concat ("Warning: Resource ", str(?resource), " is a subclass of an unqualified OWL restriction ", " of type ", ?restrictiontype) AS ?warning) 
}

Here are the resources found by this query:
unqualifiedowlrestri-edmcfibo-QueryResult.xlsx

Metadata

Metadata

Assignees

Labels

hygieneExample of general problem which should be picked up by Hygiene tests or a new hygiene test proposal

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions