Create new schema for 06*****

Schema fields table.

_images/fields_table.png
For schema with pattern 06***** we need fields:
  • region
  • district
  • cadastral_number
  • area
  • forms_of_land_ownership
  • co_owners
  • availability_of_utilities

Create template using SchemaOnline. Paste fields, and generate template for schema.

_images/06_fields.png

Edit template

Template which we got on previous step

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "region": {
      "type": "string"
    },
    "district": {
      "type": "string"
    },
    "cadastral_number": {
      "type": "string"
    },
    "area": {
      "type": "integer"
    },
    "forms_of_land_ownership": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "co_owners": {
      "type": "boolean"
    },
    "availability_of_utilities": {
      "type": "boolean"
    }
  },
  "required": [
    "region",
    "district",
    "cadastral_number",
    "area",
    "forms_of_land_ownership",
    "co_owners",
    "availability_of_utilities"
  ]
}

Now we can add validation, description, and default value for every field.

We got such a scheme.

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "region": {
      "title": "Область",
      "type": "string"
    },
    "district": {
      "type": "string",
      "title": "Район"
    },
    "cadastral_number": {
      "title": "Кадастровий номер",
      "type": "string"
    },
    "area": {
      "title": "Площа, кв.м/га",
      "type": "integer",
      "minimum": 1,
      "exclusiveMinimum": false
    },
    "forms_of_land_ownership": {
      "type": "array",
      "title": "Форми власності на землю.",
      "items": {
        "type": "string",
        "enum": ["державна", "приватна", "комунальна"]
      }
    },
    "co_owners": {
      "title": "Наявність співвласників",
      "type": "boolean",
      "default": false
    },
    "availability_of_utilities": {
      "title": "Наявність на ділянці інженерних мереж",
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "region",
    "district",
    "cadastral_number",
    "area",
    "forms_of_land_ownership",
    "co_owners",
    "availability_of_utilities"
  ]
}

Add ID

Pattern for schema is 06******, so ID must look like urn:cav:06******-*.***

Create schema for 061****

Schema fields table.

_images/fields_table.png

We can see that 061***** template has 1 additional field.

Copy previous schema, edit fields, add one more, and edit ID.

Updated schema:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "urn:cav:06100000-3.001",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "region": {
      "title": "Область",
      "type": "string"
    },
    "district": {
      "type": "string",
      "title": "Район"
    },
    "cadastral_number": {
      "title": "Кадастровий номер",
      "type": "string"
    },
    "area": {
      "title": "Площа, кв.м/га",
      "type": "integer",
      "minimum": 1,
      "exclusiveMinimum": false
    },
    "forms_of_land_ownership": {
      "type": "array",
      "title": "Форми власності на землю.",
      "items": {
        "type": "string",
        "enum": ["державна", "приватна", "комунальна"]
      }
    },
    "co_owners": {
      "title": "Наявність співвласників",
      "type": "boolean",
      "default": false
    },
    "availability_of_utilities": {
      "title": "Наявність на ділянці інженерних мереж",
      "type": "boolean",
      "default": true
    },
    "city": {
      "title": "Місто/Населений пункт",
      "type": "string"
    }
  },
  "required": [
    "region",
    "district",
    "cadastral_number",
    "area",
    "forms_of_land_ownership",
    "co_owners",
    "availability_of_utilities",
    "city"
  ]
}