Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
ontouml-js
Advanced tools
Javascript library utility for manipulating OntoUML models.
npm install ontouml-js --save
// yarn users
yarn add ontouml-js
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);
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
Javascript library utility for manipulating OntoUML models.
The npm package ontouml-js receives a total of 0 weekly downloads. As such, ontouml-js popularity was classified as not popular.
We found that ontouml-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.