﻿================================================================================
DOCUMENTO: Arquivo de Mapeamento de Schema
================================================================================
DESCRIÇÃO:
Dicionário JSON que mapeia atributos e schemas entre diferentes versões/formatos do modelo de dados geoespacial EDGV. Usado como referência de correspondência de campos na pipeline de conversão ETL.

ARQUIVO ORIGINAL: C:\DESENVOLVIMENTO\dados-modelagens\arquivo_mapeamento_schema.json
TAMANHO ORIGINAL: 6.6 KB
GERADO EM: 2026-03-17 22:37:46
PROJETO: EDGV - Especificação Técnica para a Estruturação de Dados Geoespaciais Vetoriais
CONTEXTO: Pipeline ETL para conversão de dados geoespaciais entre formatos Shapefile, PostGIS e modelos EDGV
================================================================================

CONTEÚDO DO ARQUIVO:
================================================================================

[ANÁLISE ESTRUTURAL DO JSON]
Tipo: Objeto JSON com 8 chaves de nível superior
Chaves principais: $schema, title, description, type, definitions, properties, additionalProperties, required

[CONTEÚDO JSON COMPLETO]

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Arquivo Mapeamento",
  "description": "Arquivo que descreve o mapeamento entre especificações",
  "type": "object",
  "definitions": {
    "afixo": {
      "type": "object",
      "properties": {
        "tipo": {
          "type": "string",
          "enum": [
            "sufixo",
            "prefixo"
          ]
        },
        "POINT": {
          "type": "string"
        },
        "LINESTRING": {
          "type": "string"
        },
        "POLYGON": {
          "type": "string"
        }
      },
      "required": [
        "tipo",
        "POINT",
        "LINESTRING",
        "POLYGON"
      ],
      "additionalProperties": false
    },
    "valores_concatenar": {
      "type": "object",
      "properties": {
        "nome_atributo": {
          "type": "string"
        },
        "concatenar": {
          "type": "boolean"
        },
        "valor": {
          "type": [
            "string",
            "number",
            "boolean",
            "null"
          ]
        }
      },
      "required": [
        "nome_atributo",
        "valor"
      ],
      "additionalProperties": false
    },
    "filtro": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "$or": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/filtro"
              },
              "minItems": 2
            }
          },
          "required": [
            "$or"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "$and": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/filtro"
              },
              "minItems": 2
            }
          },
          "required": [
            "$and"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "$not": {
              "$ref": "#/definitions/filtro"
            }
          },
          "required": [
            "$not"
          ],
          "additionalProperties": false
        },
        {
          "$ref": "#/definitions/valores_concatenar"
        }
      ]
    },
    "mapeamento_atributos": {
      "type": "object",
      "properties": {
        "__comment": {
          "type": "string"
        },
        "attr_A": {
          "type": "string"
        },
        "attr_B": {
          "type": "string"
        },
        "traducao": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "valor_A": {
                "type": [
                  "string",
                  "number",
                  "boolean",
                  "null"
                ]
              },
              "valor_B": {
                "type": [
                  "string",
                  "number",
                  "boolean",
                  "null"
                ]
              },
              "sentido": {
                "type": "string",
                "enum": [
                  "A=>B",
                  "B=>A"
                ]
              }
            },
            "required": [
              "valor_A",
              "valor_B"
            ],
            "additionalProperties": false
          },
          "minItems": 1
        }
      },
      "required": [
        "attr_A",
        "attr_B"
      ],
      "additionalProperties": false
    },
    "mapeamento_classes": {
      "type": "object",
      "properties": {
        "__comment": {
          "type": "string"
        },
        "classe_A": {
          "type": "string"
        },
        "classe_B": {
          "type": "string"
        },
        "com_afixo_geom_A": {
          "type": "boolean"
        },
        "com_afixo_geom_B": {
          "type": "boolean"
        },
        "agregar_geom_A": {
          "type": "boolean"
        },
        "agregar_geom_B": {
          "type": "boolean"
        },
        "com_schema_A": {
          "type": "boolean"
        },
        "com_schema_B": {
          "type": "boolean"
        },
        "sentido": {
          "type": "string",
          "enum": [
            "A=>B",
            "B=>A"
          ]
        },
        "atributos_default_B": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/valores_concatenar"
          },
          "minItems": 1
        },
        "atributos_default_A": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/valores_concatenar"
          },
          "minItems": 1
        },
        "mapeamento_atributos": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/mapeamento_atributos"
          },
          "minItems": 1
        },
        "filtro_A": {
          "$ref": "#/definitions/filtro"
        },
        "filtro_B": {
          "$ref": "#/definitions/filtro"
        },
        "mapeamento_multiplo": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "__comment": {
                "type": "string"
              },
              "tupla_A": {
                "type": "array",
                "items": {
                  "$ref": "#/definitions/valores_concatenar"
                },
                "minItems": 1
              },
              "tupla_B": {
                "type": "array",
                "items": {
                  "$ref": "#/definitions/valores_concatenar"
                },
                "minItems": 1
              },
              "sentido": {
                "type": "string",
                "enum": [
                  "A=>B",
                  "B=>A"
                ]
              }
            },
            "required": [
              "tupla_A",
              "tupla_B"
            ],
            "additionalProperties": false
          },
          "minItems": 1
        }
      },
      "required": [
        "classe_A",
        "classe_B"
      ],
      "additionalProperties": false
    }
  },
  "properties": {
    "mapeamento_classes": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/mapeamento_classes"
      }
    },
    "mapeamento_atributos": {
      "description": "Mapeamento de atributos aplicado as feições de todas as classes. Segundo mapeamento a ser realizado.",
      "type": "array",
      "items": {
        "$ref": "#/definitions/mapeamento_atributos"
      }
    },
    "atributos_default_B": {
      "description": "Valores default aplicado a todas as classes no mapeamento de B=>A. Primeiro mapeamento a ser realizado.",
      "type": "array",
      "items": {
        "$ref": "#/definitions/valores_concatenar"
      }
    },
    "atributos_default_A": {
      "description": "Valores default aplicado a todas as classes no mapeamento de A=>B. Primeiro mapeamento a ser realizado.",
      "type": "array",
      "items": {
        "$ref": "#/definitions/valores_concatenar"
      }
    },
    "schema_A": {
      "type": "string"
    },
    "schema_B": {
      "type": "string"
    },
    "agregar_geom_A": {
      "type": "boolean"
    },
    "agregar_geom_B": {
      "type": "boolean"
    },
    "afixo_geom_A": {
      "$ref": "#/definitions/afixo"
    },
    "metadados": {
      "type": "object",
      "properties": {
        "versao_arquivo": {
          "type": "string"
        },
        "modelo_A": {
          "type": "string"
        },
        "versao_modeloA": {
          "type": "string"
        },
        "modelo_B": {
          "type": "string"
        },
        "versao_modelo_B": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "afixo_geom_B": {
      "$ref": "#/definitions/afixo"
    },
    "__comment": {
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "mapeamento_classes",
    "agregar_geom_A",
    "agregar_geom_B",
    "schema_A",
    "schema_B",
    "afixo_geom_A",
    "afixo_geom_B"
  ]
}
