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#>
PREFIX omni_schema: <https://w3id.org/omnibenchmark/omni-schema/>
PREFIX linkml: <https://w3id.org/linkml/>
PREFIX schema: <http://schema.org/>
PREFIX example: <https://example.org/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
PREFIX vann: <http://purl.org/vocab/vann/>

<https://w3id.org/omnibenchmark/omni-schema> a owl:Ontology ;
  rdfs:label "omni-schema" ;
  rdfs:comment "Data model for omnibenchmark." ;
  rdfs:seeAlso <https://omnibenchmark.github.io/omni-schema> ;
  dcterms:license "Apache Software License 2.0" ;
  vann:preferredNamespacePrefix "omni_schema" ;
  vann:preferredNamespaceUri "https://w3id.org/omnibenchmark/omni-schema/"^^xsd:anyURI ;
  sh:declare [
    sh:prefix "omni_schema" ;
    sh:namespace "https://w3id.org/omnibenchmark/omni-schema/"^^xsd:anyURI
  ] , [
    sh:prefix "linkml" ;
    sh:namespace "https://w3id.org/linkml/"^^xsd:anyURI
  ] , [
    sh:prefix "schema" ;
    sh:namespace "http://schema.org/"^^xsd:anyURI
  ] , [
    sh:prefix "example" ;
    sh:namespace "https://example.org/"^^xsd:anyURI
  ] .

schema:Thing a owl:Class ;
  rdfs:comment "A generic grouping for any identifiable entity" ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty schema:name ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty schema:name ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty schema:description ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty schema:description ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Class ;
    owl:unionOf ( omni_schema:Benchmark omni_schema:Stage omni_schema:Module omni_schema:IoFile omni_schema:SoftwareEnvironment omni_schema:MetricCollector )
  ] .

omni_schema:Benchmark a owl:Class ;
  rdfs:comment "A multi-stage workflow to evaluate processing stage for a specific task." ;
  rdfs:subClassOf schema:Thing , [
    a owl:Restriction ;
    owl:onProperty omni_schema:version ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:version ;
    owl:cardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:benchmarker ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:benchmarker ;
    owl:cardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:software_backend ;
    owl:allValuesFrom omni_schema:SoftwareBackendEnum
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:software_backend ;
    owl:cardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:storage ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:storage ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:storage_api ;
    owl:allValuesFrom omni_schema:StorageApiEnum
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:storage_api ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:storage_bucket_name ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:storage_bucket_name ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:software_environments ;
    owl:allValuesFrom omni_schema:SoftwareEnvironment
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:benchmark_yaml_spec ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:benchmark_yaml_spec ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:metric_collectors ;
    owl:allValuesFrom omni_schema:MetricCollector
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:stages ;
    owl:allValuesFrom omni_schema:Stage
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:stages ;
    owl:minCardinality "1"^^xsd:nonNegativeInteger
  ] .

omni_schema:Stage a owl:Class ;
  rdfs:comment "A benchmark subtask with equivalent and independent modules." ;
  rdfs:subClassOf schema:Thing , [
    a owl:Restriction ;
    owl:onProperty omni_schema:modules ;
    owl:allValuesFrom omni_schema:Module
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:modules ;
    owl:minCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:inputs ;
    owl:allValuesFrom omni_schema:InputCollection
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:outputs ;
    owl:allValuesFrom omni_schema:IoFile
  ] .

omni_schema:Module a owl:Class ;
  rdfs:comment "A single benchmark component assigned to a specific stage." ;
  rdfs:subClassOf schema:Thing , [
    a owl:Restriction ;
    owl:onProperty omni_schema:software_environment ;
    owl:allValuesFrom omni_schema:SoftwareEnvironment
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:software_environment ;
    owl:cardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:repository ;
    owl:allValuesFrom omni_schema:Repository
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:repository ;
    owl:cardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:exclude ;
    owl:allValuesFrom omni_schema:Module
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:parameters ;
    owl:allValuesFrom omni_schema:Parameter
  ] .

