ontodev / robot

ROBOT is an OBO Tool
http://robot.obolibrary.org
BSD 3-Clause "New" or "Revised" License
257 stars 70 forks source link

How to trigger datatype property range review? #1209

Open ajnelson-nist opened 3 days ago

ajnelson-nist commented 3 days ago

I just encountered a behavior I'm not understanding.

Given this input file, try.ttl:

@prefix ex: <http://example.org/ontology/> .
@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 xsd: <http://www.w3.org/2001/XMLSchema#> .

ex:dp1
    a owl:DatatypeProperty ;
    rdfs:range xsd:dateTimeStamp ;
    .

[]
    a owl:Thing ;
    ex:dp1 2 ;
    .

I have this shell transcript (ROBOT 1.9.6):

$ java -jar robot.jar validate-profile \
      --input try.ttl \
      --profile DL \
      --strict
OWL 2 DL Profile Report: [Ontology and imports closure in profile]

Is this the expected behavior?

jamesaoverton commented 2 days ago

I don't think we can be much help with this. ROBOT just calls OWLAPI's profile validator: https://github.com/ontodev/robot/blob/master/robot-command/src/main/java/org/obolibrary/robot/ValidateProfileCommand.java#L104

I'm not surprised that the OWL profile validator does not check that 2 is not a datetime. If you replace 2 with owl:Thing you will see a profile violation, which is the kind of thing that I expect the OWL profile validator to check.

To properly validate datatypes you may need to use another approach, such as ShEx or SHACL.