{
  "namespace" : "community",
  "version" : 1,
  "types" : {
    "person" : {
      "kind" : "entity",
      "schema" : {
        "type" : "object",
        "properties" : {
          "name" : {
            "type" : "string",
            "minLength" : 1,
            "maxLength" : 160
          }
        },
        "required" : [ "name" ],
        "additionalProperties" : false
      }
    },
    "network" : {
      "kind" : "entity",
      "schema" : {
        "type" : "object",
        "properties" : {
          "name" : {
            "type" : "string",
            "minLength" : 1,
            "maxLength" : 160
          }
        },
        "required" : [ "name" ],
        "additionalProperties" : false
      }
    },
    "membership" : {
      "kind" : "relationship",
      "schema" : {
        "type" : "object",
        "properties" : {
          "note" : {
            "type" : "string",
            "maxLength" : 1000
          }
        },
        "required" : [ ],
        "additionalProperties" : false
      },
      "roles" : {
        "member" : {
          "min" : 1,
          "max" : 50,
          "types" : [ "community/person", "community/membership" ]
        },
        "network" : {
          "min" : 1,
          "max" : 1,
          "types" : [ "community/network" ]
        }
      },
      "lifecycle" : {
        "initial" : "invited",
        "states" : [ "invited", "active", "left" ]
      },
      "commands" : {
        "join" : {
          "input" : {
            "type" : "object",
            "properties" : { },
            "required" : [ ],
            "additionalProperties" : false
          },
          "from" : [ "invited" ],
          "to" : "active"
        },
        "leave" : {
          "input" : {
            "type" : "object",
            "properties" : { },
            "required" : [ ],
            "additionalProperties" : false
          },
          "from" : [ "active" ],
          "to" : "left"
        }
      }
    }
  },
  "views" : {
    "active_members" : {
      "type" : "membership",
      "where" : {
        "eq" : [ {
          "path" : [ "state" ]
        }, "active" ]
      },
      "fields" : [ "note" ]
    }
  }
}