Skip to content

Latest commit

 

History

History
147 lines (108 loc) · 11.9 KB

2d_metadata.adoc

File metadata and controls

147 lines (108 loc) · 11.9 KB

Metadata

Introduction

Two tables in a GeoPackage provide a means of storing metadata in MIME [21] encodings that are defined in accordance with any authoritative metadata specifications, and relating it to the features, rasters, and tiles data in a GeoPackage. These tables are intended to provide the support necessary to implement the hierarchical metadata model defined in ISO 19115 [28], Annex B B.5.25 MD_ScopeCode, [metadata_example_appendix] and [raster_or_tile_metadata_example_appendix], so that as GeoPackage data is captured and updated, the most local and specific detailed metadata changes associated with the new or modified data MAY be captured separately, and referenced to existing global and general metadata.

The gpkg_metadata table that contains metadata is described in clause [_metadata_table], and the gpkg_metadata_reference table that relates gpkg_metadata to GeoPackage data is described in clause [_metadata_reference_table]. There is no GeoPackage requirement that such metadata be provided or that defined metadata be structured in a hierarchical fashion [1] with more than one level, only that if it is, these tables SHALL be used. Such metadata [2] and data that relates it to GeoPackage contents SHALL NOT be stored in other tables.

Metadata Table

Data
Table Definition

A GeoPackage MAY contain a table named gpkg_metadata. If present it SHALL be defined per clause 2.4.2.1.1 Table Definition, Metadata Table Definition and [gpkg_metadata_sql].

The first component of GeoPackage metadata is the gpkg_metadata table that MAY contain metadata in MIME [21] encodings structured in accordance with any authoritative metadata specification, such as ISO 19115 [28], ISO 19115-2 [B6], ISO 19139 [B7], Dublin Core [B8], CSDGM [B10], DDMS [B12], NMF/NMIS [B13], etc. The GeoPackage interpretation of what constitutes “metadata” is a broad one that includes UML models [B14] encoded in XMI [B15], GML Application Schemas [30], ISO 19110 feature catalogues [B18], OWL [B20] and SKOS [B21] taxonomies, etc.

Table 1. Metadata Table Definition
Column Name Column Type Column Description Null Default Key

id

INTEGER

Metadata primary key

no

PK

md_scope

TEXT

Case sensitive name of the data scope to which this metadata applies; see Metadata Scopes below

no

‘dataset’

md_standard_uri

TEXT

URI [23] reference to the metadata structure definition authority [3]

no

mime_type

TEXT

MIME [21] encoding of metadata

no

text/xml [24]

metadata

TEXT

metadata

no

’’

The md_standard_uri data value provides an identifier for the metadata structure (schema) specified by its definition authority. The structure (schema) information could be in whatever encoding is used by the definition authority, e.g. UML [B14], or IDEF1x [B16], or XML/Schema [25][26][27], or RDF/S [B19].

Table Data Values

The md_scope column in the gpkg_metadata table is the name of the applicable scope for the contents of the metadata column for a given row. The list of valid scope names and their definitions is provided in Metadata Scopes below. The initial contents of this table were obtained from the ISO 19115 [40], Annex B B.5.25 MD_ScopeCode code list, which was extended [4] for use in the GeoPackage specification by addition of entries with “NA” as the scope code column in Metadata Table Definition.

Table 2. Metadata Scopes
Name (md_scope) Scope Code Definition

undefined

NA

Metadata information scope is undefined

fieldSession

012

Information applies to the field session

collectionSession

004

Information applies to the collection session

series

006

Information applies to the (dataset) series [5]

dataset

005

Information applies to the (geographic feature) dataset

featureType

010

Information applies to a feature type (class)

feature

009

Information applies to a feature (instance)

attributeType

002

Information applies to the attribute class

attribute

001

Information applies to the characteristic of a feature (instance)

tile

016

Information applies to a tile, a spatial subset of geographic data

model

015

Information applies to a copy or imitation of an existing or hypothetical object

catalog

NA

Metadata applies to a feature catalog [6]

schema

NA

Metadata applies to an application schema [7]

taxonomy

NA

Metadata applies to a taxonomy or knowledge system [8]

software

013

Information applies to a computer program or routine

service

014

Information applies to a capability which a service provider entity makes available to a service user entity through a set of interfaces that define a behaviour, such as a use case

collectionHardware

003

Information applies to the collection hardware class

nonGeographicDataset

007

Information applies to non-geographic data

dimensionGroup

008

Information applies to a dimension group

Each md_scope column value in a gpkg_metadata table or updateable view SHALL be one of the name column values from Metadata Scopes.

Metadata Reference Table

Data
Table Definition

A GeoPackage that contains a gpkg_metadata table SHALL contain a gpkg_metadata_reference table per clause 2.4.3.1.1 Table Definition, Metadata Reference Table Definition (Table Name: gpkg_metadata_reference) and [gpkg_metadata_reference_sql].

