content/developer-guide/metadata/index.html (110 lines of code) (raw):

<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE html> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xi="http://www.w3.org/2001/XInclude" xml:lang="en"> <head> <title>Metadata</title> <meta charset="UTF-8"/> <link rel="stylesheet" type="text/css" href="../book.css"/> </head> <body> <!-- Content below this point is copied in "/asf-staging/book/en/developer-guide.html" file by the `org.apache.sis.buildtools.book` class in `buildSrc`. --> <section> <header> <h1 id="Metadata">Metadata</h1> </header> <p> Many metadata standards exist, including Dublin core, <abbr>ISO</abbr> 19115 and the Image I/O metadata defined in the <code>javax.imageio.metadata</code> package. Apache <abbr>SIS</abbr> uses the <abbr>ISO</abbr> 19115 series of standards as the pivotal metadata structure, and converts other metadata structures to <abbr>ISO</abbr> 19115 when needed. The <abbr>ISO</abbr> 19115 standard defines hundreds of metadata elements, but the following table gives an overview with a few of them. Note that most of the nodes accept an arbitrary number of values. For example the <code class="OGC">extent</code> node may contain many geographic areas. </p> <table class="monospacedHeaderColumn" style="font-size:0.82vw"> <caption>Extract of a few metadata elements from ISO 19115</caption> <tr><th>Element</th> <th>Description</th></tr> <tr><td style="padding-top:9px">Metadata</td> <td style="padding-top:9px">Metadata about a dataset, service or other resources.</td></tr> <tr><td>  ├─Reference system info</td> <td>Description of the spatial and temporal reference systems used in the dataset.</td></tr> <tr><td>  ├─Identification info</td> <td>Basic information about the resource(s) to which the metadata applies.</td></tr> <tr><td>  │   ├─Citation</td> <td>Name by which the cited resource is known, reference dates, presentation form, <i>etc.</i></td></tr> <tr><td>  │   │   └─Cited responsible party</td> <td>Role, name, contact and position information for individuals or organizations that are responsible for the resource.</td></tr> <tr><td>  │   ├─Topic category</td> <td>Main theme(s) of the resource (e.g. farming, climatology, environment, economy, health, transportation, <i>etc.</i>).</td></tr> <tr><td>  │   ├─Descriptive keywords</td> <td>Category keywords, their type, and reference source.</td></tr> <tr><td>  │   ├─Spatial resolution</td> <td>Factor which provides a general understanding of the density of spatial data in the resource.</td></tr> <tr><td>  │   ├─Temporal resolution</td> <td>Smallest resolvable temporal period in a resource.</td></tr> <tr><td>  │   ├─Extent</td> <td>Spatial and temporal extent of the resource.</td></tr> <tr><td>  │   ├─Resource format</td> <td>Description of the format of the resource(s).</td></tr> <tr><td>  │   ├─Resource maintenance</td> <td>Information about the frequency of resource updates, and the scope of those updates.</td></tr> <tr><td>  │   └─Resource constraints</td> <td>Information about constraints (legal or security) which apply to the resource(s).</td></tr> <tr><td>  ├─Content info</td> <td>Information about the feature catalog and describes the coverage and image data characteristics.</td></tr> <tr><td>  │   ├─Imaging condition</td> <td>Conditions which affected the image (e.g. blurred image, fog, semi darkness, <i>etc.</i>).</td></tr> <tr><td>  │   ├─Cloud cover percentage</td> <td>Area of the dataset obscured by clouds, expressed as a percentage of the spatial extent.</td></tr> <tr><td>  │   └─Attribute group</td> <td>Information on attribute groups of the resource.</td></tr> <tr><td>  │       ├─Content type</td> <td>Types of information represented by the values (e.g. thematic classification, physical measurement, <i>etc.</i>).</td></tr> <tr><td>  │       └─Attribute</td> <td>Information on an attribute of the resource.</td></tr> <tr><td>  │           ├─Sequence identifier</td> <td>Unique name or number that identifies attributes included in the coverage.</td></tr> <tr><td>  │           ├─Peak response</td> <td>Wavelength at which the response is the highest.</td></tr> <tr><td>  │           ├─Min/max value</td> <td>Minimum/maximum value of data values in each sample dimension included in the resource.</td></tr> <tr><td>  │           ├─Units</td> <td>Units of data in each dimension included in the resource.</td></tr> <tr><td>  │           └─Transfer function type</td> <td>Type of transfer function to be used when scaling a physical value for a given element.</td></tr> <tr><td>  ├─Distribution info</td> <td>Information about the distributor of and options for obtaining the resource(s).</td></tr> <tr><td>  │   ├─Distribution format</td> <td>Description of the format of the data to be distributed.</td></tr> <tr><td>  │   └─Transfer options</td> <td>Technical means and media by which a resource is obtained from the distributor.</td></tr> <tr><td>  ├─Data quality info</td> <td>Overall assessment of quality of a resource(s).</td></tr> <tr><td>  ├─Acquisition information</td> <td>Information about the acquisition of the data.</td></tr> <tr><td>  │   ├─Environmental conditions</td> <td>Record of the environmental circumstances during the data acquisition.</td></tr> <tr><td>  │   └─Platform</td> <td>General information about the platform from which the data were taken.</td></tr> <tr><td>  │       └─Instrument</td> <td>Instrument(s) mounted on a platform.</td></tr> <tr><td>  └─Resource lineage</td> <td>Information about the provenance, sources and/or the production processes applied to the resource.</td></tr> <tr><td>      ├─Source</td> <td>Information about the source data used in creating the data specified by the scope.</td></tr> <tr><td>      └─Process step</td> <td>Information about events in the life of a resource specified by the scope.</td></tr> </table> <p> The ISO 19115 standard is reified by the <a href="http://www.geoapi.org">GeoAPI</a> interfaces defined in the <code>org.opengis.metadata</code> package and sub-packages. For each interface, the collection of declared getter methods defines its <dfn>properties</dfn> (or <dfn>attributes</dfn>). The implementation classes are defined in the <code>org.apache.sis.metadata.iso</code> package and sub-packages. The sub-packages hierarchy is the same as GeoAPI, and the names of implementation classes are the name of the GeoAPI interfaces prefixed with <code>Abstract</code> or <code>Default</code>. In this context, the <code>Abstract</code> prefix means that the class is abstract in the sense of the implemented standard. It it not necessarily abstract in the sense of Java. Because incomplete metadata are common in practice, sometimes an "abstract" class may be instantiated because of the lack of knowledge about the exact sub-type. A metadata instance (abstract or not) may also have missing values for properties considered as mandatory. The latter case is handled by <a href="#NilReason">nil reasons</a>. </p><p> A metadata may be created programmatically like below: </p> <pre><code>import org.apache.sis.metadata.iso.citation.DefaultCitation; import org.opengis.metadata.citation.PresentationForm; void main() { // Convenience constructor setting the "title" property to the given value. var citation = new DefaultCitation("Map of Antarctica"); citation.getPresentationForms().add(PresentationForm.DOCUMENT_HARDCOPY); // The following code prints "Map of Antarctica". System.out.println(citation.getTitle()); }</code></pre> <p> But more often, metadata are obtained by parsing an <abbr>XML</abbr> document conforms to the <abbr>ISO</abbr> 19115-3 schema: </p> <pre><code>import org.apache.sis.xml.XML; import org.opengis.metadata.Metadata; import jakarta.xml.bind.JAXBException; void main() throws JAXBException { var metadata = (Metadata) XML.unmarshal(Path.of("Map of Antarctica.xml")); }</code></pre> <p> Metadata objects in Apache <abbr>SIS</abbr> are mostly containers: they provide getter and setter methods for manipulating the values associated to properties (for example the <code class="OGC">title</code> property of a <code>Citation</code> object), but otherwise does not process the values. Exceptions to this rule are deprecated properties, which are not stored but rather redirected to their replacements. </p> <xi:include href="NavigateMetadata.html"/> <xi:include href="NilReason.html"/> </section> </body> </html>