Skip to content

Commit a88797e

Browse files
g1zzm0BirgitBoss
andauthored
Add examples from the Part1 V3.0 RC01 (#57)
This patch adds the examples from the book Part I V3RC01 to the directory containing JSON examples. The examples are not conforming to the actual schema, which will be achieved in a future pull request. Co-authored-by: Birgit Boss <[email protected]>
1 parent 2ec5d79 commit a88797e

File tree

14 files changed

+304
-17
lines changed

14 files changed

+304
-17
lines changed

README.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,27 @@ This repository provides the specifications of Asset Administration Shell.
1616
## Schemas
1717

1818
We provide schemas of the Asset Administration Shell for JSON, RDF and XML.
19-
These schemas are part of the document series, part 1,
19+
These schemas are derived from the document series, part 1,
2020
["Details of the Asset Administration Shell"](
2121
https://www.plattform-i40.de/PI40/Redaktion/EN/Standardartikel/specification-administrationshell.html
2222
) published by [Platform Industrie 4.0](http://www.plattform-i40.de).
2323

2424
### JSON
2525

26-
The JSON schema is available at
27-
[schemas/json/](schemas/json/) and follows JSON Schema version [2019-09](
28-
https://json-schema.org/specification-links.html#2019-09-formerly-known-as-draft-8
29-
).
26+
The JSON schema, mapping rules and examples are available at
27+
[schemas/json/](schemas/json/).
3028

3129
### RDF
3230

33-
The [RDF](
34-
https://en.wikipedia.org/wiki/Resource_Description_Framework
35-
) data model is available at [schemas/rdf/](schemas/rdf/).
31+
The RDF data model, mapping rules and examples are available at [schemas/rdf/](schemas/rdf/).
3632

3733
### XML
3834

39-
The XML schema is available at [schemas/xml/](schemas/xml/).
35+
The XML schema, mapping rules and examples are available at [schemas/xml/](schemas/xml/).
4036

4137
### XMI
4238

43-
The [XMI](https://de.wikipedia.org/wiki/XML_Metadata_Interchange) file for the [UML](https://de.wikipedia.org/wiki/Unified_Modeling_Language) metamodel [schemas/xmi](schemas/xmi/) ([XMI 2.1](https://www.omg.org/spec/XMI/2.1/About-XMI/))
44-
39+
The XMI file for the UML metamodel [schemas/xmi/](schemas/xmi/).
4540

4641
## Releases
4742

schemas/json/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# JSON
2-
In the following repository an overview of the main concepts of the Asset Administration Shell [JSON](https://tools.ietf.org/html/rfc8259) serialization is presented. For import and export scenarios the metamodel of an Asset Administration Shell needs to be serialized. A serialization format is JSON (JavaScript Object Notation).
2+
In the following repository an overview of the main concepts of the Asset Administration Shell [JSON](https://tools.ietf.org/html/rfc8259) serialization is presented. For import and export scenarios the metamodel of an Asset Administration Shell needs to be serialized. A serialization format is JSON (JavaScript Object Notation). The JSON files follow the schema version [2019-09](https://json-schema.org/specification-links.html#2019-09-formerly-known-as-draft-8).
33

44
## JSON Mapping Rules
55
The main concepts of the JSON serialization are explained by the following rules.
@@ -15,4 +15,4 @@ One serialization describes one Asset Administration Shell environment, that is,
1515

1616
![Top level structure of an AssetAdministration Shell environment mapped to JSON](https://user-images.githubusercontent.com/1814815/147122261-ac77deea-e83e-422d-bff5-f005feaf98d4.png)
1717

18-
The resulting JSON is the [minimal valid JSON](examples/miniJsonExample.json)
18+
The resulting JSON is the [minimal valid JSON.](examples/miniJsonExample.json) More examples in the [example folder.](examples)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{ "modelType":{
2+
"name":"Property"
3+
},
4+
"kind":"Instance",
5+
"semanticId":{
6+
"keys":[
7+
{
8+
"type":"GlobalReference",
9+
"value":"0173-1#02-BAA120#007",
10+
"idType":"IRDI"
11+
}
12+
]
13+
},
14+
"idShort":"MaxRotationSpeed",
15+
"category":"PARAMETER",
16+
"value":"560",
17+
"valueType":"integer",
18+
}

schemas/json/examples/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Examples of the AAS meta model
2+
3+
## Example for Top-Level Structures
4+
One serialization describes one Asset Administration Shell environment, that is, a collection of Administration Shells. The root element of the Asset Administration Shell environment has 4 aggregations. For each identifiable class, one aggregation is provided, as required by rule 3.
5+
6+
![Top level structure of an AssetAdministration Shell environment mapped to JSON](https://user-images.githubusercontent.com/1814815/147122261-ac77deea-e83e-422d-bff5-f005feaf98d4.png)
7+
8+
The resulting JSON is the [minimal valid JSON.](miniJsonExample.json)
9+
10+
## Examples for References to Identifiables
11+
As required by rule 4, Identifiables are only allowed to be located in the top-level aggregations. In deeper parts of the structure only References to the corresponding Identifiable must be taken.
12+
In the Asset Administration Shell AAS1, the submodel S1 is only a Reference to the Submodel S1 instance in the top level Submodels aggregation.
13+
14+
![Submodel reference in AssetAdministrationShell for JSON](https://user-images.githubusercontent.com/1814815/147664807-91ff8c36-6ddd-4b25-88bb-8048483ff30f.png)
15+
16+
This results in the [exemplary JSON.](ReferencesJsonExample.json)
17+
18+
A ReferenceElement has a Reference as value. This Reference has an aggregation of keys which represents a key chain. The resolved key chain points to an element. In this example the ReferenceElement’s value points to a property of another submodel in another Asset Administration Shell environment. The first key is a global key with “local”-attribute set to false, i.e. the reference is not part of the own environment. The second key is a model key which is used to define the corresponding property in the other environment by its IdShort. It is best practice to use the shortest key chain if there are multiple options.
19+
20+
![Usage of ReferenceElement in JSON](https://user-images.githubusercontent.com/1814815/147664989-3f76ac5d-3c4b-4854-afe8-3e1e2d0db527.png)
21+
22+
This results in an [exemplary JSON.](ReferenceElement.json)
23+
24+
## Examples for GlobalReference
25+
Sometimes it is useful to refer to another standard or something that is not provided by the own Asset Administration Shell environment. In this example the semantics of a Property refers to ECLASS.
26+
27+
![Usage of GlobalReference in JSON](https://user-images.githubusercontent.com/1814815/147665086-1727a769-8a76-4b10-b22e-6d30beae6486.png)
28+
29+
This results in an [exemplary JSON.](GlobalReference.json)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"modelType":{
3+
"name":"ReferenceElement"
4+
},
5+
"kind":"Instance",
6+
"semanticId":{
7+
"keys":[
8+
{
9+
"type":"GlobalReference",
10+
"value":"0173-1#02-BAA120#007",
11+
"idType":"IRDI"
12+
}
13+
]
14+
},
15+
"idShort":"MaxRotationSpeed",
16+
"category":"PARAMETER",
17+
"value":{
18+
"keys":[
19+
{
20+
"idType":"IRI",
21+
"type":"Submodel",
22+
"value":"http://admin-shell.io/submodels/012"
23+
},
24+
{
25+
"idType":"IdShort",
26+
"type":"Property",
27+
"value":"MaxRotationSpeed"
28+
}
29+
]
30+
}
31+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"submodels":[
3+
{
4+
"modelType":{
5+
"name":"Submodel"
6+
},
7+
"idShort":"S1",
8+
"identification":{
9+
"id":"http://env.com/submodels/S1",
10+
"idType":"IRI"
11+
},
12+
"submodelElements":[]
13+
}
14+
],
15+
"conceptDescriptions":[],
16+
"assetAdministrationShells":[
17+
{
18+
"modelType":"AssetAdministrationShell",
19+
"submodels":[
20+
{
21+
"keys":[
22+
{
23+
"idType":"IRI",
24+
"type":"Submodel",
25+
"value":"http://env.com/submodels/S1"
26+
}
27+
]
28+
}
29+
]
30+
}
31+
],
32+
"assets":[]
33+
}

schemas/rdf/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# Resource Description Framework
22
The Resource Description Framework ([RDF](https://www.w3.org/TR/rdf11-primer/)) is recommended standard of the W3C to unambiguously model and present semantic data. RDF documents are structured in the form of triples, consisting of subjects, relations and objects. The resulting model is often interpreted as a graph, with the subject and object elements as the nodes and the relations as the graph edges.
3-
RDF is closely related to Web standards, illustrated by the fact that all elements are encoded using (HTTP-)URIs. As a common practice, the provision of additional information at the referenced location of an RDF entity directly allows the interlinking of entities based on the Web. This process, the following of links in order to discover related information, is called dereferencing a resource and is supported by any browser or web client. Connecting distributed data sources through the Web in the described manner is referenced by the term Linked Data. Connecting the available resources and capabilities of Linked Data with the expressiveness of the Asset Shell is one motivation for the RDF serialization.
3+
4+
RDF is closely related to Web standards, illustrated by the fact that all elements are encoded using (HTTP-)URIs. As a common practice, the provision of additional information at the referenced location of an RDF entity directly allows the interlinking of entities based on the Web. This process, the following of links in order to discover related information, is called dereferencing a resource and is supported by any browser or web client. Connecting distributed data sources through the Web in the described manner is referenced by the term Linked Data. Connecting the available resources and capabilities of Linked Data with the expressiveness of the Asset Shell is one motivation for the RDF serialization.
5+
46
In addition, RDF is the basis of a wide range of logical inference and reasoning techniques. Vocabularies like RDF Schema (RDFS) and the Web Ontology Language (OWL) combine the graph-based syntax of RDF with formal definitions and axioms. This allows automated reasoners to understand the relation between entities to some extent and draw conclusions.
7+
58
Combining both features, the RDF mapping of the Asset Administration Shell can provide the basis for complex queries and requests. SPARQL, the standard query language for the Semantic Web, can combine reasoning features with the integration of external data sources. In order to benefit of these abilities, the AAS requires a clear scheme of its RDF representation. In the following, the necessary transformation rules are presented, followed by an illustration of relevant parts of the scheme and an example. The complete [data model](shacl-schema.ttl) together with the [RDF scheme](rdf-ontology.ttl) are listed in this repository.
69

710
## RDF Mapping Rules
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Organization/OrganizationOfficialName>
2+
rdf:type aas:ConceptDescription ;
3+
<https://admin-shell.io/aas/3/0/RC01/Referable/idShort> "OrganizationName"^^xsd:string ;
4+
rdfs:label "OrganizationName"^^xsd:string ;
5+
<https://admin-shell.io/aas/3/0/RC01/Identifiable/identification>
6+
<http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Organization/OrganizationOfficialName> ;
7+
<https://admin-shell.io/aas/3/0/RC01/HasDataSpecification/dataSpecification> [ (1)
8+
rdf:type aas:Reference ;
9+
<https://admin-shell.io/aas/3/0/RC01/Reference/key> [
10+
a aas:Key ;
11+
<https://admin-shell.io/aas/3/0/RC01/Key/index> "0"^^xsd:integer ;
12+
<https://admin-shell.io/aas/3/0/RC01/Key/type> aas:GLOBAL_REFERENCE_KEY_ELEMENT ;
13+
<https://admin-shell.io/aas/3/0/RC01/Key/value>
14+
<http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360> ;
15+
<https://admin-shell.io/aas/3/0/RC01/Key/idType> aas:IRI_IDENTIFIER_TYPE ;
16+
] ;
17+
] ;
18+
<https://admin-shell.io/aas/3/0/RC01/ConceptDescription/content> [ (2)
19+
rdf:type aas:DataSpecificationIEC61360 ;
20+
<https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC01/DataSpecificationIEC61360/preferredName>
21+
"offizieller Name der Organisation"@de ;
22+
<https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC01/DataSpecificationIEC61360/preferredName>
23+
"official name of the organization"@en ;
24+
<https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC01/DataSpecificationIEC61360/shortName>
25+
"OrganizationOfficialName"@en ;
26+
<https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC01/DataSpecificationIEC61360/dataType>
27+
"STRING"^^xsd:string ;
28+
<https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC01/DataSpecificationIEC61360/definition>
29+
"Der offizielle Name der Organisation."@de ;
30+
] ;
31+
<https://admin-shell.io/aas/3/0/RC01/ConceptDescription/isCaseOf> [ (3)
32+
rdf:type aas:Reference ;
33+
<https://admin-shell.io/aas/3/0/RC01/Reference/key> [
34+
a aas:Key ;
35+
<https://admin-shell.io/aas/3/0/RC01/Key/index> "0"^^xsd:integer ;
36+
<https://admin-shell.io/aas/3/0/RC01/Key/type> aas:CONCEPT_DESCRIPTION_IDENTIFIABLE_ELEMENT ;
37+
<https://admin-shell.io/aas/3/0/RC01/Key/value> "0173-1#02-AAO677#002"^^xsd:string ;
38+
<https://admin-shell.io/aas/3/0/RC01/Key/idType> aas:IRDI_IDENTIFIER_TYPE ;
39+
] ;
40+
];

schemas/rdf/examples/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Examples of the AAS meta model in RDF
2+
3+
## Example Overview
4+
RDF is often regarded as a graph model, as it provides the flexibility to interlink entities at any stage. In the following, the running example is originally provided in Turtle but accompanied with visualizations of the represented graph. Attributes referencing non-literal values are shown as directed links while Literal values are drawn together with the corresponding entity itself. In order to increase readability, the namespace declarating sections are omitted. The instances of the core classes, the AssetAdministrationShell, the Asset, Submodels, and ConceptDescriptions are shown in the figure below. The AssetAdministrationShell is provided in the [RDF file](rdf-ontology.ttl). The RDF identifiers are visualized in a condensed format in the figure but represent complete URIs, as displayed in Table 18.One can see the additionally inserted triples for rdf:type (1), rdfs:label (2), and rdfs:comment (3) as determined by Rule 4. The first attribute states the instance’ class. The second provides its commonly used name, for instance based on the idShort attribute. rdfs:comment supplies a short description about the regarded entity, based on the description value. The generally available tools, for instance the open source tool Protégé, interpret these attributes and display the correct class hierarchy, render the elements with their labels or supply short explanations based on the comments.
5+
6+
![Simplified graph of the core classes in the example](https://user-images.githubusercontent.com/1814815/147125320-3f8486d0-6269-48b6-b1ae-645db7a0bf33.png)
7+
8+
## Example Schema Shape
9+
The Shapes Constraint Language (SHACL) [38] introduces a W3C recommendation for validation mechanisms on RDF graphs. The definition of required attributes, cardinality of relations or datatype restrictions in the form of shapes (see Table 19 for an example shape) is an important aspect to enable data quality assurance in any productive system. Some tools are already created to assist the creation of SHACL shapes, e.g. a Protégé plugin and as a part of TopBraid Composer. As SHACL shapes are also defined in RDF, they share the same format and thereby reduce the required technology stack and reduces the amount of necessary libraries.
10+
The example can be found [here](AAS_Reference_shortExample.ttl).
11+
12+
## IRI Mapping
13+
Every enitiy in RDF is either a Resource or a Literal. While Literals present data values, like strings, numbers or any sequence of characters, Resources represent the nodes and edges in the data graph. As Resources must be identified through IRIs (preferable even URIs), the creation of suitable IRIs is fundamental for the mapping. Whenever resources of an AAS are already identified through IRIs (see also Section 4.4.6), these IRIs/URIs are also utilized in the RDF model. However, in cases where no IRI is given, a defined procedure has to be followed. The following decision steps determine the necessary steps in order to create an unambiguous IRI for every element of the AAS.
14+
These steps are only executed once per distinct element. If elements occur more than one time, always the same IRI identifier has to be used. This is especially relevant for the fallback solution (2b and 3) where the initial character sequence must be reused. Different elements must not get the same sequence under any circumstances.
15+
16+
1. If the element has IdentifierType = "IRI":
17+
Use the value of the identification attribute, else:
18+
2. If the enclosing AAS has an IdentifierType = "IRI":
19+
a. If the element inherits from Referable: Apply the template:
20+
<AAS identification URI>/<path/to/element>/<idShort>, where the path to the element is the concatenation of the respective idShorts separated by slashes, else:
21+
b. Apply the template: <AAS identification URI>/<path/to/element>/<random characters>
22+
3. Use randomized character sequence: <scheme>://<random characters>
23+
24+
## Example Mapping
25+
Several mapping languages have been created in order to transform structured data into RDF graphs. Most prominently, R2RML (relational data only) and RML (relational data, XML, JSON, etc.) are used to specify the necessary mappings. A RML mapping can be used to transform a given Asset Administration Shell from its XML or JSON serialization to any potential RDF serialization. The snippet in Table 20 illustrates an RML TriplesMap used to convert the XML example from Annex E. The AssetAdministrationShell elements are iterated (rml:logicalSource) and, among others, all relations to referenced Submodels are extracted (rr:predicateObjectMap).
26+
The example can be found [here](AssetAdministrationShell_Example.ttl).
27+
28+
## Example Submodel with Property
29+
Submodels contain the relevant information for a use case. Figure 93 shows the Identification Submodel with the Property containing the manufacturer of the asset. In the RDF terminology, every relation actually is called a property. In the data model of the Asset Administration Shell however, a Property is a defined sub class of the SubmodelElement. The distinction is made through the namespace: rdf:Property for every relation, aas:Property for certain SubmodelElements (see Table 20).
30+
31+
![Graph of the relations between a Submodel (F13E8576F6488342) and a Property (Manufacturer)](https://user-images.githubusercontent.com/1814815/147669163-c0147930-204c-40ed-aa32-9773795cb19d.png)
32+
33+
The example can be found [here](Submodel_SubmodelElement_Example.ttl).
34+
35+
## Example MultiLanguage String
36+
The Identification Submodel in Table 22 has two descriptions, one in English and one in German. RDF proposes the usage of LangStrings, typed Literals with a language tag. Table 23 illustrates, how Rule 7 leads to different object values.
37+
The example can be found [here](AAS_Reference_shortExample.ttl).
38+
39+
## Example Concept Description
40+
A Concept Description defines the meaning of the entities used in the Asset Administration Shells, Assets, and Submodels. Table 24 illustrates a description for the organization name of a constant. The core building blocks of the example are the reference to the data specification key (1), the actual content conforming to IEC 61360 (2), and the reference to the actual identifier in the previously used elements (3).
41+
The example can be found [here](ConceptDescriptionExample.ttl).

0 commit comments

Comments
 (0)