2019-02-04 16:26:56 +01:00
|
|
|
export interface File {
|
2019-09-03 10:09:37 +02:00
|
|
|
/**
|
|
|
|
* File name.
|
|
|
|
* @type {string}
|
|
|
|
*/
|
|
|
|
name?: string
|
|
|
|
|
2019-03-28 09:43:39 +01:00
|
|
|
/**
|
|
|
|
* File URL.
|
|
|
|
* @type {string}
|
|
|
|
*/
|
2019-02-04 16:26:56 +01:00
|
|
|
url: string
|
2019-03-28 09:43:39 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* File index.
|
|
|
|
* @type {number}
|
|
|
|
*/
|
2019-11-12 16:35:42 +01:00
|
|
|
index?: number
|
2019-11-12 13:24:36 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* File format, if applicable.
|
|
|
|
* @type {string}
|
|
|
|
* @example "text/csv"
|
|
|
|
*/
|
|
|
|
contentType: string
|
2019-03-28 09:43:39 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* File checksum.
|
|
|
|
* @type {[type]}
|
|
|
|
*/
|
2019-02-04 16:26:56 +01:00
|
|
|
checksum?: string
|
2019-03-28 09:43:39 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Checksum hash algorithm.
|
|
|
|
* @type {[type]}
|
|
|
|
*/
|
2019-02-04 16:26:56 +01:00
|
|
|
checksumType?: string
|
2019-03-28 09:43:39 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* File content length.
|
|
|
|
* @type {[type]}
|
|
|
|
*/
|
2019-11-12 13:24:36 +01:00
|
|
|
contentLength?: string
|
2019-03-28 09:43:39 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Resource ID (depending on the source).
|
|
|
|
* @type {[type]}
|
|
|
|
*/
|
2019-02-04 16:26:56 +01:00
|
|
|
resourceId?: string
|
2019-03-28 09:43:39 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* File encoding.
|
|
|
|
* @type {string}
|
|
|
|
* @example "UTF-8"
|
|
|
|
*/
|
|
|
|
encoding?: string
|
|
|
|
|
|
|
|
/**
|
|
|
|
* File compression (e.g. no, gzip, bzip2, etc).
|
|
|
|
* @type {string}
|
|
|
|
* @example "zip"
|
|
|
|
*/
|
|
|
|
compression?: string
|
2019-02-04 16:26:56 +01:00
|
|
|
}
|
|
|
|
|
2020-01-28 18:59:06 +01:00
|
|
|
export interface MetaDataAlgorithm {
|
2020-03-16 12:52:20 +01:00
|
|
|
url?: string
|
|
|
|
rawcode?: string
|
2020-01-28 18:59:06 +01:00
|
|
|
language?: string
|
|
|
|
format?: string
|
|
|
|
version?: string
|
2020-01-24 15:23:50 +01:00
|
|
|
container: {
|
|
|
|
entrypoint: string
|
|
|
|
image: string
|
|
|
|
tag: string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-04 11:46:24 +01:00
|
|
|
/**
|
2019-08-15 13:23:56 +02:00
|
|
|
* Main attributes of assets metadata.
|
|
|
|
* @see https://github.com/oceanprotocol/OEPs/tree/master/8
|
2019-02-04 11:46:24 +01:00
|
|
|
*/
|
2019-08-15 13:23:56 +02:00
|
|
|
export interface MetaDataMain {
|
2019-02-04 11:46:24 +01:00
|
|
|
/**
|
|
|
|
* Descriptive name of the Asset.
|
|
|
|
* @type {string}
|
|
|
|
* @example "UK Weather information 2011"
|
|
|
|
*/
|
2019-03-28 09:43:39 +01:00
|
|
|
name: string
|
2019-02-04 11:46:24 +01:00
|
|
|
|
|
|
|
/**
|
2020-01-10 20:25:14 +01:00
|
|
|
* Type of the Asset. Helps to filter by the type of asset ("dataset" or "algorithm").
|
2019-02-04 11:46:24 +01:00
|
|
|
* @type {string}
|
|
|
|
* @example "dataset"
|
|
|
|
*/
|
2020-01-10 20:25:14 +01:00
|
|
|
type: 'dataset' | 'algorithm'
|
2019-02-04 11:46:24 +01:00
|
|
|
|
|
|
|
/**
|
2019-04-29 14:35:42 +02:00
|
|
|
* The date on which the asset was created by the originator in
|
|
|
|
* ISO 8601 format, Coordinated Universal Time.
|
2019-02-04 11:46:24 +01:00
|
|
|
* @type {string}
|
2019-04-29 14:06:16 +02:00
|
|
|
* @example "2019-01-31T08:38:32Z"
|
2019-02-04 11:46:24 +01:00
|
|
|
*/
|
2019-03-28 09:43:39 +01:00
|
|
|
dateCreated: string
|
2019-02-04 11:46:24 +01:00
|
|
|
|
2019-04-29 14:06:16 +02:00
|
|
|
/**
|
2019-04-29 14:35:42 +02:00
|
|
|
* The date on which the asset DDO was registered into the metadata store.
|
|
|
|
* This value is created automatically by Aquarius upon registering,
|
|
|
|
* so this value can't be set.
|
2019-04-29 14:06:16 +02:00
|
|
|
* @type {string}
|
|
|
|
* @example "2019-01-31T08:38:32Z"
|
|
|
|
*/
|
|
|
|
datePublished?: string
|
|
|
|
|
2019-02-04 11:46:24 +01:00
|
|
|
/**
|
|
|
|
* Name of the entity generating this data (e.g. Tfl, Disney Corp, etc.).
|
|
|
|
* @type {string}
|
|
|
|
* @example "Met Office"
|
|
|
|
*/
|
2019-03-28 09:43:39 +01:00
|
|
|
author: string
|
2019-02-04 11:46:24 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Short name referencing the license of the asset (e.g. Public Domain, CC-0, CC-BY, No License Specified, etc. ).
|
|
|
|
* If it's not specified, the following value will be added: "No License Specified".
|
|
|
|
* @type {string}
|
|
|
|
* @example "CC-BY"
|
|
|
|
*/
|
2019-03-28 09:43:39 +01:00
|
|
|
license: string
|
2019-02-04 11:46:24 +01:00
|
|
|
|
2019-08-15 13:23:56 +02:00
|
|
|
/**
|
2020-01-29 13:34:12 +01:00
|
|
|
* Price of the asset in vodka (attoOCEAN). It must be an integer encoded as a string.
|
2019-08-15 13:23:56 +02:00
|
|
|
* @type {string}
|
|
|
|
* @example "1000000000000000000"
|
|
|
|
*/
|
|
|
|
price: string
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Array of File objects including the encrypted file urls and some additional information.
|
|
|
|
* @type {File[]}
|
|
|
|
*/
|
|
|
|
files: File[]
|
|
|
|
|
2020-01-29 13:34:12 +01:00
|
|
|
/**
|
|
|
|
* Metadata used only for assets with type `algorithm`.
|
|
|
|
* @type {MetaDataAlgorithm}
|
|
|
|
*/
|
2020-01-28 18:59:06 +01:00
|
|
|
algorithm?: MetaDataAlgorithm
|
2019-08-15 13:23:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Curation attributes of Assets Metadata.
|
|
|
|
* @see https://github.com/oceanprotocol/OEPs/tree/master/8
|
|
|
|
*/
|
|
|
|
export interface Curation {
|
|
|
|
/**
|
|
|
|
* Decimal value between 0 and 1. 0 is the default value.
|
|
|
|
* @type {number}
|
|
|
|
* @example 0.93
|
|
|
|
*/
|
|
|
|
rating: number
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Number of votes. 0 is the default value.
|
|
|
|
* @type {number}
|
|
|
|
* @example 123
|
|
|
|
*/
|
|
|
|
numVotes: number
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Schema applied to calculate the rating.
|
|
|
|
* @type {string}
|
|
|
|
* @example "Binary Voting"
|
|
|
|
*/
|
|
|
|
schema?: string
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Flag unsuitable content.
|
|
|
|
* @type {boolean}
|
|
|
|
* @example true
|
|
|
|
*/
|
|
|
|
isListed?: boolean
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Additional Information of Assets Metadata.
|
|
|
|
* @see https://github.com/oceanprotocol/OEPs/tree/master/8#additional-information
|
|
|
|
*/
|
|
|
|
export interface AdditionalInformation {
|
|
|
|
/**
|
|
|
|
* Details of what the resource is. For a dataset, this attribute
|
|
|
|
* explains what the data represents and what it can be used for.
|
|
|
|
* @type {string}
|
|
|
|
* @example "Weather information of UK including temperature and humidity"
|
|
|
|
*/
|
|
|
|
description?: string
|
|
|
|
|
2019-02-04 11:46:24 +01:00
|
|
|
/**
|
|
|
|
* The party holding the legal copyright. Empty by default.
|
|
|
|
* @type {string}
|
|
|
|
* @example "Met Office"
|
|
|
|
*/
|
2019-03-28 09:43:39 +01:00
|
|
|
copyrightHolder?: string
|
2019-02-04 11:46:24 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Example of the concept of this asset. This example is part
|
|
|
|
* of the metadata, not an external link.
|
|
|
|
* @type {string}
|
|
|
|
* @example "423432fsd,51.509865,-0.118092,2011-01-01T10:55:11+00:00,7.2,68"
|
|
|
|
*/
|
2019-03-28 09:43:39 +01:00
|
|
|
workExample?: string
|
2019-02-04 11:46:24 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Mapping of links for data samples, or links to find out more information.
|
|
|
|
* Links may be to either a URL or another Asset. We expect marketplaces to
|
|
|
|
* converge on agreements of typical formats for linked data: The Ocean Protocol
|
|
|
|
* itself does not mandate any specific formats as these requirements are likely
|
|
|
|
* to be domain-specific.
|
|
|
|
* @type {any[]}
|
|
|
|
* @example
|
|
|
|
* [
|
|
|
|
* {
|
|
|
|
* anotherSample: "http://data.ceda.ac.uk/badc/ukcp09/data/gridded-land-obs/gridded-land-obs-daily/",
|
|
|
|
* },
|
|
|
|
* {
|
|
|
|
* fieldsDescription: "http://data.ceda.ac.uk/badc/ukcp09/",
|
|
|
|
* },
|
|
|
|
* ]
|
|
|
|
*/
|
2019-06-24 13:06:38 +02:00
|
|
|
links?: { [name: string]: string }[]
|
2019-02-04 11:46:24 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The language of the content. Please use one of the language
|
|
|
|
* codes from the {@link https://tools.ietf.org/html/bcp47 IETF BCP 47 standard}.
|
|
|
|
* @type {String}
|
|
|
|
* @example "en"
|
|
|
|
*/
|
2019-03-28 09:43:39 +01:00
|
|
|
inLanguage?: string
|
2019-02-04 11:46:24 +01:00
|
|
|
|
|
|
|
/**
|
2019-04-29 14:06:16 +02:00
|
|
|
* Categories used to describe this content. Empty by default.
|
|
|
|
* @type {string[]}
|
|
|
|
* @example ["Economy", "Data Science"]
|
|
|
|
*/
|
|
|
|
categories?: string[]
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Keywords or tags used to describe this content. Empty by default.
|
|
|
|
* @type {string[]}
|
|
|
|
* @example ["weather", "uk", "2011", "temperature", "humidity"]
|
2019-02-04 11:46:24 +01:00
|
|
|
*/
|
2019-04-29 14:06:16 +02:00
|
|
|
tags?: string[]
|
2019-02-04 11:46:24 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* An indication of update latency - i.e. How often are updates expected (seldom,
|
|
|
|
* annually, quarterly, etc.), or is the resource static that is never expected
|
|
|
|
* to get updated.
|
|
|
|
* @type {string}
|
|
|
|
* @example "yearly"
|
|
|
|
*/
|
2019-08-15 13:23:56 +02:00
|
|
|
updateFrequency?: string
|
2019-02-04 11:46:24 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A link to machine-readable structured markup (such as ttl/json-ld/rdf)
|
|
|
|
* describing the dataset.
|
|
|
|
* @type {StructuredMarkup[]}
|
|
|
|
*/
|
2019-08-15 13:23:56 +02:00
|
|
|
structuredMarkup?: {
|
2019-02-04 11:46:24 +01:00
|
|
|
uri: string
|
2019-06-20 00:20:09 +02:00
|
|
|
mediaType: string
|
2019-06-24 13:06:38 +02:00
|
|
|
}[]
|
2019-02-04 11:46:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface MetaData {
|
2019-08-15 13:23:56 +02:00
|
|
|
main: MetaDataMain
|
2019-09-13 13:38:23 +02:00
|
|
|
encryptedFiles?: string
|
2019-04-29 13:31:03 +02:00
|
|
|
additionalInformation?: AdditionalInformation
|
|
|
|
curation?: Curation
|
2018-11-01 11:04:59 +01:00
|
|
|
}
|