omni_schema:IoFile a owl:Class ;
  rdfs:comment "Represents an input / output file." ;
  rdfs:subClassOf schema:Thing , [
    a owl:Restriction ;
    owl:onProperty omni_schema:path ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:path ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] .

omni_schema:InputCollection a owl:Class ;
  rdfs:comment "A holder for valid input combinations." ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty omni_schema:entries ;
    owl:allValuesFrom omni_schema:IoFile
  ] .

omni_schema:Repository a owl:Class ;
  rdfs:comment "A reference to code repository containing the module's executable code." ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty omni_schema:url ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:url ;
    owl:cardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:commit ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:commit ;
    owl:cardinality "1"^^xsd:nonNegativeInteger
  ] .

omni_schema:Parameter a owl:Class ;
  rdfs:comment "A parameter and its scope." ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty omni_schema:values ;
    owl:allValuesFrom xsd:string
  ] .

omni_schema:SoftwareEnvironment a owl:Class ;
  rdfs:comment "Contains snapshots of the software environment required for the modules to run." ;
  rdfs:subClassOf schema:Thing , [
    a owl:Restriction ;
    owl:onProperty omni_schema:easyconfig ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:easyconfig ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:envmodule ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:envmodule ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:conda ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:conda ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:apptainer ;
    owl:allValuesFrom xsd:string
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:apptainer ;
    owl:maxCardinality "1"^^xsd:nonNegativeInteger
  ] .

omni_schema:MetricCollector a owl:Class ;
  rdfs:comment "Describes a module collecting/gathering multiple metrics and generating (potentially single) aggregated files collecting these metrics." ;
  rdfs:subClassOf schema:Thing , [
    a owl:Restriction ;
    owl:onProperty omni_schema:software_environment ;
    owl:allValuesFrom omni_schema:SoftwareEnvironment
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:software_environment ;
    owl:cardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:repository ;
    owl:allValuesFrom omni_schema:Repository
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:repository ;
    owl:cardinality "1"^^xsd:nonNegativeInteger
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:inputs ;
    owl:allValuesFrom omni_schema:IoFile
  ] , [
    a owl:Restriction ;
    owl:onProperty omni_schema:outputs ;
    owl:allValuesFrom omni_schema:IoFile
  ] .

schema:name a owl:DatatypeProperty ;
  rdfs:comment "A human-readable name for a thing" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

schema:description a owl:DatatypeProperty ;
  rdfs:comment "A human-readable description for a thing" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

omni_schema:version a owl:DatatypeProperty ;
  rdfs:comment "The version of the benchmark." ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

omni_schema:benchmarker a owl:DatatypeProperty ;
  rdfs:comment "The name and contact details of the person responsible for this benchmark." ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

omni_schema:software_backend a owl:ObjectProperty ;
  rdfs:comment "The software backend used to run the benchmark, e.g. whether apptainer, envmodules, or conda." ;
  rdfs:range omni_schema:SoftwareBackendEnum ;
  a owl:FunctionalProperty .

omni_schema:storage a owl:DatatypeProperty ;
  rdfs:comment "The place hosting all benchmark data." ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

omni_schema:storage_api a owl:ObjectProperty ;
  rdfs:comment "The type of the storage API, i.e. S3." ;
  rdfs:range omni_schema:StorageApiEnum ;
  a owl:FunctionalProperty .

omni_schema:storage_bucket_name a owl:DatatypeProperty ;
  rdfs:comment "The name of the bucket (i.e. for S3)" ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

omni_schema:stages a owl:ObjectProperty ;
  rdfs:range omni_schema:Stage .

omni_schema:modules a owl:ObjectProperty ;
  rdfs:range omni_schema:Module .

omni_schema:inputs a owl:ObjectProperty ;
  rdfs:range omni_schema:InputCollection .

omni_schema:outputs a owl:ObjectProperty ;
  rdfs:range omni_schema:IoFile .

omni_schema:exclude a owl:ObjectProperty ;
  rdfs:comment "Ignore these module's outputs as input." ;
  rdfs:range omni_schema:Module .

omni_schema:repository a owl:ObjectProperty ;
  rdfs:comment "The code repository hosting the module." ;
  rdfs:range omni_schema:Repository ;
  a owl:FunctionalProperty .

