Giter VIP home page Giter VIP logo

esmf-sdk-js-aspect-model-loader's Introduction

ESMF JS SDK :: Aspect Model Loader ๐Ÿš€

Table of Contents

Introduction

This project enables developers to effortlessly load and parse one or more .ttl files and instantiate native TypeScript objects of the pared SAMM semantic concepts.

Getting help

Are you having trouble with ESMF JS? We want to help!

Getting started

Install from the public npm:

npm install @esmf/aspect-model-loader

Usage

Instantiating an Aspect the following two methods for loading ttl files(string value of the .ttl files) are provided.

Load an aspect model which is self-contained (includes no imports to other ttl file):

new AspectModelLoader().loadSelfContainedModel(ttl).subscribe((aspect: Aspect) => {
...
});

or if the model contains imports to further ttl files:

new AspectModelLoader().load('<aspect-model-urn>', ttl-1, ttl-2, ttl-3, ...).subscribe((aspect: Aspect) => {
...
});

Besides loading an aspect the project also supports to load and group the SAMM definitions by namespace.

Load all namespace and related SAMM semantic concepts:

new NamespaceLoader().load(ttl-1, ttl-2, ttl-3, ...).subscribe((namespaces: Observable<Map<string, Array<BaseMetaModelElement>>>) => {
...
});

If you are using external .ttl files you may need to parse the contents of these files to strings, to be passed to the methods params. Further all .ttl files must use the same SAMM version. Loading SAMM semantic concepts from different .ttl files having different SAMM versions is not supported yet.

Helpful functions

This module exposes some helper functions that can be used to find items inside the loaded ttl object.

Find a specific model element, and returns it or undefined.

let specificElement = loader.findByUrn(options.urnSelectedModelElement)

Find a specific model element by name, and returns the found elements.

let specificElement = loader.findByName(options.selectedModelName)

Development

Create bundle

npm run build

to build and to create the library

Update indexes

ctix create ./src

to update all index files under src. For more information see the project https://github.com/imjuni/create-ts-index.

Documentation

Further documentation and HowTos are provided in the official JS SDK User Documentation

License

SPDX-License-Identifier: MPL-2.0

This program and the accompanying materials are made available under the terms of the Mozilla Public License, v. 2.0.

The Notice file details contained third party materials.

esmf-sdk-js-aspect-model-loader's People

Contributors

michelu89 avatar atextor avatar larisavasile avatar yauhenikapl avatar dependabot[bot] avatar waltersve avatar andreas-schilling avatar jpradocueva avatar chris-volk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.