sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jso...@apache.org
Subject [sis] branch geoapi-4.0 updated: Resource : add identifier method
Date Tue, 09 Oct 2018 13:36:28 GMT
This is an automated email from the ASF dual-hosted git repository.

jsorel 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 a82bb51  Resource : add identifier method
a82bb51 is described below

commit a82bb51c004e9ac1b2a6b1f7bd013ad5eeb67433
Author: jsorel <johann.sorel@geomatys.com>
AuthorDate: Tue Oct 9 11:46:22 2018 +0200

    Resource : add identifier method
---
 .../sis/storage/earthobservation/LandsatStore.java | 28 +++++---
 .../apache/sis/storage/geotiff/GeoTiffStore.java   | 42 +++++++----
 .../sis/storage/geotiff/ImageFileDirectory.java    | 29 +++++---
 .../sis/internal/netcdf/impl/FeaturesInfo.java     | 36 ++++++----
 .../sis/internal/netcdf/ucar/FeaturesWrapper.java  | 14 ++--
 .../org/apache/sis/storage/netcdf/NetcdfStore.java | 27 +++++---
 .../org/apache/sis/internal/sql/feature/Table.java | 56 +++++++++------
 .../java/org/apache/sis/storage/sql/SQLStore.java  | 30 +++++---
 .../sis/internal/storage/JoinFeatureSet.java       | 24 ++++---
 .../sis/internal/storage/MemoryFeatureSet.java     | 15 +++-
 .../org/apache/sis/internal/storage/csv/Store.java | 81 ++++++++++++----------
 .../apache/sis/internal/storage/folder/Store.java  | 53 ++++++++------
 .../sis/internal/storage/query/FeatureSubset.java  | 17 +++--
 .../org/apache/sis/internal/storage/wkt/Store.java | 35 ++++++----
 .../org/apache/sis/internal/storage/xml/Store.java | 65 ++++++++++++-----
 .../java/org/apache/sis/storage/DataStore.java     | 14 ++--
 .../main/java/org/apache/sis/storage/Resource.java | 26 +++++++
 .../java/org/apache/sis/storage/DataStoreMock.java | 10 +++
 .../org/apache/sis/internal/storage/gpx/Store.java | 51 ++++++++------
 19 files changed, 433 insertions(+), 220 deletions(-)

diff --git a/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStore.java
b/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStore.java
index 00b20e2..f59594a 100644
--- a/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStore.java
+++ b/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStore.java
@@ -16,23 +16,24 @@
  */
 package org.apache.sis.storage.earthobservation;
 
-import java.io.Reader;
 import java.io.BufferedReader;
-import java.io.LineNumberReader;
 import java.io.IOException;
+import java.io.LineNumberReader;
+import java.io.Reader;
 import java.net.URI;
-import org.opengis.metadata.Metadata;
-import org.opengis.util.FactoryException;
-import org.opengis.parameter.ParameterValueGroup;
+import org.apache.sis.internal.storage.URIDataStore;
+import org.apache.sis.setup.OptionKey;
 import org.apache.sis.storage.DataStore;
 import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.storage.DataStoreReferencingException;
-import org.apache.sis.storage.UnsupportedStorageException;
 import org.apache.sis.storage.StorageConnector;
+import org.apache.sis.storage.UnsupportedStorageException;
 import org.apache.sis.storage.event.ChangeEvent;
 import org.apache.sis.storage.event.ChangeListener;
-import org.apache.sis.internal.storage.URIDataStore;
-import org.apache.sis.setup.OptionKey;
+import org.opengis.metadata.Metadata;
+import org.opengis.parameter.ParameterValueGroup;
+import org.opengis.util.FactoryException;
+import org.opengis.util.GenericName;
 
 
 /**
@@ -105,6 +106,17 @@ public class LandsatStore extends DataStore {
     }
 
     /**
+     * Returns a null value.
+     * TODO : implement this method when Coverage API will be finished.
+     *
+     * @return null.
+     */
+    @Override
+    public GenericName getIdentifier() {
+        return null;
+    }
+
+    /**
      * Returns information about the dataset as a whole. The returned metadata object can
contain information
      * such as the spatiotemporal extent of the dataset, contact information about the creator
or distributor,
      * data quality, usage constraints and more.
diff --git a/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java
b/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java
index 3a1e2c6..ade5c9f 100644
--- a/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java
+++ b/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java
@@ -16,33 +16,34 @@
  */
 package org.apache.sis.storage.geotiff;
 
-import java.util.Locale;
 import java.io.IOException;
 import java.net.URI;
 import java.nio.charset.Charset;
-import java.util.logging.LogRecord;
 import java.nio.charset.StandardCharsets;
 import java.nio.file.StandardOpenOption;
-import org.opengis.util.FactoryException;
-import org.opengis.metadata.Metadata;
-import org.opengis.metadata.maintenance.ScopeCode;
-import org.opengis.parameter.ParameterValueGroup;
+import java.util.Locale;
+import java.util.logging.LogRecord;
+import org.apache.sis.internal.storage.MetadataBuilder;
+import org.apache.sis.internal.storage.URIDataStore;
+import org.apache.sis.internal.storage.io.ChannelDataInput;
+import org.apache.sis.internal.storage.io.IOUtilities;
+import org.apache.sis.internal.util.Constants;
+import org.apache.sis.metadata.sql.MetadataStoreException;
 import org.apache.sis.setup.OptionKey;
 import org.apache.sis.storage.DataStore;
-import org.apache.sis.storage.StorageConnector;
-import org.apache.sis.storage.DataStoreException;
+import org.apache.sis.storage.DataStoreClosedException;
 import org.apache.sis.storage.DataStoreContentException;
+import org.apache.sis.storage.DataStoreException;
+import org.apache.sis.storage.StorageConnector;
 import org.apache.sis.storage.UnsupportedStorageException;
