diff --git a/project/excel/omni_schema.xlsx b/project/excel/omni_schema.xlsx index 6365675..0d1d3d9 100644 Binary files a/project/excel/omni_schema.xlsx and b/project/excel/omni_schema.xlsx differ diff --git a/project/graphql/omni_schema.graphql b/project/graphql/omni_schema.graphql index f2a8bf8..84d54a7 100644 --- a/project/graphql/omni_schema.graphql +++ b/project/graphql/omni_schema.graphql @@ -10,7 +10,7 @@ type Benchmark storage: String! storageApi: StorageAPIEnum! storageBucketName: String! - softwareEnvironments: [SoftwareEnvironment]! + softwareEnvironments: [SoftwareEnvironment] benchmarkYamlSpec: String metricCollectors: [MetricCollector] stages: [Stage]! diff --git a/project/jsonld/omni_schema.context.jsonld b/project/jsonld/omni_schema.context.jsonld index d7c3f09..10f7246 100644 --- a/project/jsonld/omni_schema.context.jsonld +++ b/project/jsonld/omni_schema.context.jsonld @@ -1,7 +1,7 @@ { "comments": { "description": "Auto generated by LinkML jsonld context generator", - "generation_date": "2025-02-04T16:25:11", + "generation_date": "2025-02-04T16:59:43", "source": "omni_schema.yaml" }, "@context": { diff --git a/project/jsonld/omni_schema.jsonld b/project/jsonld/omni_schema.jsonld index ef7474f..13311e0 100644 --- a/project/jsonld/omni_schema.jsonld +++ b/project/jsonld/omni_schema.jsonld @@ -617,6 +617,22 @@ "inlined": true, "@type": "SlotDefinition" }, + { + "name": "metric_collectors", + "definition_uri": "https://w3id.org/omnibenchmark/omni-schema/metric_collectors", + "description": "Metric collecting/gathering module(s)", + "from_schema": "https://w3id.org/omnibenchmark/omni-schema", + "slot_uri": "https://w3id.org/omnibenchmark/omni-schema/metric_collectors", + "owner": "Benchmark", + "domain_of": [ + "Benchmark" + ], + "range": "MetricCollector", + "multivalued": true, + "inlined": true, + "inlined_as_list": true, + "@type": "SlotDefinition" + }, { "name": "software_environments", "definition_uri": "https://w3id.org/omnibenchmark/omni-schema/software_environments", @@ -628,7 +644,6 @@ "Benchmark" ], "range": "SoftwareEnvironment", - "required": true, "multivalued": true, "inlined": true, "inlined_as_list": true, @@ -780,20 +795,6 @@ ], "range": "string", "@type": "SlotDefinition" - }, - { - "name": "metric_collectors", - "definition_uri": "https://w3id.org/omnibenchmark/omni-schema/metric_collectors", - "description": "Metric collecting/gathering module(s)", - "from_schema": "https://w3id.org/omnibenchmark/omni-schema", - "slot_uri": "https://w3id.org/omnibenchmark/omni-schema/metric_collectors", - "owner": "Benchmark", - "domain_of": [ - "Benchmark" - ], - "range": "MetricCollector", - "multivalued": true, - "@type": "SlotDefinition" } ], "classes": [ @@ -972,9 +973,9 @@ ], "metamodel_version": "1.7.0", "source_file": "omni_schema.yaml", - "source_file_date": "2025-02-04T16:24:53", - "source_file_size": 5921, - "generation_date": "2025-02-04T16:25:11", + "source_file_date": "2025-02-04T16:59:36", + "source_file_size": 5964, + "generation_date": "2025-02-04T16:59:43", "@type": "SchemaDefinition", "@context": [ "project/jsonld/omni_schema.context.jsonld", diff --git a/project/jsonschema/omni_schema.schema.json b/project/jsonschema/omni_schema.schema.json index 3677152..934a28e 100644 --- a/project/jsonschema/omni_schema.schema.json +++ b/project/jsonschema/omni_schema.schema.json @@ -29,7 +29,7 @@ "metric_collectors": { "description": "Metric collecting/gathering module(s)", "items": { - "type": "string" + "$ref": "#/$defs/MetricCollector" }, "type": [ "array", @@ -52,7 +52,10 @@ "items": { "$ref": "#/$defs/SoftwareEnvironment" }, - "type": "array" + "type": [ + "array", + "null" + ] }, "stages": { "items": { @@ -84,7 +87,6 @@ "storage", "storage_api", "storage_bucket_name", - "software_environments", "stages", "id" ], @@ -459,7 +461,7 @@ "metric_collectors": { "description": "Metric collecting/gathering module(s)", "items": { - "type": "string" + "$ref": "#/$defs/MetricCollector" }, "type": [ "array", @@ -482,7 +484,10 @@ "items": { "$ref": "#/$defs/SoftwareEnvironment" }, - "type": "array" + "type": [ + "array", + "null" + ] }, "stages": { "items": { @@ -514,7 +519,6 @@ "storage", "storage_api", "storage_bucket_name", - "software_environments", "stages", "id" ], diff --git a/project/owl/omni_schema.owl.ttl b/project/owl/omni_schema.owl.ttl index 81e4beb..a3913b3 100644 --- a/project/owl/omni_schema.owl.ttl +++ b/project/owl/omni_schema.owl.ttl @@ -12,86 +12,86 @@ omni_schema:Benchmark a owl:Class, linkml:ClassDefinition ; rdfs:label "Benchmark" ; rdfs:subClassOf [ a owl:Restriction ; - owl:allValuesFrom omni_schema:SoftwareBackendEnum ; - owl:onProperty omni_schema:software_backend ], + owl:allValuesFrom linkml:String ; + owl:onProperty omni_schema:benchmark_yaml_spec ], [ a owl:Restriction ; owl:minCardinality 1 ; - owl:onProperty omni_schema:storage_bucket_name ], + owl:onProperty omni_schema:storage_api ], [ a owl:Restriction ; - owl:minCardinality 1 ; - owl:onProperty omni_schema:software_environments ], + owl:maxCardinality 1 ; + owl:onProperty omni_schema:software_backend ], [ a owl:Restriction ; owl:minCardinality 1 ; - owl:onProperty omni_schema:storage_api ], + owl:onProperty omni_schema:software_backend ], [ a owl:Restriction ; - owl:minCardinality 1 ; + owl:maxCardinality 1 ; owl:onProperty omni_schema:version ], [ a owl:Restriction ; - owl:minCardinality 0 ; + owl:allValuesFrom omni_schema:MetricCollector ; owl:onProperty omni_schema:metric_collectors ], [ a owl:Restriction ; owl:maxCardinality 1 ; - owl:onProperty omni_schema:version ], + owl:onProperty omni_schema:benchmark_yaml_spec ], [ a owl:Restriction ; - owl:maxCardinality 1 ; - owl:onProperty omni_schema:benchmarker ], + owl:minCardinality 0 ; + owl:onProperty omni_schema:metric_collectors ], [ a owl:Restriction ; - owl:maxCardinality 1 ; - owl:onProperty omni_schema:storage ], + owl:minCardinality 1 ; + owl:onProperty omni_schema:stages ], [ a owl:Restriction ; - owl:maxCardinality 1 ; - owl:onProperty omni_schema:storage_bucket_name ], + owl:allValuesFrom omni_schema:SoftwareBackendEnum ; + owl:onProperty omni_schema:software_backend ], + [ a owl:Restriction ; + owl:minCardinality 0 ; + owl:onProperty omni_schema:software_environments ], [ a owl:Restriction ; owl:minCardinality 1 ; - owl:onProperty omni_schema:stages ], + owl:onProperty omni_schema:storage_bucket_name ], [ a owl:Restriction ; owl:minCardinality 1 ; + owl:onProperty omni_schema:version ], + [ a owl:Restriction ; + owl:allValuesFrom linkml:String ; owl:onProperty omni_schema:benchmarker ], [ a owl:Restriction ; owl:maxCardinality 1 ; - owl:onProperty omni_schema:benchmark_yaml_spec ], - [ a owl:Restriction ; - owl:allValuesFrom omni_schema:StorageAPIEnum ; owl:onProperty omni_schema:storage_api ], [ a owl:Restriction ; owl:allValuesFrom linkml:String ; - owl:onProperty omni_schema:benchmark_yaml_spec ], + owl:onProperty omni_schema:storage_bucket_name ], [ a owl:Restriction ; - owl:allValuesFrom omni_schema:MetricCollector ; - owl:onProperty omni_schema:metric_collectors ], + owl:allValuesFrom omni_schema:Stage ; + owl:onProperty omni_schema:stages ], [ a owl:Restriction ; - owl:maxCardinality 1 ; - owl:onProperty omni_schema:software_backend ], + owl:allValuesFrom linkml:String ; + owl:onProperty omni_schema:version ], + [ a owl:Restriction ; + owl:allValuesFrom omni_schema:SoftwareEnvironment ; + owl:onProperty omni_schema:software_environments ], [ a owl:Restriction ; owl:allValuesFrom linkml:String ; owl:onProperty omni_schema:storage ], [ a owl:Restriction ; - owl:minCardinality 1 ; - owl:onProperty omni_schema:storage ], + owl:minCardinality 0 ; + owl:onProperty omni_schema:benchmark_yaml_spec ], [ a owl:Restriction ; - owl:allValuesFrom omni_schema:Stage ; - owl:onProperty omni_schema:stages ], + owl:maxCardinality 1 ; + owl:onProperty omni_schema:benchmarker ], [ a owl:Restriction ; owl:maxCardinality 1 ; + owl:onProperty omni_schema:storage ], + [ a owl:Restriction ; + owl:allValuesFrom omni_schema:StorageAPIEnum ; owl:onProperty omni_schema:storage_api ], [ a owl:Restriction ; - owl:allValuesFrom linkml:String ; + owl:minCardinality 1 ; owl:onProperty omni_schema:benchmarker ], [ a owl:Restriction ; - owl:allValuesFrom linkml:String ; + owl:maxCardinality 1 ; owl:onProperty omni_schema:storage_bucket_name ], - [ a owl:Restriction ; - owl:allValuesFrom linkml:String ; - owl:onProperty omni_schema:version ], - [ a owl:Restriction ; - owl:allValuesFrom omni_schema:SoftwareEnvironment ; - owl:onProperty omni_schema:software_environments ], - [ a owl:Restriction ; - owl:minCardinality 0 ; - owl:onProperty omni_schema:benchmark_yaml_spec ], [ a owl:Restriction ; owl:minCardinality 1 ; - owl:onProperty omni_schema:software_backend ], + owl:onProperty omni_schema:storage ], omni_schema:IdentifiableEntity ; skos:definition "A multi-stage workflow to evaluate processing stage for a specific task." ; skos:inScheme . @@ -105,6 +105,9 @@ omni_schema:MetricCollector a owl:Class, linkml:ClassDefinition ; rdfs:label "MetricCollector" ; rdfs:subClassOf [ a owl:Restriction ; + owl:allValuesFrom omni_schema:IOFile ; + owl:onProperty omni_schema:outputs ], + [ a owl:Restriction ; owl:allValuesFrom omni_schema:SoftwareEnvironment ; owl:onProperty omni_schema:software_environment ], [ a owl:Restriction ; @@ -114,26 +117,23 @@ omni_schema:MetricCollector a owl:Class, owl:minCardinality 0 ; owl:onProperty omni_schema:inputs ], [ a owl:Restriction ; - owl:allValuesFrom omni_schema:Repository ; - owl:onProperty omni_schema:repository ], + owl:minCardinality 0 ; + owl:onProperty omni_schema:outputs ], [ a owl:Restriction ; owl:maxCardinality 1 ; owl:onProperty omni_schema:repository ], + [ a owl:Restriction ; + owl:allValuesFrom omni_schema:InputCollection ; + owl:onProperty omni_schema:inputs ], [ a owl:Restriction ; owl:minCardinality 1 ; owl:onProperty omni_schema:repository ], [ a owl:Restriction ; - owl:minCardinality 0 ; - owl:onProperty omni_schema:outputs ], + owl:allValuesFrom omni_schema:Repository ; + owl:onProperty omni_schema:repository ], [ a owl:Restriction ; owl:maxCardinality 1 ; owl:onProperty omni_schema:software_environment ], - [ a owl:Restriction ; - owl:allValuesFrom omni_schema:InputCollection ; - owl:onProperty omni_schema:inputs ], - [ a owl:Restriction ; - owl:allValuesFrom omni_schema:IOFile ; - owl:onProperty omni_schema:outputs ], omni_schema:IdentifiableEntity ; skos:definition "Describes a module collecting/gathering multiple metrics and generating (potentially single) aggregated files collecting these metrics." ; skos:inScheme . @@ -179,23 +179,23 @@ omni_schema:Stage a owl:Class, linkml:ClassDefinition ; rdfs:label "Stage" ; rdfs:subClassOf [ a owl:Restriction ; - owl:minCardinality 0 ; - owl:onProperty omni_schema:inputs ], - [ a owl:Restriction ; - owl:minCardinality 1 ; - owl:onProperty omni_schema:modules ], - [ a owl:Restriction ; owl:minCardinality 0 ; owl:onProperty omni_schema:outputs ], [ a owl:Restriction ; - owl:allValuesFrom omni_schema:IOFile ; - owl:onProperty omni_schema:outputs ], + owl:minCardinality 0 ; + owl:onProperty omni_schema:inputs ], [ a owl:Restriction ; owl:allValuesFrom omni_schema:InputCollection ; owl:onProperty omni_schema:inputs ], [ a owl:Restriction ; owl:allValuesFrom omni_schema:Module ; owl:onProperty omni_schema:modules ], + [ a owl:Restriction ; + owl:minCardinality 1 ; + owl:onProperty omni_schema:modules ], + [ a owl:Restriction ; + owl:allValuesFrom omni_schema:IOFile ; + owl:onProperty omni_schema:outputs ], omni_schema:IdentifiableEntity ; skos:definition "A benchmark subtask with equivalent and independent modules." ; skos:inScheme . @@ -267,22 +267,22 @@ omni_schema:Repository a owl:Class, linkml:ClassDefinition ; rdfs:label "Repository" ; rdfs:subClassOf [ a owl:Restriction ; - owl:maxCardinality 1 ; + owl:allValuesFrom linkml:String ; owl:onProperty omni_schema:commit ], [ a owl:Restriction ; - owl:allValuesFrom linkml:String ; - owl:onProperty omni_schema:url ], + owl:minCardinality 1 ; + owl:onProperty omni_schema:commit ], [ a owl:Restriction ; owl:maxCardinality 1 ; owl:onProperty omni_schema:url ], [ a owl:Restriction ; owl:minCardinality 1 ; - owl:onProperty omni_schema:commit ], + owl:onProperty omni_schema:url ], [ a owl:Restriction ; - owl:allValuesFrom linkml:String ; + owl:maxCardinality 1 ; owl:onProperty omni_schema:commit ], [ a owl:Restriction ; - owl:minCardinality 1 ; + owl:allValuesFrom linkml:String ; owl:onProperty omni_schema:url ] ; skos:definition "A reference to code repository containing the module's executable code." ; skos:inScheme . @@ -408,35 +408,35 @@ omni_schema:Module a owl:Class, linkml:ClassDefinition ; rdfs:label "Module" ; rdfs:subClassOf [ a owl:Restriction ; + owl:allValuesFrom omni_schema:SoftwareEnvironment ; + owl:onProperty omni_schema:software_environment ], + [ a owl:Restriction ; + owl:minCardinality 1 ; + owl:onProperty omni_schema:repository ], + [ a owl:Restriction ; owl:maxCardinality 1 ; owl:onProperty omni_schema:software_environment ], [ a owl:Restriction ; - owl:allValuesFrom omni_schema:Parameter ; - owl:onProperty omni_schema:parameters ], + owl:minCardinality 0 ; + owl:onProperty omni_schema:exclude ], [ a owl:Restriction ; owl:minCardinality 0 ; owl:onProperty omni_schema:parameters ], - [ a owl:Restriction ; - owl:minCardinality 1 ; - owl:onProperty omni_schema:software_environment ], [ a owl:Restriction ; owl:allValuesFrom omni_schema:Repository ; owl:onProperty omni_schema:repository ], [ a owl:Restriction ; - owl:minCardinality 0 ; - owl:onProperty omni_schema:exclude ], + owl:allValuesFrom omni_schema:Parameter ; + owl:onProperty omni_schema:parameters ], [ a owl:Restriction ; - owl:minCardinality 1 ; - owl:onProperty omni_schema:repository ], + owl:allValuesFrom omni_schema:Module ; + owl:onProperty omni_schema:exclude ], [ a owl:Restriction ; owl:maxCardinality 1 ; owl:onProperty omni_schema:repository ], [ a owl:Restriction ; - owl:allValuesFrom omni_schema:SoftwareEnvironment ; + owl:minCardinality 1 ; owl:onProperty omni_schema:software_environment ], - [ a owl:Restriction ; - owl:allValuesFrom omni_schema:Module ; - owl:onProperty omni_schema:exclude ], omni_schema:IdentifiableEntity ; skos:definition "A single benchmark component assigned to a specific stage." ; skos:inScheme . @@ -461,14 +461,14 @@ omni_schema:IOFile a owl:Class, linkml:ClassDefinition ; rdfs:label "IOFile" ; rdfs:subClassOf [ a owl:Restriction ; - owl:minCardinality 0 ; - owl:onProperty omni_schema:path ], - [ a owl:Restriction ; owl:maxCardinality 1 ; owl:onProperty omni_schema:path ], [ a owl:Restriction ; owl:allValuesFrom linkml:String ; owl:onProperty omni_schema:path ], + [ a owl:Restriction ; + owl:minCardinality 0 ; + owl:onProperty omni_schema:path ], omni_schema:IdentifiableEntity ; skos:definition "Represents an input / output file." ; skos:inScheme . @@ -477,31 +477,31 @@ omni_schema:SoftwareEnvironment a owl:Class, linkml:ClassDefinition ; rdfs:label "SoftwareEnvironment" ; rdfs:subClassOf [ a owl:Restriction ; - owl:maxCardinality 1 ; + owl:minCardinality 0 ; owl:onProperty omni_schema:easyconfig ], [ a owl:Restriction ; - owl:minCardinality 0 ; - owl:onProperty omni_schema:apptainer ], + owl:maxCardinality 1 ; + owl:onProperty omni_schema:easyconfig ], [ a owl:Restriction ; owl:allValuesFrom linkml:String ; owl:onProperty omni_schema:easyconfig ], [ a owl:Restriction ; - owl:allValuesFrom linkml:String ; - owl:onProperty omni_schema:apptainer ], + owl:maxCardinality 1 ; + owl:onProperty omni_schema:conda ], [ a owl:Restriction ; owl:minCardinality 0 ; - owl:onProperty omni_schema:envmodule ], + owl:onProperty omni_schema:apptainer ], [ a owl:Restriction ; owl:allValuesFrom linkml:String ; owl:onProperty omni_schema:conda ], [ a owl:Restriction ; owl:maxCardinality 1 ; - owl:onProperty omni_schema:conda ], + owl:onProperty omni_schema:apptainer ], [ a owl:Restriction ; owl:minCardinality 0 ; - owl:onProperty omni_schema:conda ], + owl:onProperty omni_schema:envmodule ], [ a owl:Restriction ; - owl:maxCardinality 1 ; + owl:allValuesFrom linkml:String ; owl:onProperty omni_schema:apptainer ], [ a owl:Restriction ; owl:allValuesFrom linkml:String ; @@ -511,7 +511,7 @@ omni_schema:SoftwareEnvironment a owl:Class, owl:onProperty omni_schema:envmodule ], [ a owl:Restriction ; owl:minCardinality 0 ; - owl:onProperty omni_schema:easyconfig ], + owl:onProperty omni_schema:conda ], omni_schema:IdentifiableEntity ; skos:definition "Contains snapshots of the software environment required for the modules to run." ; skos:inScheme . @@ -523,8 +523,8 @@ omni_schema:IdentifiableEntity a owl:Class, owl:minCardinality 0 ; owl:onProperty omni_schema:name ], [ a owl:Restriction ; - owl:allValuesFrom linkml:String ; - owl:onProperty omni_schema:name ], + owl:allValuesFrom linkml:Uriorcurie ; + owl:onProperty omni_schema:id ], [ a owl:Restriction ; owl:minCardinality 0 ; owl:onProperty omni_schema:description ], @@ -534,18 +534,18 @@ omni_schema:IdentifiableEntity a owl:Class, [ a owl:Restriction ; owl:minCardinality 1 ; owl:onProperty omni_schema:id ], + [ a owl:Restriction ; + owl:maxCardinality 1 ; + owl:onProperty omni_schema:name ], [ a owl:Restriction ; owl:allValuesFrom linkml:String ; owl:onProperty omni_schema:description ], [ a owl:Restriction ; - owl:allValuesFrom linkml:Uriorcurie ; - owl:onProperty omni_schema:id ], - [ a owl:Restriction ; - owl:maxCardinality 1 ; - owl:onProperty omni_schema:description ], + owl:allValuesFrom linkml:String ; + owl:onProperty omni_schema:name ], [ a owl:Restriction ; owl:maxCardinality 1 ; - owl:onProperty omni_schema:name ] ; + owl:onProperty omni_schema:description ] ; skos:definition "A generic grouping for any identifiable entity" ; skos:exactMatch schema1:Thing ; skos:inScheme . diff --git a/project/shacl/omni_schema.shacl.ttl b/project/shacl/omni_schema.shacl.ttl index 190ec75..de08895 100644 --- a/project/shacl/omni_schema.shacl.ttl +++ b/project/shacl/omni_schema.shacl.ttl @@ -11,40 +11,42 @@ omni_schema:Benchmark a sh:NodeShape ; sh:description "A multi-stage workflow to evaluate processing stage for a specific task." ; sh:ignoredProperties ( rdf:type ) ; sh:property [ sh:datatype xsd:string ; + sh:description "The name of the bucket (i.e. for S3)" ; + sh:maxCount 1 ; + sh:minCount 1 ; + sh:nodeKind sh:Literal ; + sh:order 5 ; + sh:path omni_schema:storage_bucket_name ], + [ sh:datatype xsd:string ; sh:description "A human-readable description for a thing" ; sh:maxCount 1 ; sh:nodeKind sh:Literal ; sh:order 12 ; sh:path schema1:description ], - [ sh:description "The software backend used to run the benchmark, e.g. whether apptainer, envmodules, or conda." ; - sh:in ( "apptainer" "envmodules" "conda" "docker" "host" ) ; + [ sh:class omni_schema:SoftwareEnvironment ; + sh:description "Dictionary of software environments keyed by their identifiers" ; + sh:nodeKind sh:IRI ; + sh:order 6 ; + sh:path omni_schema:software_environments ], + [ sh:description "The type of the storage API, i.e. S3." ; + sh:in ( "S3" ) ; sh:maxCount 1 ; sh:minCount 1 ; - sh:order 2 ; - sh:path omni_schema:software_backend ], - [ sh:datatype xsd:string ; - sh:description "Benchmark Specification version." ; - sh:maxCount 1 ; - sh:nodeKind sh:Literal ; - sh:order 7 ; - sh:path omni_schema:benchmark_yaml_spec ], + sh:order 4 ; + sh:path omni_schema:storage_api ], [ sh:datatype xsd:string ; sh:description "A human-readable name for a thing" ; sh:maxCount 1 ; sh:nodeKind sh:Literal ; sh:order 11 ; sh:path schema1:name ], - [ sh:class omni_schema:SoftwareEnvironment ; - sh:description "Dictionary of software environments keyed by their identifiers" ; - sh:minCount 1 ; - sh:nodeKind sh:IRI ; - sh:order 6 ; - sh:path omni_schema:software_environments ], - [ sh:class omni_schema:Stage ; + [ sh:datatype xsd:string ; + sh:description "The place hosting all benchmark data." ; + sh:maxCount 1 ; sh:minCount 1 ; - sh:nodeKind sh:IRI ; - sh:order 9 ; - sh:path omni_schema:stages ], + sh:nodeKind sh:Literal ; + sh:order 3 ; + sh:path omni_schema:storage ], [ sh:class omni_schema:MetricCollector ; sh:description "Metric collecting/gathering module(s)" ; sh:nodeKind sh:IRI ; @@ -57,12 +59,6 @@ omni_schema:Benchmark a sh:NodeShape ; sh:nodeKind sh:Literal ; sh:order 0 ; sh:path omni_schema:version ], - [ sh:description "The type of the storage API, i.e. S3." ; - sh:in ( "S3" ) ; - sh:maxCount 1 ; - sh:minCount 1 ; - sh:order 4 ; - sh:path omni_schema:storage_api ], [ sh:datatype xsd:anyURI ; sh:description "A unique identifier for a thing" ; sh:maxCount 1 ; @@ -70,6 +66,12 @@ omni_schema:Benchmark a sh:NodeShape ; sh:nodeKind sh:Literal ; sh:order 10 ; sh:path schema1:identifier ], + [ sh:datatype xsd:string ; + sh:description "Benchmark Specification version." ; + sh:maxCount 1 ; + sh:nodeKind sh:Literal ; + sh:order 7 ; + sh:path omni_schema:benchmark_yaml_spec ], [ sh:datatype xsd:string ; sh:description "The name and contact details of the person responsible for this benchmark." ; sh:maxCount 1 ; @@ -77,20 +79,17 @@ omni_schema:Benchmark a sh:NodeShape ; sh:nodeKind sh:Literal ; sh:order 1 ; sh:path omni_schema:benchmarker ], - [ sh:datatype xsd:string ; - sh:description "The name of the bucket (i.e. for S3)" ; - sh:maxCount 1 ; + [ sh:class omni_schema:Stage ; sh:minCount 1 ; - sh:nodeKind sh:Literal ; - sh:order 5 ; - sh:path omni_schema:storage_bucket_name ], - [ sh:datatype xsd:string ; - sh:description "The place hosting all benchmark data." ; + sh:nodeKind sh:IRI ; + sh:order 9 ; + sh:path omni_schema:stages ], + [ sh:description "The software backend used to run the benchmark, e.g. whether apptainer, envmodules, or conda." ; + sh:in ( "apptainer" "envmodules" "conda" "docker" "host" ) ; sh:maxCount 1 ; sh:minCount 1 ; - sh:nodeKind sh:Literal ; - sh:order 3 ; - sh:path omni_schema:storage ] ; + sh:order 2 ; + sh:path omni_schema:software_backend ] ; sh:targetClass omni_schema:Benchmark . omni_schema:MetricCollector a sh:NodeShape ; @@ -98,13 +97,10 @@ omni_schema:MetricCollector a sh:NodeShape ; sh:closed true ; sh:description "Describes a module collecting/gathering multiple metrics and generating (potentially single) aggregated files collecting these metrics." ; sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:class omni_schema:Repository ; - sh:description "The code repository hosting the module." ; - sh:maxCount 1 ; - sh:minCount 1 ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:order 1 ; - sh:path omni_schema:repository ], + sh:property [ sh:class omni_schema:IOFile ; + sh:nodeKind sh:IRI ; + sh:order 3 ; + sh:path omni_schema:outputs ], [ sh:class omni_schema:InputCollection ; sh:nodeKind sh:BlankNodeOrIRI ; sh:order 2 ; @@ -116,6 +112,13 @@ omni_schema:MetricCollector a sh:NodeShape ; sh:nodeKind sh:IRI ; sh:order 0 ; sh:path omni_schema:software_environment ], + [ sh:datatype xsd:anyURI ; + sh:description "A unique identifier for a thing" ; + sh:maxCount 1 ; + sh:minCount 1 ; + sh:nodeKind sh:Literal ; + sh:order 4 ; + sh:path schema1:identifier ], [ sh:datatype xsd:string ; sh:description "A human-readable description for a thing" ; sh:maxCount 1 ; @@ -128,17 +131,13 @@ omni_schema:MetricCollector a sh:NodeShape ; sh:nodeKind sh:Literal ; sh:order 5 ; sh:path schema1:name ], - [ sh:datatype xsd:anyURI ; - sh:description "A unique identifier for a thing" ; + [ sh:class omni_schema:Repository ; + sh:description "The code repository hosting the module." ; sh:maxCount 1 ; sh:minCount 1 ; - sh:nodeKind sh:Literal ; - sh:order 4 ; - sh:path schema1:identifier ], - [ sh:class omni_schema:IOFile ; - sh:nodeKind sh:IRI ; - sh:order 3 ; - sh:path omni_schema:outputs ] ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:order 1 ; + sh:path omni_schema:repository ] ; sh:targetClass omni_schema:MetricCollector . omni_schema:Parameter a sh:NodeShape ; @@ -156,38 +155,38 @@ omni_schema:Stage a sh:NodeShape ; sh:closed true ; sh:description "A benchmark subtask with equivalent and independent modules." ; sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:datatype xsd:anyURI ; - sh:description "A unique identifier for a thing" ; - sh:maxCount 1 ; - sh:minCount 1 ; - sh:nodeKind sh:Literal ; - sh:order 3 ; - sh:path schema1:identifier ], - [ sh:class omni_schema:IOFile ; + sh:property [ sh:class omni_schema:IOFile ; sh:nodeKind sh:IRI ; sh:order 2 ; sh:path omni_schema:outputs ], + [ sh:datatype xsd:string ; + sh:description "A human-readable name for a thing" ; + sh:maxCount 1 ; + sh:nodeKind sh:Literal ; + sh:order 4 ; + sh:path schema1:name ], [ sh:datatype xsd:string ; sh:description "A human-readable description for a thing" ; sh:maxCount 1 ; sh:nodeKind sh:Literal ; sh:order 5 ; sh:path schema1:description ], - [ sh:datatype xsd:string ; - sh:description "A human-readable name for a thing" ; + [ sh:class omni_schema:InputCollection ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:order 1 ; + sh:path omni_schema:inputs ], + [ sh:datatype xsd:anyURI ; + sh:description "A unique identifier for a thing" ; sh:maxCount 1 ; + sh:minCount 1 ; sh:nodeKind sh:Literal ; - sh:order 4 ; - sh:path schema1:name ], + sh:order 3 ; + sh:path schema1:identifier ], [ sh:class omni_schema:Module ; sh:minCount 1 ; sh:nodeKind sh:IRI ; sh:order 0 ; - sh:path omni_schema:modules ], - [ sh:class omni_schema:InputCollection ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:order 1 ; - sh:path omni_schema:inputs ] ; + sh:path omni_schema:modules ] ; sh:targetClass omni_schema:Stage . omni_schema:InputCollection a sh:NodeShape ; @@ -211,13 +210,13 @@ omni_schema:Module a sh:NodeShape ; sh:nodeKind sh:Literal ; sh:order 6 ; sh:path schema1:description ], - [ sh:datatype xsd:anyURI ; - sh:description "A unique identifier for a thing" ; + [ sh:class omni_schema:Repository ; + sh:description "The code repository hosting the module." ; sh:maxCount 1 ; sh:minCount 1 ; - sh:nodeKind sh:Literal ; - sh:order 4 ; - sh:path schema1:identifier ], + sh:nodeKind sh:BlankNodeOrIRI ; + sh:order 1 ; + sh:path omni_schema:repository ], [ sh:class omni_schema:SoftwareEnvironment ; sh:description "Reference to a software environment by key." ; sh:maxCount 1 ; @@ -225,17 +224,13 @@ omni_schema:Module a sh:NodeShape ; sh:nodeKind sh:IRI ; sh:order 0 ; sh:path omni_schema:software_environment ], - [ sh:class omni_schema:Repository ; - sh:description "The code repository hosting the module." ; + [ sh:datatype xsd:anyURI ; + sh:description "A unique identifier for a thing" ; sh:maxCount 1 ; sh:minCount 1 ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:order 1 ; - sh:path omni_schema:repository ], - [ sh:class omni_schema:Parameter ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:order 3 ; - sh:path omni_schema:parameters ], + sh:nodeKind sh:Literal ; + sh:order 4 ; + sh:path schema1:identifier ], [ sh:datatype xsd:string ; sh:description "A human-readable name for a thing" ; sh:maxCount 1 ; @@ -246,7 +241,11 @@ omni_schema:Module a sh:NodeShape ; sh:description "Ignore these module's outputs as input." ; sh:nodeKind sh:IRI ; sh:order 2 ; - sh:path omni_schema:exclude ] ; + sh:path omni_schema:exclude ], + [ sh:class omni_schema:Parameter ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:order 3 ; + sh:path omni_schema:parameters ] ; sh:targetClass omni_schema:Module . omni_schema:Repository a sh:NodeShape ; @@ -254,19 +253,19 @@ omni_schema:Repository a sh:NodeShape ; sh:description "A reference to code repository containing the module's executable code." ; sh:ignoredProperties ( rdf:type ) ; sh:property [ sh:datatype xsd:string ; - sh:description "The git compatible url." ; + sh:description "The commit hash." ; sh:maxCount 1 ; sh:minCount 1 ; sh:nodeKind sh:Literal ; - sh:order 0 ; - sh:path omni_schema:url ], + sh:order 1 ; + sh:path omni_schema:commit ], [ sh:datatype xsd:string ; - sh:description "The commit hash." ; + sh:description "The git compatible url." ; sh:maxCount 1 ; sh:minCount 1 ; sh:nodeKind sh:Literal ; - sh:order 1 ; - sh:path omni_schema:commit ] ; + sh:order 0 ; + sh:path omni_schema:url ] ; sh:targetClass omni_schema:Repository . omni_schema:IOFile a sh:NodeShape ; @@ -280,6 +279,12 @@ omni_schema:IOFile a sh:NodeShape ; sh:nodeKind sh:Literal ; sh:order 0 ; sh:path omni_schema:path ], + [ sh:datatype xsd:string ; + sh:description "A human-readable description for a thing" ; + sh:maxCount 1 ; + sh:nodeKind sh:Literal ; + sh:order 3 ; + sh:path schema1:description ], [ sh:datatype xsd:string ; sh:description "A human-readable name for a thing" ; sh:maxCount 1 ; @@ -292,13 +297,7 @@ omni_schema:IOFile a sh:NodeShape ; sh:minCount 1 ; sh:nodeKind sh:Literal ; sh:order 1 ; - sh:path schema1:identifier ], - [ sh:datatype xsd:string ; - sh:description "A human-readable description for a thing" ; - sh:maxCount 1 ; - sh:nodeKind sh:Literal ; - sh:order 3 ; - sh:path schema1:description ] ; + sh:path schema1:identifier ] ; sh:targetClass omni_schema:IOFile . omni_schema:SoftwareEnvironment a sh:NodeShape ; @@ -306,31 +305,37 @@ omni_schema:SoftwareEnvironment a sh:NodeShape ; sh:closed true ; sh:description "Contains snapshots of the software environment required for the modules to run." ; sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:datatype xsd:string ; - sh:description "Apptainer image static ORAS url, including name:tag." ; + sh:property [ sh:datatype xsd:anyURI ; + sh:description "A unique identifier for a thing" ; sh:maxCount 1 ; + sh:minCount 1 ; sh:nodeKind sh:Literal ; - sh:order 3 ; - sh:path omni_schema:apptainer ], + sh:order 4 ; + sh:path schema1:identifier ], [ sh:datatype xsd:string ; sh:description "Environment module name." ; sh:maxCount 1 ; sh:nodeKind sh:Literal ; sh:order 1 ; sh:path omni_schema:envmodule ], + [ sh:datatype xsd:string ; + sh:description "Conda environment file." ; + sh:maxCount 1 ; + sh:nodeKind sh:Literal ; + sh:order 2 ; + sh:path omni_schema:conda ], [ sh:datatype xsd:string ; sh:description "A human-readable description for a thing" ; sh:maxCount 1 ; sh:nodeKind sh:Literal ; sh:order 6 ; sh:path schema1:description ], - [ sh:datatype xsd:anyURI ; - sh:description "A unique identifier for a thing" ; + [ sh:datatype xsd:string ; + sh:description "Apptainer image static ORAS url, including name:tag." ; sh:maxCount 1 ; - sh:minCount 1 ; sh:nodeKind sh:Literal ; - sh:order 4 ; - sh:path schema1:identifier ], + sh:order 3 ; + sh:path omni_schema:apptainer ], [ sh:datatype xsd:string ; sh:description "Easybuild configuration file." ; sh:maxCount 1 ; @@ -342,32 +347,26 @@ omni_schema:SoftwareEnvironment a sh:NodeShape ; sh:maxCount 1 ; sh:nodeKind sh:Literal ; sh:order 5 ; - sh:path schema1:name ], - [ sh:datatype xsd:string ; - sh:description "Conda environment file." ; - sh:maxCount 1 ; - sh:nodeKind sh:Literal ; - sh:order 2 ; - sh:path omni_schema:conda ] ; + sh:path schema1:name ] ; sh:targetClass omni_schema:SoftwareEnvironment . schema1:Thing a sh:NodeShape ; sh:closed false ; sh:description "A generic grouping for any identifiable entity" ; sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:datatype xsd:string ; - sh:description "A human-readable name for a thing" ; - sh:maxCount 1 ; - sh:nodeKind sh:Literal ; - sh:order 1 ; - sh:path schema1:name ], - [ sh:datatype xsd:anyURI ; + sh:property [ sh:datatype xsd:anyURI ; sh:description "A unique identifier for a thing" ; sh:maxCount 1 ; sh:minCount 1 ; sh:nodeKind sh:Literal ; sh:order 0 ; sh:path schema1:identifier ], + [ sh:datatype xsd:string ; + sh:description "A human-readable name for a thing" ; + sh:maxCount 1 ; + sh:nodeKind sh:Literal ; + sh:order 1 ; + sh:path schema1:name ], [ sh:datatype xsd:string ; sh:description "A human-readable description for a thing" ; sh:maxCount 1 ; diff --git a/project/shex/omni_schema.shex b/project/shex/omni_schema.shex index 05bcacc..cfcfb27 100644 --- a/project/shex/omni_schema.shex +++ b/project/shex/omni_schema.shex @@ -57,7 +57,7 @@ linkml:Sparqlpath xsd:string @linkml:String ; [ ] ; @linkml:String ; - @ + ; + @ * ; @linkml:String ? ; @ * ; @ + diff --git a/project/sqlschema/omni_schema.sql b/project/sqlschema/omni_schema.sql index 33a5afb..d5b1cbb 100644 --- a/project/sqlschema/omni_schema.sql +++ b/project/sqlschema/omni_schema.sql @@ -56,10 +56,8 @@ -- * Slot: id Description: A unique identifier for a thing -- * Slot: name Description: A human-readable name for a thing -- * Slot: description Description: A human-readable description for a thing --- * Slot: repository_id Description: The code repository hosting the module. --- # Class: "Benchmark_metric_collectors" Description: "" -- * Slot: Benchmark_id Description: Autocreated FK slot --- * Slot: metric_collectors_id Description: Metric collecting/gathering module(s) +-- * Slot: repository_id Description: The code repository hosting the module. -- # Class: "Module_exclude" Description: "" -- * Slot: Module_id Description: Autocreated FK slot -- * Slot: exclude_id Description: Ignore these module's outputs as input. @@ -145,9 +143,11 @@ CREATE TABLE "MetricCollector" ( id TEXT NOT NULL, name TEXT, description TEXT, + "Benchmark_id" TEXT, repository_id INTEGER NOT NULL, PRIMARY KEY (id), FOREIGN KEY(software_environment) REFERENCES "SoftwareEnvironment" (id), + FOREIGN KEY("Benchmark_id") REFERENCES "Benchmark" (id), FOREIGN KEY(repository_id) REFERENCES "Repository" (id) ); CREATE TABLE "IOFile" ( @@ -169,13 +169,6 @@ CREATE TABLE "InputCollection" ( FOREIGN KEY("Stage_id") REFERENCES "Stage" (id), FOREIGN KEY("MetricCollector_id") REFERENCES "MetricCollector" (id) ); -CREATE TABLE "Benchmark_metric_collectors" ( - "Benchmark_id" TEXT, - metric_collectors_id TEXT, - PRIMARY KEY ("Benchmark_id", metric_collectors_id), - FOREIGN KEY("Benchmark_id") REFERENCES "Benchmark" (id), - FOREIGN KEY(metric_collectors_id) REFERENCES "MetricCollector" (id) -); CREATE TABLE "Module_exclude" ( "Module_id" TEXT, exclude_id TEXT, diff --git a/src/omni_schema/datamodel/omni_schema.py b/src/omni_schema/datamodel/omni_schema.py index 3e02e94..3fca934 100644 --- a/src/omni_schema/datamodel/omni_schema.py +++ b/src/omni_schema/datamodel/omni_schema.py @@ -1,5 +1,5 @@ # Auto generated from omni_schema.yaml by pythongen.py version: 0.0.1 -# Generation date: 2025-02-04T16:25:11 +# Generation date: 2025-02-04T16:59:43 # Schema: omni-schema # # id: https://w3id.org/omnibenchmark/omni-schema @@ -120,10 +120,10 @@ class Benchmark(IdentifiableEntity): storage: str = None storage_api: Union[str, "StorageAPIEnum"] = None storage_bucket_name: str = None - software_environments: Union[Dict[Union[str, SoftwareEnvironmentId], Union[dict, "SoftwareEnvironment"]], List[Union[dict, "SoftwareEnvironment"]]] = empty_dict() stages: Union[Dict[Union[str, StageId], Union[dict, "Stage"]], List[Union[dict, "Stage"]]] = empty_dict() + software_environments: Optional[Union[Dict[Union[str, SoftwareEnvironmentId], Union[dict, "SoftwareEnvironment"]], List[Union[dict, "SoftwareEnvironment"]]]] = empty_dict() benchmark_yaml_spec: Optional[str] = None - metric_collectors: Optional[Union[Union[str, MetricCollectorId], List[Union[str, MetricCollectorId]]]] = empty_list() + metric_collectors: Optional[Union[Dict[Union[str, MetricCollectorId], Union[dict, "MetricCollector"]], List[Union[dict, "MetricCollector"]]]] = empty_dict() def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): if self._is_empty(self.id): @@ -161,20 +161,16 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): if not isinstance(self.storage_bucket_name, str): self.storage_bucket_name = str(self.storage_bucket_name) - if self._is_empty(self.software_environments): - self.MissingRequiredField("software_environments") - self._normalize_inlined_as_list(slot_name="software_environments", slot_type=SoftwareEnvironment, key_name="id", keyed=True) - if self._is_empty(self.stages): self.MissingRequiredField("stages") self._normalize_inlined_as_list(slot_name="stages", slot_type=Stage, key_name="id", keyed=True) + self._normalize_inlined_as_list(slot_name="software_environments", slot_type=SoftwareEnvironment, key_name="id", keyed=True) + if self.benchmark_yaml_spec is not None and not isinstance(self.benchmark_yaml_spec, str): self.benchmark_yaml_spec = str(self.benchmark_yaml_spec) - if not isinstance(self.metric_collectors, list): - self.metric_collectors = [self.metric_collectors] if self.metric_collectors is not None else [] - self.metric_collectors = [v if isinstance(v, MetricCollectorId) else MetricCollectorId(v) for v in self.metric_collectors] + self._normalize_inlined_as_list(slot_name="metric_collectors", slot_type=MetricCollector, key_name="id", keyed=True) super().__post_init__(**kwargs) @@ -516,8 +512,11 @@ class slots: slots.parameters = Slot(uri=OMNI_SCHEMA.parameters, name="parameters", curie=OMNI_SCHEMA.curie('parameters'), model_uri=OMNI_SCHEMA.parameters, domain=None, range=Optional[Union[Union[dict, Parameter], List[Union[dict, Parameter]]]]) +slots.metric_collectors = Slot(uri=OMNI_SCHEMA.metric_collectors, name="metric_collectors", curie=OMNI_SCHEMA.curie('metric_collectors'), + model_uri=OMNI_SCHEMA.metric_collectors, domain=None, range=Optional[Union[Dict[Union[str, MetricCollectorId], Union[dict, MetricCollector]], List[Union[dict, MetricCollector]]]]) + slots.software_environments = Slot(uri=OMNI_SCHEMA.software_environments, name="software_environments", curie=OMNI_SCHEMA.curie('software_environments'), - model_uri=OMNI_SCHEMA.software_environments, domain=None, range=Union[Dict[Union[str, SoftwareEnvironmentId], Union[dict, SoftwareEnvironment]], List[Union[dict, SoftwareEnvironment]]]) + model_uri=OMNI_SCHEMA.software_environments, domain=None, range=Optional[Union[Dict[Union[str, SoftwareEnvironmentId], Union[dict, SoftwareEnvironment]], List[Union[dict, SoftwareEnvironment]]]]) slots.software_environment = Slot(uri=OMNI_SCHEMA.software_environment, name="software_environment", curie=OMNI_SCHEMA.curie('software_environment'), model_uri=OMNI_SCHEMA.software_environment, domain=None, range=Union[str, SoftwareEnvironmentId]) @@ -550,7 +549,4 @@ class slots: model_uri=OMNI_SCHEMA.apptainer, domain=None, range=Optional[str]) slots.benchmark_yaml_spec = Slot(uri=OMNI_SCHEMA.benchmark_yaml_spec, name="benchmark_yaml_spec", curie=OMNI_SCHEMA.curie('benchmark_yaml_spec'), - model_uri=OMNI_SCHEMA.benchmark_yaml_spec, domain=None, range=Optional[str]) - -slots.metric_collectors = Slot(uri=OMNI_SCHEMA.metric_collectors, name="metric_collectors", curie=OMNI_SCHEMA.curie('metric_collectors'), - model_uri=OMNI_SCHEMA.metric_collectors, domain=None, range=Optional[Union[Union[str, MetricCollectorId], List[Union[str, MetricCollectorId]]]]) \ No newline at end of file + model_uri=OMNI_SCHEMA.benchmark_yaml_spec, domain=None, range=Optional[str]) \ No newline at end of file diff --git a/src/omni_schema/schema/omni_schema.yaml b/src/omni_schema/schema/omni_schema.yaml index 71f1cb8..f438437 100644 --- a/src/omni_schema/schema/omni_schema.yaml +++ b/src/omni_schema/schema/omni_schema.yaml @@ -182,7 +182,7 @@ slots: inlined: true inlined_as_list: true required: true - + modules: range: Module multivalued: true @@ -216,13 +216,21 @@ slots: range: Parameter multivalued: true + metric_collectors: + range: MetricCollector + description: "Metric collecting/gathering module(s)" + multivalued: true + inlined: true + inlined_as_list: true + required: false + software_environments: range: SoftwareEnvironment description: "Dictionary of software environments keyed by their identifiers" multivalued: true inlined: true inlined_as_list: true - required: true + required: false software_environment: range: SoftwareEnvironment @@ -271,10 +279,4 @@ slots: range: string description: Benchmark Specification version. - metric_collectors: - range: MetricCollector - description: "Metric collecting/gathering module(s)" - required: false - multivalued: true -