The second component of GeoPackage metadata is the gpkg_metadata_reference table that links metadata in the gpkg_metadata table to data in the feature, and tiles tables defined in clauses 2.1.6 and 2.2.7. The gpkg_metadata_reference table is not required to contain any rows.

Table 3. Metadata Reference Table Definition (Table Name: gpkg_metadata_reference)
Column Name Col Type Column Description Null Default Key

reference_scope

TEXT

Lowercase metadata reference scope; one of ‘geopackage’, ‘table’,‘column’, ’row’, ’row/col’

no

table_name

TEXT

Name of the table to which this metadata reference applies, or NULL for reference_scope of ‘geopackage’.

yes

column_name

TEXT

Name of the column to which this metadata reference applies; NULL for reference_scope of ‘geopackage’,‘table’ or ‘row’, or the name of a column in the table_name table for reference_scope of ‘column’ or ‘row/col’

yes

row_id_value [9]

INTEGER

NULL for reference_scope of ‘geopackage’, ‘table’ or ‘column’, or the rowed of a row record in the table_name table for reference_scope of ‘row’ or ‘row/col’

yes

timestamp

DATETIME

timestamp value in ISO 8601 format as defined by the strftime function \'%Y-%m-%dT%H:%M:%fZ' format string applied to the current time

no

strftime(\'%Y-%m-%dT%H:%M:%fZ', \'now')

md_file_id

INTEGER

gpkg_metadata table id column value for the metadata to which this gpkg_metadata_reference applies

no

FK

md_parent_id

INTEGER

gpkg_metadata table id column value for the hierarchical parent gpkg_metadata for the gpkg_metadata to which this gpkg_metadata_reference applies, or NULL if md_file_id forms the root of a metadata hierarchy

yes

FK

Every row in gpkg_metadata_reference that has null value as md_parent_id forms the root of a metadata hierarchy.[10]

Table Data Values

Every gpkg_metadata_reference table reference scope column value SHALL be one of ‘geopackage’, ‘table’, ‘column’, ’row’, ’row/col’ in lowercase.

Every gpkg_metadata_reference table row with a reference_scope column value of ‘geopackage’ SHALL have a table_name column value that is NULL. Every other gpkg_metadata_reference table row SHALL have a table_name column value that references a value in the gpkg_contents table_name column.

Every gpkg_metadata_reference table row with a reference_scope column value of ‘geopackage’,‘table’ or ‘row’ SHALL have a column_name column value that is NULL. Every other gpkg_metadata_reference table row SHALL have a column_name column value that contains the name of a column in the SQLite table or view identified by the table_name column value.

Every gpkg_metadata_reference table row with a reference_scope column value of ‘geopackage’, ‘table’ or ‘column’ SHALL have a row_id_value column value that is NULL. Every other gpkg_metadata_reference table row SHALL have a row_id_value column value that contains the ROWID of a row in the SQLite table or view identified by the table_name column value.

Every gpkg_metadata_reference table row timestamp column value SHALL be in ISO 8601 [29] format containing a complete date plus UTC hours, minutes, seconds and a decimal fraction of a second, with a ‘Z’ (‘zulu’) suffix indicating UTC.[11]

Every gpkg_metadata_reference table row md_file_id column value SHALL be an id column value from the gpkg_metadata table.

Every gpkg_metadata_reference table row md_parent_id column value that is NOT NULL SHALL be an id column value from the gpkg_metadata table that is not equal to the md_file_id column value for that row.


1. Informative examples of hierarchical metadata are provided in [metadata_example_appendix]
2. An informative example of raster image metadata is provided in [tiles_example_appendix]
3. For example, for ISO 19139 metadata the URI value should be the metadata schema namespace http://www.isotc211.org/2005/gmd
4. The scope codes in Metadata Scopes include a very wide set of descriptive information types as “metadata” to describe data.
5. ISO 19139 format metadata (B32) is recommended for general-purpose description of geospatial data at the series and dataset metadata scopes.
6. The “catalog” md_scope MAY be used for Feature Catalog (B40) information stored as XML metadata that is linked to features stored in a GeoPackage.
7. The “schema” md_scope MAY be used for Application Schema (B37)(B38)(B39)(B44) information stored as XML metadata that is linked to features stored in a GeoPackage.
8. The “taxonomy” md_scope MAY be used for taxonomy or knowledge system (B41)(B42) “linked data” information stored as XML metadata that is linked to features stored in a GeoPackage.
9. In SQLite, the rowid value is always equal to the value of a single-column primary key on an integer column [B30] and is not changed by a database reorganization performed by the VACUUM SQL command.
10. Such a metadata hierarchy MAY have only one level of defined metadata
11. The following statement selects an ISO 8601timestamp value using the SQLite strftime function: SELECT (strftime('%Y-%m-%dT%H:%M:%fZ','now')).