S3I data model v3
Summarized based on the previous issues #5 #10 #11, we propose here the version of the new S3I Directory information model V3.
And an example harvester meta model:
{
"thingId": "s3i:4711",
"policyId": "s3i:4711",
"attributes":{
"apiVersion": "3.0",
"dataModel": "fml40",
"name": "Harvester",
"description": "Meta model of example harvester",
"type": "component",
"publicKey": "xxasrgrgs",
"roles": ["fml40::Harvester"],
"values": {
"ml40::Location": {
"description": "Geolocation of Harvester",
"valueSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"longitude": {"type": "double"},
"latitude": {"type": "double"}
}
},
"endpoints": [
{
"uri": "amqp://:ACCESS_TOKEN@rabbitmq.s3i.vswf.dev:5672/s3i?exchange=demo.exchange?routingKey=s3ibs://s3i:4711",
"contentType": "application/json",
"isMessageBased": true,
"requestSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "s3i-b get value request",
"type": "object",
"properties": {
"identifier": {"type": "string"},
"sender": {"type": "string"},
"receivers": {
"type": "array",
"items": {"type": "string"}
},
"attributePath": {"type": "string"},
"replyingToEndpoint": {"type": "string"},
"messageType": {"type": "string"}
}
},
"responseSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "s3i-b get value reply",
"type": "object",
"properties": {
"identifier": {"type": "string"},
"sender": {"type": "string"},
"receivers": {
"type": "array",
"items": {"type": "string"}
},
"value": {"type": "double"},
"replyingToEndpoint": {"type": "string"}
}
}
},
{
"uri": "https://broker.s3i.vswf.dev/s3ibs://s3i:4711",
"contentType": "application/json",
"methods": ["POST"],
"isMessageBased": true,
"requestSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "s3i-b get value request",
"type": "object",
"properties": {
"identifier": {"type": "string"},
"sender": {"type": "string"},
"receivers": {
"type": "array",
"items": {"type": "string"}
},
"attributePath": {"type": "string"},
"replyingToEndpoint": {"type": "string"},
"messageType": {"type": "string"}
}
}
},
{
"uri": "https://broker.s3i.vswf.dev/s3ibs://s3i:4711",
"contentType": "application/json",
"methods": ["GET"],
"isMessageBased": true,
"responseSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "s3i-b get value reply",
"type": "object",
"properties": {
"identifier": {"type": "string"},
"sender": {"type": "string"},
"receivers": {
"type": "array",
"items": {"type": "string"}
},
"value": {"type": "double"},
"replyingToEndpoint": {"type": "string"}
}
}
}
]
}
},
"services": {
"fml40::AcceptsFellingJob/accept": {
"description": "ForestML 4.0 accept felling job request",
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"job": {
"type": "object",
"properties": {
"identifier": "string",
"cuttingLength": "number"
}
}
}
},
"outputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"ok": {
"type": "boolean"
}
}
},
"endpoints": [
{
"uri": "amqp://:ACCESS_TOKEN/rabbitmq.s3i.vswf.dev/s3i:5672?exchange=demo.exchange?routingKey=s3ibs://s3i:4711",
"contentType": "application/json",
"isMessageBased": true,
"requestSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"description": "s3i-b service request",
"properties": {
"identifier": {"type": "string"},
"sender": {"type": "string"},
"receivers": {
"type": "array",
"items": {"type": "string"}
},
"serviceType": {"type": "string"},
"parameters": "#/services/fml40::AcceptsFellingJob/accept/inputSchema",
"replyingToEndpoint": {"type": "string"}
}
},
"responseSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"description": "s3i-b service reply",
"properties": {
"identifier": {"type": "string"},
"sender": {"type": "string"},
"receivers": {
"type": "array",
"items": {"type": "string"}
},
"serviceType": {"type": "string"},
"results": {
"type": "object",
"properties": {
"ok": {
"type": "boolean"
}
}
},
"replyToMessage": {"type": "string"}
}
}
}
]
}
},
"events": {
"s3i:4711.newLocation": {
"description": "event emitted if location changed",
"eventSchema":{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"identifier": {"type": "string"},
"sender": {"type": "string"},
"topic": {"type": "string"},
"timestamp": {"type": "number"},
"messageType": {"type": "string"},
"content": {
"type": "object",
"properties": "#/values/ml40::Location/valueSchema"
}
}
},
"endpoints": [
{
"uri": "amqp://:ACCESS_TOKEN/rabbitmq.s3i.vswf.dev/s3i:5672?exchange=event_exchange?routingKey=s3i:4711newLocation",
"contentType": "application/json",
"isMessageBased": true
}
]
}
},
"linksToPerson": {
"ownedBy": {
"targets": ["s3i:forest_owner_müller_4711"]
}
},
"linksToThing": {
"controlledBy": {
"targets": ["s3i:fbz_4711"]
},
"child": {
"targets": ["s3i:smart_forestry_hsm_dummy_harvester_4711"]
}
}
}
}