diff --git a/extensions/3DTILES_metadata/README.md b/extensions/3DTILES_metadata/README.md index 81d75b294..c9e433d42 100644 --- a/extensions/3DTILES_metadata/README.md +++ b/extensions/3DTILES_metadata/README.md @@ -326,21 +326,21 @@ Tileset authors may define their own additional statistics, like `_mode` in the ### Overview -While [classes](#class) within a schema define the data types and meanings of properties, properties do not take on particular values until a metadata is assigned (i.e. the class is "instatiated") to a particular entity within the 3D Tiles hierarchy. Property values may be assigned to entities as described in the sections below. +While [classes](#class) within a schema define the data types and meanings of properties, properties do not take on particular values until a metadata is assigned (i.e. the class is "instatiated") as a particular metadata entity within the 3D Tiles hierarchy. Each metadata entity contains the name of the class that it is an instance of, as well as a dictionary of property values that correspond to the properties of that class. This common structure is defined in [metadataEntity.schema.json](./schema/metadataEntity.schema.json). Each property value assigned must be defined by a class property with the same alphanumeric property ID, with values matching the data type of the class property. An entity may provide values for only a subset of the properties of its class, but class properties marked `required: true` must not be omitted. -Most property values are encoded as JSON within the entity to which they are assigned. One notable exception is metadata assigned to [implicit tiles](#implicit-tile-properties), stored in a more compact binary form. +Most property values are encoded as JSON within the entity. One notable exception is metadata assigned to [implicit tiles](#implicit-tile-properties), stored in a more compact binary form. ### Tileset Properties -*Defined in [tileset.schema.json](./schema/tileset.schema.json)*. +*Defined in [tileset.schema.json](./schema/tileset.schema.json) and [metadataEntity.schema.json](./schema/metadataEntity.schema.json)*. Properties assigned to tilesets provide metadata about the tileset as a whole. Common examples might include year of collection, author details, or other general context for the tileset contents. The `tileset` object within a tileset's `3DTILES_metadata` extension must specify its class (`class`). Within a `properties` dictionary, values for properties are given, encoded as JSON types according to the [JSON Format](../../specification/Metadata/README.md#json-format) specification. -> **Example:** The example below defines properties of a tileset, with the tileset representing an instance of a "city" class. Required properties "dateFounded" and "population" are given; optional property "country" is omitted. +> **Example:** The example below defines properties of a tileset, with the tileset being an instance of a "city" class. Required properties "dateFounded" and "population" are given; optional property "country" is omitted. > > ```jsonc > { @@ -373,7 +373,7 @@ The `tileset` object within a tileset's `3DTILES_metadata` extension must specif ### Tile Properties -*Defined in [tile.3DTILES_metadata.schema.json](./schema/tile.3DTILES_metadata.schema.json)*. +*Defined in [tile.3DTILES_metadata.schema.json](./schema/tile.3DTILES_metadata.schema.json) and [metadataEntity.schema.json](./schema/metadataEntity.schema.json)*. Property values may be assigned to individual tiles, including (for example) spatial hints to optimize traversal algorithms. The example below uses the built-in semantic `TILE_MAXIMUM_HEIGHT` from the [3D Metadata Semantic Reference](../../specification/Metadata/Semantics). @@ -486,7 +486,7 @@ Binary property value arrays are located in buffer views of the implicit tiling ### Content Group Properties -*Defined in [group.schema.json](./schema/group.schema.json) and [tileset.3DTILES_metadata.schema.json](./schema/content.3DTILES_metadata.schema.json)*. +*Defined in [group.schema.json](./schema/group.schema.json), [metadataEntity.schema.json](./schema/metadataEntity.schema.json), and [tileset.3DTILES_metadata.schema.json](./schema/content.3DTILES_metadata.schema.json)*. Tiles may contain more than one content entity (see: [`3DTILES_multiple_contents`](../3DTILES_multiple_contents)), or multiple tiles may reference content sharing the same metadata. In these cases, metadata assigned to the tile would be inadequate or inefficient for describing tile contents. This extension allows content to be organized into collections, or "groups", and metadata may be associated with each group. Groups are useful for supporting metadata on only a subset of a tile's content, or for working with collections of contents as layers, e.g. to manage visibility or visual styling. diff --git a/extensions/3DTILES_metadata/schema/group.schema.json b/extensions/3DTILES_metadata/schema/group.schema.json index a768a5e61..17e06622d 100644 --- a/extensions/3DTILES_metadata/schema/group.schema.json +++ b/extensions/3DTILES_metadata/schema/group.schema.json @@ -6,55 +6,13 @@ "description": "An object containing metadata about a group.", "allOf": [ { - "$ref": "tilesetProperty.schema.json" + "$ref": "metadataEntity.schema.json" } ], "properties": { - "class": { - "type": "string", - "description": "The class that property values conform to. The value must be a class ID declared in the `classes` dictionary." - }, - "properties": { - "type": "object", - "description": "A dictionary, where each key corresponds to a property ID in the class' `properties` dictionary and each value contains the property values. The type of the value must match the property definition: For `BOOLEAN` use `true` or `false`. For `STRING` use a JSON string. For numeric types use a JSON number. For `ENUM` use a valid enum `name`, not an integer value. For `ARRAY`, `VECN`, and `MATN` types use a JSON array containing values matching the `componentType`. Required properties must be included in this dictionary.", - "minProperties": 1, - "additionalProperties": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "type": "array", - "items": { - "type": "number" - } - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - } - }, + "class": {}, + "properties": {}, "extensions": {}, "extras": {} - }, - "required": [ - "class", - "properties" - ] + } } \ No newline at end of file diff --git a/extensions/3DTILES_metadata/schema/metadataEntity.schema.json b/extensions/3DTILES_metadata/schema/metadataEntity.schema.json new file mode 100644 index 000000000..528cdb053 --- /dev/null +++ b/extensions/3DTILES_metadata/schema/metadataEntity.schema.json @@ -0,0 +1,60 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "metadataEntity.schema.json", + "title": "Metadata Entity", + "type": "object", + "description": "An object containing a reference to a class from a metadata schema, and property values that conform to the properties of that class.", + "allOf": [ + { + "$ref": "tilesetProperty.schema.json" + } + ], + "properties": { + "class": { + "type": "string", + "description": "The class that property values conform to. The value must be a class ID declared in the `classes` dictionary." + }, + "properties": { + "type": "object", + "description": "A dictionary, where each key corresponds to a property ID in the class' `properties` dictionary and each value contains the property values. The type of the value must match the property definition: For `BOOLEAN` use `true` or `false`. For `STRING` use a JSON string. For numeric types use a JSON number. For `ENUM` use a valid enum `name`, not an integer value. For `ARRAY`, `VECN`, and `MATN` types use a JSON array containing values matching the `componentType`. Required properties must be included in this dictionary.", + "minProperties": 1, + "additionalProperties": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "type": "array", + "items": { + "type": "number" + } + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "extensions": {}, + "extras": {} + }, + "required": [ + "class", + "properties" + ] +} \ No newline at end of file diff --git a/extensions/3DTILES_metadata/schema/tile.3DTILES_metadata.schema.json b/extensions/3DTILES_metadata/schema/tile.3DTILES_metadata.schema.json index 601d846c9..94bc621ec 100644 --- a/extensions/3DTILES_metadata/schema/tile.3DTILES_metadata.schema.json +++ b/extensions/3DTILES_metadata/schema/tile.3DTILES_metadata.schema.json @@ -6,55 +6,13 @@ "description": "An object containing metadata about a tile. This extension must not be added to tiles using the `3DTILES_implicit_tiling` extension since tile metadata is provided separately in the subtrees.", "allOf": [ { - "$ref": "tilesetProperty.schema.json" + "$ref": "metadataEntity.schema.json" } ], "properties": { - "class": { - "type": "string", - "description": "The class that property values conform to. The value must be a class ID declared in the `classes` dictionary." - }, - "properties": { - "type": "object", - "description": "A dictionary, where each key corresponds to a property ID in the class' `properties` dictionary and each value contains the property values. The type of the value must match the property definition: For `BOOLEAN` use `true` or `false`. For `STRING` use a JSON string. For numeric types use a JSON number. For `ENUM` use a valid enum `name`, not an integer value. For `ARRAY`, `VECN`, and `MATN` types use a JSON array containing values matching the `componentType`. Required properties must be included in this dictionary.", - "minProperties": 1, - "additionalProperties": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "type": "array", - "items": { - "type": "number" - } - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - } - }, + "class": {}, + "properties": {}, "extensions": {}, "extras": {} - }, - "required": [ - "class", - "properties" - ] + } } \ No newline at end of file diff --git a/extensions/3DTILES_metadata/schema/tileset.schema.json b/extensions/3DTILES_metadata/schema/tileset.schema.json index e259087a1..3dfdaf24f 100644 --- a/extensions/3DTILES_metadata/schema/tileset.schema.json +++ b/extensions/3DTILES_metadata/schema/tileset.schema.json @@ -6,55 +6,13 @@ "description": "An object containing metadata about the tileset.", "allOf": [ { - "$ref": "tilesetProperty.schema.json" + "$ref": "metadataEntity.schema.json" } ], "properties": { - "class": { - "type": "string", - "description": "The class that property values conform to. The value must be a class ID declared in the `classes` dictionary." - }, - "properties": { - "type": "object", - "description": "A dictionary, where each key corresponds to a property ID in the class' `properties` dictionary and each value contains the property values. The type of the value must match the property definition: For `BOOLEAN` use `true` or `false`. For `STRING` use a JSON string. For `ENUM` use a valid enum `name`, not an integer value. For `ARRAY`, `VECN`, and `MATN` types use a JSON array containing values matching the `componentType`. Required properties must be included in this dictionary.", - "minProperties": 1, - "additionalProperties": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "type": "array", - "items": { - "type": "number" - } - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - } - }, + "class": {}, + "properties": {}, "extensions": {}, "extras": {} - }, - "required": [ - "class", - "properties" - ] + } } \ No newline at end of file