squid-js/src/ddo/MetaData.ts

262 lines
6.4 KiB
TypeScript
Raw Normal View History

2019-02-04 16:26:56 +01:00
export interface File {
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}
*/
index?: number
/**
* 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-04-29 14:06:16 +02:00
contentLength?: number
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
/**
* File format, if applicable.
* @type {string}
* @example "text/csv"
*/
contentType?: string
2019-02-04 16:26:56 +01:00
}
/**
* Base attributes of Assets Metadata.
* @see https://github.com/oceanprotocol/OEPs/tree/master/8#base-attributes
*/
2019-03-28 09:43:39 +01:00
export interface MetaDataBase {
/**
* Descriptive name of the Asset.
* @type {string}
* @example "UK Weather information 2011"
*/
2019-03-28 09:43:39 +01:00
name: string
/**
* Type of the Asset. Helps to filter by the type of asset,
* initially ("dataset", "algorithm", "container", "workflow", "other").
* @type {string}
* @example "dataset"
*/
2019-06-20 00:20:09 +02:00
type: 'dataset' | 'algorithm' | 'container' | 'workflow' | 'other'
/**
* 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"
*/
2019-03-28 09:43:39 +01:00
description?: string
/**
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.
* @type {string}
2019-04-29 14:06:16 +02:00
* @example "2019-01-31T08:38:32Z"
*/
2019-03-28 09:43:39 +01:00
dateCreated: string
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
/**
* 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
/**
* 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
/**
* The party holding the legal copyright. Empty by default.
* @type {string}
* @example "Met Office"
*/
2019-03-28 09:43:39 +01:00
copyrightHolder?: string
/**
* 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
/**
* 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-20 00:20:09 +02:00
links?: Array<{ [name: string]: string }>
/**
* 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-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-04-29 14:06:16 +02:00
tags?: string[]
/**
* Price of the asset.
* @type {string}
* @example "1000000000000000000"
*/
price: string
2019-02-04 16:26:56 +01:00
/**
* Array of File objects including the encrypted file urls and some additional information.
* @type {File[]}
*/
2019-03-28 09:43:39 +01:00
files: File[]
2019-02-04 16:26:56 +01:00
/**
* SHA3 hash of concatenated values: [list of all file checksums] + name + author + license + did
* @type {string}
*/
2019-03-28 09:43:39 +01:00
checksum?: string
2019-03-28 09:43:39 +01:00
encryptedFiles?: any
}
/**
* Curation attributes of Assets Metadata.
* @see https://github.com/oceanprotocol/OEPs/tree/master/8#curation-attributes
*/
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.
2019-04-29 14:06:16 +02:00
* @type {string}
* @example "Binary Voting"
*/
schema?: string
}
/**
* Additional Information of Assets Metadata.
* @see https://github.com/oceanprotocol/OEPs/tree/master/8#additional-information
*/
export interface AdditionalInformation {
/**
* 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-04-29 14:06:16 +02:00
updateFrequency: string
/**
* A link to machine-readable structured markup (such as ttl/json-ld/rdf)
* describing the dataset.
* @type {StructuredMarkup[]}
*/
2019-02-04 18:13:54 +01:00
structuredMarkup: Array<{
uri: string
2019-06-20 00:20:09 +02:00
mediaType: string
2019-02-04 18:13:54 +01:00
}>
/**
* Checksum of attributes to be able to compare if there are changes in
* the asset that you are purchasing.
* @type {string}
*/
checksum: string
}
export interface MetaData {
additionalInformation?: AdditionalInformation
base: MetaDataBase
curation?: Curation
2018-11-01 11:04:59 +01:00
}