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

n3-utility

v0.1.0

Published

Reasoning utilities for the Notation 3 reasoning language that work in the browser and Node.

Readme

Notation 3 Utilities

Notation3 (N3) is a language for natively building and reasoning over semantic Knowledge Graphs. Several online tools exist to experiment with N3, such as the Notation3 Editor, the Eyeling Playground and the eye-js playground.

When building applications with N3, developers often rely on a specific reasoning library. Over time, they may want or need to switch to another implementation (e.g. for features, performance, or deployment constraints). However, these libraries usually expose different interfaces, making such transitions non-trivial. This mismatch also surfaces across environments: server-side and browser-based reasoners typically have different interfaces, further complicating reuse.

This package addresses the interface mismatch by providing a uniform function interface reason, the core method provided by the Reasoner class:

reason(dataStore: Store, rules: string): Promise<Store>

This method takes an RDF graph (Store) and a set of N3 rules (.n3 string), and returns a new Store containing the inferred results.

This package supports three different implementations of N3:

  • Euler Yet another proof Engine - EYE (The OG prolog version) through the EyeReasoner class
    • you do need a prolog install local -> so only works in node if eye is installed correctly
  • EYE JS (webassembly version of EYE) EyeJsReasoner class
  • eyeling (A Notation3 (N3) reasoner in JavaScript) EyelingReasoner class
    • Also supports streaming interfaces natively, but check the documentation or ask the maintainers for that purpose

This package supports multiple N3 reasoner implementations, each with their own class implementation that exposes the reason interface:

  • EYE (Euler Yet another proof Engine) exposed via the EyeReasoner class
    EYE is the original Notation3 implementation writtein in Prolog. Thus a local Prolog installation is required and as such only works in Node.js environments where EYE is correctly installed.
  • EYE JS exposed via the EyeJsReasoner class
    EYE JS is the WebAssembly-based version of EYE that can run in both Node.js and the browser.
  • eyeling exposed via the EyelingReasoner class
    Eyeling is a JavaScript-native N3 reasoner. It also supports streaming interfaces, though these are not exposed through this abstraction (see its documentation for advanced usage).

How to use this library

For Typescript, independent of whether you use it in a browser or Node environment, the code below should produce the following output: :Socrates a :Mortal .

import { Parser, Store } from 'n3'
import { EyelingReasoner } from 'N3-utility'

const data = `
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix : <http://example.org/socrates#>.

:Socrates a :Human.
:Human rdfs:subClassOf :Mortal.
`;

const rules = `
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix : <http://example.org/socrates#>.
{
    ?S a ?A .
    ?A rdfs:subClassOf ?B . 
} 
=> 
{
    ?S a ?B .
} .
`

const store = new Store(new Parser().parse(data));

const reasoner = new EyelingReasoner();

const result = await reasoner.reason(store, rules);

Local development

nvm use # If you use nvm for node version management
# Required because of mismatch between eyereasoner and the new n3 library
npm install -D --legacy-peer-deps

Testing

npx playwright install
npm run test:browser 

Feedback and questions

Do not hesitate to report a bug.

Further questions can also be asked to Wout Slabbinck (developer and maintainer of this repository).