Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "BaSyx / Documentation / API / Submodel"

(Created page with "BaSyx sub models are objects with properties and operations. They are parts of Asset Administration Shells (AAS), but may be deployed on different physical locations. Sub mode...")
 
m (Replaces Submodel API with swagger hub link)
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
BaSyx sub models are objects with properties and operations. They are parts of Asset Administration Shells (AAS), but may be deployed on different physical locations. Sub models and Asset Administration Shells are bidirectionally linked; Asset Administration Shells refer to "their" sub models, and sub models refer to their Asset Administration Shell. BaSyx submodel providers enable access to sub models. A sub model provider needs to implement the submodel provider API that is described on this wiki page. The sub model provider API enables access to properties and operations of BaSyx submodel providers. The BaSys sub model proider API provides a facade to numerous data sources. The BaSyx common components package implements sub model providers that read properties from SQL data bases, via XQuery, and from configuration files. Furthermore, the BaSyx SDK enables creation of additional sub model provider types that provide e.g. live data from devices or integrate new data sources into a production environment.  
+
"A Submodel defines a specific aspect of the asset represented by the Asset Administration Shell. A Submodel is used to structure the virtual representation and technical functionality of an Administration Shell into distinguishable parts. Each Submodel refers to a well-defined domain or subject matter. Submodels can become standardized and thus become submodels types. Submodels can have different life-cycles." (Details of the Asset Administration Shell, 2018, p. 46, [https://www.plattform-i40.de/PI40/Redaktion/DE/Downloads/Publikation/2018-verwaltungsschale-im-detail.pdf])
  
The BaSyx sub model provider API is defined as following:
+
Amongst the official attributes of Submodels, BaSyx defines aggregates called data elements, operations and events. These aggregates are used to structure official SubmodelElements (Property, ReferenceElement, Event, Operation, etc.) into groups of same functionality, i.e.
 +
* DataElements as collection for value-based properties
 +
* Operations as collection for callable methods
 +
* Events as collection for events descriptions.
  
 +
But the information model of a Submodel is only one side of the coin. BaSyx follows a distributed approach, i.e. Submodels may be deployed in distributed infrastructure. Asset Administration Shells only refer to their Submodels by terms of a reference comprising the Submodel's endpoints. They do not know about their Submodels' content but they know the way to it. On the other side, Submodels may reference their Asset Administration Shells as well via a parent attribute.
  
{| class="wikitable" style="background-color:LightCyan;"
+
In order to access the Submodel's content, BaSyx defines so-called Submodel Service Providers. These Service Providers are used to make data elements, operations and events accessible by defining various access methods, e.g. GET- and SET- resp. MethodCalled-handler. Initially, on an abstract level, there is no technology binding necessary to build or use a service provider. Later of course, when starting the runtime, BaSyx provides highly generic technology bindings which can be used to grant access to the Submodel's content via chosen technology (HTTP/REST, OPC UA, BaSyx native).
| style="color:blue" | GET  
+
| /aas
+
| '''Description'''
+
* Returns the Asset Administration Shell that this sub model belongs to
+
  
 +
In a nutshell, BaSyx Submodel Service Providers enable access to Submodels' content. A Submodel Service Provider needs to implement the generic Submodel Service Provider interface that is exemplary described on this page in HTTP/REST technology. The Submodel Service Provider enables access to data elements, operations and events. The BaSyx Submodel Service Provider may provide a façade hiding numerous (proprietary) data sources, e.g. SQL databases, XML configuration files, AutomationML, Hashmaps, Lambda, XQuery and many more. Furthermore, the BaSyx SDK enables creation of custom Submodel Service Providers. This is done by deriving from abstract BaSyx Service Provider interfaces.
  
'''Response codes'''
+
The BaSyx Submodel Service Provider HTTP/REST API is explained [https://app.swaggerhub.com/apis/BaSyx/basyx_submodel_http_rest_api/v1 here].
* 200: Returns JSON-serialized list of Returns the request Asset Administration Shell
+
* 400: Bad Request
+
* 502: Bad Gateway
+
 
+
|- style="background-color:#LightCyan;"
+
| style="color:blue" | GET
+
| /aas/submodels
+
| '''Description'''
+
* Retrieves all SubModels from the Asset Administration Shell that the sub model belongs to
+
 
+
 
+
'''Response codes'''
+
* 200: Returns a list of found SubModels
+
* 404: No sub models found
+
* 502: Bad Gateway
+
 
+
|- style="background-color:#d3f8d3;"
+
| style="color:SeaGreen" | POST
+
| /aas/submodels
+
| '''Description'''
+
* Adds a new SubModel to an existing Asset Administration Shell
+
 
+
 
+
'''Parameter'''
+
* ''(body)'': JSON serialized submodel description for Asset Administration Shell
+
 
+
 
+
'''Response codes'''
+
* 201: SubModel created successfully
+
* 400: Bad Request
+
* 502: Bad Gateway
+
 
+
|- style="background-color:LightCyan;"
+
| style="color:blue" | GET
+
| /aas/submodels/{subModelId}
+
| '''Description'''
+
* Retrieves a specific SubModel structure from a specific Asset Administration Shell
+
 
+
 
+
'''Parameter'''
+
* ''subModelId'': Unique ID of the requested sub model
+
 
+
 
+
'''Response codes'''
+
* 200: Returns the requested SubModel
+
* 404: No SubModel found
+
* 502: Bad Gateway
+
 
+
|- style="background-color:#ffe6ea;"
+
| style="color:DarkRed" | DELETE
+
| /aas/submodels/{subModelId}
+
| '''Description'''
+
* Deletes a specific SubModel from a specific Asset Administration Shell
+
 
+
 
+
'''Parameter'''
+
* ''subModelId'': Unique ID of the sub model to be deleted
+
 
+
 
+
'''Response codes'''
+
* 204: SubModel deleted successfully
+
* 400: Bad Request
+
* 502: Bad Gateway
+
 
+
|- style="background-color:LightCyan;"
+
| style="color:blue" | GET
+
| /aas/submodels/{subModelId}/properties
+
| '''Description'''
+
* Retrieves all properties from the addressed sub model
+
 
+
 
+
'''Parameter'''
+
* ''subModelId'': Unique ID of the addressed sub model
+
 
+
 
+
'''Response codes'''
+
* 200: Returns property list
+
* 404: No properties found
+
* 502: Bad Gateway
+
 
+
|- style="background-color:#d3f8d3;"
+
| style="color:SeaGreen" | POST
+
| /aas/submodels/{subModelId}/properties
+
| '''Description'''
+
* Adds a new property to the sub model
+
 
+
 
+
'''Parameter'''
+
* ''subModelId'': Unique ID of the addressed sub model
+
* ''(body)'': The property description object
+
 
+
'''Response codes'''
+
* 201: Property created successfully
+
* 400: Bad Request
+
* 502: Bad Gateway
+
 
+
|- style="background-color:LightCyan;"
+
| style="color:blue" | GET
+
| /aas/submodels/{subModelId}/operations
+
| '''Description'''
+
* Retrieves all operations from the addressed sub model
+
 
+
 
+
'''Parameter'''
+
* ''subModelId'': Unique ID of the addressed sub model
+
 
+
 
+
'''Response codes'''
+
* 200: Returns property list
+
* 404: No operations found
+
* 502: Bad Gateway
+
 
+
|- style="background-color:#d3f8d3;"
+
| style="color:SeaGreen" | POST
+
| /aas/submodels/{subModelId}/properties
+
| '''Description'''
+
* Adds a new operation to the sub model
+
 
+
 
+
'''Parameter'''
+
* ''subModelId'': Unique ID of the addressed sub model
+
* ''(body)'': The operation description object
+
 
+
 
+
'''Response codes'''
+
* 201: Operation created successfully
+
* 400: Bad Request
+
* 502: Bad Gateway
+
 
+
|- style="background-color:LightCyan;"
+
| style="color:blue" | GET
+
| /aas/submodels/{subModelId}/properties/{propertyId}
+
| '''Description'''
+
* Retrieves a specific property from a sub model
+
 
+
 
+
'''Parameter'''
+
* ''subModelId'': Unique ID of the addressed sub model
+
* ''propertyId'': (qualified) name of the addressed property
+
 
+
 
+
'''Response codes'''
+
* 200: Returns property list
+
* 404: No property found
+
* 502: Bad Gateway
+
 
+
|- style="background-color:LemonChiffon;"
+
| style="color:Sienna" | PUT
+
| /aas/submodels/{subModelId}/properties/{propertyId}
+
| '''Description'''
+
* Sets the value of a sub model property
+
 
+
 
+
'''Parameter'''
+
* ''subModelId'': Unique ID of the addressed sub model
+
* ''propertyId'': (qualified) name of the addressed property
+
 
+
 
+
'''Response codes'''
+
* 204: Property value changed successfully
+
* 404: No Property found
+
* 502: Bad Gateway
+
 
+
|- style="background-color:#ffe6ea;"
+
| style="color:DarkRed" | DELETE
+
| /aas/submodels/{subModelId}/properties/{propertyId}
+
| '''Description'''
+
* Deletes a sub model property
+
 
+
'''Parameter'''
+
* ''subModelId'': Unique ID of the addressed sub model
+
* ''propertyId'': (qualified) name of the addressed property
+
 
+
 
+
'''Response codes'''
+
* 204: Property deleted successfully
+
* 400: Bad Request
+
* 502: Bad Gateway
+
 
+
|- style="background-color:LightCyan;"
+
| style="color:blue" | GET
+
| /aas/submodels/{subModelId}/properties/{operationId}
+
| '''Description'''
+
* Retrieves a specific operation descriptor from a sub model
+
 
+
 
+
'''Parameter'''
+
* ''subModelId'': Unique ID of the addressed sub model
+
* ''operationId'': (qualified) name of the addressed operation
+
 
+
 
+
'''Response codes'''
+
* 200: Returns requested operation descriptor
+
* 404: No operationfound
+
* 502: Bad Gateway
+
 
+
|- style="background-color:#d3f8d3;"
+
| style="color:SeaGreen" | POST
+
| /aas/submodels/{subModelId}/properties/{operationId}
+
| '''Description'''
+
* Invokes a sub model operation with the specified list of parameter
+
 
+
 
+
'''Parameter'''
+
* ''subModelId'': Unique ID of the addressed sub model
+
* ''operationId'': (qualified) name of the addressed operation
+
 
+
 
+
'''Response codes'''
+
* 204: Operation invoked successfully
+
* 400: Bad Request
+
* 502: Bad Gateway
+
 
+
|- style="background-color:#ffe6ea;"
+
| style="color:DarkRed" | DELETE
+
| /aas/submodels/{subModelId}/properties/{propertyId}
+
| '''Description'''
+
* Deletes a sub model operation
+
 
+
 
+
'''Parameter'''
+
* ''subModelId'': Unique ID of the addressed sub model
+
* ''operationId'': (qualified) name of the addressed operation
+
 
+
 
+
'''Response codes'''
+
* 204: Operation deleted successfully
+
* 400: Bad Request
+
* 502: Bad Gateway
+
|}
+
 
+
 
+
{| class="wikitable"
+
| BaSyx project links:  [[BaSyx | Project BaSyx main wiki page]]  <nowiki>|</nowiki>  [[BaSyx.WhatIsBasyx | What is BaSyx?]]  <nowiki>|</nowiki>  [[BaSyx.Documentation | BaSyx Developer Documentation]]
+
|}
+

Latest revision as of 02:39, 30 October 2020

"A Submodel defines a specific aspect of the asset represented by the Asset Administration Shell. A Submodel is used to structure the virtual representation and technical functionality of an Administration Shell into distinguishable parts. Each Submodel refers to a well-defined domain or subject matter. Submodels can become standardized and thus become submodels types. Submodels can have different life-cycles." (Details of the Asset Administration Shell, 2018, p. 46, [1])

Amongst the official attributes of Submodels, BaSyx defines aggregates called data elements, operations and events. These aggregates are used to structure official SubmodelElements (Property, ReferenceElement, Event, Operation, etc.) into groups of same functionality, i.e.

  • DataElements as collection for value-based properties
  • Operations as collection for callable methods
  • Events as collection for events descriptions.

But the information model of a Submodel is only one side of the coin. BaSyx follows a distributed approach, i.e. Submodels may be deployed in distributed infrastructure. Asset Administration Shells only refer to their Submodels by terms of a reference comprising the Submodel's endpoints. They do not know about their Submodels' content but they know the way to it. On the other side, Submodels may reference their Asset Administration Shells as well via a parent attribute.

In order to access the Submodel's content, BaSyx defines so-called Submodel Service Providers. These Service Providers are used to make data elements, operations and events accessible by defining various access methods, e.g. GET- and SET- resp. MethodCalled-handler. Initially, on an abstract level, there is no technology binding necessary to build or use a service provider. Later of course, when starting the runtime, BaSyx provides highly generic technology bindings which can be used to grant access to the Submodel's content via chosen technology (HTTP/REST, OPC UA, BaSyx native).

In a nutshell, BaSyx Submodel Service Providers enable access to Submodels' content. A Submodel Service Provider needs to implement the generic Submodel Service Provider interface that is exemplary described on this page in HTTP/REST technology. The Submodel Service Provider enables access to data elements, operations and events. The BaSyx Submodel Service Provider may provide a façade hiding numerous (proprietary) data sources, e.g. SQL databases, XML configuration files, AutomationML, Hashmaps, Lambda, XQuery and many more. Furthermore, the BaSyx SDK enables creation of custom Submodel Service Providers. This is done by deriving from abstract BaSyx Service Provider interfaces.

The BaSyx Submodel Service Provider HTTP/REST API is explained here.

Back to the top