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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDataset.DwcAMetadata of dataset that has been published as a Darwin Core Archive (DwC-A).
-
Constructor Summary
Constructors Constructor Description Dataset()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEndpoint(Endpoint endpoint)voidaddMachineTag(MachineTag machineTag)booleanequals(Object o)@Size(min=1,max=50) StringgetAbbreviation()TODO: Document what this is TODO: are both alias & abbreviation needed?StringgetAcknowledgements()StringgetAdditionalInfo()@Size(min=2,max=50) StringgetAlias()TODO: Document what this isList<Citation>getBibliographicCitations()Set<String>getCategory()@Valid CitationgetCitation()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()DategetCreated()StringgetCreatedBy()List<CuratorialUnitComposite>getCuratorialUnits()List<DataDescription>getDataDescriptions()LanguagegetDataLanguage()DategetDeleted()StringgetDescription()DOIgetDoi()UUIDgetDuplicateOfDatasetKey()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.@Valid Dataset.DwcAgetDwca()List<Endpoint>getEndpoints()StringgetGeographicCoverageDescription()List<GeospatialCoverage>getGeographicCoverages()StringgetGettingStarted()URIgetHomepage()List<Identifier>getIdentifiers()@NotNull UUIDgetInstallationKey()StringgetIntroduction()UUIDgetKey()List<KeywordCollection>getKeywordCollections()@NotNull LanguagegetLanguage()LicensegetLicense()Persisted in the database table.URIgetLogoUrl()List<MachineTag>getMachineTags()StringgetMaintenanceDescription()A description of the maintenance frequency of this resource.MaintenanceUpdateFrequencygetMaintenanceUpdateFrequency()Persisted in the database table.DategetModified()StringgetModifiedBy()List<UUID>getNetworkKeys()Networks in which this dataset is a constituent.@javax.validation.constraints.Min(0L) intgetNumConstituents()UUIDgetParentDatasetKey()ProjectgetProject()DategetPubDate()@NotNull UUIDgetPublishingOrganizationKey()StringgetPublishingOrganizationName()StringgetPurpose()@Size(min=1) StringgetRights()Any kind of (copy)rights/IPR statements that apply to the datasets data.SamplingDescriptiongetSamplingDescription()StringgetShortName()DatasetSubtypegetSubtype()List<Tag>getTags()List<TaxonomicCoverages>getTaxonomicCoverages()List<TemporalCoverage>getTemporalCoverages()StringgetTitle()@NotNull DatasetTypegetType()StringgetVersion()inthashCode()booleanisExternal()booleanisLockedForAutoUpdate()booleanlenientEquals(Dataset other)Only checks the persisted properties, excluding the server controlled fields (key, created, license etc).voidsetAbbreviation(String abbreviation)Persisted in the database table.voidsetAcknowledgements(String acknowledgements)voidsetAdditionalInfo(String additionalInfo)voidsetAlias(String alias)Persisted in the database table.voidsetBibliographicCitations(List<Citation> bibliographicCitations)voidsetCategory(Set<String> category)voidsetCitation(Citation citation)Persisted in the database table.voidsetCollections(List<Collection> collections)voidsetComments(List<Comment> comments)voidsetContacts(List<Contact> contacts)voidsetContactsCitation(List<CitationContact> contactsCitation)voidsetCountryCoverage(Set<Country> countryCoverage)voidsetCreated(Date created)Autoassigned in the database table, ignored when persisted.voidsetCreatedBy(String createdBy)Persisted in the database table.voidsetCuratorialUnits(List<CuratorialUnitComposite> curatorialUnits)voidsetDataDescriptions(List<DataDescription> dataDescriptions)voidsetDataLanguage(Language dataLanguage)voidsetDeleted(Date deleted)Persisted in the database table.voidsetDescription(String description)Persisted in the database table.voidsetDoi(DOI doi)voidsetDuplicateOfDatasetKey(UUID duplicateOfDatasetKey)Persisted in the database table.voidsetDwca(Dataset.DwcA dwca)voidsetEndpoints(List<Endpoint> endpoints)voidsetExternal(boolean external)Persisted in the database table.voidsetGeographicCoverageDescription(String geographicCoverageDescription)voidsetGeographicCoverages(List<GeospatialCoverage> geographicCoverages)voidsetGettingStarted(String gettingStarted)voidsetHomepage(URI homepage)Persisted in the database table.voidsetIdentifiers(List<Identifier> identifiers)voidsetInstallationKey(UUID installationKey)Persisted in the database table.voidsetIntroduction(String introduction)voidsetKey(UUID key)Persisted in the database table.voidsetKeywordCollections(List<KeywordCollection> keywordCollections)voidsetLanguage(Language language)Persisted in the database table.voidsetLicense(License license)Persisted in the database table.voidsetLockedForAutoUpdate(boolean lockedForAutoUpdate)Persisted in the database table.voidsetLogoUrl(URI logoUrl)Persisted in the database table.voidsetMachineTags(List<MachineTag> machineTags)voidsetMaintenanceDescription(String maintenanceDescription)voidsetMaintenanceUpdateFrequency(MaintenanceUpdateFrequency maintenanceUpdateFrequency)Persisted in the database table.voidsetModified(Date modified)Persisted in the database table.voidsetModifiedBy(String modifiedBy)Persisted in the database table.voidsetNetworkKeys(List<UUID> networkKeys)voidsetNumConstituents(int numConstituents)Not persisted in the database table, but calculated on the fly.voidsetParentDatasetKey(UUID parentDatasetKey)Persisted in the database table.voidsetProject(Project project)voidsetPubDate(Date pubDate)voidsetPublishingOrganizationKey(UUID publishingOrganizationKey)Persisted in the database table.voidsetPublishingOrganizationName(String publishingOrganizationName)voidsetPurpose(String purpose)voidsetRights(String rights)Persisted in the database table.voidsetSamplingDescription(SamplingDescription samplingDescription)voidsetShortName(String shortName)voidsetSubtype(DatasetSubtype subtype)Persisted in the database table.voidsetTags(List<Tag> tags)voidsetTaxonomicCoverages(List<TaxonomicCoverages> taxonomicCoverages)voidsetTemporalCoverages(List<TemporalCoverage> temporalCoverages)voidsetTitle(String title)Persisted in the database table.voidsetType(DatasetType type)Persisted in the database table.voidsetVersion(String version)StringtoString()
-
-
-
Constructor Detail
-
Dataset
public Dataset()
-
-
Method Detail
-
getKey
public UUID getKey()
- Specified by:
getKeyin interfaceNetworkEntity
-
setKey
public void setKey(UUID key)
Persisted in the database table.- Specified by:
setKeyin interfaceNetworkEntity
-
getVersion
@Nullable public String getVersion()
-
setVersion
public void setVersion(String version)
-
getTitle
public String getTitle()
- Specified by:
getTitlein interfaceNetworkEntity
-
setTitle
public void setTitle(String title)
Persisted in the database table.- Specified by:
setTitlein interfaceNetworkEntity
-
getDescription
@Nullable public String getDescription()
- Specified by:
getDescriptionin interfaceNetworkEntity
-
setDescription
public void setDescription(String description)
Persisted in the database table.- Specified by:
setDescriptionin interfaceNetworkEntity
-
getCreated
public Date getCreated()
- Specified by:
getCreatedin interfaceNetworkEntity
-
setCreated
public void setCreated(Date created)
Autoassigned in the database table, ignored when persisted.- Specified by:
setCreatedin interfaceNetworkEntity
-
getModified
public Date getModified()
- Specified by:
getModifiedin interfaceNetworkEntity
-
setModified
public void setModified(Date modified)
Persisted in the database table.- Specified by:
setModifiedin interfaceNetworkEntity
-
getDeleted
@Nullable public Date getDeleted()
- Specified by:
getDeletedin interfaceNetworkEntity
-
setDeleted
public void setDeleted(Date deleted)
Persisted in the database table.- Specified by:
setDeletedin 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 isnullthen 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:
getCreatedByin interfaceNetworkEntity
-
setCreatedBy
public void setCreatedBy(String createdBy)
Persisted in the database table.- Specified by:
setCreatedByin interfaceNetworkEntity
-
getModifiedBy
public String getModifiedBy()
- Specified by:
getModifiedByin interfaceNetworkEntity
-
setModifiedBy
public void setModifiedBy(String modifiedBy)
Persisted in the database table.- Specified by:
setModifiedByin interfaceNetworkEntity
-
getContacts
public List<Contact> getContacts()
- Specified by:
getContactsin interfaceContactable
-
setContacts
public void setContacts(List<Contact> contacts)
- Specified by:
setContactsin interfaceContactable
-
getEndpoints
public List<Endpoint> getEndpoints()
- Specified by:
getEndpointsin interfaceEndpointable
-
setEndpoints
public void setEndpoints(List<Endpoint> endpoints)
- Specified by:
setEndpointsin interfaceEndpointable
-
addEndpoint
public void addEndpoint(Endpoint endpoint)
- Specified by:
addEndpointin interfaceEndpointable
-
getMachineTags
public List<MachineTag> getMachineTags()
- Specified by:
getMachineTagsin interfaceMachineTaggable
-
setMachineTags
public void setMachineTags(List<MachineTag> machineTags)
- Specified by:
setMachineTagsin interfaceMachineTaggable
-
addMachineTag
public void addMachineTag(MachineTag machineTag)
- Specified by:
addMachineTagin interfaceMachineTaggable
-
getIdentifiers
public List<Identifier> getIdentifiers()
- Specified by:
getIdentifiersin interfaceIdentifiable
-
setIdentifiers
public void setIdentifiers(List<Identifier> identifiers)
- Specified by:
setIdentifiersin interfaceIdentifiable
-
getComments
public List<Comment> getComments()
- Specified by:
getCommentsin interfaceCommentable
-
setComments
public void setComments(List<Comment> comments)
- Specified by:
setCommentsin 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)
-
getDwca
@Nullable @Valid public @Valid Dataset.DwcA getDwca()
-
setDwca
public void setDwca(Dataset.DwcA dwca)
-
getCategory
public Set<String> getCategory()
-
setCategory
public void setCategory(Set<String> category)
-
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:
lenientEqualsin interfaceLenientEquals<Dataset>- Parameters:
other- To compare against- Returns:
- true if...
-
-