Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect use of rdfs:domain #17

Open
IS4Code opened this issue Dec 26, 2020 · 2 comments
Open

Incorrect use of rdfs:domain #17

IS4Code opened this issue Dec 26, 2020 · 2 comments

Comments

@IS4Code
Copy link

IS4Code commented Dec 26, 2020

I have noticed some properties in the filesystem ontology akin to this:

:lastAccessedOn
    a owl:DatatypeProperty, owl:FunctionalProperty ;
    rdfs:domain :Directory, :File ;
    rdfs:range xsd:dateTimeStamp .

As is it currently written, this implies that the domain of :lastAccessedOn is the intersection of classes :Directory and :File, not their union.

Per the RDF Schema 1.1:

Where a property P has more than one rdfs:domain property, then the resources denoted by subjects of triples with predicate P are instances of all the classes stated by the rdfs:domain properties.
Any entity that has this property is simultaneously a file and a directory.

The solution would be to specify a class that both :File and :Directory are subclasses of. I think it would be best to add some overarching class like :FileSystemEntry and use that, since even volumes, links etc. might have these attributes.

@plbt5
Copy link

plbt5 commented Oct 6, 2021

I fully support @IllidanS4 's review comment. Regarding solution, although S4 's suggestion is certainly valid, I suggest the use of a blank node to improve terseness and readability, as follows:

:lastAccessedOn
    a owl:DatatypeProperty, owl:FunctionalProperty ;
    rdfs:domain [
    	owl:unionOf (
            :Directory :File
        )
    ] ;
    rdfs:range xsd:dateTimeStamp .

@plbt5
Copy link

plbt5 commented Oct 6, 2021

Apart from the above, is it really the intention to apply rdfs:domain and rdfs:range in the way that it is specified? Its application is often confused as setting a data restriction, as opposed to its actual function that is to infer something to be of a certain class. In this example, with the following data:

<A> :lastAccessedOn <B> .

the function of the rdfs:range statement would be to infer that

<B>  rdf:type xsd:dateTimeStamp .

I assume, though, that the authors expected an error message of some sort in case <B> did not actually denote an xsd:dateTimeStamp. However, in order to enforce this behaviour one would apply a SHACL statement to specify that particular data constraint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants