### Install Aspect Model Loader Source: https://github.com/eclipse-esmf/esmf-sdk-js-aspect-model-loader/blob/main/README.md Install the Aspect Model Loader package from npm. This is the initial step to begin using the SDK. ```bash npm install @esmf/aspect-model-loader ``` -------------------------------- ### Install ESMF SDK JS Aspect Model Loader Source: https://github.com/eclipse-esmf/esmf-sdk-js-aspect-model-loader/blob/main/documentation/js-sdk-aml-guide/modules/ROOT/pages/index.adoc Install the Aspect Model loader from the GitHub release repository using npm. Ensure you replace `{esmf-sdk-js-aspect-model-loader-version}` with the correct version number. ```shell npm install https://github.com/eclipse-esmf/esmf-sdk-js-aspect-model-loader/releases/download/v{esmf-sdk-js-aspect-model-loader-version}/esmf-aspect-model-loader-{esmf-sdk-js-aspect-model-loader-version}.tgz ``` -------------------------------- ### License Header Template Source: https://github.com/eclipse-esmf/esmf-sdk-js-aspect-model-loader/blob/main/CONTRIBUTING.md This template should be used for license and copyright headers in all contributed files. Replace placeholders with actual company names and years. ```text /* * Copyright (c) {YEAR} {NAME OF COMPANY X} * Copyright (c) {YEAR} {NAME OF COMPANY Y} * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. * * SPDX-License-Identifier: MPL-2.0 */ ``` -------------------------------- ### Build Aspect Model Loader Library Source: https://github.com/eclipse-esmf/esmf-sdk-js-aspect-model-loader/blob/main/documentation/js-sdk-aml-guide/modules/ROOT/pages/index.adoc Build the Aspect Model loader library by running the `npm run build` command. This command compiles the source code and creates the distributable library files. ```bash npm run build ``` -------------------------------- ### Git Version Tag Syntax Source: https://github.com/eclipse-esmf/esmf-sdk-js-aspect-model-loader/blob/main/CONTRIBUTING.md Specifies the syntax for Git version tags, including pre-release identifiers. ```text vX.Y.Z-[pre-release-identifier] Examples: v1.0.0-RC1, v1.0.0 ``` -------------------------------- ### Update Index Files Source: https://github.com/eclipse-esmf/esmf-sdk-js-aspect-model-loader/blob/main/documentation/js-sdk-aml-guide/modules/ROOT/pages/index.adoc Update all index files under the `src` directory using the `ctix create ./src` command. This is useful for managing module exports in TypeScript projects. ```bash ctix create ./src ``` -------------------------------- ### Semantic Versioning Format Source: https://github.com/eclipse-esmf/esmf-sdk-js-aspect-model-loader/blob/main/CONTRIBUTING.md Defines the MAJOR.MINOR.PATCH format for versioning, including rules for incrementing each component based on the nature of changes. ```text Given a version number MAJOR.MINOR.PATCH, increment the: - MAJOR version when you make incompatible API changes, - MINOR version when you add functionality in a backwards compatible manner, and - PATCH version when you make backwards compatible bug fixes. Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format. ``` -------------------------------- ### Load and Group Namespaces Source: https://github.com/eclipse-esmf/esmf-sdk-js-aspect-model-loader/blob/main/README.md Load and group SAMM definitions by namespace. This is useful for organizing semantic concepts from multiple .ttl files. ```typescript new NamespaceLoader().load(ttl-1, ttl-2, ttl-3, ...).subscribe((namespaces: Observable>>) => { ... }); ``` -------------------------------- ### Load Aspect Model with Imports Source: https://github.com/eclipse-esmf/esmf-sdk-js-aspect-model-loader/blob/main/README.md Load an aspect model that may contain imports to other .ttl files. Provide the URN of the model and the string content of each .ttl file. ```typescript new AspectModelLoader().load('', ttl-1, ttl-2, ttl-3, ...).subscribe((aspect: Aspect) => { ... }); ``` -------------------------------- ### Load Aspect Model with Imports Source: https://github.com/eclipse-esmf/esmf-sdk-js-aspect-model-loader/blob/main/documentation/js-sdk-aml-guide/modules/ROOT/pages/index.adoc Load an Aspect Model that contains imports to other .ttl files. Pass the URN of the main model and the string contents of the imported .ttl files as arguments to the `load` method. The loaded model is provided as an observable Aspect object. ```javascript new AspectModelLoader().load('', ttl-1, ttl-2, ttl-3).subscribe((aspect: Aspect) => { ... }); ``` -------------------------------- ### Load Self-Contained Aspect Model Source: https://github.com/eclipse-esmf/esmf-sdk-js-aspect-model-loader/blob/main/documentation/js-sdk-aml-guide/modules/ROOT/pages/index.adoc Load a self-contained Aspect Model (a .ttl file that includes no imports) using the `loadSelfContainedModel` method. The loaded model is provided as an observable Aspect object. ```javascript new AspectModelLoader().loadSelfContainedModel(ttl).subscribe((aspect: Aspect) => { ... }); ``` -------------------------------- ### Load Self-Contained Aspect Model Source: https://github.com/eclipse-esmf/esmf-sdk-js-aspect-model-loader/blob/main/README.md Use this method to load an aspect model that does not import other .ttl files. The .ttl content is provided as a string. ```typescript new AspectModelLoader().loadSelfContainedModel(ttl).subscribe((aspect: Aspect) => { ... }); ``` -------------------------------- ### Find Model Element by URN Source: https://github.com/eclipse-esmf/esmf-sdk-js-aspect-model-loader/blob/main/documentation/js-sdk-aml-guide/modules/ROOT/pages/index.adoc Use the `findByUrn` helper function to find a specific model element within the loaded Aspect Model using its URN. Returns the element if found, otherwise returns undefined. ```javascript let specificElement = loader.findByUrn(options.urnSelectedModelElement) ``` -------------------------------- ### Find Model Element by Name Source: https://github.com/eclipse-esmf/esmf-sdk-js-aspect-model-loader/blob/main/documentation/js-sdk-aml-guide/modules/ROOT/pages/index.adoc Use the `findByName` helper function to find specific model elements within the loaded Aspect Model by their name. Returns an array of found elements. ```javascript let specificElement = loader.findByName(options.selectedModelName) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.