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

@unrdf/graph-analytics

v26.4.8

Published

Advanced graph analytics for RDF knowledge graphs using graphlib

Readme

@unrdf/graph-analytics

Advanced graph analytics for RDF knowledge graphs using graphlib.

Features

1. RDF to Graph Conversion

Convert RDF triple stores to graphlib Graph instances for analysis.

import { createStore } from '@unrdf/oxigraph';
import { rdfToGraph, getGraphStats } from '@unrdf/graph-analytics';

const store = createStore();
// ... add RDF triples ...

const graph = rdfToGraph(store);
const stats = getGraphStats(graph);
console.log(`Nodes: ${stats.nodeCount}, Edges: ${stats.edgeCount}`);

2. Centrality Algorithms

Compute entity importance using PageRank and degree centrality.

import { computePageRank, getTopNodes } from '@unrdf/graph-analytics';

const pagerank = computePageRank(graph, { dampingFactor: 0.85 });
const top10 = getTopNodes(pagerank, 10);
console.log('Most important entities:', top10);

3. Path Finding

Discover relationships through shortest paths and path enumeration.

import { findShortestPath, findAllPaths } from '@unrdf/graph-analytics';

const shortestPath = findShortestPath(graph, sourceUri, targetUri);
console.log('Path:', shortestPath.path);

const allPaths = findAllPaths(graph, sourceUri, targetUri, { maxDepth: 4 });
console.log(`Found ${allPaths.length} paths`);

4. Community Detection

Identify clusters and communities in knowledge graphs.

import { detectCommunitiesLPA, getCommunityStats } from '@unrdf/graph-analytics';

const communities = detectCommunitiesLPA(graph);
const stats = getCommunityStats(communities);
console.log(`Detected ${stats.totalCommunities} communities`);

Installation

pnpm add @unrdf/graph-analytics

Quick Start

# Run demo
pnpm demo

# Run tests
pnpm test

# Run with coverage
pnpm test -- --coverage

API Reference

Converter

  • rdfToGraph(store, options) - Convert RDF store to graph
  • sparqlResultsToGraph(results, options) - Convert SPARQL results to graph
  • getGraphStats(graph) - Compute graph statistics

Centrality

  • computePageRank(graph, options) - PageRank algorithm
  • computeDegreeCentrality(graph) - Degree centrality
  • computeBetweennessCentrality(graph) - Betweenness centrality
  • getTopNodes(scores, k) - Get top K nodes by score

Paths

  • findShortestPath(graph, source, target) - Dijkstra shortest path
  • findAllPaths(graph, source, target, options) - All paths enumeration
  • findCommonNeighbors(graph, node1, node2) - Common neighbors
  • findKHopNeighbors(graph, source, k) - K-hop neighborhood
  • discoverRelationshipChains(graph, source, target) - Relationship patterns

Clustering

  • detectCommunitiesLPA(graph, options) - Label propagation
  • detectCommunitiesModularity(graph, options) - Modularity-based
  • findKCore(graph, k) - K-core decomposition
  • getCommunityStats(communities) - Community statistics

Performance

Optimized for RDF knowledge graphs:

  • Efficient graph conversion (streaming support)
  • Fast PageRank convergence
  • Scalable path algorithms
  • Memory-efficient community detection

License

MIT