From 004695ca547904079c26d6325efc1c3e15c97534 Mon Sep 17 00:00:00 2001 From: Ben Gyori Date: Tue, 15 Aug 2023 18:10:06 -0400 Subject: [PATCH 1/6] Update base schema --- base_schema.json | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/base_schema.json b/base_schema.json index a4eb0b6..c191e05 100644 --- a/base_schema.json +++ b/base_schema.json @@ -2,23 +2,33 @@ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { - "name": { - "type": "string", - "description": "Name of the model." - }, - "description": { - "type": "string", - "description": "A description of the model." - }, - "schema": { - "type": "string", - "format": "uri", - "description": "URI of a JSON schema document that describes the model stored in the 'model' parameter." + "header": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the model." + }, + "description": { + "type": "string", + "description": "A description of the model." + }, + "schema": { + "type": "string", + "format": "uri", + "description": "URI of a JSON schema document that describes the model stored in the 'model' parameter." + }, + "schema_name": { + "type": "string", + "description": "The ID of the schema name. E.g. `petrinet`" + } + }, + "required": [ + "name", + "description", + "schema" + ] }, - "schema_name": { - "type": "string", - "description": "The ID of the schema name. E.g. `petrinet`" - }, "model": { "type": "object", "description": "JSON representation of a model. This should contain everything needed to fully run the model, including all rates/initial parameters/distributions/etc." @@ -33,9 +43,7 @@ } }, "required": [ - "name", - "description", - "schema", + "hader", "model" ] } From 120d52e501f5cbe0771dbf176a6f6e9b4170a5cc Mon Sep 17 00:00:00 2001 From: Ben Gyori Date: Tue, 15 Aug 2023 18:17:53 -0400 Subject: [PATCH 2/6] Update petrinet and regnet schemas --- petrinet/petrinet_schema.json | 38 +++++++++++++++++------------- regnet/regnet_schema.json | 44 +++++++++++++++++++++-------------- 2 files changed, 48 insertions(+), 34 deletions(-) diff --git a/petrinet/petrinet_schema.json b/petrinet/petrinet_schema.json index 2270a35..d5e5b39 100644 --- a/petrinet/petrinet_schema.json +++ b/petrinet/petrinet_schema.json @@ -2,21 +2,27 @@ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { - "name": { - "type": "string" - }, - "schema": { - "type": "string", - "format": "uri" - }, - "schema_name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "model_version": { - "type": "string" + "header": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "schema": { + "type": "string", + "format": "uri" + }, + "schema_name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "model_version": { + "type": "string" + } + }, + "required": ["name", "schema", "description"] }, "properties": { "type": "object" @@ -377,5 +383,5 @@ } }, "additionalProperties": true, - "required": ["name", "description", "schema", "model"] + "required": ["header", "model"] } diff --git a/regnet/regnet_schema.json b/regnet/regnet_schema.json index 7a8ba87..ad914ba 100644 --- a/regnet/regnet_schema.json +++ b/regnet/regnet_schema.json @@ -2,21 +2,31 @@ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { - "name": { - "type": "string" - }, - "schema": { - "type": "string", - "format": "uri" - }, - "schema_name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "model_version": { - "type": "string" + "header": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "schema": { + "type": "string", + "format": "uri" + }, + "schema_name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "model_version": { + "type": "string" + } + }, + "required": [ + "name", + "schema", + "description" + ] }, "properties": { "type": "object" @@ -176,9 +186,7 @@ } }, "required": [ - "name", - "description", - "schema", + "header", "model" ] } From 8f6619513820b087b7116e16ea3d65342063665f Mon Sep 17 00:00:00 2001 From: Ben Gyori Date: Tue, 15 Aug 2023 18:20:19 -0400 Subject: [PATCH 3/6] Update petrinet examples with header --- petrinet/examples/flux_typed.json | 10 ++++++---- petrinet/examples/flux_typed_aug.json | 10 ++++++---- petrinet/examples/ont_pop_vax.json | 10 ++++++---- petrinet/examples/sir.json | 12 +++++++----- petrinet/examples/sir_flux_span.json | 10 ++++++---- petrinet/examples/sir_typed.json | 12 +++++++----- petrinet/examples/sir_typed_aug.json | 10 ++++++---- 7 files changed, 44 insertions(+), 30 deletions(-) diff --git a/petrinet/examples/flux_typed.json b/petrinet/examples/flux_typed.json index 877514f..bce6e8e 100644 --- a/petrinet/examples/flux_typed.json +++ b/petrinet/examples/flux_typed.json @@ -1,8 +1,10 @@ { - "name": "Two City Stratification Model", - "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", - "description": "Stratification spatially between two cities model created by Micah. Modified by Patrick.", - "model_version": "0.1", + "header": { + "name": "Two City Stratification Model", + "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", + "description": "Stratification spatially between two cities model created by Micah. Modified by Patrick.", + "model_version": "0.1" + }, "model": { "states": [ { diff --git a/petrinet/examples/flux_typed_aug.json b/petrinet/examples/flux_typed_aug.json index 291477d..465d26c 100644 --- a/petrinet/examples/flux_typed_aug.json +++ b/petrinet/examples/flux_typed_aug.json @@ -1,8 +1,10 @@ { - "name": "Two City Stratification Model", - "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", - "description": "Stratification spatially between two cities model created by Micah", - "model_version": "0.1", + "header": { + "name": "Two City Stratification Model", + "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", + "description": "Stratification spatially between two cities model created by Micah", + "model_version": "0.1" + }, "model": { "states": [ { diff --git a/petrinet/examples/ont_pop_vax.json b/petrinet/examples/ont_pop_vax.json index 5c9bb33..73d4d7c 100644 --- a/petrinet/examples/ont_pop_vax.json +++ b/petrinet/examples/ont_pop_vax.json @@ -1,8 +1,10 @@ { - "name": "Ontology Model w/ Pop and Vax States", - "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", - "description": "Ontology Model w/ Population and Vaccine-Unit States. File created by Patrick based ontology created by Nelson", - "model_version": "0.1", + "header": { + "name": "Ontology Model w/ Pop and Vax States", + "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", + "description": "Ontology Model w/ Population and Vaccine-Unit States. File created by Patrick based ontology created by Nelson", + "model_version": "0.1" + }, "model": { "states": [ { diff --git a/petrinet/examples/sir.json b/petrinet/examples/sir.json index 2cb3c32..d71eadc 100644 --- a/petrinet/examples/sir.json +++ b/petrinet/examples/sir.json @@ -1,9 +1,11 @@ { - "name": "SIR Model", - "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", - "description": "SIR model", - "schema_name": "petrinet", - "model_version": "0.1", + "header": { + "name": "SIR Model", + "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", + "description": "SIR model", + "schema_name": "petrinet", + "model_version": "0.1" + }, "model": { "states": [ { diff --git a/petrinet/examples/sir_flux_span.json b/petrinet/examples/sir_flux_span.json index 11b2ba9..6712db5 100644 --- a/petrinet/examples/sir_flux_span.json +++ b/petrinet/examples/sir_flux_span.json @@ -1,8 +1,10 @@ { - "name": "SIR-Two-City-Flux Stratified Model", - "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", - "description": "SIR disease model stratified spatially between two cities model created by Patrick", - "model_version": "0.1", + "header": { + "name": "SIR-Two-City-Flux Stratified Model", + "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", + "description": "SIR disease model stratified spatially between two cities model created by Patrick", + "model_version": "0.1" + }, "model": { "states": [ { diff --git a/petrinet/examples/sir_typed.json b/petrinet/examples/sir_typed.json index dbc9cc6..3bb3c16 100644 --- a/petrinet/examples/sir_typed.json +++ b/petrinet/examples/sir_typed.json @@ -1,9 +1,11 @@ { - "name": "SIR Model", - "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", - "schema_name": "petrinet", - "description": "Typed SIR model created by Nelson, derived from the one by Ben, Micah, Brandon", - "model_version": "0.1", + "header": { + "name": "SIR Model", + "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", + "schema_name": "petrinet", + "description": "Typed SIR model created by Nelson, derived from the one by Ben, Micah, Brandon", + "model_version": "0.1" + }, "model": { "states": [ { diff --git a/petrinet/examples/sir_typed_aug.json b/petrinet/examples/sir_typed_aug.json index 53ecef8..0c1f932 100644 --- a/petrinet/examples/sir_typed_aug.json +++ b/petrinet/examples/sir_typed_aug.json @@ -1,8 +1,10 @@ { - "name": "SIR Model", - "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", - "description": "Typed SIR model created by Nelson, derived from the one by Ben, Micah, Brandon", - "model_version": "0.1", + "header": { + "name": "SIR Model", + "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", + "description": "Typed SIR model created by Nelson, derived from the one by Ben, Micah, Brandon", + "model_version": "0.1" + }, "model": { "states": [ { From b8222aea4ad69900bf43d5ff5b8e29cfe859f6dd Mon Sep 17 00:00:00 2001 From: Ben Gyori Date: Tue, 15 Aug 2023 18:21:03 -0400 Subject: [PATCH 4/6] Update regnet examples --- regnet/examples/lotka_volterra.json | 12 +++++++----- regnet/examples/syntax_edge_cases.json | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/regnet/examples/lotka_volterra.json b/regnet/examples/lotka_volterra.json index 056fe37..b042554 100644 --- a/regnet/examples/lotka_volterra.json +++ b/regnet/examples/lotka_volterra.json @@ -1,9 +1,11 @@ { - "name": "Lotka Volterra", - "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/regnet_v0.1/regnet/regnet_schema.json", - "schema_name": "regnet", - "description": "Lotka Volterra model", - "model_version": "0.1", + "header": { + "name": "Lotka Volterra", + "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/regnet_v0.1/regnet/regnet_schema.json", + "schema_name": "regnet", + "description": "Lotka Volterra model", + "model_version": "0.1" + }, "model": { "vertices": [ { diff --git a/regnet/examples/syntax_edge_cases.json b/regnet/examples/syntax_edge_cases.json index 5736a5c..d959d53 100644 --- a/regnet/examples/syntax_edge_cases.json +++ b/regnet/examples/syntax_edge_cases.json @@ -1,9 +1,11 @@ { - "name": "Syntax Edge Cases", - "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/regnet_v0.1/regnet/regnet_schema.json", - "schema_name": "regnet", - "description": "A regulatory network to demonstrate syntactic edge cases of the JSON Schema of RegNets.", - "model_version": "0.1", + "header": { + "name": "Syntax Edge Cases", + "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/regnet_v0.1/regnet/regnet_schema.json", + "schema_name": "regnet", + "description": "A regulatory network to demonstrate syntactic edge cases of the JSON Schema of RegNets.", + "model_version": "0.1" + }, "model": { "vertices": [ { From 088ad0b0bd1d7c14f7b2703f16ab8369bb5fa18c Mon Sep 17 00:00:00 2001 From: Ben Gyori Date: Tue, 15 Aug 2023 18:27:57 -0400 Subject: [PATCH 5/6] Fix base schema --- base_schema.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/base_schema.json b/base_schema.json index c191e05..187004e 100644 --- a/base_schema.json +++ b/base_schema.json @@ -21,6 +21,10 @@ "schema_name": { "type": "string", "description": "The ID of the schema name. E.g. `petrinet`" + }, + "model_version": { + "type": "string", + "description": "The version of the model." } }, "required": [ @@ -43,7 +47,7 @@ } }, "required": [ - "hader", + "header", "model" ] } From 18671ac87ebfcaa5a90c7b99d243f76fded22a4c Mon Sep 17 00:00:00 2001 From: Ben Gyori Date: Tue, 15 Aug 2023 18:33:47 -0400 Subject: [PATCH 6/6] Add header in all sub-models --- petrinet/examples/flux_typed.json | 10 ++++--- petrinet/examples/flux_typed_aug.json | 10 ++++--- petrinet/examples/sir_flux_span.json | 40 ++++++++++++++++----------- petrinet/examples/sir_typed.json | 10 ++++--- petrinet/examples/sir_typed_aug.json | 10 ++++--- 5 files changed, 48 insertions(+), 32 deletions(-) diff --git a/petrinet/examples/flux_typed.json b/petrinet/examples/flux_typed.json index bce6e8e..dd61e3e 100644 --- a/petrinet/examples/flux_typed.json +++ b/petrinet/examples/flux_typed.json @@ -43,10 +43,12 @@ "ode": {}, "typing": { "system": { - "name": "Ontology Model w/ Pop and Vax States", - "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", - "description": "Ontology Model w/ Population and Vaccine-Unit States. File created by Patrick based ontology created by Nelson", - "model_version": "0.1", + "header": { + "name": "Ontology Model w/ Pop and Vax States", + "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", + "description": "Ontology Model w/ Population and Vaccine-Unit States. File created by Patrick based ontology created by Nelson", + "model_version": "0.1" + }, "model": { "states": [ { diff --git a/petrinet/examples/flux_typed_aug.json b/petrinet/examples/flux_typed_aug.json index 465d26c..25734a9 100644 --- a/petrinet/examples/flux_typed_aug.json +++ b/petrinet/examples/flux_typed_aug.json @@ -75,10 +75,12 @@ "ode": {}, "typing": { "system": { - "name": "Ontology Model w/ Pop and Vax States", - "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", - "description": "Ontology Model w/ Population and Vaccine-Unit States. File created by Patrick based ontology created by Nelson", - "model_version": "0.1", + "header": { + "name": "Ontology Model w/ Pop and Vax States", + "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", + "description": "Ontology Model w/ Population and Vaccine-Unit States. File created by Patrick based ontology created by Nelson", + "model_version": "0.1" + }, "model": { "states": [ { diff --git a/petrinet/examples/sir_flux_span.json b/petrinet/examples/sir_flux_span.json index 6712db5..9c1654c 100644 --- a/petrinet/examples/sir_flux_span.json +++ b/petrinet/examples/sir_flux_span.json @@ -156,10 +156,12 @@ "span": [ { "system": { - "name": "SIR Model", - "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", - "description": "Typed SIR model created by Nelson, derived from the one by Ben, Micah, Brandon", - "model_version": "0.1", + "header": { + "name": "SIR Model", + "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", + "description": "Typed SIR model created by Nelson, derived from the one by Ben, Micah, Brandon", + "model_version": "0.1" + }, "model": { "states": [ { @@ -318,10 +320,12 @@ }, "typing": { "system": { - "name": "Ontology Model w/ Pop and Vax States", - "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", - "description": "Ontology Model w/ Population and Vaccine-Unit States. File created by Patrick based ontology created by Nelson", - "model_version": "0.1", + "header": { + "name": "Ontology Model w/ Pop and Vax States", + "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", + "description": "Ontology Model w/ Population and Vaccine-Unit States. File created by Patrick based ontology created by Nelson", + "model_version": "0.1" + }, "model": { "states": [ { @@ -475,10 +479,12 @@ }, { "system": { - "name": "Two City Stratification Model", - "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", - "description": "Stratification spatially between two cities model created by Micah", - "model_version": "0.1", + "header": { + "name": "Two City Stratification Model", + "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", + "description": "Stratification spatially between two cities model created by Micah", + "model_version": "0.1" + }, "model": { "states": [ { @@ -549,10 +555,12 @@ "ode": {}, "typing": { "system": { - "name": "Ontology Model w/ Pop and Vax States", - "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", - "description": "Ontology Model w/ Population and Vaccine-Unit States. File created by Patrick based ontology created by Nelson", - "model_version": "0.1", + "header": { + "name": "Ontology Model w/ Pop and Vax States", + "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", + "description": "Ontology Model w/ Population and Vaccine-Unit States. File created by Patrick based ontology created by Nelson", + "model_version": "0.1" + }, "model": { "states": [ { diff --git a/petrinet/examples/sir_typed.json b/petrinet/examples/sir_typed.json index 3bb3c16..2f6d114 100644 --- a/petrinet/examples/sir_typed.json +++ b/petrinet/examples/sir_typed.json @@ -148,10 +148,12 @@ }, "typing": { "system": { - "name": "Ontology Model w/ Pop and Vax States", - "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", - "description": "Ontology Model w/ Population and Vaccine-Unit States. File created by Patrick based ontology created by Nelson", - "model_version": "0.1", + "header": { + "name": "Ontology Model w/ Pop and Vax States", + "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", + "description": "Ontology Model w/ Population and Vaccine-Unit States. File created by Patrick based ontology created by Nelson", + "model_version": "0.1" + }, "model": { "states": [ { diff --git a/petrinet/examples/sir_typed_aug.json b/petrinet/examples/sir_typed_aug.json index 0c1f932..2475684 100644 --- a/petrinet/examples/sir_typed_aug.json +++ b/petrinet/examples/sir_typed_aug.json @@ -163,10 +163,12 @@ }, "typing": { "system": { - "name": "Ontology Model w/ Pop and Vax States", - "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", - "description": "Ontology Model w/ Population and Vaccine-Unit States. File created by Patrick based ontology created by Nelson", - "model_version": "0.1", + "header": { + "name": "Ontology Model w/ Pop and Vax States", + "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", + "description": "Ontology Model w/ Population and Vaccine-Unit States. File created by Patrick based ontology created by Nelson", + "model_version": "0.1" + }, "model": { "states": [ {