sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1771197 - in /sis/branches/JDK8/core/sis-metadata/src/main: java/org/apache/sis/metadata/sql/Installer.java resources/org/apache/sis/metadata/sql/Create.sql
Date Thu, 24 Nov 2016 18:14:52 GMT
Author: desruisseaux
Date: Thu Nov 24 18:14:52 2016
New Revision: 1771197

URL: http://svn.apache.org/viewvc?rev=1771197&view=rev
Log:
Add some more metadata. The value added there were hard-coded in the Java code, but we have
not yet done the replacement of Java code by searches in the database.

Modified:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/Installer.java
    sis/branches/JDK8/core/sis-metadata/src/main/resources/org/apache/sis/metadata/sql/Create.sql

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/Installer.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/Installer.java?rev=1771197&r1=1771196&r2=1771197&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/Installer.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/Installer.java
[UTF-8] Thu Nov 24 18:14:52 2016
@@ -60,9 +60,9 @@ final class Installer extends ScriptRunn
     @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(20)");
-            StringBuilders.replace(sql, "metadata.\"CI_DateTypeCode\"", "VARCHAR(20)");
-            StringBuilders.replace(sql, "metadata.\"CI_PresentationFormCode\"", "VARCHAR(20)");
+            StringBuilders.replace(sql, "metadata.\"CI_RoleCode\"", "VARCHAR(25)");
+            StringBuilders.replace(sql, "metadata.\"CI_DateTypeCode\"", "VARCHAR(25)");
+            StringBuilders.replace(sql, "metadata.\"CI_PresentationFormCode\"", "VARCHAR(25)");
         }
         return super.execute(sql);
     }

Modified: sis/branches/JDK8/core/sis-metadata/src/main/resources/org/apache/sis/metadata/sql/Create.sql
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/resources/org/apache/sis/metadata/sql/Create.sql?rev=1771197&r1=1771196&r2=1771197&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/resources/org/apache/sis/metadata/sql/Create.sql
(original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/resources/org/apache/sis/metadata/sql/Create.sql
Thu Nov 24 18:14:52 2016
@@ -42,49 +42,72 @@ CREATE CAST (VARCHAR AS metadata."CI_Dat
 -- We do not need to create all tables or all columns in tables here.
 -- Missing tables and columns will be added on-the-fly by SIS as needed.
 --
--- VARCHAR(10) are for primary keys or foreigner keys.
--- VARCHAR(80) are for character sequences.
+-- VARCHAR(15) are for primary keys or foreigner keys.
+-- VARCHAR(120) are for character sequences.
 --
 CREATE TABLE metadata."MD_Identifier" (
-  ID                            VARCHAR(10) NOT NULL PRIMARY KEY,
-  "authority"                   VARCHAR(10),
-  "code"                        VARCHAR(80),
-  "codeSpace"                   VARCHAR(80),
-  "version"                     VARCHAR(80));
+  ID          VARCHAR(15) NOT NULL PRIMARY KEY,
+  "authority" VARCHAR(15),
+  "code"      VARCHAR(120),
+  "codeSpace" VARCHAR(120),
+  "version"   VARCHAR(120));
 
 CREATE TABLE metadata."CI_Party" (
-  ID                            VARCHAR(10) NOT NULL PRIMARY KEY,
-  "name"                        VARCHAR(80));
+  ID     VARCHAR(15) NOT NULL PRIMARY KEY,
+  "name" VARCHAR(120));
 
 CREATE TABLE metadata."CI_Responsibility" (
-  ID                            VARCHAR(10) NOT NULL PRIMARY KEY,
-  "role"                        metadata."CI_RoleCode",
-  "party"                       VARCHAR(10) REFERENCES metadata."CI_Party" (ID) ON UPDATE
RESTRICT ON DELETE RESTRICT);
+  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);
 
 CREATE TABLE metadata."CI_Date" (
-  ID                            VARCHAR(10) NOT NULL PRIMARY KEY,
-  "date"                        TIMESTAMP,
-  "dateType"                    metadata."CI_DateTypeCode");
+  ID         VARCHAR(15) NOT NULL PRIMARY KEY,
+  "date"     TIMESTAMP,
+  "dateType" metadata."CI_DateTypeCode");
 
 CREATE TABLE metadata."CI_Citation" (
-  ID                            VARCHAR(10) NOT NULL PRIMARY KEY,
-  "title"                       VARCHAR(80),
-  "alternateTitle"              VARCHAR(80),
-  "date"                        VARCHAR(10) REFERENCES metadata."CI_Date" (ID) ON UPDATE
RESTRICT ON DELETE RESTRICT,
-  "edition"                     VARCHAR(80),
-  "editionDate"                 TIMESTAMP,
-  "identifier"                  VARCHAR(10) REFERENCES metadata."MD_Identifier"     (ID)
ON UPDATE RESTRICT ON DELETE RESTRICT,
-  "citedResponsibleParty"       VARCHAR(10) REFERENCES metadata."CI_Responsibility" (ID)
ON UPDATE RESTRICT ON DELETE RESTRICT,
-  "presentationForm"            metadata."CI_PresentationFormCode");
+  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,
+  "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");
 
 ALTER TABLE metadata."MD_Identifier" ADD CONSTRAINT fk_identifier_citation
 FOREIGN KEY ("authority") REFERENCES metadata."CI_Citation" (ID) ON UPDATE RESTRICT ON DELETE
RESTRICT;
 
 CREATE TABLE metadata."MD_Format" (
-  ID                            VARCHAR(10) NOT NULL PRIMARY KEY,
-  "formatSpecificationCitation" VARCHAR(10) REFERENCES metadata."CI_Citation" (ID) ON UPDATE
RESTRICT ON DELETE RESTRICT,
-  "amendmentNumber"             VARCHAR(80),
-  "fileDecompressionTechnique"  VARCHAR(80));
+  ID                            VARCHAR(15) NOT NULL PRIMARY KEY,
+  "formatSpecificationCitation" VARCHAR(15) REFERENCES metadata."CI_Citation" (ID) ON UPDATE
RESTRICT ON DELETE RESTRICT,
+  "amendmentNumber"             VARCHAR(120),
+  "fileDecompressionTechnique"  VARCHAR(120));
+
+
+--
+-- Metadata about organizations.
+--
+
+INSERT INTO metadata."CI_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');
+
+INSERT INTO metadata."CI_Responsibility" (ID, "party", "role") VALUES
+  ('Apache', 'Apache', 'principalInvestigator'),
+  ('OGC',    'OGC',    'principalInvestigator'),
+  ('ISO',    'ISO',    'principalInvestigator'),
+  ('IOGP',   'IOGP',   'principalInvestigator');
+
+INSERT INTO metadata."CI_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'),
+  ('EPSG',        NULL,                  'IOGP',    'EPSG Geodetic Parameter Dataset');
 
 
 --



Mime
View raw message