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

sparqly

v0.37.1

Published

RDF CLI with SPARQL query and embedded YASGUI playground

Readme

Sparqly

A CLI for querying, hashing, diffing, formatting, and serving RDF. Canonical-form hash and diff (RDFC-1.0, blank-node-stable), plus an embedded YASGUI playground.

Alpha — pre-1.0; expect breaking changes between releases. See CHANGELOG before upgrading.

Install

Requires Node 22+.

npm install -g sparqly
sparqly --help

# or, no install
npx sparqly --help

Quickstart

Run SPARQL against a glob of RDF files:

sparqly query "data/**/*.ttl" -q 'SELECT * WHERE { ?s ?p ?o } LIMIT 10'

Open the embedded playground in your browser:

sparqly serve "data/**/*.ttl" --port=3000
# UI at http://localhost:3000, SPARQL endpoint at /api/sparql

serve exposes every non-reference source at /api/sparql/<id> (plus /api/diff, /api/describe, /api/source-snippet, /api/config, and the playground). Pass a positional glob/URL or --source @id to scope the served set to one entry. It's a single-user development tool — not hardened for concurrent users.

Detect drift between a curated source and its split parts. hash --compare-with exits 1 on mismatch; diff then shows exactly which triples drifted:

sparqly hash domain.ttl --compare-with "parts/**/*.ttl"
# match: 4f3c…a1

# On mismatch:
sparqly diff domain.ttl "parts/**/*.ttl"
# - <http://example.org/c> <http://example.org/q> <http://example.org/d> .
# + <http://example.org/c> <http://example.org/q> <http://example.org/d2> .

Sources

A source is a declared input that produces RDF. Sparqly understands three kinds:

  • glob — files on disk (the quickstart examples above).
  • endpoint — a remote SPARQL HTTP endpoint.
  • empty — an in-memory store, used to host a federated query that composes endpoints via SERVICE clauses (handy when an endpoint can't federate itself).

Sources are declared in sparqly.config.yaml and referenced by @id on the CLI. The kind is inferred from which key is present (glob:, endpoint:, or empty: true):

# sparqly.config.yaml
sources:
  - id: fedlex
    endpoint: https://fedlex.data.admin.ch/sparqlendpoint
  - id: domain
    glob: data/**/*.ttl
    default: true

Derivation is a verb, not a source kind: scope a source at command time with an inline query (--query / --query-file), which passes through to an endpoint when the target is one:

sparqly query @fedlex \
  --query 'CONSTRUCT { ?act ?p ?o } WHERE { ?act ?p ?o ; <http://schema.org/dateCreated> ?d
                                            FILTER (?d > "2024-01-01"^^<http://www.w3.org/2001/XMLSchema#date>) }'

See docs/sources.md for the full source-spec reference — auth on endpoints, source transforms (graphName, annotateSource), disk-backed storage, git pinning, and the empty + SERVICE federation pattern.

Next steps

License

MIT