-import org.apache.sis.storage.DataStoreClosedException;
 import org.apache.sis.storage.event.ChangeEvent;
 import org.apache.sis.storage.event.ChangeListener;
-import org.apache.sis.internal.storage.io.ChannelDataInput;
-import org.apache.sis.internal.storage.io.IOUtilities;
-import org.apache.sis.internal.storage.MetadataBuilder;
-import org.apache.sis.internal.storage.URIDataStore;
-import org.apache.sis.internal.util.Constants;
-import org.apache.sis.metadata.sql.MetadataStoreException;
 import org.apache.sis.util.resources.Errors;
+import org.opengis.metadata.Metadata;
+import org.opengis.metadata.maintenance.ScopeCode;
+import org.opengis.parameter.ParameterValueGroup;
+import org.opengis.util.FactoryException;
+import org.opengis.util.GenericName;
 
 
 /**
@@ -107,6 +108,17 @@ public class GeoTiffStore extends DataStore {
     }
 
     /**
+     * Returns a null value.
+     * TODO : implement this method when Coverage API will be finished.
+     *
+     * @return null.
+     */
+    @Override
+    public GenericName getIdentifier() {
+        return null;
+    }
+
+    /**
      * Returns information about the dataset as a whole. The returned metadata object can
contain information
      * such as the spatiotemporal extent of the dataset, contact information about the creator
or distributor,
      * data quality, usage constraints and more.
diff --git a/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/ImageFileDirectory.java
b/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/ImageFileDirectory.java
index 5b6bd49..2e991c3 100644
--- a/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/ImageFileDirectory.java
+++ b/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/ImageFileDirectory.java
@@ -17,28 +17,29 @@
 package org.apache.sis.storage.geotiff;
 
 import java.io.IOException;
+import java.nio.charset.Charset;
 import java.text.ParseException;
 import java.util.Arrays;
 import java.util.Locale;
 import java.util.logging.Level;
 import java.util.logging.LogRecord;
-import java.nio.charset.Charset;
 import javax.measure.Unit;
 import javax.measure.quantity.Length;
-import org.opengis.metadata.Metadata;
-import org.opengis.metadata.citation.DateType;
-import org.opengis.util.FactoryException;
+import org.apache.sis.coverage.grid.GridExtent;
+import org.apache.sis.coverage.grid.GridGeometry;
 import org.apache.sis.internal.geotiff.Resources;
 import org.apache.sis.internal.storage.AbstractResource;
 import org.apache.sis.internal.storage.MetadataBuilder;
 import org.apache.sis.internal.storage.io.ChannelDataInput;
-import org.apache.sis.storage.DataStoreException;
-import org.apache.sis.storage.DataStoreContentException;
-import org.apache.sis.storage.GridCoverageResource;
-import org.apache.sis.coverage.grid.GridGeometry;
-import org.apache.sis.coverage.grid.GridExtent;
 import org.apache.sis.math.Vector;
 import org.apache.sis.measure.Units;
+import org.apache.sis.storage.DataStoreContentException;
+import org.apache.sis.storage.DataStoreException;
+import org.apache.sis.storage.GridCoverageResource;
+import org.opengis.metadata.Metadata;
+import org.opengis.metadata.citation.DateType;
+import org.opengis.util.FactoryException;
+import org.opengis.util.GenericName;
 
 
 /**
@@ -366,6 +367,16 @@ final class ImageFileDirectory extends AbstractResource implements GridCoverageR
     }
 
     /**
+     * Datastore root resource has no identifier.
+     *
+     * @return null
+     */
+    @Override
+    public GenericName getIdentifier() {
+        return null;
+    }
+
+    /**
      * Adds the value read from the current position in the given stream for the entry identified
      * by the given GeoTIFF tag. This method may store the value either in a field of this
class,
      * or directly in the {@link MetadataBuilder}. However in the later case, this method
should
diff --git a/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/FeaturesInfo.java
b/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/FeaturesInfo.java
index cbd8e98..232f3c0 100644
--- a/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/FeaturesInfo.java
+++ b/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/FeaturesInfo.java
@@ -16,37 +16,36 @@
  */
 package org.apache.sis.internal.netcdf.impl;
 
-import java.util.Map;
-import java.util.List;
-import java.util.Collection;
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
 import java.util.Spliterator;
+import java.util.function.Consumer;
 import java.util.stream.Stream;
 import java.util.stream.StreamSupport;
-import java.util.function.Consumer;
-import java.io.IOException;
-import org.apache.sis.math.Vector;
+import org.apache.sis.feature.DefaultAttributeType;
+import org.apache.sis.feature.DefaultFeatureType;
+import org.apache.sis.internal.feature.MovingFeature;
 import org.apache.sis.internal.netcdf.DataType;
 import org.apache.sis.internal.netcdf.DiscreteSampling;
 import org.apache.sis.internal.netcdf.Resources;
-import org.apache.sis.internal.feature.MovingFeature;
+import org.apache.sis.math.Vector;
+import org.apache.sis.setup.GeometryLibrary;
 import org.apache.sis.storage.DataStore;
 import org.apache.sis.storage.DataStoreException;
-import org.apache.sis.feature.DefaultFeatureType;
-import org.apache.sis.feature.DefaultAttributeType;
 import org.apache.sis.util.collection.BackingStoreException;
 import org.apache.sis.util.logging.WarningListeners;
-import org.apache.sis.setup.GeometryLibrary;
-import ucar.nc2.constants.CF;
-
-// Branch-dependent imports
+import org.opengis.feature.AttributeType;
 import org.opengis.feature.Feature;
 import org.opengis.feature.FeatureType;
 import org.opengis.feature.PropertyType;
