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 🙏

© 2024 – Pkg Stats / Ryan Hefner

semantic-domains

v1.0.1

Published

List of semantic domains from semdom.org, version 4

Downloads

3

Readme

semantic-domains

List of semantic domains from semdom.org, version 4.

npm install semantic-domains
yarn add semantic-domains

This package exports an object, which has a domains property that is an array of semantic domain objects. Each semantic domain object has the following properties.

  • id: string: The semantic domain ID. For example, the semantic domain "Injure" has ID '2.5.3'.
  • name: string: Human-readable name of the semanti domain.
  • parentId: string: ID of the parent semantic domain. For top-level semantic domains, this string is empty.
  • description: string: Human-readable description of the semantic domain.
  • examples: string[]: Array of example words or phrases that fit the semantic domain.

The array of semantic domains is sorted logically by ID.

How to search semantic domains

The default export includes a few functions to search and index semantic domains.

findAllChildren(id): Returns an array of all children, grandchildren, etc. of a semantic domain with the given ID. findById(id): Finds and returns a semantic domain by ID. findChildren(id): Returns an array of immediate children of a semantic domain with the given ID. findRoots(): Returns an array of top-level semantic domains. buildIndex(): Returns an hash that includes all semantic domains, keyed by their IDs.

Compatibility

semantic-domains should work on any reasonably recent version of Node.js. It uses ES2015 features like Array.find, Array.filter, and Array.reduce, so you might need a polyfill if you're targeting older browsers. If you don't need the helper functions, you can include the semantic domains data directly using require('semantic-domains/domains.json') or require('semantic-domains/domains.min.json').

Building

Build the list of semantic domains directly from the source using yarn build.

Test with yarn test.

Legal stuff

This NPM package, as well as the semantic domains themselves, are licensed under CC BY-SA 4.0.

The semantic domains were parsed from the list available on the RWC Questinonnaire. This document is available in the sources/ folder in DOCX format. A HTML-formatted version, which is used to parse the domains, is in the file words.html.

The semantic domain data was modified in order to be machine-readable and convenient to consume in Javascript. No major changes to the content are intended.