Package org.gbif.api.model.registry
Class Dataset
- java.lang.Object
-
- org.gbif.api.model.registry.Dataset
-
- All Implemented Interfaces:
Serializable
,Commentable
,Contactable
,Endpointable
,Identifiable
,LenientEquals<Dataset>
,MachineTaggable
,NetworkEntity
,Taggable
public class Dataset extends Object implements NetworkEntity, Contactable, Endpointable, MachineTaggable, Taggable, Identifiable, Commentable, LenientEquals<Dataset>
A GBIF dataset which provides occurrence data, checklist data, sampling event data or metadata. This Dataset class is covering all the GBIF metadata profile v1.3, but only a few properties are kept in the database table:- key
- parentDatasetKey
- duplicateOfDatasetKey
- version
- installationKey
- publishingOrganizationKey
- publishingOrganizationName
- networkKeys
- license
- maintenanceUpdateFrequency
- external
- numConstituents
- type
- subtype
- title
- alias
- abbreviation
- description
- language
- homepage
- logoUrl
- citation
- rights
- lockedForAutoUpdate
- createdBy
- modifiedBy
- created
- modified
- deleted
- See Also:
- GBIF EML Profile XML Schema, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Dataset()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEndpoint(Endpoint endpoint)
void
addMachineTag(MachineTag machineTag)
boolean
equals(Object o)
@Size(min=1,max=50) String
getAbbreviation()
TODO: Document what this is TODO: are both alias & abbreviation needed?String
getAcknowledgements()
String
getAdditionalInfo()
@Size(min=2,max=50) String
getAlias()
TODO: Document what this isList<Citation>
getBibliographicCitations()
@Valid Citation
getCitation()
The exact form of how to cite this dataset.List<Collection>
getCollections()
List<Comment>
getComments()
List<Contact>
getContacts()
List<CitationContact>
getContactsCitation()
A generated list of contacts used in the citation text when it is generated by the GBIF API.Set<Country>
getCountryCoverage()
Date
getCreated()
String
getCreatedBy()
List<CuratorialUnitComposite>
getCuratorialUnits()
List<DataDescription>
getDataDescriptions()
Language
getDataLanguage()
Date
getDeleted()
String
getDescription()
DOI
getDoi()
UUID
getDuplicateOfDatasetKey()
If a dataset is registered with GBIF through more than one place we'll mark all but one as a duplicate by pointing it to the canonical dataset.List<Endpoint>
getEndpoints()
String
getGeographicCoverageDescription()
List<GeospatialCoverage>
getGeographicCoverages()
String
getGettingStarted()
URI
getHomepage()
List<Identifier>
getIdentifiers()
@NotNull UUID
getInstallationKey()
String
getIntroduction()
UUID
getKey()
List<KeywordCollection>
getKeywordCollections()
@NotNull Language
getLanguage()
License
getLicense()
Persisted in the database table.URI
getLogoUrl()
List<MachineTag>
getMachineTags()
String
getMaintenanceDescription()
A description of the maintenance frequency of this resource.MaintenanceUpdateFrequency
getMaintenanceUpdateFrequency()
Persisted in the database table.Date
getModified()
String
getModifiedBy()
List<UUID>
getNetworkKeys()
Networks in which this dataset is a constituent.@javax.validation.constraints.Min(0L) int
getNumConstituents()
UUID
getParentDatasetKey()
Project
getProject()
Date
getPubDate()
@NotNull UUID
getPublishingOrganizationKey()
String
getPublishingOrganizationName()
String
getPurpose()
@Size(min=1) String
getRights()
Any kind of (copy)rights/IPR statements that apply to the datasets data.SamplingDescription
getSamplingDescription()
String
getShortName()
DatasetSubtype
getSubtype()
List<Tag>
getTags()
List<TaxonomicCoverages>
getTaxonomicCoverages()
List<TemporalCoverage>
getTemporalCoverages()
String
getTitle()
@NotNull DatasetType
getType()
String
getVersion()
int
hashCode()
boolean
isExternal()
boolean
isLockedForAutoUpdate()
boolean
lenientEquals(Dataset other)
Only checks the persisted properties, excluding the server controlled fields (key, created, license etc).void
setAbbreviation(String abbreviation)
Persisted in the database table.void
setAcknowledgements(String acknowledgements)
void
setAdditionalInfo(String additionalInfo)
void
setAlias(String alias)
Persisted in the database table.void
setBibliographicCitations(List<Citation> bibliographicCitations)
void
setCitation(Citation citation)
Persisted in the database table.void
setCollections(List<Collection> collections)
void
setComments(List<Comment> comments)
void
setContacts(List<Contact> contacts)
void
setContactsCitation(List<CitationContact> contactsCitation)
void
setCountryCoverage(Set<Country> countryCoverage)
void
setCreated(Date created)
Autoassigned in the database table, ignored when persisted.void
setCreatedBy(String createdBy)
Persisted in the database table.void
setCuratorialUnits(List<CuratorialUnitComposite> curatorialUnits)
void
setDataDescriptions(List<DataDescription> dataDescriptions)
void
setDataLanguage(Language dataLanguage)
void
setDeleted(Date deleted)
Persisted in the database table.void
setDescription(String description)
Persisted in the database table.void
setDoi(DOI doi)
void
setDuplicateOfDatasetKey(UUID duplicateOfDatasetKey)
Persisted in the database table.void
setEndpoints(List<Endpoint> endpoints)
void
setExternal(boolean external)
Persisted in the database table.void
setGeographicCoverageDescription(String geographicCoverageDescription)
void
setGeographicCoverages(List<GeospatialCoverage> geographicCoverages)
void
setGettingStarted(String gettingStarted)
void
setHomepage(URI homepage)
Persisted in the database table.void
setIdentifiers(List<Identifier> identifiers)
void
setInstallationKey(UUID installationKey)
Persisted in the database table.void
setIntroduction(String introduction)
void
setKey(UUID key)
Persisted in the database table.void
setKeywordCollections(List<KeywordCollection> keywordCollections)
void
setLanguage(Language language)
Persisted in the database table.void
setLicense(License license)
Persisted in the database table.void
setLockedForAutoUpdate(boolean lockedForAutoUpdate)
Persisted in the database table.void
setLogoUrl(URI logoUrl)
Persisted in the database table.void
setMachineTags(List<MachineTag> machineTags)
void
setMaintenanceDescription(String maintenanceDescription)
void
setMaintenanceUpdateFrequency(MaintenanceUpdateFrequency maintenanceUpdateFrequency)
Persisted in the database table.void
setModified(Date modified)
Persisted in the database table.void
setModifiedBy(String modifiedBy)
Persisted in the database table.void
setNetworkKeys(List<UUID> networkKeys)
void
setNumConstituents(int numConstituents)
Not persisted in the database table, but calculated on the fly.void
setParentDatasetKey(UUID parentDatasetKey)
Persisted in the database table.void
setProject(Project project)
void
setPubDate(Date pubDate)
void
setPublishingOrganizationKey(UUID publishingOrganizationKey)
Persisted in the database table.void
setPublishingOrganizationName(String publishingOrganizationName)
void
setPurpose(String purpose)
void
setRights(String rights)
Persisted in the database table.void
setSamplingDescription(SamplingDescription samplingDescription)
void
setShortName(String shortName)
void
setSubtype(DatasetSubtype subtype)
Persisted in the database table.void
setTags(List<Tag> tags)
void
setTaxonomicCoverages(List<TaxonomicCoverages> taxonomicCoverages)
void
setTemporalCoverages(List<TemporalCoverage> temporalCoverages)
void
setTitle(String title)
Persisted in the database table.void
setType(DatasetType type)
Persisted in the database table.void
setVersion(String version)
String
toString()
-
-
-
Constructor Detail
-
Dataset
public Dataset()
-
-
Method Detail
-
getKey
public UUID getKey()
- Specified by:
getKey
in interfaceNetworkEntity
-
setKey
public void setKey(UUID key)
Persisted in the database table.- Specified by:
setKey
in interfaceNetworkEntity
-
getVersion
@Nullable public String getVersion()
-
setVersion
public void setVersion(String version)
-
getTitle
public String getTitle()
- Specified by:
getTitle
in interfaceNetworkEntity
-
setTitle
public void setTitle(String title)
Persisted in the database table.- Specified by:
setTitle
in interfaceNetworkEntity
-
getDescription
@Nullable public String getDescription()
- Specified by:
getDescription
in interfaceNetworkEntity
-
setDescription
public void setDescription(String description)
Persisted in the database table.- Specified by:
setDescription
in interfaceNetworkEntity
-
getCreated
public Date getCreated()
- Specified by:
getCreated
in interfaceNetworkEntity
-
setCreated
public void setCreated(Date created)
Autoassigned in the database table, ignored when persisted.- Specified by:
setCreated
in interfaceNetworkEntity
-
getModified
public Date getModified()
- Specified by:
getModified
in interfaceNetworkEntity
-
setModified
public void setModified(Date modified)
Persisted in the database table.- Specified by:
setModified
in interfaceNetworkEntity
-
getDeleted
@Nullable public Date getDeleted()
- Specified by:
getDeleted
in interfaceNetworkEntity
-
setDeleted
public void setDeleted(Date deleted)
Persisted in the database table.- Specified by:
setDeleted
in interfaceNetworkEntity
-
getParentDatasetKey
@Nullable public UUID getParentDatasetKey()
-
setParentDatasetKey
public void setParentDatasetKey(UUID parentDatasetKey)
Persisted in the database table.
-
getDuplicateOfDatasetKey
@Nullable public UUID getDuplicateOfDatasetKey()
If a dataset is registered with GBIF through more than one place we'll mark all but one as a duplicate by pointing it to the canonical dataset. That is done using this field. If it isnull
then this is not a known duplicate.
-
setDuplicateOfDatasetKey
public void setDuplicateOfDatasetKey(UUID duplicateOfDatasetKey)
Persisted in the database table.
-
getInstallationKey
@NotNull public @NotNull UUID getInstallationKey()
-
setInstallationKey
public void setInstallationKey(UUID installationKey)
Persisted in the database table.
-
getPublishingOrganizationKey
@NotNull public @NotNull UUID getPublishingOrganizationKey()
-
setPublishingOrganizationKey
public void setPublishingOrganizationKey(UUID publishingOrganizationKey)
Persisted in the database table.
-
getPublishingOrganizationName
@Nullable public String getPublishingOrganizationName()
-
setPublishingOrganizationName
public void setPublishingOrganizationName(String publishingOrganizationName)
-
getNetworkKeys
public List<UUID> getNetworkKeys()
Networks in which this dataset is a constituent.
-
setNetworkKeys
public void setNetworkKeys(List<UUID> networkKeys)
-
getMaintenanceUpdateFrequency
@Nullable public MaintenanceUpdateFrequency getMaintenanceUpdateFrequency()
Persisted in the database table.- Returns:
- the frequency with which changes are made to the dataset
-
setMaintenanceUpdateFrequency
public void setMaintenanceUpdateFrequency(MaintenanceUpdateFrequency maintenanceUpdateFrequency)
Persisted in the database table.
-
getMaintenanceDescription
public String getMaintenanceDescription()
A description of the maintenance frequency of this resource.- Returns:
- the description of the maintenance frequency of this resource
-
setMaintenanceDescription
public void setMaintenanceDescription(String maintenanceDescription)
-
getLicense
public License getLicense()
Persisted in the database table. Note for backwards compatibility, we cannot apply @NotNull to license. Otherwise existing users of our API would have to ensure Dataset objects always populate license. In the Registry DB, Dataset.license defaults to CC-BY 4.0. Therefore license must be excluded from lenientEquals method.- Returns:
- the License applied to the dataset
- See Also:
- POR-3133
-
setLicense
public void setLicense(License license)
Persisted in the database table. Can be interpreted from EML.intellectualRights using machine readable format:<intellectualRights> <para>This work is licensed under a <ulink url="http://creativecommons.org/licenses/by/4.0/legalcode"><citetitle>Creative Commons Attribution (CC-BY) 4.0 License</citetitle></ulink>.</para> </intellectualRights>
-
getDoi
public DOI getDoi()
- Returns:
- the primary DOI for this dataset regardless if issued by GBIF or publisher
-
isExternal
public boolean isExternal()
-
setExternal
public void setExternal(boolean external)
Persisted in the database table.
-
getNumConstituents
@Min(0L) public @javax.validation.constraints.Min(0L) int getNumConstituents()
-
setNumConstituents
public void setNumConstituents(int numConstituents)
Not persisted in the database table, but calculated on the fly.
-
getType
@NotNull public @NotNull DatasetType getType()
-
setType
public void setType(DatasetType type)
Persisted in the database table.
-
getSubtype
@Nullable public DatasetSubtype getSubtype()
-
setSubtype
public void setSubtype(DatasetSubtype subtype)
Persisted in the database table.
-
getShortName
@Nullable public String getShortName()
-
setShortName
public void setShortName(String shortName)
-
getAlias
@Nullable @Size(min=2, max=50) public @Size(min=2,max=50) String getAlias()
TODO: Document what this is
-
getAbbreviation
@Nullable @Size(min=1, max=50) public @Size(min=1,max=50) String getAbbreviation()
TODO: Document what this is TODO: are both alias & abbreviation needed?
-
setAbbreviation
public void setAbbreviation(String abbreviation)
Persisted in the database table.
-
getLanguage
@NotNull public @NotNull Language getLanguage()
-
setLanguage
public void setLanguage(Language language)
Persisted in the database table.
-
getHomepage
@Nullable public URI getHomepage()
-
setHomepage
public void setHomepage(URI homepage)
Persisted in the database table.
-
getLogoUrl
@Nullable public URI getLogoUrl()
-
setLogoUrl
public void setLogoUrl(URI logoUrl)
Persisted in the database table.
-
getCitation
@Nullable @Valid public @Valid Citation getCitation()
The exact form of how to cite this dataset.
-
setCitation
public void setCitation(Citation citation)
Persisted in the database table.
-
getContactsCitation
@Nullable public List<CitationContact> getContactsCitation()
A generated list of contacts used in the citation text when it is generated by the GBIF API.
-
setContactsCitation
public void setContactsCitation(List<CitationContact> contactsCitation)
-
getRights
@Nullable @Size(min=1) public @Size(min=1) String getRights()
Any kind of (copy)rights/IPR statements that apply to the datasets data.
-
isLockedForAutoUpdate
public boolean isLockedForAutoUpdate()
-
setLockedForAutoUpdate
public void setLockedForAutoUpdate(boolean lockedForAutoUpdate)
Persisted in the database table.
-
getCreatedBy
public String getCreatedBy()
- Specified by:
getCreatedBy
in interfaceNetworkEntity
-
setCreatedBy
public void setCreatedBy(String createdBy)
Persisted in the database table.- Specified by:
setCreatedBy
in interfaceNetworkEntity
-
getModifiedBy
public String getModifiedBy()
- Specified by:
getModifiedBy
in interfaceNetworkEntity
-
setModifiedBy
public void setModifiedBy(String modifiedBy)
Persisted in the database table.- Specified by:
setModifiedBy
in interfaceNetworkEntity
-
getContacts
public List<Contact> getContacts()
- Specified by:
getContacts
in interfaceContactable
-
setContacts
public void setContacts(List<Contact> contacts)
- Specified by:
setContacts
in interfaceContactable
-
getEndpoints
public List<Endpoint> getEndpoints()
- Specified by:
getEndpoints
in interfaceEndpointable
-
setEndpoints
public void setEndpoints(List<Endpoint> endpoints)
- Specified by:
setEndpoints
in interfaceEndpointable
-
addEndpoint
public void addEndpoint(Endpoint endpoint)
- Specified by:
addEndpoint
in interfaceEndpointable
-
getMachineTags
public List<MachineTag> getMachineTags()
- Specified by:
getMachineTags
in interfaceMachineTaggable
-
setMachineTags
public void setMachineTags(List<MachineTag> machineTags)
- Specified by:
setMachineTags
in interfaceMachineTaggable
-
addMachineTag
public void addMachineTag(MachineTag machineTag)
- Specified by:
addMachineTag
in interfaceMachineTaggable
-
getIdentifiers
public List<Identifier> getIdentifiers()
- Specified by:
getIdentifiers
in interfaceIdentifiable
-
setIdentifiers
public void setIdentifiers(List<Identifier> identifiers)
- Specified by:
setIdentifiers
in interfaceIdentifiable
-
getComments
public List<Comment> getComments()
- Specified by:
getComments
in interfaceCommentable
-
setComments
public void setComments(List<Comment> comments)
- Specified by:
setComments
in interfaceCommentable
-
getBibliographicCitations
public List<Citation> getBibliographicCitations()
-
setBibliographicCitations
public void setBibliographicCitations(List<Citation> bibliographicCitations)
-
getCuratorialUnits
public List<CuratorialUnitComposite> getCuratorialUnits()
-
setCuratorialUnits
public void setCuratorialUnits(List<CuratorialUnitComposite> curatorialUnits)
-
getTaxonomicCoverages
public List<TaxonomicCoverages> getTaxonomicCoverages()
-
setTaxonomicCoverages
public void setTaxonomicCoverages(List<TaxonomicCoverages> taxonomicCoverages)
-
getGeographicCoverageDescription
public String getGeographicCoverageDescription()
-
setGeographicCoverageDescription
public void setGeographicCoverageDescription(String geographicCoverageDescription)
-
getGeographicCoverages
public List<GeospatialCoverage> getGeographicCoverages()
-
setGeographicCoverages
public void setGeographicCoverages(List<GeospatialCoverage> geographicCoverages)
-
getTemporalCoverages
public List<TemporalCoverage> getTemporalCoverages()
-
setTemporalCoverages
public void setTemporalCoverages(List<TemporalCoverage> temporalCoverages)
-
getKeywordCollections
public List<KeywordCollection> getKeywordCollections()
-
setKeywordCollections
public void setKeywordCollections(List<KeywordCollection> keywordCollections)
-
getProject
public Project getProject()
-
setProject
public void setProject(Project project)
-
getSamplingDescription
public SamplingDescription getSamplingDescription()
-
setSamplingDescription
public void setSamplingDescription(SamplingDescription samplingDescription)
-
getCountryCoverage
public Set<Country> getCountryCoverage()
-
setCountryCoverage
public void setCountryCoverage(Set<Country> countryCoverage)
-
getCollections
public List<Collection> getCollections()
-
setCollections
public void setCollections(List<Collection> collections)
-
getDataDescriptions
public List<DataDescription> getDataDescriptions()
-
setDataDescriptions
public void setDataDescriptions(List<DataDescription> dataDescriptions)
-
getDataLanguage
public Language getDataLanguage()
-
setDataLanguage
public void setDataLanguage(Language dataLanguage)
-
getPurpose
public String getPurpose()
-
setPurpose
public void setPurpose(String purpose)
-
getIntroduction
@Nullable public String getIntroduction()
-
setIntroduction
public void setIntroduction(String introduction)
-
getGettingStarted
@Nullable public String getGettingStarted()
-
setGettingStarted
public void setGettingStarted(String gettingStarted)
-
getAcknowledgements
@Nullable public String getAcknowledgements()
-
setAcknowledgements
public void setAcknowledgements(String acknowledgements)
-
getAdditionalInfo
public String getAdditionalInfo()
-
setAdditionalInfo
public void setAdditionalInfo(String additionalInfo)
-
getPubDate
public Date getPubDate()
-
setPubDate
public void setPubDate(Date pubDate)
-
lenientEquals
public boolean lenientEquals(Dataset other)
Only checks the persisted properties, excluding the server controlled fields (key, created, license etc). Does not include the nested properties.- Specified by:
lenientEquals
in interfaceLenientEquals<Dataset>
- Parameters:
other
- To compare against- Returns:
- true if...
-
-