Skip to content

Commit

Permalink
Merge pull request #58 from DARPA-ASKEM/header
Browse files Browse the repository at this point in the history
Implement header for base properties
  • Loading branch information
bgyori authored Aug 22, 2023
2 parents 14d9eb8 + 18671ac commit f2c90f1
Show file tree
Hide file tree
Showing 12 changed files with 185 additions and 125 deletions.
50 changes: 31 additions & 19 deletions base_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,37 @@
"$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`"
},
"model_version": {
"type": "string",
"description": "The version of the model."
}
},
"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."
Expand All @@ -33,9 +47,7 @@
}
},
"required": [
"name",
"description",
"schema",
"header",
"model"
]
}
20 changes: 12 additions & 8 deletions petrinet/examples/flux_typed.json
Original file line number Diff line number Diff line change
@@ -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": [
{
Expand Down Expand Up @@ -41,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": [
{
Expand Down
20 changes: 12 additions & 8 deletions petrinet/examples/flux_typed_aug.json
Original file line number Diff line number Diff line change
@@ -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": [
{
Expand Down Expand Up @@ -73,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": [
{
Expand Down
10 changes: 6 additions & 4 deletions petrinet/examples/ont_pop_vax.json
Original file line number Diff line number Diff line change
@@ -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": [
{
Expand Down
12 changes: 7 additions & 5 deletions petrinet/examples/sir.json
Original file line number Diff line number Diff line change
@@ -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": [
{
Expand Down
50 changes: 30 additions & 20 deletions petrinet/examples/sir_flux_span.json
Original file line number Diff line number Diff line change
@@ -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": [
{
Expand Down Expand Up @@ -154,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": [
{
Expand Down Expand Up @@ -316,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": [
{
Expand Down Expand Up @@ -473,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": [
{
Expand Down Expand Up @@ -547,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": [
{
Expand Down
22 changes: 13 additions & 9 deletions petrinet/examples/sir_typed.json
Original file line number Diff line number Diff line change
@@ -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": [
{
Expand Down Expand Up @@ -146,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": [
{
Expand Down
20 changes: 12 additions & 8 deletions petrinet/examples/sir_typed_aug.json
Original file line number Diff line number Diff line change
@@ -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": [
{
Expand Down Expand Up @@ -161,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": [
{
Expand Down
38 changes: 22 additions & 16 deletions petrinet/petrinet_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -377,5 +383,5 @@
}
},
"additionalProperties": true,
"required": ["name", "description", "schema", "model"]
"required": ["header", "model"]
}
12 changes: 7 additions & 5 deletions regnet/examples/lotka_volterra.json
Original file line number Diff line number Diff line change
@@ -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": [
{
Expand Down
12 changes: 7 additions & 5 deletions regnet/examples/syntax_edge_cases.json
Original file line number Diff line number Diff line change
@@ -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": [
{
Expand Down
Loading

0 comments on commit f2c90f1

Please sign in to comment.