public class CkanResourceBase extends Object
CkanDataset
. In DCAT terminology,
a Ckan Resource is a DCAT Distribution.
CkanResourceBase
holds fields that can be sent when
creating
a resource,, while CkanResource
holds more fields that can be
returned with searches.
This class initializes nothing to fully preserve all we get from ckan. In
practice, all fields of retrieved resources can be null except maybe
url
.Constructor and Description |
---|
CkanResourceBase() |
CkanResourceBase(String url,
String packageId)
Constructor with the minimal list of required items to successfully
create a resource on the server.
|
Modifier and Type | Method and Description |
---|---|
String |
getCacheLastUpdated()
Should be a Timestamp
|
String |
getCacheUrl()
God only knows what this is
|
Timestamp |
getCreated()
In JSON is something like this: i.e.
|
String |
getDescription() |
String |
getFormat()
In Ckan 1.8 was lowercase, 2.2a seems capitalcase.
|
String |
getHash()
Sometimes for dati.trentino.it can be the empty string
|
String |
getId()
Returns the alphanumerical id, i.e.
|
String |
getLastModified()
Jackan note: this field should represent the timestamp of the last update
of the resource *data*, not metadata.
|
String |
getMimetype()
i.e.
|
String |
getMimetypeInner()
Unknown meaning, as usual.
|
String |
getName()
Human readable name, i.e.
|
Map<String,Object> |
getOthers()
CKAN instances might have
custom data schemas that force presence of custom properties among
'regular' ones.
|
String |
getPackageId()
The dataset this resource belongs to.
|
String |
getResourceType()
So far, found: "api", "file", "file.upload"
|
String |
getRevisionId()
alphanumerical id, i.e.
|
String |
getSize()
File size in bytes, if calculated by ckan for files in storage, like i.e.
|
String |
getUrl()
The Url to the pyhsical file i.e.
|
Timestamp |
getWebstoreLastUpdated()
Ckan always refers to UTC timezone
|
String |
getWebstoreUrl()
Found "active" as value.
|
void |
putOthers(String name,
Object value)
See
getOthers() |
void |
setCacheLastUpdated(String cacheLastUpdated)
Should be a Timestamp
|
void |
setCacheUrl(String cacheUrl)
God only knows what this is
|
void |
setCreated(Timestamp created)
Ckan always refers to UTC timezone
|
void |
setDescription(String description) |
void |
setFormat(String format)
In Ckan 1.8 was lowercase, 2.2a seems capitalcase.
|
void |
setHash(String hash)
Sometimes for dati.trentino.it can be the empty string
|
void |
setId(String id) |
void |
setLastModified(String lastModified)
Jackan note: this field should represent the timestamp of the last update
of the resource *data*, not metadata.
|
void |
setMimetype(String mimetype)
i.e.
|
void |
setMimetypeInner(String mimetypeInner)
Unknown meaning, as usual.
|
void |
setName(String name)
Human readable name, i.e.
|
void |
setOthers(Map<String,Object> others) |
void |
setPackageId(String packageId)
The dataset id the resource belongs to.
|
void |
setResourceType(String resourceType)
So far, found: "api", "file", "file.upload"
|
void |
setRevisionId(String revisionId)
alphanumerical id, i.e.
|
void |
setSize(String size)
File size in bytes, if calculated by ckan for files in storage, like i.e.
|
void |
setUrl(String url)
The Url to the pyhsical file i.e.
|
void |
setWebstoreLastUpdated(Timestamp webstoreLastUpdated)
Ckan always refers to UTC timezone
|
void |
setWebstoreUrl(String webstoreUrl) |
public CkanResourceBase()
public CkanResourceBase(String url, String packageId)
url
- the Url to the pyhsical file i.e.
http://dati.trentino.it/storage/f/2013-05-09T140831/TRENTO_Laghi_monitorati_UTM.csv
(could also be a file outside ckan server)packageId
- id of the dataset that contains the resource@Nullable public String getPackageId()
public void setPackageId(@Nullable String packageId)
packageId
- the dataset this resource belongs to.@Nullable public Map<String,Object> getOthers()
public void setOthers(@Nullable Map<String,Object> others)
others
- getOthers()
,
putOthers(java.lang.String, java.lang.Object)
public void putOthers(String name, Object value)
getOthers()
setOthers(java.util.Map)
public String getCacheLastUpdated()
public void setCacheLastUpdated(@Nullable String cacheLastUpdated)
public void setCacheUrl(String cacheUrl)
public Timestamp getCreated()
public void setCreated(Timestamp created)
public String getDescription()
public void setDescription(String description)
public String getFormat()
public void setFormat(String format)
public String getHash()
public void setHash(String hash)
public String getId()
public void setId(String id)
id
- alphanumerical id, i.e. "c4577b8f-5603-4098-917e-da03e8ddf461"public String getLastModified()
CkanClient.CKAN_TIMESTAMP_PATTERN
format, so this field probably
should follow the same format.public void setLastModified(String lastModified)
CkanClient.CKAN_TIMESTAMP_PATTERN
format, so this field probably
should follow the same format.public String getMimetype()
public void setMimetype(String mimetype)
public String getMimetypeInner()
public void setMimetypeInner(@Nullable String mimetypeInner)
@Nullable public String getName()
CkanDatasetBase.name
which instead is lowercased and
intended to be part of the url.
Notice we found name null in data.gov.uk datasets... i.e.
unclaimed-estates-list , taken
from
this dataset search (They use description field instead)public void setName(@Nullable String name)
CkanDatasetBase.name
which instead is lowercased and
intended to be part of the url. For Nullable explanation see
getName()
public String getResourceType()
public void setResourceType(String resourceType)
public String getRevisionId()
public void setRevisionId(String revisionId)
public String getSize()
public void setSize(@Nullable String size)
public String getUrl()
public void setUrl(String url)
public Timestamp getWebstoreLastUpdated()
public void setWebstoreLastUpdated(Timestamp webstoreLastUpdated)
public String getWebstoreUrl()
public void setWebstoreUrl(String webstoreUrl)
webstoreUrl
- Found "active" as value. Maybe it is a CkanState?Copyright © 2015 Trento Rise. All rights reserved.