GithubHelp home page GithubHelp logo

solid-typeindex-support's Introduction

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 indexUrl = '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, indexUrl, 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, indexUrl, 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, indexUrl: 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
indexUrl 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

solid-typeindex-support's People

Contributors

soltanireza65 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.