16
16
17
17
## Introduction
18
18
19
- The main purpose of this package it to allow users to load and parse one or
20
- more [ .ttl files ] ( < https://en.wikipedia .org/wiki/Turtle_(syntax) > ) into native TypeScript objects .
19
+ This project enables developers to effortlessly load and parse one or more [ .ttl files ] ( < https://en.wikipedia.org/wiki/Turtle_(syntax) > )
20
+ and instantiate native TypeScript objects of the pared [ SAMM ] ( < https://projects.eclipse .org/projects/dt.esmf > ) semantic concepts .
21
21
22
22
## Getting help
23
23
@@ -39,7 +39,7 @@ npm install @esmf/aspect-model-loader
39
39
40
40
## Usage
41
41
42
- This package contains two methods for loading ttl files(string value of the .ttl files).
42
+ Instantiating an Aspect the following two methods for loading ttl files(string value of the .ttl files) are provided .
43
43
44
44
Load an aspect model which is self-contained (includes no imports to other ttl file):
45
45
@@ -49,16 +49,27 @@ new AspectModelLoader().loadSelfContainedModel(ttl).subscribe((aspect: Aspect) =
49
49
});
50
50
```
51
51
52
- or if the model contains imports to additional ttl files:
52
+ or if the model contains imports to further ttl files:
53
53
54
54
```
55
- new AspectModelLoader().load('<aspect-model-urn>', ttl-1, ttl-2, ttl-3).subscribe((aspect: Aspect) => {
55
+ new AspectModelLoader().load('<aspect-model-urn>', ttl-1, ttl-2, ttl-3, ...).subscribe((aspect: Aspect) => {
56
+ ...
57
+ });
58
+ ```
59
+
60
+ Besides loading an aspect the project also supports to load and group the SAMM definitions by namespace.
61
+
62
+ Load all namespace and related SAMM semantic concepts:
63
+
64
+ ```
65
+ new NamespaceLoader().load(ttl-1, ttl-2, ttl-3, ...).subscribe((namespaces: Observable<Map<string, Array<BaseMetaModelElement>>>) => {
56
66
...
57
67
});
58
68
```
59
69
60
70
If you are using external .ttl files you may need to parse the contents of these files to strings, to be passed to the
61
- methods params.
71
+ methods params. Further all .ttl files must use the same SAMM version. Loading SAMM semantic concepts from different .ttl files
72
+ having different SAMM versions is not supported yet.
62
73
63
74
## Helpful functions
64
75
0 commit comments