001/*
002 *    GeoAPI - Java interfaces for OGC/ISO standards
003 *    Copyright © 2004-2023 Open Geospatial Consortium, Inc.
004 *    http://www.geoapi.org
005 *
006 *    Licensed under the Apache License, Version 2.0 (the "License");
007 *    you may not use this file except in compliance with the License.
008 *    You may obtain a copy of the License at
009 *
010 *        http://www.apache.org/licenses/LICENSE-2.0
011 *
012 *    Unless required by applicable law or agreed to in writing, software
013 *    distributed under the License is distributed on an "AS IS" BASIS,
014 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 *    See the License for the specific language governing permissions and
016 *    limitations under the License.
017 */
018package org.opengis.metadata.lineage;
019
020import java.util.Collection;
021import java.util.Collections;
022import org.opengis.util.InternationalString;
023import org.opengis.metadata.maintenance.Scope;
024import org.opengis.metadata.citation.Citation;
025import org.opengis.metadata.maintenance.ScopeCode;
026import org.opengis.annotation.UML;
027import org.opengis.annotation.Profile;
028
029import static org.opengis.annotation.Obligation.*;
030import static org.opengis.annotation.Specification.*;
031import static org.opengis.annotation.ComplianceLevel.*;
032
033
034/**
035 * Information about the events or source data used in constructing the data specified by
036 * the scope or lack of knowledge about lineage.
037 * At least one of {@linkplain #getStatement() statement}, {@linkplain #getProcessSteps() process steps}
038 * and {@linkplain #getSources() sources} shall be provided.
039 *
040 * @author  Martin Desruisseaux (IRD)
041 * @author  Rémi Maréchal (Geomatys)
042 * @version 3.1
043 * @since   2.0
044 */
045@UML(identifier="LI_Lineage", specification=ISO_19115)
046public interface Lineage {
047    /**
048     * General explanation of the data producer's knowledge about the lineage of a dataset.
049     *
050     * @return explanation of the data producer's knowledge about the lineage, or {@code null}.
051     *
052     * @condition Shall be provided only if {@linkplain Scope#getLevel() scope level} is
053     *            {@link ScopeCode#DATASET} or {@link ScopeCode#SERIES}.
054     */
055    @Profile(level=CORE)
056    @UML(identifier="statement", obligation=CONDITIONAL, specification=ISO_19115)
057    InternationalString getStatement();
058
059    /**
060     * Type of resource and / or extent to which the lineage information applies.
061     *
062     * @return type of resource and / or extent, or {@code null} if none.
063     *
064     * @since 3.1
065     */
066    @UML(identifier="scope", obligation=OPTIONAL, specification=ISO_19115)
067    default Scope getScope() {
068        return null;
069    }
070
071    /**
072     * Additional documentation.
073     *
074     * <div class="note"><b>Example</b>
075     * a publication that describes the whole process to generate this resource (for example a dataset).
076     * </div>
077     *
078     * @return additional documentation.
079     *
080     * @since 3.1
081     */
082    @UML(identifier="additionalDocumentation", obligation=OPTIONAL, specification=ISO_19115)
083    default Collection<? extends Citation> getAdditionalDocumentation() {
084        return Collections.emptyList();
085    }
086
087    /**
088     * Information about events in the life of a resource specified by the scope.
089     *
090     * @return information about events in the life of a resource.
091     *
092     * @condition Mandatory if {@linkplain #getStatement() statement} and
093     *            {@linkplain #getSources() source} are not provided.
094     */
095    @UML(identifier="processStep", obligation=CONDITIONAL, specification=ISO_19115)
096    Collection<? extends ProcessStep> getProcessSteps();
097
098    /**
099     * Information about the source data used in creating the data specified by the scope.
100     *
101     * @return information about the source data.
102     *
103     * @condition Mandatory if {@linkplain #getStatement() statement} and
104     *            {@linkplain #getProcessSteps() process step} are not provided.
105     */
106    @UML(identifier="source", obligation=CONDITIONAL, specification=ISO_19115)
107    Collection<? extends Source> getSources();
108}