Skip to content

Instantly share code, notes, and snippets.

@ajnelson-nist
Last active February 2, 2024 13:51
Show Gist options
  • Save ajnelson-nist/33e408c4b6d0043f3121de79e1c2654b to your computer and use it in GitHub Desktop.
Save ajnelson-nist/33e408c4b6d0043f3121de79e1c2654b to your computer and use it in GitHub Desktop.
An OWL Profiles test of punning in response to UCO Issue 586

This Gist contains a test undertaken when reviewing portions of UCO Issue 586.

Disclaimer

Participation by NIST in the creation of the documentation of mentioned software is not intended to imply a recommendation or endorsement by the National Institute of Standards and Technology, nor is it intended to imply that any specific software is necessarily the best available for the purpose.

Usage

Target environments: macOS, Linux, or Windows Subsystem for Linux.

Procedure:

  1. Clone Gist.
  2. Run make -k (for --keep-going). Some resources will be downloaded. Any Java resources have previously-encountered hashes included in the Gist, and are verified before download procedure completes.

Transcript

These were the results from a prior run. make -k had been run once, which downloaded robot.jar and then used it to run tests. This transcript is from a following make -k run, which did not need to repeat the robot.jar recipe.

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

java -jar robot.jar validate-profile \
	  --input asserted.ttl \
	  --profile EL \
	  --strict
OWL 2 EL Profile Report: Ontology and imports closure NOT in profile. The following violations are present:
Use of data range not in profile: <https://example.org/DatatypeAndObjectProperty-1> [Declaration(Datatype(<https://example.org/DatatypeAndObjectProperty-1>)) in OntologyID(Anonymous-2)]
Use of data range not in profile: <https://example.org/DatatypeAndAnnotationProperty-1> [Declaration(Datatype(<https://example.org/DatatypeAndAnnotationProperty-1>)) in OntologyID(Anonymous-2)]
Use of data range not in profile: <https://example.org/DatatypeAndDatatypeProperty-1> [Declaration(Datatype(<https://example.org/DatatypeAndDatatypeProperty-1>)) in OntologyID(Anonymous-2)]

PROFILE VIOLATION ERROR null violates profile EL
For details see: http://robot.obolibrary.org/validate-profile#profile-violation-error
Use the -vvv option to show the stack trace.
Use the --help option to see usage information.
make: *** [check-el] Error 1
java -jar robot.jar validate-profile \
	  --input asserted.ttl \
	  --profile QL \
	  --strict
OWL 2 QL Profile Report: Ontology and imports closure NOT in profile. The following violations are present:
Use of data range not in profile: <https://example.org/DatatypeAndObjectProperty-1> [Declaration(Datatype(<https://example.org/DatatypeAndObjectProperty-1>)) in OntologyID(Anonymous-2)]
Use of data range not in profile: <https://example.org/DatatypeAndAnnotationProperty-1> [Declaration(Datatype(<https://example.org/DatatypeAndAnnotationProperty-1>)) in OntologyID(Anonymous-2)]
Use of data range not in profile: <https://example.org/DatatypeAndDatatypeProperty-1> [Declaration(Datatype(<https://example.org/DatatypeAndDatatypeProperty-1>)) in OntologyID(Anonymous-2)]

PROFILE VIOLATION ERROR null violates profile QL
For details see: http://robot.obolibrary.org/validate-profile#profile-violation-error
Use the -vvv option to show the stack trace.
Use the --help option to see usage information.
make: *** [check-ql] Error 1
java -jar robot.jar validate-profile \
	  --input asserted.ttl \
	  --profile RL \
	  --strict
OWL 2 RL Profile Report: Ontology and imports closure NOT in profile. The following violations are present:
Use of data range not in profile: <https://example.org/DatatypeAndObjectProperty-1> [Declaration(Datatype(<https://example.org/DatatypeAndObjectProperty-1>)) in OntologyID(Anonymous-2)]
Use of data range not in profile: <https://example.org/DatatypeAndAnnotationProperty-1> [Declaration(Datatype(<https://example.org/DatatypeAndAnnotationProperty-1>)) in OntologyID(Anonymous-2)]
Use of data range not in profile: <https://example.org/DatatypeAndDatatypeProperty-1> [Declaration(Datatype(<https://example.org/DatatypeAndDatatypeProperty-1>)) in OntologyID(Anonymous-2)]

