sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 02/02: Drop package prefixes (e.g. "CI_" in "CI_Citation") in name of tables created by MetadataWriter. https://issues.apache.org/jira/browse/SIS-425
Date Fri, 20 Jul 2018 10:35:20 GMT
This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git

commit 72dc2cc6ec45a9267cd459d1fb86acebd0050dde
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Fri Jul 20 12:34:45 2018 +0200

    Drop package prefixes (e.g. "CI_" in "CI_Citation") in name of tables created by MetadataWriter.
    https://issues.apache.org/jira/browse/SIS-425
---
 .../metadata/EllipsoidalHeightCombiner.java        |  4 +-
 .../org/apache/sis/metadata/sql/Installer.java     |  8 ++--
 .../apache/sis/metadata/sql/MetadataSource.java    | 21 ++++++---
 .../apache/sis/metadata/sql/TableHierarchy.java    | 52 ++++++++++-----------
 .../org/apache/sis/metadata/sql/package-info.java  |  2 +-
 .../main/java/org/apache/sis/util/iso/Types.java   | 42 +++++++++++++----
 .../org/apache/sis/metadata/sql/Create.sql         | 54 +++++++++++-----------
 .../java/org/apache/sis/util/iso/TypesTest.java    |  5 +-
 8 files changed, 112 insertions(+), 76 deletions(-)

diff --git a/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/EllipsoidalHeightCombiner.java
b/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/EllipsoidalHeightCombiner.java
index 0212c61..827826c 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/EllipsoidalHeightCombiner.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/EllipsoidalHeightCombiner.java
@@ -104,8 +104,8 @@ public class EllipsoidalHeightCombiner {
     }
 
     /**
-     * Creates a compound CRS, but we special processing for (two-dimensional Geographic
+ ellipsoidal heights) tupples.
-     * If any such tupple is found, a three-dimensional geographic CRS is created instead
than the compound CRS.
+     * Creates a compound CRS, but we special processing for (two-dimensional Geographic
+ ellipsoidal heights) tuples.
+     * If any such tuple is found, a three-dimensional geographic CRS is created instead
than the compound CRS.
      *
      * @param  properties  name and other properties to give to the new object.
      * @param  components  ordered array of {@code CoordinateReferenceSystem} objects.
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/Installer.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/Installer.java
index ac75363..626222c 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/Installer.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/Installer.java
@@ -28,7 +28,7 @@ import org.apache.sis.util.StringBuilders;
  * Executes the installation scripts for the "metadata" schema in the "SpatialMetadata" database.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.8
+ * @version 1.0
  * @since   0.8
  * @module
  */
@@ -60,9 +60,9 @@ final class Installer extends ScriptRunner {
     @Override
     protected int execute(final StringBuilder sql) throws SQLException, IOException {
         if (!isEnumTypeSupported && CharSequences.startsWith(sql, "CREATE TABLE",
true)) {
-            StringBuilders.replace(sql, "metadata.\"CI_RoleCode\"", "VARCHAR(25)");
-            StringBuilders.replace(sql, "metadata.\"CI_DateTypeCode\"", "VARCHAR(25)");
-            StringBuilders.replace(sql, "metadata.\"CI_PresentationFormCode\"", "VARCHAR(25)");
+            StringBuilders.replace(sql, "metadata.\"RoleCode\"", "VARCHAR(25)");
+            StringBuilders.replace(sql, "metadata.\"DateTypeCode\"", "VARCHAR(25)");
+            StringBuilders.replace(sql, "metadata.\"PresentationFormCode\"", "VARCHAR(25)");
         }
         return super.execute(sql);
     }
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataSource.java
b/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataSource.java
index 4501b17..81262a7 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataSource.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataSource.java
@@ -86,7 +86,7 @@ import org.apache.sis.util.iso.Types;
  *   Format format = source.lookup(Format.class, "PNG");
  * }
  *
