npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ontology-suite

v0.16.1

Published

Write OWL ontologies as TypeScript: the scripting DSL of the Ontology Development Suite VS Code extension.

Readme

ontology-suite

Write OWL ontologies as TypeScript. This is the scripting DSL of the Ontology Development Suite VS Code extension, published on its own so that import ... from 'ontology-suite/dsl' resolves anywhere: in CI, in another editor, or in a script you run with Node.

npm install --save-dev ontology-suite

Example

import { ontology, defontology, defclass, defobjectproperty, defdatatypeproperty, defindividual, datatype, mx, build } from 'ontology-suite/dsl';

ontology('http://example.org/zoo#', 'zoo');
defontology('http://example.org/zoo', { versionIRI: 'http://example.org/zoo/1.0.0', label: 'Zoo' });

const Animal = defclass('Animal', { label: [{ value: 'animal', language: 'en' }, { value: 'Tier', language: 'de' }] });
const Enclosure = defclass('Enclosure');
const livesIn = defobjectproperty('livesIn', { domain: Animal, range: Enclosure, characteristics: ['functional'] });
const age = defdatatypeproperty('age', { range: datatype('xsd:integer', { minInclusive: 0, maxInclusive: 150 }) });

defclass('Resident', { equivalentClass: mx`Animal and ${livesIn} some Enclosure` });

const pool = defindividual('pool', { types: [Enclosure] });
defindividual('pingu', { types: [Animal], facts: [[livesIn, pool], [age, 7]] });

const { quads, prefixes } = build();
console.log(`${quads.length} triples`);

build() returns the ontology as RDF/JS quads, with the prefixes it uses, ready for any RDF/JS serializer, such as n3's Writer. The types catch a mistake before the script runs: a fact giving an object property a literal, say, or a datatype property in a property chain. Code the type checker never saw, run with tsx or written in JavaScript, gets the same mistake back as an error naming the function, the argument and what it was given.

What the language has

  • Declarations: ontology, defontology (version IRI, imports, annotations), defclass, defobjectproperty (characteristics, inverse, chain), defdatatypeproperty (datatype ranges with facets), defindividual (types and facts), allDifferent.
  • Class expressions: some, only, hasValue, minCardinality, maxCardinality, exactCardinality, and, or, not, inverse for a restriction on the inverse of a property, and Manchester Syntax through mx`...`.
  • Patterns: someOnly and asSubclasses, after Tawny-OWL.
  • References to terms declared elsewhere: classRef, objectPropertyRef, datatypePropertyRef, individualRef.

Labels and comments take a language tag, and any declaration takes annotations. The extension's tutorial walks through all of it.

With the VS Code extension

You don't need this package to use the DSL in VS Code: the extension types .ontology.ts scripts and runs them (Ontology Suite: Run Ontology Script) without it. If the package is installed, the editor uses its types, and the extension still runs a script with its own copy of the DSL, so keep the two at the same version.

License

MIT