ResourceObject

List of resource types »

ResourceObject["name"]

represents a resource with the specified name.

ResourceObject["uuid"]

represents a resource with the specified UUID.

ResourceObject[loc]

imports a resource from the specified location.

ResourceObject[assoc]

gives a resource with content and metadata specified by the association assoc.

Details and Options

  • Resources can be stored locally, in the cloud, or in a global resource repository.
  • ResourceObject[str] searches first locally, then in a user's cloud account, and then in global resource repositories.
  • In ResourceObject["name"], the name must be published in a public repository or registered using ResourceRegister.
  • ResourceObject[loc] accepts locations of previous resource object deployments including LocalObject and CloudObject.
  • Get[ResourceObject[]] typically retrieves the primary content of the resource.
  • Normal[ResourceObject[]] gives the metadata for a resource, as an association.
  • ResourceObject[]["Properties"] gives a list of available metadata items for a resource.
  • Options and SetOptions can be used with settable properties of ResourceObject.
  • DeleteObject[ResourceObject[]] removes the local cache of a resource object.
  • All resource types share the following standard metadata properties:
  • "Name"name of the resource
    "ResourceType"type of resource (e.g. "Data" or "Function")
    "Description"brief description of the resource
    "Details"detailed explanation of the resource and its use
    "UUID"UUID of the resource
    "RepositoryLocation"location of the original repository for the resource
    "ResourceLocations"locations where the resource can be accessed
    "Version"version specification for the resource
    "Keywords"list of search terms for the resource
    "SeeAlso"list of related resource objects
    "SourceMetadata"information about the origin of the resource's content
  • Possible standard values for "ResourceType" include:
  • "Data"data retrievable with ResourceData
    "Function"function retrievable with ResourceFunction
    "NeuralNet"neural net retrievable with NetModel
  • ResourceSubmit submits a user-created resource for publication in a public repository.
  • For resources in public repositories, "SourceMetadata" consists of an association whose keys are based on a subset of properties from the Dublin Core metadata standard:
  • "Creator"any person, organization, or group that is primarily responsible for the creation of the content
    "Contributor"any person, organization, or group that contributed to the creation of the content but was not primarily responsible for it
    "Coverage"spatial and/or temporal coverage of the data
    "Date"date or dates primarily associated with the data, such as creation, publication, or revision dates
    "Description"general description of the original source
    "Language"language of the original source
    "Publisher"publisher, person, or organization that made the source publicly available
    "Rights"description of or link to license information for the original source
    "Source"hyperlink or other reference to the source of the data as a whole
    "Title"title of the original source
  • Data Resources
  • Typical elements in a retrieved data resource include:
  • "ContentElements"names of elements in the resource
    "DefaultContentElement"name of the default element (as retrieved by ResourceData)
    "ContentSize"size of the default element (as retrieved by ResourceData)
    "ContentElementLocations"storage locations (cloud, local, ...) of elements
  • Typical elements that can be used in constructing a data resource include:
  • "Content"explicit expression representing content of the resource
    "ContentElementFunctions"functions to derive additional elements from content

Examples

open allclose all

Basic Examples  (4)

Retrieve a data resource from the data repository:

Import the content using ResourceData:

Retrieve a neural network from the neural net repository:

Get the NetChain with ResourceData:

Get a function resource from the function repository:

Get the included function with ResourceFunction:

Use the function:

Define a new custom data resource object:

Retrieve the data:

Scope  (5)

Define a new function resource:

Deploy it to a cloud object to share:

The function is now usable with CloudObject by anyone:

Newly created resource objects are only stored in memory for the current session:

Use LocalCache to store a resource locally for future use:

Create a multipart data resource object:

Retrieve one element:

Retrieve all the elements:

Delete the resource:

Reference a data repository resource by ID:

Create a word cloud from a data resource using a specific element:

Properties & Relations  (2)

A user-created resource cannot immediately be referenced by name in ResourceObject:

Use ResourceRegister to register the name:

Explore the properties of a data resource:

Introduced in 2016
 (11.0)
 |
Updated in 2017
 (11.2)
2019
 (12.0)