OntoUML JS
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;
rootPackage.getAllContents()
rootPackage.getAllContentsByType([ OntoUMLType.GENERALIZATION_TYPE, OntoUMLType.PROPERTY_TYPE ])
rootPackage.getContentById('elementId')
const student = rootPackage.getAllContents().find(element => element.name === 'Student');
student.stereotypes;
student.getParents();
student.getAncestors();
student.getChildren();
student.getDescendants();
const enrollmentDate = rootPackage.getAllContents().find(element => element.name === 'Enrollment Date');
enrollmentDate.properties[0];
enrollmentDate.getRootPackage;
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: