DDO schema updates

This commit is contained in:
Matthias Kretschmann 2019-11-20 11:50:17 +01:00
parent 7cf8c61be0
commit 14df1d877b
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 11 additions and 14 deletions

View File

@ -1,8 +1,9 @@
const asset = { const asset = {
base: { main: {
name: '10 Monkey Species Small', name: '10 Monkey Species Small',
dateCreated: '2012-02-01T10:55:11Z', dateCreated: '2012-02-01T10:55:11Z',
author: 'Mario', author: 'Mario',
type: 'dataset',
license: 'CC0: Public Domain', license: 'CC0: Public Domain',
price: '0', price: '0',
files: [ files: [
@ -11,7 +12,7 @@ const asset = {
contentType: 'application/zip', contentType: 'application/zip',
checksum: '2bf9d229d110d1976cdf85e9f3256c7f', checksum: '2bf9d229d110d1976cdf85e9f3256c7f',
checksumType: 'MD5', checksumType: 'MD5',
contentLength: 12057507, contentLength: '12057507',
compression: 'zip', compression: 'zip',
encoding: 'UTF-8', encoding: 'UTF-8',
url: url:
@ -22,19 +23,15 @@ const asset = {
contentType: 'text/txt', contentType: 'text/txt',
checksum: '354d19c0733c47ef3a6cce5b633116b0', checksum: '354d19c0733c47ef3a6cce5b633116b0',
checksumType: 'MD5', checksumType: 'MD5',
contentLength: 928, contentLength: '928',
url: url:
'https://s3.amazonaws.com/datacommons-seeding-us-east/10_Monkey_Species_Small/assets/monkey_labels.txt', 'https://s3.amazonaws.com/datacommons-seeding-us-east/10_Monkey_Species_Small/assets/monkey_labels.txt'
resourceId: 'test'
},
{
index: 2
} }
], ]
checksum: '', },
additionalInformation: {
categories: ['image'], categories: ['image'],
tags: ['image data', 'classification', 'animals'], tags: ['image data', 'classification', 'animals'],
type: 'dataset',
description: 'EXAMPLE ONLY ', description: 'EXAMPLE ONLY ',
copyrightHolder: 'Unknown', copyrightHolder: 'Unknown',
workExample: 'image path, id, label', workExample: 'image path, id, label',

View File

@ -73,18 +73,18 @@ class App extends Component {
// get first asset from search results // get first asset from search results
const consumeAsset = this.state.results[0] const consumeAsset = this.state.results[0]
// get service we want to execute // get service we want to execute
const service = consumeAsset.findServiceByType('Access') const service = consumeAsset.findServiceByType('access')
// order service agreement // order service agreement
const agreement = await this.state.ocean.assets.order( const agreement = await this.state.ocean.assets.order(
consumeAsset.id, consumeAsset.id,
service.serviceDefinitionId, service.index,
accounts[0] accounts[0]
) )
// consume it // consume it
await this.state.ocean.assets.consume( await this.state.ocean.assets.consume(
agreement, agreement,
consumeAsset.id, consumeAsset.id,
service.serviceDefinitionId, service.index,
accounts[0], accounts[0],
'', '',
0 0