omni_schema:parameters a owl:ObjectProperty ;
  rdfs:range omni_schema:Parameter .

omni_schema:metric_collectors a owl:ObjectProperty ;
  rdfs:comment "Metric collecting/gathering module(s)" ;
  rdfs:range omni_schema:MetricCollector .

omni_schema:software_environments a owl:ObjectProperty ;
  rdfs:comment "Dictionary of software environments keyed by their identifiers" ;
  rdfs:range omni_schema:SoftwareEnvironment .

omni_schema:software_environment a owl:ObjectProperty ;
  rdfs:comment "Reference to a software environment by key." ;
  rdfs:range omni_schema:SoftwareEnvironment ;
  a owl:FunctionalProperty .

omni_schema:path a owl:DatatypeProperty ;
  rdfs:comment "The output path pattern for the IO file." ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

omni_schema:url a owl:DatatypeProperty ;
  rdfs:comment "The git compatible url." ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

omni_schema:commit a owl:DatatypeProperty ;
  rdfs:comment "The commit hash." ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

omni_schema:values a owl:DatatypeProperty ;
  rdfs:range xsd:string .

omni_schema:entries a owl:ObjectProperty ;
  rdfs:range omni_schema:IoFile .

omni_schema:easyconfig a owl:DatatypeProperty ;
  rdfs:comment "Easybuild configuration file." ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

omni_schema:envmodule a owl:DatatypeProperty ;
  rdfs:comment "Environment module name." ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

omni_schema:conda a owl:DatatypeProperty ;
  rdfs:comment "Conda environment file." ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

omni_schema:apptainer a owl:DatatypeProperty ;
  rdfs:comment "Apptainer image static ORAS url, including name:tag." ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

omni_schema:benchmark_yaml_spec a owl:DatatypeProperty ;
  rdfs:comment "Benchmark Specification version." ;
  rdfs:range xsd:string ;
  a owl:FunctionalProperty .

omni_schema:StorageApiEnum a owl:Class ;
  owl:equivalentClass [
    a owl:Class ;
    owl:oneOf ( omni_schema:StorageApiEnum.S_3 )
  ] .

omni_schema:StorageApiEnum.S_3 a owl:NamedIndividual ;
  skos:notation "S3" ;
  a omni_schema:StorageApiEnum .

omni_schema:SoftwareBackendEnum a owl:Class ;
  owl:equivalentClass [
    a owl:Class ;
    owl:oneOf ( omni_schema:SoftwareBackendEnum.APPTAINER omni_schema:SoftwareBackendEnum.ENVMODULES omni_schema:SoftwareBackendEnum.CONDA omni_schema:SoftwareBackendEnum.DOCKER omni_schema:SoftwareBackendEnum.HOST )
  ] .

omni_schema:SoftwareBackendEnum.APPTAINER a owl:NamedIndividual ;
  skos:notation "apptainer" ;
  a omni_schema:SoftwareBackendEnum .

omni_schema:SoftwareBackendEnum.ENVMODULES a owl:NamedIndividual ;
  skos:notation "envmodules" ;
  a omni_schema:SoftwareBackendEnum .

omni_schema:SoftwareBackendEnum.CONDA a owl:NamedIndividual ;
  skos:notation "conda" ;
  a omni_schema:SoftwareBackendEnum .

omni_schema:SoftwareBackendEnum.DOCKER a owl:NamedIndividual ;
  skos:notation "docker" ;
  a omni_schema:SoftwareBackendEnum .

omni_schema:SoftwareBackendEnum.HOST a owl:NamedIndividual ;
  skos:notation "host" ;
  a omni_schema:SoftwareBackendEnum .

dcterms:license a owl:AnnotationProperty .

vann:preferredNamespacePrefix a owl:AnnotationProperty .

vann:preferredNamespaceUri a owl:AnnotationProperty .

skos:notation a owl:AnnotationProperty .

sh:declare a owl:AnnotationProperty .

sh:prefix a owl:AnnotationProperty .

sh:namespace a owl:AnnotationProperty .