- * where {@code id} is the primary key value for the desired record in the {@code MD_Format}
table.
+ * where {@code id} is the primary key value for the desired record in the {@code Format}
table.
  *
  * <div class="section">Properties</div>
  * The constructor expects three Java arguments (the {@linkplain MetadataStandard metadata
standard},
@@ -456,7 +456,7 @@ public class MetadataSource implements AutoCloseable {
             schema = schema.toLowerCase(Locale.US);
         }
         quoteSchema = false;
-        try (ResultSet result = md.getTables(catalog, schema, "CI_Citation", null)) {
+        try (ResultSet result = md.getTables(catalog, schema, "Citation", null)) {
             if (result.next()) {
                 return;
             }
@@ -571,8 +571,10 @@ public class MetadataSource implements AutoCloseable {
     }
 
     /**
-     * Returns the table name for the specified class.
-     * This is usually the ISO 19115 name.
+     * Returns the table name for the specified class. This is usually the ISO 19115 name,
+     * but we fallback on the simple class name if the ISO name is not available.
+     * The package prefix is omitted (e.g. {@code "CI_"} in {@code "CI_Citation"}
+     * since newer ISO standards tend to drop it.
      */
     static String getTableName(final Class<?> type) {
         final UML annotation = type.getAnnotation(UML.class);
@@ -580,7 +582,14 @@ public class MetadataSource implements AutoCloseable {
             return type.getSimpleName();
         }
         final String name = annotation.identifier();
-        return name.substring(name.lastIndexOf('.') + 1);
+        int s = name.lastIndexOf('.') + 1;
+        /*
+         * Drop package prefix if present (e.g. "CI_" in "CI_Citation").
+         */
+        if (name.length() > s+3 && name.charAt(s+2) == '_' && Character.isUpperCase(name.charAt(1)))
{
+            s += 3;
+        }
+        return name.substring(s);
     }
 
     /**
@@ -899,7 +908,7 @@ public class MetadataSource implements AutoCloseable {
             throws SQLException, MetadataStoreException
     {
         /*
-         * If the identifier is prefixed with a table name as in "{CI_Organisation}identifier",
+         * If the identifier is prefixed with a table name as in "{Organisation}identifier",
          * the name between bracket is a subtype of the given 'type' argument.
          */
         final Class<?> type           = TableHierarchy.subType(info.getMetadataType(),
toSearch.identifier);
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/TableHierarchy.java
b/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/TableHierarchy.java
index 4f1f8ac..7b435e8 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/TableHierarchy.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/TableHierarchy.java
@@ -33,9 +33,9 @@ import org.apache.sis.util.iso.Types;
 final class TableHierarchy {
     /**
      * Delimiter characters for the table name in identifier. Table names are prefixed to
identifiers only if
-     * the type represented by the table is a subtype. For example since {@code CI_Organisation}
is a subtype
-     * of {@code CI_Party}, identifiers for organizations need to be prefixed by {@code {CI_Organisation}}
in
-     * order allow {@code MetadataSource} to know in which table to search for such party.
+     * the type represented by the table is a subtype. For example since {@code Organisation}
is a subtype of
+     * {@code Party}, identifiers for organizations need to be prefixed by {@code {Organisation}}
in order to
+     * allow {@code MetadataSource} to know in which table to search for such party.
      *
      * @see MetadataWriter#isReservedChar(int)
      */
@@ -43,7 +43,7 @@ final class TableHierarchy {
 
     /**
      * Abbreviations for commonly-used tables. We use those abbreviations because table names
like
-     * {@code "MD_VectorSpatialRepresentation"} consume a lot of space, which leave few spaces
left
+     * {@code "VectorSpatialRepresentation"} consume a lot of space, which leave few spaces
left
      * for actual identifiers when we want to limit the length to a relatively small value.
      */
     private static final Map<String,String> ABBREVIATIONS = new HashMap<>(25);
@@ -53,27 +53,27 @@ final class TableHierarchy {
      */
     private static final Map<String,String> TABLES = new HashMap<>(25);
     static {
-        add("CI_Individual",                  "ind");
-        add("CI_Organisation",                "org");
-        add("CI_ResponsibleParty",            "rp");
-        add("MD_VectorSpatialRepresentation", "vec");
-        add("MD_GridSpatialRepresentation",   "grd");
-        add("MD_Georectified",                "rtf");
-        add("MD_Georeferenceable",            "cbl");
-        add("MD_DataIdentification",          "data");
-        add("SV_ServiceIdentification",       "srv");
-        add("MD_FeatureCatalogueDescription", "cat");
-        add("MD_CoverageDescription",         "cov");
-        add("MD_ImageDescription",            "img");
-        add("MD_SampleDimension",             "sd");
-        add("MD_Band",                        "band");
-        add("MD_LegalConstraints",            "legal");
-        add("MD_SecurityConstraints",         "secu");
-        add("EX_GeographicBoundingBox",       "bbox");
-        add("EX_BoundingPolygon",             "poly");
-        add("EX_GeographicDescription",       "gdsc");
-        add("EX_SpatialTemporalExtent",       "ste");
-        add("MI_GCPCollection",               "gcp");
+        add("Individual",                  "ind");
+        add("Organisation",                "org");
+        add("ResponsibleParty",            "rp");
+        add("VectorSpatialRepresentation", "vec");
+        add("GridSpatialRepresentation",   "grd");
+        add("Georectified",                "rtf");
+        add("Georeferenceable",            "cbl");
+        add("DataIdentification",          "data");
+        add("ServiceIdentification",       "srv");
+        add("FeatureCatalogueDescription", "cat");
+        add("CoverageDescription",         "cov");
+        add("ImageDescription",            "img");
+        add("SampleDimension",             "sd");
+        add("Band",                        "band");
+        add("LegalConstraints",            "legal");
+        add("SecurityConstraints",         "secu");
+        add("GeographicBoundingBox",       "bbox");
+        add("BoundingPolygon",             "poly");
+        add("GeographicDescription",       "gdsc");
+        add("SpatialTemporalExtent",       "ste");
+        add("GCPCollection",               "gcp");
         // TODO: missing quality package.
     }
 
@@ -102,7 +102,7 @@ final class TableHierarchy {
     /**
      * If the given identifier specifies a subtype of the given type, then returns that subtype.
      * For example if the given type is {@code Party.class} and the given identifier is
-     * {@code "{CI_Organisation}EPSG"}, then this method returns {@code Organisation.class}.
+     * {@code "{Organisation}EPSG"}, then this method returns {@code Organisation.class}.
      * Otherwise this method returns {@code type} unchanged.
      */
     static Class<?> subType(Class<?> type, final String identifier) {
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/package-info.java
b/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/package-info.java
index e460785..14c2a0f 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/package-info.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/package-info.java
@@ -42,7 +42,7 @@
  *
  * @author  Touraïvane (IRD)
  * @author  Martin Desruisseaux (IRD, Geomatys)
- * @version 0.8
+ * @version 1.0
  *
  * @see org.apache.sis.referencing.factory.sql
  *
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/util/iso/Types.java b/core/sis-metadata/src/main/java/org/apache/sis/util/iso/Types.java
index 8fe2626..61ecfdf 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/util/iso/Types.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/util/iso/Types.java
@@ -36,6 +36,7 @@ import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.logging.Logging;
 import org.apache.sis.util.resources.Errors;
+import org.apache.sis.util.collection.Containers;
 import org.apache.sis.util.collection.BackingStoreException;
 import org.apache.sis.internal.util.CodeLists;
 import org.apache.sis.internal.system.Loggers;
@@ -102,13 +103,13 @@ public final class Types extends Static {
     private static final char SEPARATOR = '.';
 
     /**
-     * The types for ISO 19115 UML identifiers. The keys are UML identifiers. Values
-     * are either class names as {@link String} objects, or the {@link Class} instances.
+     * The types for ISO 19115 UML identifiers. The keys are UML identifiers.
+     * Values are either class names as {@link String} objects, or the {@link Class} instances.
      * This map will be built only when first needed.
      *
      * @see #forStandardName(String)
      */
-    private static Map<Object,Object> typeForNames;
+    private static Map<String,Object> typeForNames;
 
     /**
      * Do not allow instantiation of this class.
@@ -497,12 +498,18 @@ public final class Types extends Static {
      * </ul>
      * </div>
      *
-     * Only identifiers for the stable part of GeoAPI or for some Apache SIS classes are
recognized.
-     * This method does not handle the identifiers for interfaces in the {@code geoapi-pending}
module.
+     * The package prefix (e.g. {@code "CI_"} in {@code "CI_Citation"}) can be omitted.
+     * The flexibility is provided for allowing transition to newer ISO standards,
+     * which are dropping the package prefixes.
+     * For example {@code "CS_AxisDirection"} in ISO 19111:2007
+     * has been renamed {@code "AxisDirection"} in ISO 19111:2018.
+     *
+     * <p>Only identifiers for the stable part of GeoAPI or for some Apache SIS classes
are recognized.
+     * This method does not handle the identifiers for interfaces in the {@code geoapi-pending}
module.</p>
      *
      * <div class="note"><b>Future evolution:</b>
      * when a new ISO type does not yet have a corresponding GeoAPI interface,
-     * this method may temporarily return an Apache SIS class instead until a future version
can use the interface.
+     * this method may temporarily return an Apache SIS class instead, until a future version
can use the interface.
      * For example {@code forStandardName("CI_Individual")} returns
      * <code>{@linkplain org.apache.sis.metadata.iso.citation.DefaultIndividual}.class</code>
in Apache SIS versions
      * that depend on GeoAPI 3.0, but the return type may be changed to {@code Individual.class}
when Apache SIS will
@@ -528,9 +535,28 @@ public final class Types extends Static {
             } catch (IOException | IllegalArgumentException e) {
                 throw new BackingStoreException(e);
             }
-            typeForNames = new HashMap<>(props);
+            /*
+             * Copy all map entries from Properties to a new HashMap for avoiding Properties
synchronization.
+             * Also use internized strings because those Strings are programmatic names or
annotation values
+             * which are expected to be internized anyway when the corresponding classes
are loaded.
+             */
+            typeForNames = new HashMap<>(Containers.hashMapCapacity(2 * props.size()));
+            for (final Map.Entry<Object,Object> e : props.entrySet()) {
+                final String key   = ((String) e.getKey()).intern();
+                final String value = ((String) e.getValue()).intern();
+                typeForNames.put(key, value);
+
+                // Heuristic rule for omitting the prefix (e.g. "CI_" in "CI_Citation").
+                if (key.length() > 3 && key.charAt(2) == '_' && Character.isUpperCase(key.charAt(1)))
{
+                    typeForNames.putIfAbsent(key.substring(3).intern(), value);
+                }
+            }
+            // Following code list is not defined in ISO 19115-2 but appears in XML schemas.
             typeForNames.putIfAbsent("MI_SensorTypeCode", "org.apache.sis.internal.metadata.SensorType");
         }
+        /*
+         * Get the interface class for the given identifier, loading the class when first
needed.
+         */
         final Object value = typeForNames.get(identifier);
         if (value == null || value instanceof Class<?>) {
             return (Class<?>) value;
@@ -541,7 +567,7 @@ public final class Types extends Static {
         } catch (ClassNotFoundException e) {
             throw new TypeNotPresentException((String) value, e);
         }
-        typeForNames.put(identifier, type);
+        typeForNames.put(identifier.intern(), type);
         return type;
     }
 
diff --git a/core/sis-metadata/src/main/resources/org/apache/sis/metadata/sql/Create.sql b/core/sis-metadata/src/main/resources/org/apache/sis/metadata/sql/Create.sql
index de48ddc..3aff648 100644
--- a/core/sis-metadata/src/main/resources/org/apache/sis/metadata/sql/Create.sql
+++ b/core/sis-metadata/src/main/resources/org/apache/sis/metadata/sql/Create.sql
@@ -13,7 +13,7 @@ COMMENT ON SCHEMA metadata IS 'ISO 19115 metadata';
 -- Those declarations will be omitted on databases that do
 -- no support enumerations; VARCHAR is used instead.
 --
-CREATE TYPE metadata."CI_PresentationFormCode" AS ENUM (
+CREATE TYPE metadata."PresentationFormCode" AS ENUM (
   'documentDigital', 'documentHardcopy',
   'imageDigital',    'imageHardcopy',
   'mapDigital',      'mapHardcopy',
@@ -22,19 +22,19 @@ CREATE TYPE metadata."CI_PresentationFormCode" AS ENUM (
   'tableDigital',    'tableHardcopy',
   'videoDigital',    'videoHardcopy');
 
-CREATE TYPE metadata."CI_RoleCode" AS ENUM (
+CREATE TYPE metadata."RoleCode" AS ENUM (
   'resourceProvider', 'custodian', 'owner', 'user', 'distributor', 'originator', 'pointOfContact',
   'principalInvestigator', 'processor', 'publisher', 'author', 'sponsor', 'coAuthor', 'collaborator',
   'editor', 'mediator', 'rightsHolder', 'contributor', 'funder', 'stakeholder');
 
-CREATE TYPE metadata."CI_DateTypeCode" AS ENUM (
+CREATE TYPE metadata."DateTypeCode" AS ENUM (
   'creation', 'publication', 'revision', 'expiry', 'lastUpdate', 'lastRevision', 'nextUpdate',
   'unavailable', 'inForce', 'adopted', 'deprecated', 'superseded', 'validityBegins', 'validityExpires',
   'released', 'distribution');
 
-CREATE CAST (VARCHAR AS metadata."CI_PresentationFormCode") WITH INOUT AS ASSIGNMENT;
-CREATE CAST (VARCHAR AS metadata."CI_RoleCode")             WITH INOUT AS ASSIGNMENT;
-CREATE CAST (VARCHAR AS metadata."CI_DateTypeCode")         WITH INOUT AS ASSIGNMENT;
+CREATE CAST (VARCHAR AS metadata."PresentationFormCode") WITH INOUT AS ASSIGNMENT;
+CREATE CAST (VARCHAR AS metadata."RoleCode")             WITH INOUT AS ASSIGNMENT;
+CREATE CAST (VARCHAR AS metadata."DateTypeCode")         WITH INOUT AS ASSIGNMENT;
 
 
 --
@@ -45,44 +45,44 @@ CREATE CAST (VARCHAR AS metadata."CI_DateTypeCode")         WITH INOUT
AS ASSIGN
 -- VARCHAR(15) are for primary keys or foreigner keys.
 -- VARCHAR(120) are for character sequences.
 --
-CREATE TABLE metadata."MD_Identifier" (
+CREATE TABLE metadata."Identifier" (
   ID          VARCHAR(15) NOT NULL PRIMARY KEY,
   "authority" VARCHAR(15),
   "code"      VARCHAR(120),
   "codeSpace" VARCHAR(120),
   "version"   VARCHAR(120));
 
-CREATE TABLE metadata."CI_Party" (
+CREATE TABLE metadata."Party" (
   ID     VARCHAR(15) NOT NULL PRIMARY KEY,
   "name" VARCHAR(120));
 
-CREATE TABLE metadata."CI_Responsibility" (
+CREATE TABLE metadata."Responsibility" (
   ID      VARCHAR(15) NOT NULL PRIMARY KEY,
-  "role"  metadata."CI_RoleCode",
-  "party" VARCHAR(15) REFERENCES metadata."CI_Party" (ID) ON UPDATE RESTRICT ON DELETE RESTRICT);
+  "role"  metadata."RoleCode",
+  "party" VARCHAR(15) REFERENCES metadata."Party" (ID) ON UPDATE RESTRICT ON DELETE RESTRICT);
 
-CREATE TABLE metadata."CI_Date" (
+CREATE TABLE metadata."Date" (
   ID         VARCHAR(15) NOT NULL PRIMARY KEY,
   "date"     TIMESTAMP,
-  "dateType" metadata."CI_DateTypeCode");
+  "dateType" metadata."DateTypeCode");
 
-CREATE TABLE metadata."CI_Citation" (
+CREATE TABLE metadata."Citation" (
   ID                      VARCHAR(15) NOT NULL PRIMARY KEY,
   "title"                 VARCHAR(120),
   "alternateTitle"        VARCHAR(120),
-  "date"                  VARCHAR(15) REFERENCES metadata."CI_Date" (ID) ON UPDATE RESTRICT
ON DELETE RESTRICT,
+  "date"                  VARCHAR(15) REFERENCES metadata."Date" (ID) ON UPDATE RESTRICT
ON DELETE RESTRICT,
   "edition"               VARCHAR(120),
   "editionDate"           TIMESTAMP,
-  "identifier"            VARCHAR(15) REFERENCES metadata."MD_Identifier"     (ID) ON UPDATE
RESTRICT ON DELETE RESTRICT,
-  "citedResponsibleParty" VARCHAR(15) REFERENCES metadata."CI_Responsibility" (ID) ON UPDATE
RESTRICT ON DELETE RESTRICT,
-  "presentationForm"      metadata."CI_PresentationFormCode");
+  "identifier"            VARCHAR(15) REFERENCES metadata."Identifier"     (ID) ON UPDATE
RESTRICT ON DELETE RESTRICT,
+  "citedResponsibleParty" VARCHAR(15) REFERENCES metadata."Responsibility" (ID) ON UPDATE
RESTRICT ON DELETE RESTRICT,
+  "presentationForm"      metadata."PresentationFormCode");
 
-ALTER TABLE metadata."MD_Identifier" ADD CONSTRAINT fk_identifier_citation
-FOREIGN KEY ("authority") REFERENCES metadata."CI_Citation" (ID) ON UPDATE RESTRICT ON DELETE
RESTRICT;
+ALTER TABLE metadata."Identifier" ADD CONSTRAINT fk_identifier_citation
+FOREIGN KEY ("authority") REFERENCES metadata."Citation" (ID) ON UPDATE RESTRICT ON DELETE
RESTRICT;
 
-CREATE TABLE metadata."MD_Format" (
+CREATE TABLE metadata."Format" (
   ID                            VARCHAR(15) NOT NULL PRIMARY KEY,
-  "formatSpecificationCitation" VARCHAR(15) REFERENCES metadata."CI_Citation" (ID) ON UPDATE
RESTRICT ON DELETE RESTRICT,
+  "formatSpecificationCitation" VARCHAR(15) REFERENCES metadata."Citation" (ID) ON UPDATE
RESTRICT ON DELETE RESTRICT,
   "amendmentNumber"             VARCHAR(120),
   "fileDecompressionTechnique"  VARCHAR(120));
 
@@ -91,21 +91,21 @@ CREATE TABLE metadata."MD_Format" (
 -- Metadata about organizations.
 --
 
-INSERT INTO metadata."CI_Party" (ID, "name") VALUES
+INSERT INTO metadata."Party" (ID, "name") VALUES
   ('Apache', 'The Apache Software Foundation'),
   ('OGC',    'Open Geospatial Consortium'),
   ('ISO',    'International Organization for Standardization'),
   ('IOGP',   'International Association of Oil & Gas producers'),
   ('NATO',   'North Atlantic Treaty Organization');
 
-INSERT INTO metadata."CI_Responsibility" (ID, "party", "role") VALUES
+INSERT INTO metadata."Responsibility" (ID, "party", "role") VALUES
   ('Apache', 'Apache', 'principalInvestigator'),
   ('OGC',    'OGC',    'principalInvestigator'),
   ('ISO',    'ISO',    'principalInvestigator'),
   ('IOGP',   'IOGP',   'principalInvestigator'),
   ('NATO',   'NATO',   'principalInvestigator');
 
-INSERT INTO metadata."CI_Citation" (ID, "edition", "citedResponsibleParty", "title") VALUES
+INSERT INTO metadata."Citation" (ID, "edition", "citedResponsibleParty", "title") VALUES
   ('SIS',         NULL,                  'Apache',  'Apache Spatial Information System'),
   ('ISO 19115-1', 'ISO 19115-1:2014(E)', 'ISO',     'Geographic Information — Metadata
Part 1: Fundamentals'),
   ('ISO 19115-2', 'ISO 19115-2:2009(E)', 'ISO',     'Geographic Information — Metadata
Part 2: Extensions for imagery and gridded data'),
@@ -116,7 +116,7 @@ INSERT INTO metadata."CI_Citation" (ID, "edition", "citedResponsibleParty",
"tit
 --
 -- Metadata about file formats.
 --
-INSERT INTO metadata."CI_Citation" (ID, "alternateTitle", "title") VALUES
+INSERT INTO metadata."Citation" (ID, "alternateTitle", "title") VALUES
   ('GeoTIFF', 'GeoTIFF', 'GeoTIFF Coverage Encoding Profile'),
   ('NetCDF',  'NetCDF',  'NetCDF Classic and 64-bit Offset Format'),
   ('PNG',     'PNG',     'PNG (Portable Network Graphics) Specification'),
@@ -124,7 +124,7 @@ INSERT INTO metadata."CI_Citation" (ID, "alternateTitle", "title") VALUES
   ('CSV-MF',  'CSV',     'OGC Moving Features Encoding Extension: Simple Comma-Separated
Values (CSV)'),
   ('GPX',     'GPX',     'GPS Exchange Format');
 
-INSERT INTO metadata."MD_Format" (ID, "formatSpecificationCitation") VALUES
+INSERT INTO metadata."Format" (ID, "formatSpecificationCitation") VALUES
   ('GeoTIFF', 'GeoTIFF'),
   ('NetCDF',  'NetCDF'),
   ('PNG',     'PNG'),
diff --git a/core/sis-metadata/src/test/java/org/apache/sis/util/iso/TypesTest.java b/core/sis-metadata/src/test/java/org/apache/sis/util/iso/TypesTest.java
index 6a75d77..0f92e7a 100644
--- a/core/sis-metadata/src/test/java/org/apache/sis/util/iso/TypesTest.java
+++ b/core/sis-metadata/src/test/java/org/apache/sis/util/iso/TypesTest.java
@@ -41,7 +41,7 @@ import static org.opengis.test.Assert.*;
  * Tests the {@link Types} class.
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
- * @version 0.6
+ * @version 1.0
  * @since   0.3
  * @module
  */
@@ -101,7 +101,8 @@ public final strictfp class TypesTest extends TestCase {
     public void testForStandardName() {
         assertEquals(Citation     .class, Types.forStandardName("CI_Citation"));
         assertEquals(Datum        .class, Types.forStandardName("CD_Datum"));
-        assertEquals(Citation     .class, Types.forStandardName("CI_Citation")); // Value
should be cached.
+        assertEquals(Citation     .class, Types.forStandardName("CI_Citation"));        
   // Value should be cached.
+        assertEquals(Citation     .class, Types.forStandardName("Citation"));
         assertEquals(AxisDirection.class, Types.forStandardName("CS_AxisDirection"));
         assertNull  (                     Types.forStandardName("MD_Dummy"));
     }


Mime
View raw message