This is the primary function for querying the HydroShare API /hsapi/resource endpoint. It will return a tibble corresponding to the given parameters. Endpoint is chosen algorithmically based on passed parameters.

hs_resource(...)

Arguments

...

See details.

Value

A tibble. See details.

Details

Below is a sectioned list of all possible parameters that hs_resource can parse, and the corresponding HydroShare API endpoint(s)/functions used.

Parameters marked with an asterisk (*) are required for that endpoint.

Searching Resources (hs_search)

Endpoint:

  • /hsapi/resource/search

Parameters:

ParameterData/Object TypeDescription
pageintegerA page number within the paginated result set.
countintegerNumber of results to return per page.
creatorcharacterThe first author (name or email)
authorcharacter vectorList of authors (name or email)
groupcharacterA group name (requires edit_permissions = TRUE)
usercharacterViewable by user (name or email)
ownercharacterOwned by user (name or email)
from_dateDateTo get a list of resources created on or after this date
to_dateDateTo get a list of resources created on or before this date
subjectcharacter vectorComma separated list of subjects
full_text_searchcharacterGet a list of resources with this text
edit_permissionlogicalFilter by edit permissions of user/group/owner?
publishedlogicalFilter by published resources?
typecharacter vectorList of resources of the specified resource types. See below possible values.
coverage_typecharacterTo get a list of resources that fall within the specified tial coverage boundary. Either: "box" or "point"
coordinatescharacter vectorList of spatial coordinates in the form of (north, south, t, west)
include_obseletelogicalInclude replaced resources?

For available resource types, see hs_types.

Getting Resource Information by ID (hs_sysmeta)

Endpoints:

  • /hsapi/resource/id/sysmeta

Parameters:

ParametersData/Object TypeDescription
id*characterResource Alphanumeric ID

Return:

ColumnDescription
resource_titleTitle of the resource
resource_typeResource type
resource_idID of the resource
abstractResource abstract
authorsAuthors of resource
creatorCreator of resource
doiResource DOI ID
publicIndicates if resource if public
discoverableIndicates if resource is discoverable
shareableIndicates if resource is shareable
immutableIndicates if resource is immutable
publishedIndicates if resource is published
date_createdDate resource was created
date_last_updatedDate resource was last updated
bag_urlURL to resource download, can be passed to download.file
science_metadata_urlURL to science metadata
resource_map_urlURL to resource map
resource_urlURL to resource
content_typesResource content types, see hs_content_types

Getting Resource Access Permissions (hs_access)

Endpoint:

  • /hsapi/resource/id/access

Parameters:

ParameterData/Object TypeDescription
id*characterResource Alphanumeric ID
access*logicalMust be TRUE for access query

Return:

ColumnDescription
idResource Alphanumeric ID
privilegeUser's privilege level
userUser to be granted privilege
resourceResource to which privilege applies
grantorGrantor of privilege

Getting Resource File List (hs_files)

Endpoint:

  • /hsapi/resource/id/files

Parameters:

ParameterData/Object TypeDescription
id*characterResource Alphanumeric ID
files*logicalMust be TRUE for files query
pageintegerPage of results to return
countintegerNumber of files to return per page

Return:

ColumnDescription
file_nameThe filename, including the path
urlThe url to download the file
sizeThe size of the file
content_typeThe content type of the file
logical_file_typeThe logical file type
modified_timeThe last modified time of the file
checksumThe file's checksum

Getting Resource Folder(s) (hs_folder)

Endpoint:

  • /hsapi/resource/id/folders/pathname/

Parameters:

ParameterData/Object TypeDescription
id*characterResource Alphanumeric ID
pathname*characterPath to folder in resource's contents

Return:

ColumnDescription
resource_idResource Alphanumeric ID
pathPath to folder in resource's contents
contentsNested tibble with files and folders within path

Getting Resource Science Metadata (hs_scimeta)

Endpoints:

  • /hsapi/resource/id/scimeta

Parameters:

ParameterData/Object TypeDescription
id*characterResource Alphanumeric ID
scimeta*logicalMust be TRUE for scimeta query

Return:

ColumnDescription
idResource Alphanumeric ID
titleResource Title
citationResource Bibliography Citation
creatorsNested tibble of resource creator(s)
sourcesNested tibble of resource source(s)
metadataNested tibble with additional resource metadata