-import org.opengis.feature.AttributeType;
+import org.opengis.util.GenericName;
+import ucar.nc2.constants.CF;
 
 
 /**
@@ -152,6 +151,15 @@ final class FeaturesInfo extends DiscreteSampling {
     }
 
     /**
+     *
+     * @return type name.
+     */
+    @Override
+    public GenericName getIdentifier() {
+        return type.getName();
+    }
+
+    /**
      * Returns {@code true} if the given attribute value is one of the {@code cf_role} attribute
values
      * supported by this implementation.
      */
diff --git a/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/FeaturesWrapper.java
b/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/FeaturesWrapper.java
index f052158..a8db9f2 100644
--- a/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/FeaturesWrapper.java
+++ b/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/FeaturesWrapper.java
@@ -17,15 +17,14 @@
 package org.apache.sis.internal.netcdf.ucar;
 
 import java.util.stream.Stream;
-import org.apache.sis.storage.DataStore;
-import org.apache.sis.setup.GeometryLibrary;
 import org.apache.sis.internal.netcdf.DiscreteSampling;
+import org.apache.sis.setup.GeometryLibrary;
+import org.apache.sis.storage.DataStore;
 import org.apache.sis.util.logging.WarningListeners;
-import ucar.nc2.ft.FeatureCollection;
-
-// Branch-dependent imports
 import org.opengis.feature.Feature;
 import org.opengis.feature.FeatureType;
+import org.opengis.util.GenericName;
+import ucar.nc2.ft.FeatureCollection;
 
 
 /**
@@ -55,6 +54,11 @@ final class FeaturesWrapper extends DiscreteSampling {
     }
 
     @Override
+    public GenericName getIdentifier() {
+        throw new UnsupportedOperationException();      // TODO
+    }
+
+    @Override
     public FeatureType getType() {
         throw new UnsupportedOperationException();      // TODO
     }
diff --git a/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java
b/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java
index d946f82..35bf5f7 100644
--- a/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java
+++ b/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java
@@ -18,25 +18,26 @@ package org.apache.sis.storage.netcdf;
 
 import java.io.IOException;
 import java.net.URI;
-import java.util.List;
 import java.util.Collection;
-import org.opengis.metadata.Metadata;
-import org.opengis.parameter.ParameterValueGroup;
-import org.apache.sis.storage.DataStore;
-import org.apache.sis.storage.DataStoreException;
-import org.apache.sis.storage.UnsupportedStorageException;
-import org.apache.sis.storage.StorageConnector;
-import org.apache.sis.storage.Aggregate;
+import java.util.List;
 import org.apache.sis.internal.netcdf.Decoder;
 import org.apache.sis.internal.storage.URIDataStore;
 import org.apache.sis.internal.util.UnmodifiableArrayList;
 import org.apache.sis.metadata.ModifiableMetadata;
 import org.apache.sis.setup.OptionKey;
+import org.apache.sis.storage.Aggregate;
+import org.apache.sis.storage.DataStore;
+import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.storage.Resource;
+import org.apache.sis.storage.StorageConnector;
+import org.apache.sis.storage.UnsupportedStorageException;
 import org.apache.sis.storage.event.ChangeEvent;
 import org.apache.sis.storage.event.ChangeListener;
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.Version;
+import org.opengis.metadata.Metadata;
+import org.opengis.parameter.ParameterValueGroup;
+import org.opengis.util.GenericName;
 import ucar.nc2.constants.CDM;
 
 
@@ -118,6 +119,16 @@ public class NetcdfStore extends DataStore implements Aggregate {
     }
 
     /**
+     * SQL Datastore root resource has no identifier.
+     *
+     * @return null
+     */
+    @Override
+    public GenericName getIdentifier() {
+        return null;
+    }
+
+    /**
      * Returns the version number of the Climate and Forecast (CF) conventions used in the
netCDF file.
      * The use of CF convention is mandated by the OGC 11-165r2 standard
      * (<cite>CF-netCDF3 Data Model Extension standard</cite>).
diff --git a/storage/sis-sqlstore/src/main/java/org/apache/sis/internal/sql/feature/Table.java
b/storage/sis-sqlstore/src/main/java/org/apache/sis/internal/sql/feature/Table.java
index 3fdfa04..fd0be5f 100644
--- a/storage/sis-sqlstore/src/main/java/org/apache/sis/internal/sql/feature/Table.java
+++ b/storage/sis-sqlstore/src/main/java/org/apache/sis/internal/sql/feature/Table.java
@@ -16,46 +16,45 @@
  */
 package org.apache.sis.internal.sql.feature;
 
-import java.util.Map;
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
-import java.util.ArrayList;
-import java.util.Collection;
+import java.util.Map;
 import java.util.stream.Stream;
 import java.util.stream.StreamSupport;
-import java.sql.DatabaseMetaData;
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
 import javax.sql.DataSource;
-import org.opengis.util.GenericName;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.apache.sis.feature.builder.AssociationRoleBuilder;
 import org.apache.sis.feature.builder.AttributeRole;
 import org.apache.sis.feature.builder.AttributeTypeBuilder;
-import org.apache.sis.feature.builder.AssociationRoleBuilder;
 import org.apache.sis.feature.builder.FeatureTypeBuilder;
 import org.apache.sis.internal.feature.Geometries;
-import org.apache.sis.storage.DataStoreException;
-import org.apache.sis.storage.DataStoreContentException;
-import org.apache.sis.storage.InternalDataStoreException;
 import org.apache.sis.internal.metadata.sql.Reflection;
 import org.apache.sis.internal.metadata.sql.SQLUtilities;
 import org.apache.sis.internal.storage.AbstractFeatureSet;
 import org.apache.sis.internal.util.CollectionsExt;
-import org.apache.sis.util.collection.WeakValueHashMap;
-import org.apache.sis.util.collection.TreeTable;
+import org.apache.sis.storage.DataStoreContentException;
+import org.apache.sis.storage.DataStoreException;
+import org.apache.sis.storage.InternalDataStoreException;
 import org.apache.sis.util.CharSequences;
