---
id: "gml_id"
kind: "datatype"
status: "draft"
is_pii: false
categories: ["geo"]
langs: ["common"]
quality: 80
url: "http://registry.apicrafter.io/datatype/gml_id"
---

# GML object identifier (gml:id) (`gml_id`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

Value of the gml:id attribute, the handle of an object in a Geography Markup Language (GML) document, such as a feature or a geometry in a WFS response. Its XML Schema type is ID, so the value is an XML NCName (it starts with a letter or an underscore and has no colon or space) and it is unique only within the document that contains it. It serves internal cross-references and is not a persistent identifier; GML carries stable identifiers in gml:identifier instead. GeoServer builds it from the feature type name and a number, as in states.1. GDAL reads the attribute into a string field called gml_id, so tables exported from GML or WFS data with ogr2ogr or QGIS keep it as a column. The regexp covers the NCName characters of the Basic Multilingual Plane.

- Parent datatype: `id`
- Personal data (PII): no
- Categories: Geographic identifiers (geo)
- Countries: global
- Languages: Common to most languages (common)
- Classification: identifier

## Detection

Regular expression (Python `re`):

```
^[A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$
```

## Examples

- `states.1` — GeoServer feature of the topp:states sample layer
- `states.1.1` — GeoServer geometry of feature states.1 in GML 3.2 output
- `myFeature.1` — GDAL GML driver documentation
- `table1-1` — GDAL GML driver documentation, WFS join
- `topp:states.1` (invalid example) — an NCName has no colon; topp is the namespace prefix of the feature type
- `1.1` (invalid example) — an NCName cannot start with a digit
- `states 1` (invalid example) — an NCName has no space

## Translations

- ru: Идентификатор объекта GML (gml:id)

## Sources

- doc: <https://gdal.org/en/stable/drivers/vector/gml.html>
- doc: <https://schemas.opengis.net/gml/3.2.1/gmlBase.xsd>
- doc: <https://www.w3.org/TR/xml-names/#NT-NCName>

## Quality

Score 80/100. Missing: mapping (Wikidata, Schema.org, ...), detector coverage.

JSON: <http://registry.apicrafter.io/api/v1/datatypes/gml_id.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/geo/gml_id.yaml>
