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
The following commit(s) were added to refs/heads/geoapi-4.0 by this push: new d79ae0a663 Update the `RenameOnImport.lst` file for importing data in old schema. d79ae0a663 is described below commit d79ae0a66333152e32b4d68c61c29cacf4e3c5ae Author: Martin Desruisseaux <martin.desruisse...@geomatys.com> AuthorDate: Tue Nov 8 14:43:46 2022 +0100 Update the `RenameOnImport.lst` file for importing data in old schema. --- .../src/main/java/org/apache/sis/xml/readme.html | 16 +++++++++++---- .../org/apache/sis/xml/RenameOnImport.lst | 14 +++++++++---- .../org/apache/sis/xml/RenameListGenerator.java | 24 +++++++++++++++++----- 3 files changed, 41 insertions(+), 13 deletions(-) diff --git a/core/sis-metadata/src/main/java/org/apache/sis/xml/readme.html b/core/sis-metadata/src/main/java/org/apache/sis/xml/readme.html index 0d18276cd8..ee79708ddf 100644 --- a/core/sis-metadata/src/main/java/org/apache/sis/xml/readme.html +++ b/core/sis-metadata/src/main/java/org/apache/sis/xml/readme.html @@ -4,6 +4,9 @@ <title>Syntax of Rename files</title> <meta charset="UTF-8"> <style> + p, code, pre { + font-size: 18px; + } p { text-align: justify; } @@ -14,7 +17,7 @@ </style> </head> <body> - <h1>Syntax of <code>RenameOnImport</code>/<code>Export</code> files</h1> + <h1>Syntax of RenameOnImport/Export files</h1> <p> <b>WARNING: the syntax documented in this page is not committed API and may change in any future SIS version.</b> </p> @@ -37,16 +40,21 @@ <var>Before</var> is the name before the renaming process and <var>after</var> is the name after the renaming process.</li> <li>The ":" character in "<var>Child</var> : <var>Parent</var>" means that a subclass inherits all properties from a parent class. The <var>parent</var> must be defined before the <var>child</var> (no forward references). + This is used for avoiding to repeat all super-class properties in sub-classes. + It has no other meaning, i.e. the class hierarchy is not retained at runtime.</li> <li>The "!" character in "<var>Class</var> !<var>reason</var>" skips the association of current namespace to that class - (but namespace will still be associated to the properties). <var>Reason</var> is a free text.</li> + (but namespace will still be associated to the properties). <var>Reason</var> is a free text. + This is used with deprecated classes that do not exist anymore in the new namespace + (often because the class has been renamed).</li> </ul> <p> For example the following snippet from <code>RenameOnImport.lst</code> declares that the <code>Citation.title</code>, <code>Citation.edition</code> and <code>Address.country</code> properties are defined in the <b><code>cit</code></b> namespace, - while the <code>Extent.description</code> property is defined in the <b><code>gex</code></b> namespace - and the <code>Georectified.centrePoint</code> property is defined in the <b><code>msr</code></b> namespace. + while the <code>Extent.description</code> property is defined in the <b><code>gex</code></b> namespace. Those information are required when reading a file encoded by the old standards because almost all properties where in the single <code>gmd</code> namespace. + Properties not listed will have their namespace unchanged (e.g. still in the old <code>gmd</code> namespace). + Classes that did not existed in old standard should not be listed. </p> <blockquote><pre># Legacy namespace containing elements to rename: * http://www.isotc211.org/2005/gmd diff --git a/core/sis-metadata/src/main/resources/org/apache/sis/xml/RenameOnImport.lst b/core/sis-metadata/src/main/resources/org/apache/sis/xml/RenameOnImport.lst index 93ead5056f..cb3183b976 100644 --- a/core/sis-metadata/src/main/resources/org/apache/sis/xml/RenameOnImport.lst +++ b/core/sis-metadata/src/main/resources/org/apache/sis/xml/RenameOnImport.lst @@ -673,11 +673,17 @@ http://standards.iso.org/iso/19157/-2/dqc/1.0 dateTime http://standards.iso.org/iso/19157/-2/mdq/1.0 AbstractDQ_Element + derivedElement + evaluationMethod + measure result + standaloneQualityReportDetails AbstractDQ_Completeness : AbstractDQ_Element AbstractDQ_LogicalConsistency : AbstractDQ_Element AbstractDQ_PositionalAccuracy : AbstractDQ_Element AbstractDQ_Result + dateTime + resultScope AbstractDQ_TemporalAccuracy : AbstractDQ_Element !other namespace AbstractDQ_ThematicAccuracy : AbstractDQ_Element DQ_AbsoluteExternalPositionalAccuracy : AbstractDQ_PositionalAccuracy @@ -685,20 +691,21 @@ http://standards.iso.org/iso/19157/-2/mdq/1.0 DQ_CompletenessCommission : AbstractDQ_Completeness DQ_CompletenessOmission : AbstractDQ_Completeness DQ_ConceptualConsistency : AbstractDQ_LogicalConsistency - DQ_ConformanceResult + DQ_ConformanceResult : AbstractDQ_Result explanation pass specification DQ_DataQuality report scope + standaloneQualityReport DQ_DomainConsistency : AbstractDQ_LogicalConsistency DQ_EvaluationMethodTypeCode DQ_FormatConsistency : AbstractDQ_LogicalConsistency DQ_GriddedDataPositionalAccuracy : AbstractDQ_PositionalAccuracy DQ_NonQuantitativeAttributeAccuracy : AbstractDQ_ThematicAccuracy !other namespace DQ_QuantitativeAttributeAccuracy : AbstractDQ_ThematicAccuracy - DQ_QuantitativeResult + DQ_QuantitativeResult : AbstractDQ_Result value valueType/valueRecordType valueUnit @@ -707,8 +714,7 @@ http://standards.iso.org/iso/19157/-2/mdq/1.0 DQ_TemporalValidity : AbstractDQ_TemporalAccuracy DQ_ThematicClassificationCorrectness : AbstractDQ_ThematicAccuracy DQ_TopologicalConsistency : AbstractDQ_LogicalConsistency - QE_CoverageResult - resultContentDescription + QE_CoverageResult : AbstractDQ_Result resultFile resultFormat resultSpatialRepresentation diff --git a/core/sis-metadata/src/test/java/org/apache/sis/xml/RenameListGenerator.java b/core/sis-metadata/src/test/java/org/apache/sis/xml/RenameListGenerator.java index 3381457f66..bbc605559b 100644 --- a/core/sis-metadata/src/test/java/org/apache/sis/xml/RenameListGenerator.java +++ b/core/sis-metadata/src/test/java/org/apache/sis/xml/RenameListGenerator.java @@ -37,9 +37,10 @@ import org.apache.sis.internal.xml.LegacyNamespaces; /** - * Creates a file in the {@value TransformingReader#FILENAME} format. This class can be executed if the content - * has changed, or for verifying the current file. Output format contains namespaces first, then classes, - * then properties. Example: + * Creates a file in the {@value TransformingReader#FILENAME} format. + * {@code RenameListGenerator} can be executed if ISO 19115 standards have changed. + * The format is described in the {@code readme.html} page in source code directory. + * Output format contains namespaces first, then classes, then properties. Example: * * {@preformat text * http://standards.iso.org/iso/19115/-3/cit/1.0 @@ -53,12 +54,21 @@ import org.apache.sis.internal.xml.LegacyNamespaces; * This class can be used as a starting point for generating a new file from scratch. * It should not be used for updating the existing file (unless a lot of things have changed) * because some of {@value TransformingReader#FILENAME} content have been edited by hand. + * In particular: + * + * <ul> + * <li>Current implementation lists all classes, including classes that should + * not be listed because they did not existed in previous standard.</li> + * <li>Current implementation repeats properties inherited from parent classes. + * It does not use the "<var>Child</var> : <var>Parent</var>" syntax.</li> + * </ul> + * * For generating a new file: * * {@preformat java * public static void main(String[] args) throws Exception { - * RenameListGenerator gen = new RenameListGenerator(Paths.get("/path/to/your/classes")); - * gen.add(Paths.get("root/package/of/classes/to/add")); + * RenameListGenerator gen = new RenameListGenerator(Paths.get("/home/user/project/build/classes")); + * gen.add(Paths.get("org/apache/sis/metadata/iso")); * try (final BufferedWriter out = Files.newBufferedWriter(Paths.get("MyOutputFile.lst"))) { * gen.print(out); * } @@ -186,6 +196,10 @@ public final class RenameListGenerator { } } + /** + * Returns the namespace declared on {@link XmlSchema} annotation. + * May be the namespace inherited from the package. + */ private static String namespace(final Class<?> classe, String classNS) { if (classNS.equals(DEFAULT)) { classNS = classe.getPackage().getDeclaredAnnotation(XmlSchema.class).namespace();