Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ontouml-js

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ontouml-js

Javascript library utility for manipulating OntoUML models.

  • 0.2.0-alpha.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

OntoUML JS

GitHub Workflow Status

Javascript library utility for manipulating OntoUML models.

Getting Start

npm install ontouml-js --save

// yarn users
yarn add ontouml-js

Usage

This package is designed to support manipulating OntoUML models, such as the one above, serialized in ontouml-schema JSON format.

import { ModelManager } from 'ontouml-js';

const modelManager = new ModelManager(ontoULMSchemaModel);

const rootPackage = modelManager.rootPackage; // ontoULMSchemaModel root package
rootPackage.getAllContents() // returns elements recursively contained within the executing package
rootPackage.getAllContentsByType([ OntoUMLType.GENERALIZATION_TYPE, OntoUMLType.PROPERTY_TYPE ]) // returns elements contained within in the package selected by type
rootPackage.getContentById('elementId') // returns the element bearering the given id

const student = rootPackage.getAllContents().find(element => element.name === 'Student'); // Student role class
student.stereotypes; // [ 'role' ]
student.getParents(); // [ Person kind class ]
student.getAncestors(); // [ Person kind class, Agent category class ]
student.getChildren(); // [ Privately Enrolled role class, Privately Enrolled role class ]
student.getDescendants(); // [ Privately Enrolled role class, Privately Enrolled role class ]

const enrollmentDate = rootPackage.getAllContents().find(element => element.name === 'Enrollment Date'); // Enrollment Date mode class
enrollmentDate.properties[0]; // date property representing the class's attibute
enrollmentDate.getRootPackage; // returns rootPackage

About

If you are interested to know more, feel free to open an issue to provide feedback on the project or reach our team members for more specific cases:

FAQs

Package last updated on 17 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc