{
  "method_version": 1,
  "kind": "database_transformation_method",
  "database_name": "DialCodesPlus source-derived land-border assertions",
  "upstream": {
    "name": "mledoze/countries",
    "information_uri": "https://github.com/mledoze/countries/tree/fa4f62182d19ff4f8b325cde6387c9cd9d80955a",
    "edition_kind": "repository_commit",
    "edition": "fa4f62182d19ff4f8b325cde6387c9cd9d80955a",
    "input_filename": "countries.json",
    "license_name": "Open Database License (ODbL) 1.0",
    "license_uri": "https://opendatacommons.org/licenses/odbl/1.0/"
  },
  "derivative_boundary": "Only the source-derived country identifier and source-asserted border relation described here. Country display names, calling codes, flags, maps, independent government border records and editorial eligibility decisions are separate inputs, not copied into this database.",
  "rights": {
    "database_license": "ODbL-1.0",
    "license_uri": "https://opendatacommons.org/licenses/odbl/1.0/",
    "access_offer": "This file contains the complete method of making every alteration, including all additional contents, for the source-derived database under ODbL section4.6(b). It is offered free of charge without authentication or additional restrictions.",
    "scope": "This notice concerns this source-derived database; it makes no claim that every database or all site content has the same licence."
  },
  "input_contract": {
    "encoding": "UTF-8",
    "root_type": "array",
    "required_fields": {
      "cca2": "unique two-uppercase-letter string",
      "cca3": "unique three-uppercase-letter string",
      "borders": "array of unique three-uppercase-letter strings; every value must name a source cca3 record"
    },
    "duplicate_object_keys": "reject",
    "duplicate_identity_or_border": "reject",
    "unknown_border_target": "reject",
    "missing_null_or_wrong_type": "reject rather than guess an empty array"
  },
  "steps": [
    {
      "order": 1,
      "operation": "parse_and_validate",
      "definition": "Parse the entire upstream input under input_contract. Do not run scripts, follow links, fetch assets or read other files."
    },
    {
      "order": 2,
      "operation": "index",
      "definition": "Create a dictionary from every source row cca3 to that same row cca2. The dictionary is a temporary lookup, not an additional external dataset."
    },
    {
      "order": 3,
      "operation": "project_and_rename",
      "definition": "For every source row emit one country object. Set iso_alpha2 to the row cca2. Set source_asserted_land_border_iso_alpha2 to the list obtained by replacing each borders element with the indexed cca2 for that element. Do not retain any other input fields."
    },
    {
      "order": 4,
      "operation": "preserve_assertions",
      "definition": "Preserve every source row, every source identity and every directed source assertion, including one-sided assertions and empty arrays. Do not repair reciprocity, remove disputed relations, add a reverse edge, infer no-land-neighbours, merge territories with a metropole, filter to the site catalogue, or add independently collected border facts."
    },
    {
      "order": 5,
      "operation": "sort",
      "definition": "Sort each emitted source_asserted_land_border_iso_alpha2 array ascending by ASCII string comparison. Sort country objects ascending by iso_alpha2 using the same comparison. Sorting is the only reordering."
    },
    {
      "order": 6,
      "operation": "add_declared_metadata",
      "definition": "Construct the root object with schema_version, database_name, source_edition, license_uri, notices and countries, in that property order. Set schema_version to1, database_name to this method database_name, source_edition to upstream.edition, license_uri to upstream.license_uri, notices to additional_contents.notices in their stated order and countries to the sorted emitted array. Each country object has exactly iso_alpha2 and source_asserted_land_border_iso_alpha2 in that order."
    },
    {
      "order": 7,
      "operation": "encode",
      "definition": "Encode the root object as UTF-8 JSON using two spaces per indentation level and LF line breaks, followed by exactly one final LF; no BOM. Strings use standard JSON escaping. No other fields or transformations are permitted."
    }
  ],
  "additional_contents": {
    "geographic_facts": [],
    "external_dataset_rows": [],
    "identity_substitutions": [],
    "metadata_values": {
      "schema_version": 1,
      "database_name": "DialCodesPlus source-derived land-border assertions",
      "source_edition": "fa4f62182d19ff4f8b325cde6387c9cd9d80955a",
      "license_uri": "https://opendatacommons.org/licenses/odbl/1.0/"
    },
    "notices": [
      "Contains information from mledoze/countries, made available under the Open Database License (ODbL) 1.0.",
      "Source credit: mledoze/countries contributors; its README credits @ancosen for help with borders data and Wikipedia for the remaining data.",
      "The source-derived database is available under ODbL 1.0: https://opendatacommons.org/licenses/odbl/1.0/",
      "Only country identifiers and source border assertions are included. Flags and all other source fields are excluded."
    ],
    "other_contents": "None. Field names, ordering, identity lookup, metadata and every retained/removed input field are fully specified above."
  },
  "presentation_boundary": {
    "catalogue": "An independent site catalogue chooses which exact country IDs have pages and supplies display names, calling codes and flags. Such presentation values are not copied into the source-derived database.",
    "eligibility": "A separate source qualification selects whether a source assertion supports a complete current country list, a positive zero statement, or neither. An empty source array alone is not relabelled as a verified zero. Filtering a displayed query does not alter the retained source-derived database.",
    "independent_sources": "An independently qualified complete government country set takes precedence as a separate source. Its pairs, qualifications or dates are not unioned into this database. If data are merged or corrected in a stored derivative, this method must be amended to include every alteration and all additional contents before that changed derivative is publicly used.",
    "offer": "Links associated with source-derived country output identify the upstream database, ODbL licence and this complete method. No raw upstream archive or ready source-data export is offered."
  }
}
