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

@rezasoltani/solid-typeindex-support

v0.0.7

Published

See [Docs](https://pondersource.github.io/solid-typeindex-support/)

Downloads

6

Readme

solid-typeindex-support

See Docs

Development

git clone https://github.com/pondersource/solid-typeindex-support
npm install
npm run test

Dependencies:

  • @inrupt/solid-client: This module provides methods for interacting with the Solid Pod.
  • @inrupt/vocab-common-rdf: This module provides methods for working with RDF data.
  • @rdfjs/data-model: This module provides methods for working with RDF data.

Usage

mpm install @rezasoltani/solid-typeindex-support
import { TypeIndexHelper } from '@rezasoltani/solid-typeindex-support';

const webId = 'https://example.com/profile#me';
const solidInstanceUrl = 'https://example.com/type-index.ttl';
const rdfClass = "http://schema.org/Book";

const instances = await TypeIndexHelper.getFromTypeIndex(webId, rdfClass, fetch, true);

const updatedIndex = await TypeIndexHelper.registerInTypeIndex(webId, 'My Book List', rdfClass, fetch, solidInstanceUrl, true);

Classes

| Class | Description | | --- | --- | | TypeIndexHelper | TypeIndexHelper provides helper methods for working with typeIndexes in Solid. This includes methods for getting and updating a user's public and private typeIndexes. |

Methods

| Method | Modifiers | Description | | --- | --- | --- | | getFromTypeIndex(webId, rdfClass, fetch, isPrivate) | static | Retrieves all instances of the given RDF class from the user's typeIndexe. | | registerInTypeIndex(webId, typeRegistrationTitle, rdfClass, fetch, solidInstanceUrl, isPrivate) | static | Registers a type registration in the user's typeIndexe. |

TypeIndexHelper.getFromTypeIndex() method

Retrieves all instances of the given RDF class from the user's typeIndexe.

Signature:

static getFromTypeIndex(webId: string, rdfClass: string, fetch: any, isPrivate: true): Promise<string[]>;

Parameters

| Parameter | Type | Description | | --- | --- | --- | | webId | string | The user's WebID | | rdfClass | string | The RDF class to retrieve instances for | | fetch | any | Authenticated fetch function | | isPrivate | true | Whether the typeIndexe is private or public |

Returns:

Promise<string[]>

TypeIndexHelper.registerInTypeIndex() method

Registers a type registration in the user's typeIndexe.

Signature:

static registerInTypeIndex(webId: string, typeRegistrationTitle: string, rdfClass: string, fetch: any, solidInstanceUrl: string, isPrivate: boolean): Promise<SolidDataset>;

Parameters

| Parameter | Type | Description | | --- | --- | --- | | webId | string | The WebID of the user | | typeRegistrationTitle | string | The title to use for the type registration | | rdfClass | string | The RDF class that this registration is for | | fetch | any | The authenticated fetch function | | solidInstanceUrl | string | The URL of the index being registered | | isPrivate | boolean | Whether to register in the private or public typeIndexe |

Returns:

Promise<SolidDataset>

A Promise resolving to the updated typeIndexe dataset