-import org.apache.sis.util.Exceptions;
 import org.apache.sis.util.Classes;
-import org.apache.sis.util.Numbers;
 import org.apache.sis.util.Debug;
-
-// Branch-dependent imports
-import org.opengis.feature.Feature;
-import org.opengis.feature.FeatureType;
+import org.apache.sis.util.Exceptions;
+import org.apache.sis.util.Numbers;
+import org.apache.sis.util.collection.TreeTable;
+import org.apache.sis.util.collection.WeakValueHashMap;
+import org.apache.sis.util.iso.Names;
 import org.opengis.feature.AttributeType;
+import org.opengis.feature.Feature;
 import org.opengis.feature.FeatureAssociationRole;
+import org.opengis.feature.FeatureType;
+import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.opengis.util.GenericName;
 
 
 /**
@@ -417,6 +416,21 @@ final class Table extends AbstractFeatureSet {
     }
 
     /**
+     *
+     * @return table identifier composed of catalog, schema and table name.
+     */
+    @Override
+    public GenericName getIdentifier() {
+        if (name.catalog != null && name.schema != null) {
+            return Names.createGenericName(null, null, name.catalog, name.schema, name.table);
+        } else if (name.schema != null) {
+            return Names.createGenericName(null, null, name.schema, name.table);
+        } else {
+            return Names.createLocalName(null, null, name.table);
+        }
+    }
+
+    /**
      * Returns the given relations as an array, or {@code null} if none.
      */
     private static Relation[] toArray(final Collection<Relation> relations) {
diff --git a/storage/sis-sqlstore/src/main/java/org/apache/sis/storage/sql/SQLStore.java b/storage/sis-sqlstore/src/main/java/org/apache/sis/storage/sql/SQLStore.java
index 0db5080..72d5073 100644
--- a/storage/sis-sqlstore/src/main/java/org/apache/sis/storage/sql/SQLStore.java
+++ b/storage/sis-sqlstore/src/main/java/org/apache/sis/storage/sql/SQLStore.java
@@ -16,27 +16,27 @@
  */
 package org.apache.sis.storage.sql;
 
-import java.util.Collection;
-import javax.sql.DataSource;
 import java.sql.Connection;
 import java.sql.SQLException;
-import org.opengis.util.GenericName;
-import org.opengis.metadata.Metadata;
-import org.opengis.parameter.ParameterValueGroup;
-import org.opengis.metadata.spatial.SpatialRepresentationType;
-import org.apache.sis.storage.Resource;
+import java.util.Collection;
+import javax.sql.DataSource;
+import org.apache.sis.internal.sql.feature.Database;
+import org.apache.sis.internal.sql.feature.Resources;
+import org.apache.sis.internal.storage.MetadataBuilder;
 import org.apache.sis.storage.Aggregate;
 import org.apache.sis.storage.DataStore;
 import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.storage.IllegalNameException;
+import org.apache.sis.storage.Resource;
 import org.apache.sis.storage.StorageConnector;
 import org.apache.sis.storage.event.ChangeEvent;
 import org.apache.sis.storage.event.ChangeListener;
-import org.apache.sis.internal.sql.feature.Database;
-import org.apache.sis.internal.sql.feature.Resources;
-import org.apache.sis.internal.storage.MetadataBuilder;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.Exceptions;
+import org.opengis.metadata.Metadata;
+import org.opengis.metadata.spatial.SpatialRepresentationType;
+import org.opengis.parameter.ParameterValueGroup;
+import org.opengis.util.GenericName;
 
 
 /**
@@ -132,6 +132,16 @@ public class SQLStore extends DataStore implements Aggregate {
     }
 
     /**
+     * SQL Datastore root resource has no identifier.
+     *
+     * @return null
+     */
+    @Override
+    public GenericName getIdentifier() {
+        return null;
+    }
+
+    /**
      * Returns the database model, analyzing the database schema when first needed.
      */
     private synchronized Database model() throws DataStoreException {
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/JoinFeatureSet.java
b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/JoinFeatureSet.java
index 14fd057..e7e9434 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/JoinFeatureSet.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/JoinFeatureSet.java
@@ -16,17 +16,16 @@
  */
 package org.apache.sis.internal.storage;
 
-import java.util.Map;
 import java.util.Collections;
+import java.util.Map;
 import java.util.Spliterator;
 import java.util.function.Consumer;
 import java.util.stream.Stream;
 import java.util.stream.StreamSupport;
-import org.opengis.util.GenericName;
-import org.opengis.geometry.Envelope;
-import org.apache.sis.feature.FeatureOperations;
-import org.apache.sis.feature.DefaultFeatureType;
 import org.apache.sis.feature.DefaultAssociationRole;
+import org.apache.sis.feature.DefaultFeatureType;
+import org.apache.sis.feature.FeatureOperations;
+import org.apache.sis.filter.DefaultFilterFactory;
 import org.apache.sis.internal.feature.AttributeConvention;
 import org.apache.sis.internal.storage.query.SimpleQuery;
 import org.apache.sis.storage.DataStore;
@@ -36,8 +35,6 @@ import org.apache.sis.util.ArraysExt;
 import org.apache.sis.util.collection.BackingStoreException;
 import org.apache.sis.util.collection.Containers;
 import org.apache.sis.util.logging.WarningListeners;
-
-// Branch-dependent imports
 import org.opengis.feature.Feature;
 import org.opengis.feature.FeatureType;
 import org.opengis.feature.Operation;
@@ -46,7 +43,8 @@ import org.opengis.filter.Filter;
 import org.opengis.filter.FilterFactory;
 import org.opengis.filter.PropertyIsEqualTo;
 import org.opengis.filter.expression.Expression;
-import org.apache.sis.filter.DefaultFilterFactory;
+import org.opengis.geometry.Envelope;
+import org.opengis.util.GenericName;
 
 
 /**
@@ -255,6 +253,16 @@ public class JoinFeatureSet extends AbstractFeatureSet {
     }
 
     /**
+     * Returns the name of the join operation resulting feature type.
+     *
+     * @return resulting feature type name.
+     */
+    @Override
+    public GenericName getIdentifier() {
+        return type.getName();
+    }
+
+    /**
      * Creates a minimal {@code properties} map for feature type or property type constructors.
      * This minimalist map contain only the mandatory entry, which is the name.
      */
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MemoryFeatureSet.java
b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MemoryFeatureSet.java
index 7700b71..e62217a 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MemoryFeatureSet.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MemoryFeatureSet.java
@@ -21,11 +21,10 @@ import java.util.stream.Stream;
 import org.apache.sis.storage.DataStore;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.logging.WarningListeners;
-import org.opengis.metadata.Metadata;
-
-// Branch-dependent imports
 import org.opengis.feature.Feature;
 import org.opengis.feature.FeatureType;
+import org.opengis.metadata.Metadata;
+import org.opengis.util.GenericName;
 
 
 /**
@@ -72,6 +71,16 @@ public final class MemoryFeatureSet extends AbstractFeatureSet {
     }
 
     /**
+     * Returns the name of the feature type.
+     *
+     * @return feature type name.
+     */
+    @Override
+    public GenericName getIdentifier() {
+        return type.getName();
+    }
+
+    /**
      * Returns the type common to all feature instances in this set.
      *
      * @return a description of properties that are common to all features in this dataset.
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java
b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java
index fe1aff8..1f940b0 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java
@@ -16,69 +16,68 @@
  */
 package org.apache.sis.internal.storage.csv;
 
-import java.util.List;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.LineNumberReader;
+import java.io.Reader;
+import java.net.URI;
+import java.nio.charset.Charset;
+import java.time.DateTimeException;
+import java.time.Instant;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Date;
+import java.util.List;
 import java.util.Locale;
-import java.util.stream.Stream;
-import java.util.stream.StreamSupport;
 import java.util.logging.Level;
 import java.util.logging.LogRecord;
-import java.time.Instant;
-import java.time.DateTimeException;
-import java.io.Reader;
-import java.io.BufferedReader;
-import java.io.LineNumberReader;
-import java.io.IOException;
-import java.net.URI;
-import java.nio.charset.Charset;
+import java.util.stream.Stream;
+import java.util.stream.StreamSupport;
 import javax.measure.Unit;
 import javax.measure.quantity.Time;
-import org.opengis.util.FactoryException;
-import org.opengis.geometry.Envelope;
-import org.opengis.metadata.Metadata;
-import org.opengis.metadata.maintenance.ScopeCode;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
-import org.opengis.referencing.crs.TemporalCRS;
-import org.opengis.referencing.operation.TransformException;
 import org.apache.sis.feature.DefaultAttributeType;
 import org.apache.sis.feature.DefaultFeatureType;
 import org.apache.sis.feature.FoliationRepresentation;
-import org.apache.sis.referencing.CRS;
-import org.apache.sis.referencing.CommonCRS;
-import org.apache.sis.internal.referencing.GeodeticObjectBuilder;
-import org.apache.sis.internal.util.UnmodifiableArrayList;
-import org.apache.sis.internal.storage.MetadataBuilder;
-import org.apache.sis.internal.storage.io.IOUtilities;
-import org.apache.sis.internal.storage.io.RewindableLineReader;
+import org.apache.sis.geometry.GeneralEnvelope;
+import org.apache.sis.geometry.ImmutableEnvelope;
 import org.apache.sis.internal.feature.Geometries;
 import org.apache.sis.internal.feature.MovingFeature;
+import org.apache.sis.internal.referencing.GeodeticObjectBuilder;
+import org.apache.sis.internal.storage.MetadataBuilder;
 import org.apache.sis.internal.storage.Resources;
 import org.apache.sis.internal.storage.URIDataStore;
-import org.apache.sis.geometry.GeneralEnvelope;
-import org.apache.sis.geometry.ImmutableEnvelope;
+import org.apache.sis.internal.storage.io.IOUtilities;
+import org.apache.sis.internal.storage.io.RewindableLineReader;
+import org.apache.sis.internal.util.UnmodifiableArrayList;
+import org.apache.sis.io.InvalidSeekException;
+import org.apache.sis.measure.Units;
 import org.apache.sis.metadata.iso.DefaultMetadata;
 import org.apache.sis.metadata.sql.MetadataStoreException;
+import org.apache.sis.referencing.CRS;
+import org.apache.sis.referencing.CommonCRS;
+import org.apache.sis.setup.OptionKey;
 import org.apache.sis.storage.DataOptionKey;
-import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.storage.DataStoreContentException;
+import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.storage.DataStoreReferencingException;
-import org.apache.sis.storage.UnsupportedStorageException;
-import org.apache.sis.storage.StorageConnector;
 import org.apache.sis.storage.FeatureSet;
-import org.apache.sis.setup.OptionKey;
+import org.apache.sis.storage.StorageConnector;
+import org.apache.sis.storage.UnsupportedStorageException;
 import org.apache.sis.util.ArraysExt;
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.resources.Errors;
-import org.apache.sis.io.InvalidSeekException;
-import org.apache.sis.measure.Units;
-
-// Branch-dependent imports
+import org.opengis.feature.AttributeType;
 import org.opengis.feature.Feature;
 import org.opengis.feature.FeatureType;
 import org.opengis.feature.PropertyType;
-import org.opengis.feature.AttributeType;
+import org.opengis.geometry.Envelope;
+import org.opengis.metadata.Metadata;
+import org.opengis.metadata.maintenance.ScopeCode;
+import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.opengis.referencing.crs.TemporalCRS;
+import org.opengis.referencing.operation.TransformException;
+import org.opengis.util.FactoryException;
+import org.opengis.util.GenericName;
 
 
 /**
@@ -311,6 +310,16 @@ final class Store extends URIDataStore implements FeatureSet {
     }
 
     /**
+     * CSV Identifier is identical to it's feature type name.
+     *
+     * @return CSV feature type name.
+     */
+    @Override
+    public GenericName getIdentifier() {
+        return featureType.getName();
+    }
+
+    /**
      * Moves the reader position to beginning of file, if possible. We try to use the mark
defined by the constructor,
      * which is set after the last header line. If the mark is no longer valid, then we have
to create a new line reader.
      * In this later case, we have to skip the header lines (i.e. we reproduce the constructor
loop, but without parsing
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/folder/Store.java
b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/folder/Store.java
index 33ba0a0..dbf864e 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/folder/Store.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/folder/Store.java
@@ -16,41 +16,43 @@
  */
 package org.apache.sis.internal.storage.folder;
 
-import java.util.Map;
-import java.util.List;
+import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.nio.charset.Charset;
+import java.nio.file.DirectoryIteratorException;
+import java.nio.file.DirectoryStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.List;
 import java.util.Locale;
+import java.util.Map;
 import java.util.TimeZone;
-import java.util.logging.Level;
 import java.util.concurrent.ConcurrentHashMap;
-import java.nio.charset.Charset;
-import java.nio.file.Path;
-import java.nio.file.Files;
-import java.nio.file.DirectoryStream;
-import java.nio.file.DirectoryIteratorException;
-import java.io.IOException;
-import java.io.UncheckedIOException;
-import org.opengis.metadata.Metadata;
-import org.opengis.metadata.maintenance.ScopeCode;
-import org.opengis.parameter.ParameterValueGroup;
+import java.util.logging.Level;
+import org.apache.sis.internal.storage.MetadataBuilder;
+import org.apache.sis.internal.storage.Resources;
+import org.apache.sis.internal.storage.StoreResource;
+import org.apache.sis.internal.storage.StoreUtilities;
+import org.apache.sis.internal.util.UnmodifiableArrayList;
 import org.apache.sis.setup.OptionKey;
-import org.apache.sis.storage.Resource;
 import org.apache.sis.storage.Aggregate;
 import org.apache.sis.storage.DataStore;
-import org.apache.sis.storage.DataStores;
+import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.storage.DataStoreProvider;
+import org.apache.sis.storage.DataStores;
+import org.apache.sis.storage.Resource;
 import org.apache.sis.storage.StorageConnector;
-import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.storage.UnsupportedStorageException;
-import org.apache.sis.util.collection.BackingStoreException;
-import org.apache.sis.internal.util.UnmodifiableArrayList;
-import org.apache.sis.internal.storage.MetadataBuilder;
-import org.apache.sis.internal.storage.StoreUtilities;
-import org.apache.sis.internal.storage.StoreResource;
-import org.apache.sis.internal.storage.Resources;
 import org.apache.sis.storage.event.ChangeEvent;
 import org.apache.sis.storage.event.ChangeListener;
+import org.apache.sis.util.collection.BackingStoreException;
+import org.apache.sis.util.iso.Names;
+import org.opengis.metadata.Metadata;
+import org.opengis.metadata.maintenance.ScopeCode;
+import org.opengis.parameter.ParameterValueGroup;
+import org.opengis.util.GenericName;
 
 
 /**
@@ -181,6 +183,13 @@ class Store extends DataStore implements StoreResource, Aggregate, DirectoryStre
         componentProvider = parent.componentProvider;
     }
 
+    @Override
+    public GenericName getIdentifier() {
+        final String displayName = getDisplayName();
+        if (displayName != null) return Names.createLocalName(null, null, displayName);
+        return null;
+    }
+
     /**
      * Returns the data store for the root directory specified by the user.
      */
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/query/FeatureSubset.java
b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/query/FeatureSubset.java
index 6a05c92..14a2798 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/query/FeatureSubset.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/query/FeatureSubset.java
@@ -18,18 +18,17 @@ package org.apache.sis.internal.storage.query;
 
 import java.util.List;
 import java.util.stream.Stream;
-import org.opengis.geometry.Envelope;
 import org.apache.sis.internal.feature.FeatureUtilities;
 import org.apache.sis.internal.storage.AbstractFeatureSet;
 import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.storage.FeatureSet;
-
-// Branch-dependent imports
 import org.opengis.feature.Feature;
 import org.opengis.feature.FeatureType;
 import org.opengis.filter.Filter;
-import org.opengis.filter.sort.SortBy;
 import org.opengis.filter.expression.Expression;
+import org.opengis.filter.sort.SortBy;
+import org.opengis.geometry.Envelope;
+import org.opengis.util.GenericName;
 
 
 /**
@@ -71,6 +70,16 @@ final class FeatureSubset extends AbstractFeatureSet {
     }
 
     /**
+     * Inherit parent FeatureSet identifier.
+     *
+     * @return parent FeatureSet identifier.
+     */
+    @Override
+    public GenericName getIdentifier() {
+        return source.getIdentifier();
+    }
+
+    /**
      * Returns {@code null} since computing the envelope would be costly.
      */
     @Override
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java
b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java
index af7a0d9..91f221e 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java
@@ -16,26 +16,27 @@
  */
 package org.apache.sis.internal.storage.wkt;
 
-import java.util.List;
-import java.util.Arrays;
-import java.util.ArrayList;
-import java.io.Reader;
 import java.io.IOException;
-import java.text.ParsePosition;
+import java.io.Reader;
 import java.text.ParseException;
-import org.opengis.metadata.Metadata;
-import org.opengis.referencing.ReferenceSystem;
-import org.apache.sis.internal.storage.Resources;
-import org.apache.sis.storage.StorageConnector;
-import org.apache.sis.storage.DataStoreException;
-import org.apache.sis.storage.DataStoreContentException;
-import org.apache.sis.storage.UnsupportedStorageException;
+import java.text.ParsePosition;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 import org.apache.sis.internal.storage.MetadataBuilder;
+import org.apache.sis.internal.storage.Resources;
 import org.apache.sis.internal.storage.URIDataStore;
 import org.apache.sis.referencing.IdentifiedObjects;
 import org.apache.sis.setup.GeometryLibrary;
 import org.apache.sis.setup.OptionKey;
+import org.apache.sis.storage.DataStoreContentException;
+import org.apache.sis.storage.DataStoreException;
+import org.apache.sis.storage.StorageConnector;
+import org.apache.sis.storage.UnsupportedStorageException;
 import org.apache.sis.util.CharSequences;
+import org.opengis.metadata.Metadata;
+import org.opengis.referencing.ReferenceSystem;
+import org.opengis.util.GenericName;
 
 
 /**
@@ -95,6 +96,16 @@ final class Store extends URIDataStore {
     }
 
     /**
+     * WKT files have no unique identifiers.
+     *
+     * @return null
+     */
+    @Override
+    public GenericName getIdentifier() {
+        return null;
+    }
+
+    /**
      * Parses the objects, if not already done. Note that {@link #objects} may still be empty
      * if an exception has been thrown at this invocation time or in previous invocation.
      *
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java
b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java
index 76b9f55..db4851a 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java
@@ -16,31 +16,36 @@
  */
 package org.apache.sis.internal.storage.xml;
 
-import java.util.Map;
-import java.util.Collections;
-import java.util.logging.LogRecord;
 import java.io.Closeable;
-import java.io.Reader;
-import java.io.InputStream;
 import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+import java.util.Collections;
+import java.util.Map;
+import java.util.logging.LogRecord;
 import javax.xml.bind.JAXBException;
 import javax.xml.transform.stream.StreamSource;
-import org.opengis.metadata.Metadata;
-import org.opengis.util.FactoryException;
-import org.opengis.referencing.ReferenceSystem;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
-import org.apache.sis.xml.XML;
-import org.apache.sis.storage.StorageConnector;
+import org.apache.sis.internal.referencing.DefinitionVerifier;
+import org.apache.sis.internal.storage.MetadataBuilder;
+import org.apache.sis.internal.storage.URIDataStore;
+import org.apache.sis.internal.system.Loggers;
+import org.apache.sis.metadata.iso.DefaultMetadata;
+import org.apache.sis.referencing.NamedIdentifier;
+import org.apache.sis.setup.OptionKey;
 import org.apache.sis.storage.DataStoreException;
+import org.apache.sis.storage.StorageConnector;
 import org.apache.sis.storage.UnsupportedStorageException;
-import org.apache.sis.metadata.iso.DefaultMetadata;
 import org.apache.sis.util.logging.WarningListener;
 import org.apache.sis.util.resources.Errors;
-import org.apache.sis.internal.system.Loggers;
-import org.apache.sis.internal.storage.URIDataStore;
-import org.apache.sis.internal.storage.MetadataBuilder;
-import org.apache.sis.internal.referencing.DefinitionVerifier;
-import org.apache.sis.setup.OptionKey;
+import org.apache.sis.xml.XML;
+import org.opengis.metadata.Identifier;
+import org.opengis.metadata.Metadata;
+import org.opengis.metadata.citation.Citation;
+import org.opengis.metadata.identification.Identification;
+import org.opengis.referencing.ReferenceSystem;
+import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.opengis.util.FactoryException;
+import org.opengis.util.GenericName;
 
 
 /**
@@ -104,6 +109,32 @@ final class Store extends URIDataStore {
     }
 
     /**
+     * Returns the first identifier in the metadata.
+     *
+     * @return first metadata identifier or null if parsing fails or if there are
+     *         no identifiers.
+     */
+    @Override
+    public GenericName getIdentifier() {
+        try {
+            Metadata metadata = getMetadata();
+            if (metadata != null) {
+                for (Identification idt : metadata.getIdentificationInfo()) {
+                    Citation citation = idt.getCitation();
+                    if (citation != null) {
+                        for (Identifier id : citation.getIdentifiers()) {
+                            return NamedIdentifier.castOrCopy(id);
+                        }
+                    }
+                }
+            }
+        } catch (DataStoreException ex) {
+            return null;
+        }
+        return null;
+    }
+
+    /**
      * Returns the input stream or reader set in the given source, or {@code null} if none.
      */
     private static Closeable input(final StreamSource source) {
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java b/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java
index 60cc685..4543e89 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java
@@ -16,19 +16,19 @@
  */
 package org.apache.sis.storage;
 
+import java.util.IdentityHashMap;
 import java.util.Locale;
 import java.util.Map;
-import java.util.IdentityHashMap;
 import java.util.NoSuchElementException;
-import org.opengis.metadata.Metadata;
-import org.opengis.metadata.identification.Identification;
-import org.opengis.parameter.ParameterValueGroup;
-import org.apache.sis.util.Localized;
+import org.apache.sis.internal.storage.Resources;
+import org.apache.sis.internal.util.Citations;
 import org.apache.sis.util.ArgumentChecks;
+import org.apache.sis.util.Localized;
 import org.apache.sis.util.logging.WarningListener;
 import org.apache.sis.util.logging.WarningListeners;
-import org.apache.sis.internal.storage.Resources;
-import org.apache.sis.internal.util.Citations;
+import org.opengis.metadata.Metadata;
+import org.opengis.metadata.identification.Identification;
+import org.opengis.parameter.ParameterValueGroup;
 
 
 /**
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/storage/Resource.java b/storage/sis-storage/src/main/java/org/apache/sis/storage/Resource.java
index 6d98a90..b9b50b8 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/storage/Resource.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/storage/Resource.java
@@ -19,6 +19,7 @@ package org.apache.sis.storage;
 import org.apache.sis.storage.event.ChangeEvent;
 import org.apache.sis.storage.event.ChangeListener;
 import org.opengis.metadata.Metadata;
+import org.opengis.util.GenericName;
 
 
 /**
@@ -51,6 +52,31 @@ import org.opengis.metadata.Metadata;
  * @module
  */
 public interface Resource {
+
+    /**
+     * Returns the resource primary identifier.
+     * <p>
+     * This identifier can be used to uniquely identify a resource in the containing
+     * {@link DataStore}. For this identifier to be reliable the following
+     * conditions must be guaranted :
+     * </p>
+     * <ul>
+     *   <li>It must be unique in the {@link DataStore} which contains it, if there
is one.</li>
+     *   <li>It's value must not change after closing and reopening the {@link DataStore}.</li>
+     *   <li>This identifier must be present in the {@link Metadata} returned by {@link
#getMetadata() }
+     *    in the field at path {@literal IdentificationInfon/Citation/Identifier}.
+     *   </li>
+     * </ul>
+     * <p>
+     * If any of the above conditions isn't met, this identifier should be null. This
+     * case may happen when a resource is an intermediate result of an ongoing process
+     * or is an opportuniste resource like a sensor event.
+     * </p>
+     *
+     * @return GenericName, can be null if the resource has no reliable identifier
+     */
+    GenericName getIdentifier();
+
     /**
      * Returns information about this resource.
      * If this resource is an {@link Aggregate}, then the metadata may enumerate characteristics
diff --git a/storage/sis-storage/src/test/java/org/apache/sis/storage/DataStoreMock.java b/storage/sis-storage/src/test/java/org/apache/sis/storage/DataStoreMock.java
index 1259c8f..93815d5 100644
--- a/storage/sis-storage/src/test/java/org/apache/sis/storage/DataStoreMock.java
+++ b/storage/sis-storage/src/test/java/org/apache/sis/storage/DataStoreMock.java
@@ -20,6 +20,7 @@ import org.apache.sis.storage.event.ChangeEvent;
 import org.apache.sis.storage.event.ChangeListener;
 import org.opengis.metadata.Metadata;
 import org.opengis.parameter.ParameterValueGroup;
+import org.opengis.util.GenericName;
 
 
 /**
@@ -44,6 +45,15 @@ final strictfp class DataStoreMock extends DataStore {
     }
 
     /**
+     * Mock data store has no identifier.
+     * @return null
+     */
+    @Override
+    public GenericName getIdentifier() {
+        return null;
+    }
+
+    /**
      * Returns the display name specified at construction time.
      */
     @Override
diff --git a/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Store.java
b/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Store.java
index 7c8db04..fc6aae2 100644
--- a/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Store.java
+++ b/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Store.java
@@ -16,37 +16,36 @@
  */
 package org.apache.sis.internal.storage.gpx;
 
-import java.util.stream.Stream;
-import java.util.stream.StreamSupport;
 import java.io.UncheckedIOException;
 import java.net.URISyntaxException;
-import org.opengis.util.NameFactory;
-import org.opengis.util.FactoryException;
-import org.opengis.geometry.Envelope;
-import org.opengis.metadata.Metadata;
-import org.opengis.metadata.distribution.Format;
-import org.apache.sis.storage.FeatureSet;
-import org.apache.sis.storage.StorageConnector;
-import org.apache.sis.storage.DataStoreException;
-import org.apache.sis.storage.DataStoreContentException;
-import org.apache.sis.storage.ConcurrentReadException;
-import org.apache.sis.storage.IllegalNameException;
-import org.apache.sis.internal.system.DefaultFactories;
+import java.util.stream.Stream;
+import java.util.stream.StreamSupport;
 import org.apache.sis.internal.storage.AbstractResource;
 import org.apache.sis.internal.storage.xml.stream.StaxDataStore;
-import org.apache.sis.util.collection.BackingStoreException;
+import org.apache.sis.internal.system.DefaultFactories;
+import org.apache.sis.metadata.iso.citation.DefaultCitation;
+import org.apache.sis.metadata.iso.distribution.DefaultFormat;
+import org.apache.sis.setup.GeometryLibrary;
+import org.apache.sis.setup.OptionKey;
+import org.apache.sis.storage.ConcurrentReadException;
+import org.apache.sis.storage.DataStoreContentException;
+import org.apache.sis.storage.DataStoreException;
+import org.apache.sis.storage.FeatureSet;
+import org.apache.sis.storage.IllegalNameException;
+import org.apache.sis.storage.StorageConnector;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.Version;
-import org.apache.sis.setup.OptionKey;
-import org.apache.sis.setup.GeometryLibrary;
+import org.apache.sis.util.collection.BackingStoreException;
 import org.apache.sis.util.iso.DefaultNameFactory;
 import org.apache.sis.util.iso.SimpleInternationalString;
-import org.apache.sis.metadata.iso.citation.DefaultCitation;
-import org.apache.sis.metadata.iso.distribution.DefaultFormat;
-
-// Branch-dependent imports
 import org.opengis.feature.Feature;
 import org.opengis.feature.FeatureType;
+import org.opengis.geometry.Envelope;
+import org.opengis.metadata.Metadata;
+import org.opengis.metadata.distribution.Format;
+import org.opengis.util.FactoryException;
+import org.opengis.util.GenericName;
+import org.opengis.util.NameFactory;
 
 
 /**
@@ -148,6 +147,16 @@ public final class Store extends StaxDataStore implements FeatureSet
{
     }
 
     /**
+     * Returns GPX parent feature type name.
+     *
+     * @return feature type name.
+     */
+    @Override
+    public GenericName getIdentifier() {
+        return types.parent.getName();
+    }
+
+    /**
      * Returns information about the dataset as a whole.
      *
      * @return information about the dataset, or {@code null} if none.


Mime
View raw message