Data Model View
The SWIM database is designed under the constraints of a NoSQL database managed with MongoDB. This section describes the collection schemas implemented in MongoDB for this project.
Note: Section pending updates according to latest data model upgrades.
Database Catalog
The current data model is composed of the following collections:
- model-base: Holds base JSON structure of registered models.
 - model-meta: Holds metadata of a registered model.
 - output: Holds a collection of model output metadata. (Description coming soon)
 - parameter2: Holds a collection of model paramater metadata and default values. (Description coming soon)
 - provschema: Holds the basic provenance structure of a model run.
 - userscenario: Holds user defined model executions.
 
MODEL-META
Stores metadata information of a specific scientific model implementation executable by a modeling software agent. It also provides information regarding model creators, host server and interfacing information.
Primary Representation

Field Details
| Field | Type | Description | 
|---|---|---|
| _id | xsd:string | MongoDB auto-generated unique identifier. | 
| modelName | xsd:string | Name of the exposed model. | 
| modelDescription | xsd:string | A short description of what the model does. | 
| dateCreated | xsd:datetime | Date of the first model release. | 
| dateModified | xsd:datetime | Date and time of last modification to the model. | 
| softwareAgent | xsd:string | Software application capable of executing and implementing the model. | 
| license | xsd:string | The license information for the exposed model. | 
| version | xsd:string | Provides the version of the base model. | 
| sponsor | xsd:string | Organization, person or institution that provides funding. | 
| creators | Object array | Model authors/creators. | 
| creators.name | xsd:string | Creator full name | 
| creators.department | xsd:string | A division of a organization such as a government, university, business, or shop, dealing with a specific subject. | 
| creators.organization | xsd:string | Creator organization name | 
| creators.email | xsd:string | Electronic mail address for communication. | 
| creators.city | xsd:string | Named geographical locality | 
| creators.state | xsd:string | Region associated with the address of an object. | 
| creators.country | xsd:string | The country name associated with the address of an object. | 
| hostServer | Object container | Server machine where the base model and corresponding software agent is deployed. | 
| hostServer.serverName | xsd:string | DNS name of the server. | 
| hostServer.serverIP | xsd:string | External IP Address of the server. | 
| hostServer.serverAdmin | xsd:string | Person is charge of administating the server. | 
| hostServer.adminEmail | xsd:string | Administrator email. | 
| hostServer.serverOwner | xsd:string | Organization or person that owns the physical server. | 
| serviceInfo | Object container | Information regarding the exposed webservice of the model. | 
| serviceInfo.serviceURL | xsd:string | Request URI | 
| serviceInfo.serviceMethod | xsd:string | http method to invoke a request (EG: POST, GET) | 
| serviceInfo.consumes | xsd:string | A list of MIME types the service can consume. (E.G: application/json) | 
| serviceInfo.produces | xsd:string | MIME types produced as a response by the service. | 
| service.isPublic | xsd:string | If the service is available on the web for public use. (true or false). | 
| serviceInfo.externalDocs | Object array | Additional external documentation. | 
JSON Skeleton Representation
{
    "_id" : "",
    "modelName" : "",
    "modelDescription" : "",
    "dateCreated" : "",
    "dateModified" : "",
    "softwareAgent" : "",
    "license" : "",
    "version" : "",
    "sponsor" : "",
    "creators" : [
    {
        "name" : "",
        "department" : "",
        "email" : "",
        "organization" : "",
        "city" : "",
        "state" : "",
        "country" : ""
    }
    ],
    "hostServer" : {
        "serverName" : "",
        "serverIP" : "",
        "serverAdmin" : "",
        "adminEmail" : "",
        "serverOwner" : ""
    },
    "serviceInfo" : {
        "serviceURL" : "",
        "serviceMethod" : "",
        "consumes" : "",
        "produces" : "",
        "isPublic" : "",
        "externalDocs" : [""]
    }
}
MODEL-BASE
Stores a set of default parameter values for a base modeling scenario. Each document provides extended metadata about the scenario such as: name, description, date created and last date modified; a set of model settings: model id, algorithm, method, and finally a set of predefined model inputs: target model id, parameter name, label, unit, default value, default data source, among others. Model-base documents are used to dynamically load default parameter values on the graphical user interface.
Primary Representation

