{
  "id": "es_dni_masked",
  "kind": "datatype",
  "status": "draft",
  "name": "Spanish identity document number, masked for publication",
  "doc": "Number of a Spanish identity document (DNI or NIE) with all but four digits replaced by asterisks, as public bodies publish it next to the name of a person. The data protection law (Ley Orgánica 3/2018, seventh additional provision) asks for four digits of the document, and the guidance of the Spanish data protection authorities picks the digits in positions four to seven, so the DNI 12345678X is written ***4567** and the NIE L1234567X is written ****4567*. The guidance is a recommendation, and registers of contracts and grants also show other positions.",
  "parent": "es_dni",
  "is_pii": true,
  "categories": [
    "persons",
    "pii"
  ],
  "country": [
    "ES"
  ],
  "langs": [
    "common"
  ],
  "classification": "identifier",
  "regexp": "^(?:\\*{3}\\d{4}\\*{2}|\\*{4}\\d{4}\\*)$",
  "examples": [
    {
      "value": "***4567**",
      "description": "the DNI 12345678X of the guidance",
      "valid": true
    },
    {
      "value": "****4567*",
      "description": "the NIE L1234567X of the guidance",
      "valid": true
    },
    {
      "value": "12345678X",
      "description": "not masked",
      "valid": false
    }
  ],
  "links": [
    {
      "type": "doc",
      "url": "https://www.aepd.es/documento/orientaciones-da7.pdf"
    },
    {
      "type": "doc",
      "url": "https://www.boe.es/buscar/act.php?id=BOE-A-2018-16673"
    }
  ],
  "translations": {
    "es": {
      "name": "DNI o NIE anonimizado para su publicación"
    },
    "ru": {
      "name": "Номер документа DNI/NIE"
    }
  },
  "detected_by": {
    "tools": [
      "metacrafter"
    ],
    "metacrafter_rules": [
      {
        "rule": "esdnimaskedvalue",
        "type": "data",
        "match": "regex",
        "file": "es/es_codes.yaml"
      }
    ]
  },
  "quality": {
    "score": 90,
    "missing": [
      "mapping (Wikidata, Schema.org, ...)"
    ]
  },
  "source": {
    "path": "data/datatypes/ES/persons/es_dni_masked.yaml",
    "url": "https://github.com/apicrafter/metacrafter-registry/blob/main/data/datatypes/ES/persons/es_dni_masked.yaml",
    "edit_url": "https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/ES/persons/es_dni_masked.yaml"
  },
  "urls": {
    "html": "https://registry.apicrafter.io/datatype/es_dni_masked",
    "json": "https://registry.apicrafter.io/api/v1/datatypes/es_dni_masked.json"
  }
}