1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00
squid-js/src/ddo/MetaData.ts

66 lines
2.3 KiB
TypeScript
Raw Normal View History

2018-11-01 11:04:59 +01:00
import AdditionalInformation from "./AdditionalInformation"
2018-11-01 11:05:29 +01:00
import Curation from "./Curation"
2018-11-01 11:04:59 +01:00
import MetaDataBase from "./MetaDataBase"
2018-11-01 11:05:29 +01:00
import StructuredMarkup from "./StructuredMarkup"
2018-11-01 11:04:59 +01:00
2018-11-12 08:33:19 +01:00
const base: MetaDataBase = {
name: "UK Weather information 2011",
type: "dataset",
description: "Weather information of UK including temperature and humidity",
size: "3.1gb",
dateCreated: "2012-02-01T10:55:11+00:00",
author: "Met Office",
license: "CC-BY",
copyrightHolder: "Met Office",
encoding: "UTF-8",
compression: "zip",
contentType: "text/csv",
// tslint:disable-next-line
workExample: "stationId,latitude,longitude,datetime,temperature,humidity423432fsd,51.509865,-0.118092,2011-01-01T10:55:11+00:00,7.2,68",
contentUrls: [
"https://testocnfiles.blob.core.windows.net/testfiles/testzkp.zip",
"https://testocnfiles.blob.core.windows.net/testfiles/testzkp.zip",
2018-11-12 08:33:19 +01:00
],
links: [
{sample1: "http://data.ceda.ac.uk/badc/ukcp09/data/gridded-land-obs/gridded-land-obs-daily/"},
{sample2: "http://data.ceda.ac.uk/badc/ukcp09/data/gridded-land-obs/gridded-land-obs-averages-25km/"},
{fieldsDescription: "http://data.ceda.ac.uk/badc/ukcp09/"},
],
inLanguage: "en",
tags: "weather, uk, 2011, temperature, humidity",
price: 10,
} as MetaDataBase
const curation: Curation = {
rating: 0.93,
numVotes: 123,
schema: "Binary Votting",
} as Curation
const additionalInformation: AdditionalInformation = {
updateFrecuency: "yearly",
structuredMarkup: [
{
uri: "http://skos.um.es/unescothes/C01194/jsonld",
mediaType: "application/ld+json",
} as StructuredMarkup,
{
uri: "http://skos.um.es/unescothes/C01194/turtle",
mediaType: "text/turtle",
} as StructuredMarkup,
],
} as AdditionalInformation
2018-11-01 11:04:59 +01:00
export default class MetaData {
2018-11-16 14:26:26 +01:00
public additionalInformation: AdditionalInformation
2018-11-12 08:33:19 +01:00
public base: MetaDataBase
public curation: Curation
2018-11-01 11:04:59 +01:00
2018-11-12 08:33:19 +01:00
constructor(metaData?: MetaData) {
this.additionalInformation = (metaData && metaData.additionalInformation) || additionalInformation
this.base = (metaData && metaData.base) || base
this.curation = (metaData && metaData.curation) || curation
2018-11-12 08:33:19 +01:00
}
2018-11-01 11:04:59 +01:00
}