Field Details
| Field | Type | Description | 
|---|---|---|
| _id | xsd:string | MongoDB auto-generated unique identifier. | 
| scenarioName | xsd:string | Given name of a scenario. | 
| scenarioDescription | xsd:string | A short description of what the scenario is. | 
| dateCreated | xsd:string | Date of first scenario specification. | 
| dateModified | xsd:datetime | Date of last modification to scenario fields. | 
| modelSettings | Object array | Default general settings of models used for the current scenario. | 
| modelSettings.modelID | xsd:string | Reference to model-meta document. | 
| modelSettings. ... | xsd:string | Modeling software specific settings can be added as attributes | 
| modelInputs | Object array | Array of model inputs. | 
| modelInputs.modelID | xsd:string | Reference to model-meta document. | 
| modelInputs.paramName | xsd:string | Parameter name as defined on the modeling code or software agent. | 
| modelInputs.paramCategory | xsd:string | A class or division to which the parameter is a part of. | 
| modelInputs.paramLabel | xsd:string | Human readable name for the parameter. | 
| modelInputs.paramUnit | xsd:string | Particular physical quantity, defined and adopted by convention. | 
| modelInputs.paramDefaultValue | Object array | A predefined value of a particular parameter. | 
| modelInputs.paramDefaultSource | xsd:string | A related resource from which the described resource is derived. | 
| modelInputs.maxValue | xsd:string | The greatest numerical value that the parameter can take. | 
| modelInputs.minValue | xsd:string | The lowest numerical value that the parameter can take. | 
| modelInputs.structType | xsd:string | Data structure used on the parameter value field: Scalar: single value Table: 1 to n dimension tables. | 
| modelInputs.structDimension | xsd:string | Dimension size of the table structure. This field is not required for scalar values. | 
| modelInputs.dataType | xsd:string | Data type of the defined value. Eg. Integer, double | 
| modelInputs.definitionType | xsd:string | How the value of the parameter is stablished: Static: hardcoded into the model. Scenario: defined by a specific scenario selection. User: Can be customized by a user. | 
JSON Skeleton Representation
{
    "_id" : "",
    "scenarioName" : "",
    "scenarioDescription" : "",
    "dateCreated" : "",
    "dateModified" : "",
    "modelSettings" : [
    {
        "modelID" : "",
    }
    ],
    "modelInputs" : [
    {
        "modelID" : "",
        "paramName" : "",
        "paramLabel" : "",
        "paramCategory : "",
        "paramUnit" : "",
        "paramDefaultValue" : "",
        "paramDefaultSource" : "",
        "maxValue" : "",
        "minValue" : "",
        "dataType" : "",
        "structType" : "",
        "structDimension" : "",
        "dataType" : "",
        "definitionType" : ""
    }
    ]
}
USER SCENARIO
Stores a set of user defined scenario metadata, model inputs and requested outputs.
Primary Representation

Field Details
| Field | Type | Description | 
|---|---|---|
| _id | xsd:string | MongoDB auto-generated unique identifier. | 
| className | xsd:string | Morphia mapping java class on webservice. | 
| name | xsd:string | User defined name of a given projection input. | 
| description | xsd:string | Short description to describe projection scenario and inputs. | 
| userid | xsd:string | Reference to user id of the water project website. | 
| baseScenario | xsd:string | Given name of the scenario taken as base for the current projection. | 
| baseClimateScenario | xsd:string | Given name of a climate scenario taken as a base for the current projection. | 
| startedAtTime | xsd:datetime | Date and time when projection was submitted. | 
| endedAtTime | xsd:datetime | Date and time when model execution finished. | 
| status | xsd:string | Execution state of submitted projection (queued, running, complete, error). | 
| isPublic | xsd:string | Flag to determine if the projection is available for public view. (true or false) | 
| modelSettings | Object array | General settings of models used for the current scenario. | 
| modelSettings.modelID | xsd:string | Reference to model-meta document. | 
| modelInputs | Object array | Array of model inputs. | 
| modelInputs.modelID | xsd:string | Reference to model-meta document. | 
| modelInputs.paramName | xsd:string | Parameter name as defined on the modeling code or software agent. | 
| modelInputs.paramLabel | xsd:string | Human readable name for the parameter. | 
| modelInputs.paramUnit | xsd:string | Particular physical quantity, defined and adopted by convention. | 
| modelInputs.paramDefaultValue | Object array | A predefined value of a particular parameter. | 
| modelInputs.paramValue | Object array | User defined value of a particular parameter. | 
| modelInputs.paramDefaultSource | xsd:string | A related resource from which the described resource is derived. | 
| modelInputs.maxValue | xsd:string | The greatest numerical value that the parameter can take. | 
| modelInputs.minValue | xsd:string | The lowest numerical value that the parameter can take. | 
| modelInputs.structType | xsd:string | Data structure used on the parameter value field: Scalar: single value Table: 1 to n dimension tables. | 
| modelInputs.structDimension | xsd:string | Dimension size of the table structure. This field is not required for scalar values. | 
| modelInputs.dataType | xsd:string | Data type of the defined value. Eg. Integer, double | 
| modelInputs.definitionMethod | xsd:string | How the value of the parameter is stablished: Static: hardcoded into the model. Scenario: defined by a specific scenario selection. User: Can be customized by a user. | 
| modelOutputs | Object array | |
| modelOutputs.varName | xsd:string | Model or software agent name of an output variable. | 
| modelOutputs.varLabel | xsd:string | Human name of an output variable. | 
| modelOutputs.varDescription | xsd:string | Detailed information about the variable. | 
| modelOutputs.varCategory | xsd:string | Class or division to which the variable is part of. | 
| modelOutputs.varValue | xsd:string | Output value of a particular variable. | 
| modelOutputs.varUnit | xsd:string | Particular physical quantity, defined and adopted by convention. | 
JSON Skeleton Representation
{
    "_id" : "",
    "className" : "",
    "name" : "",
    "description" : "",
    "userid" : "",
    "baseScenario" : "",
    "baseClimateScenario" : "",
    "startedAtTime" : "",
    "endedAtTime" : "",
    "status" : "",
    "isPublic" : "",
    "modelSettings" : [
    {
        "modelID" : "",
    }
    ],
"modelInputs" : [
    {
    "modelID" : "",
    "paramName" : "",
    "paramLabel" : "",
    "paramCategory" : "",
    "paramUnit" : "",
    "paramDefaultValue" : "",
    "paramDefaultSource" : "",
    "paramValue" : [""],
    "structType" : "",
    "structDimension" : "",
    "dataType" : "",
    "definitionType" : ""
    }
    ],
"modelOutputs" : [
    {
    "varName" : "",
  "varLabel" : "",
    "varDescription" :"",
    "varCategory" : "",
    "varValue" : [""],
    "varUnit" : "",
    }
    ]
}