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

ontouml-js

Package Overview
Dependencies
Maintainers
3
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.4.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
3
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 and their serialization into ontouml-schema compliant JSON files.

import { Project, serializationUtils } from 'ontouml-js';

// Every OntoUML element can be created from a constructor that can receive a partial object as references for its creation
const project = new Project({ name: 'My Project' }); // creates an OntoUML projects

// Projects contain an instance of Package  dubbed model that contains all model elements in the project
// Container elements, e.g., projects and packages, also serve as factories for their contents
const model = project.createModel({ name: 'Model a.k.a. Root Package' }); // creates a "model" Package

// Instead of partial objects, "factory" methods receive more suitable lists of arguments to facilitating populating elements
const person = model.createKind('Person');
const school = model.createKind('School');
const date = model.createDatatype('Date');
const enrollment = model.createRelator('Enrollment');
const studiesAt = model.createMaterialRelation(person, school, 'studies at');

model.createMediationRelation(enrollment, person);
model.createMediationRelation(enrollment, school);

// our API is constantly updated to include helpful methods to facilitate building OntoUML models
studiesAt.getTargetEnd().name = 'school';
studiesAt.getTargetEnd().setCardinalityToMany();
studiesAt.getSourceEnd().name = 'student';
studiesAt.getSourceEnd().cardinality = '1..*';

enrollment.createAttribute(date, 'enrollment date');

// Containers also include methods to easily support retrieving their contents
model.getAllAttributes(); // returns all contained attributes
model.getAllClasses(); // returns all contained classes
model.getAllGeneralizations(); // returns all contained generalizations

// Any element can be easily serialized into JSON, and properly serialized elements can be deserialized just as easily
const projectSerialization = JSON.stringify(project);
const projectCopy = serializationUtils.parse(projectSerialization);

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 01 Mar 2021

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