PROFILE VIOLATION ERROR null violates profile RL
For details see: http://robot.obolibrary.org/validate-profile#profile-violation-error
Use the -vvv option to show the stack trace.
Use the --help option to see usage information.
make: *** [check-rl] Error 1
make: Target `all' not remade because of errors.
@prefix ex: <https://example.org/> .
@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 sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
ex:ClassAndAnnotationProperty-1
a
owl:Class ,
owl:AnnotationProperty
;
.
ex:ClassAndDatatypeProperty-1
a
owl:Class ,
owl:DatatypeProperty
;
.
ex:ClassAndObjectProperty-1
a
owl:Class ,
owl:ObjectProperty
;
.
ex:DatatypeAndAnnotationProperty-1
a
rdfs:Datatype ,
owl:AnnotationProperty
;
.
ex:DatatypeAndDatatypeProperty-1
a
rdfs:Datatype ,
owl:DatatypeProperty
;
.
ex:DatatypeAndObjectProperty-1
a
rdfs:Datatype ,
owl:ObjectProperty
;
.

NIST Software Licensing Statement

NIST-developed software is provided by NIST as a public service. You may use, copy, and distribute copies of the software in any medium, provided that you keep intact this entire notice. You may improve, modify, and create derivative works of the software or any portion of the software, and you may copy and distribute such modifications or works. Modified works should carry a notice stating that you changed the software and should note the date and nature of any such change. Please explicitly acknowledge the National Institute of Standards and Technology as the source of the software.

NIST-developed software is expressly provided "AS IS." NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED, IN FACT, OR ARISING BY OPERATION OF LAW, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND DATA ACCURACY. NIST NEITHER REPRESENTS NOR WARRANTS THAT THE OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT ANY DEFECTS WILL BE CORRECTED. NIST DOES NOT WARRANT OR MAKE ANY REPRESENTATIONS REGARDING THE USE OF THE SOFTWARE OR THE RESULTS THEREOF, INCLUDING BUT NOT LIMITED TO THE CORRECTNESS, ACCURACY, RELIABILITY, OR USEFULNESS OF THE SOFTWARE.

You are solely responsible for determining the appropriateness of using and distributing the software and you assume all risks associated with its use, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and the unavailability or interruption of operation. This software is not intended to be used in any situation where a failure could cause risk of injury or damage to property. The software developed by NIST employees is not subject to copyright protection within the United States.

#!/usr/bin/make -f
# Portions of this file contributed by NIST are governed by the
# following statement:
#
# This software was developed at the National Institute of Standards
# and Technology by employees of the Federal Government in the course
# of their official duties. Pursuant to Title 17 Section 105 of the
# United States Code, this software is not subject to copyright
# protection within the United States. NIST assumes no responsibility
# whatsoever for its use by other parties, and makes no guarantees,
# expressed or implied, about its quality, reliability, or any other
# characteristic.
#
# We would appreciate acknowledgement if the software is used.
all: \
check
.PHONY: \
check-dl \
check-el \
check-ql \
check-rl
check: \
check-dl \
check-el \
check-ql \
check-rl
check-dl: \
robot.jar
java -jar robot.jar validate-profile \
--input asserted.ttl \
--profile DL \
--strict
check-el: \
robot.jar
java -jar robot.jar validate-profile \
--input asserted.ttl \
--profile EL \
--strict
check-ql: \
robot.jar
java -jar robot.jar validate-profile \
--input asserted.ttl \
--profile QL \
--strict
check-rl: \
robot.jar
java -jar robot.jar validate-profile \
--input asserted.ttl \
--profile RL \
--strict
clean:
robot.jar: \
robot.jar.sha3-256
wget \
--output-document _$@ \
https://github.com/ontodev/robot/releases/download/v1.9.5/robot.jar
test \
"x$$(openssl dgst -sha3-256 _$@ | awk '{print($$NF)}')" \
== \
"x$$(head -n1 robot.jar.sha3-256)"
touch _$@
mv _$@ $@
bd59e09dbd9fb9976cb9c9b6b3490afe8efb2493e6181dab2c063be3289ead1e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment