open-index/open-npm huggingface dataset:
npm package: @jeswr/css-auth-utils
Description: This is a temporary library for logging into the Community Solid Server using [client credentials](https://communitysolidserver.github.io/CommunitySolidServer/5.x/usage/client-credentials/).
Author: Jesse Wright
Latest version: 1.4.0

# CSS Auth Utils

This is a temporary library for logging into the Community Solid Server using [client credentials](https://communitysolidserver.github.io/CommunitySolidServer/5.x/usage/client-credentials/).

```ts
import { getAuthenticatedFetch } from '@jeswr/css-auth-utils';

const fetch = getAuthenticatedFetch({
  podName: 'example',
  email: 'hello@example.com',
  password: 'abc123',
  url: 'http://localhost:3002/'
})
```

## Logging in using the browser flow

In some testing use cases we wish to follow the browser login flow, but mock the user interaction with the browser. This can be achieved using the `cssRedirectFactory` which fills in the email and password and completes the user flow with the CSS using puppeteer.

Generally this should only be used when testing browser login flows in e2e tests.

```ts
import { cssRedirectFactory } from '@jeswr/css-auth-utils';

await session.login({
  oidcIssuer: 'http://localhost:3000/',
  redirectUrl: 'http://localhost:3001/',
  handleRedirect: cssRedirectFactory('hello@example.com', 'abc123')
});
```

If you just wish to get the session, and don't need to control the server for redirect URLs then you can do:

```ts
import { getSessionFromBrowserLogin } from '@jeswr/css-auth-utils';

const session = await getSessionFromBrowserLogin({
  email: 'hello@example.com',
  password: 'abc123',
  oidcIssuer: 'http://localhost:3000/',
});
```

## [ESS] Logging in using the browser flow

```ts
import { essRedirectFactory } from '@jeswr/css-auth-utils';

await session.login({
  oidcIssuer: 'https://login.inrupt.com/',
  redirectUrl: 'http://localhost:3001/',
  handleRedirect: cssRedirectFactory('myUsername', 'abc123')
});
```


```ts
import { getSessionFromBrowserLogin, essRedirectFactory } from '@jeswr/css-auth-utils';

const session = await getSessionFromBrowserLogin({
  oidcIssuer: 'https://login.inrupt.com/',
  email: 'myUsername',
  password: 'abc123',
  redirectFactory: essRedirectFactory
});
```

## License
©2023–present
[Jesse Wright](https://github.com/jeswr),
[MIT License](https://github.com/jeswr/useState/blob/master/LICENSE).
npm package: @jeswr/css-init-utils
Description: A temporary repo with utils for initialising the Community Solid Server
Author: Jesse Wright
Latest version: 1.0.0

# CSS Init Utils

This is a temporary package to easily init the [Community Solid Server](https://github.com/CommunitySolidServer/CommunitySolidServer/) in scripts until https://github.com/CommunitySolidServer/CommunitySolidServer/pull/1509 is released.

```ts
import { createApp } from '@jeswr/css-init-utils';

function main() {
  const app = createApp({
    port: 3_002,
    seededPodConfigJson: path.join(__dirname, 'configs', 'solid-css-seed.json'),
  });
  await app.start();
}

main();
```

## License
©2023–present
[Jesse Wright](https://github.com/jeswr),
[MIT License](https://github.com/jeswr/useState/blob/master/LICENSE).
npm package: @jeswr/ldflex-handlers
Description: Custom handlers for use with LDflex
Author: Jesse Wright
Latest version: 1.1.0

## ⚠️ Most handlers exported by this library are now available [here](https://github.com/LDflex/async-iteration-handlers)


# ldflex handlers
My custom handlers for use with the [LDflex](https://github.com/ldflex/ldflex) Library

### Usage

```ts
import { defaultHandlers } from '@jeswr/ldflex-handlers'
import { PathFactory } from 'ldflex'

const myPath = new PathFactory({
  handlers: defaultHandlers,
  context: // see https://github.com/ldflex/ldflex for usage
  queryEngine: // see https://github.com/ldflex/ldflex for usage
});
```

All exposed handlers are declared [here](https://github.com/jeswr/ldflex-handlers/blob/main/lib/handlers/allHandlers.ts)
npm package: @jeswr/prefixcc
Description: A utility library to lookup prefixes and uris on prefixcc
Author: Jesse Wright
Latest version: 1.2.1

#  prefixcc

Get prefixes for your URIs using the [prefix.cc](http://prefix.cc/) Web API.

[![GitHub license](https://img.shields.io/github/license/jeswr/prefixcc.js.svg)](https://github.com/jeswr/prefixcc.js/blob/master/LICENSE)
[![npm version](https://img.shields.io/npm/v/@jeswr/prefixcc.svg)](https://www.npmjs.com/package/@jeswr/prefixcc)
[![build](https://img.shields.io/github/workflow/status/jeswr/prefixcc.js/Node.js%20CI)](https://github.com/jeswr/prefixcc.js/tree/main/)
[![Dependabot](https://badgen.net/badge/Dependabot/enabled/green?icon=dependabot)](https://dependabot.com/)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

## Usage

Primarily this library can be used to look up common prefixes for a given URI, and also look up the URI most commonly associated with a prefix.

```ts
import { uriToPrefix, prefixToUri, lookupAllPrefixes } from '@jeswr/prefixcc'

const prefix = await uriToPrefix('http://xmlns.com/foaf/0.1/'); // foaf
const url = await prefixToUri('foaf');                          // http://xmlns.com/foaf/0.1/

// Returns an object with all prefixes recorded in prefix.cc
const prefixes = await lookupAllPrefixes(); // { ..., foaf: 'http://xmlns.com/foaf/0.1/', ... }
```

It can also mint new prefixes when there are no recommended ones available

```ts
await uriToPrefix('https://www.my-url/etad/', { mintOnUnknown: true }); // etad
```

and ensure that prefixes are unique from those that you're already using

```ts
await uriToPrefix(
  'https://www.my-url-2/etad/', {
    mintOnUnknown: true,
    existingPrefixes: { etad: 'https://www.my-url/etad/' }
}); // etad0

await uriToPrefix(
  'http://xmlns.com/foaf/0.1/', {
    existingPrefixes: { foaf: 'https://www.my-url/' }
}); // foaf0
```

## License
©2022–present
[Jesse Wright](https://github.com/jeswr),
[MIT License](https://github.com/jeswr/useState/blob/master/LICENSE).
npm package: @jeswr/promisify-event-emitter
Description: Utility to resolve EventEmitters as a promise
Author: Jesse Wright
Latest version: 1.0.1

# promisify-event-emitter
Utility to resolve EventEmitters as a promise

[![GitHub license](https://img.shields.io/github/license/jeswr/promisify-event-emitter.svg)](https://github.com/jeswr/promisify-event-emitter/blob/master/LICENSE)
[![npm version](https://img.shields.io/npm/v/@jeswr/promisify-event-emitter.svg)](https://www.npmjs.com/package/promisify-event-emitter)
[![build](https://img.shields.io/github/workflow/status/jeswr/promisify-event-emitter/Node.js%20CI)](https://github.com/jeswr/promisify-event-emitter/tree/main/)
[![Dependabot](https://badgen.net/badge/Dependabot/enabled/green?icon=dependabot)](https://dependabot.com/)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

## Usage

By default `promisifyEventEmitter` returns a promise which resolves to undefined if the `end` event is called, and rejects if the `error` event is called.

```ts
import { promisifyEventEmitter } from '@jeswr/promisify-event-emitter'

const stream = new Readable();
stream.push(null);
await promisifyEventEmitter(stream.on('data', () => {}));
```

The return value on `end` can also be customized. For instance:

```ts
export default function arrayifyStream<T = any>(stream: EventEmitter): Promise<T[]> {
  const array: T[] = [];
  return promisifyEventEmitter(stream.on('data', data => array.push(data)), array);
}
```

## License
©2022–present
[Jesse Wright](https://github.com/jeswr),
[MIT License](https://github.com/jeswr/promisify-event-emitter/blob/master/LICENSE).
npm package: @jeswr/rdf-serialize-store
Description: Serialise data from any iterable set of quads.
Author: Jesse Wright
Latest version: 1.1.1

# rdf-serialize-store.js

Serialise data from any iterable set of quads.

[![GitHub license](https://img.shields.io/github/license/jeswr/rdf-serialize-store.js.svg)](https://github.com/jeswr/rdf-serialize-store.js/blob/master/LICENSE)
[![npm version](https://img.shields.io/npm/v/@jeswr/rdf-serialize-store.svg)](https://www.npmjs.com/package/@jeswr/rdf-serialize-store)
[![build](https://img.shields.io/github/actions/workflow/status/jeswr/rdf-serialize-store.js/nodejs.yml?branch=main)](https://github.com/jeswr/rdf-serialize-store.js/tree/main/)
[![Dependabot](https://badgen.net/badge/Dependabot/enabled/green?icon=dependabot)](https://dependabot.com/)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

## Usage

```ts
import { Quad, Store, DataFactory } from 'n3';
import serialize from '@jeswr/rdf-serialize-store';
const { namedNode, literal, quad } = DataFactory;

const quads = [
  quad(namedNode('http://example.org/subject'), namedNode('http://example.org/predicate'), namedNode('http://example.org/object')),
  quad(namedNode('http://example.org/subject'), namedNode('http://example.org/predicate'), literal('object')),
];

// <http://example.org/subject> <http://example.org/predicate> <http://example.org/object>, "object".
await serialize(quads, { contentType: 'text/turtle' });
await serialize(new Store(quads), { contentType: 'text/turtle' });

// @prefix ex: <http://example.org/> .
// ex:subject ex:predicate ex:object, "object".
await serialize(quads, { contentType: 'text/turtle', prefixes: { ex: "http://example.org/" } });
```

## License
©2024–present
[Jesse Wright](https://github.com/jeswr),
[MIT License](https://github.com/jeswr/rdf-serialize-store.js/blob/master/LICENSE).
npm package: @jeswr/rdfjs-sign
Description: A set of utilities for signing RDF. :warning: Not for production use :warning:
Author: Jesse Wright
Latest version: 1.3.1

# RDFJS Sign
A set of utilities for signing RDF. :warning: Not for production use :warning:

[![GitHub license](https://img.shields.io/github/license/jeswr/rdfjs-sign.svg)](https://github.com/jeswr/rdfjs-sign/blob/master/LICENSE)
[![npm version](https://img.shields.io/npm/v/@jeswr/rdfjs-sign.svg)](https://www.npmjs.com/package/@jeswr/rdfjs-sign)
[![build](https://img.shields.io/github/actions/workflow/status/jeswr/rdfjs-sign/nodejs.yml?branch=main)](https://github.com/jeswr/rdfjs-sign/tree/main/)
[![Dependabot](https://badgen.net/badge/Dependabot/enabled/green?icon=dependabot)](https://dependabot.com/)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

## Usage
```ts
import { DataFactory } from 'n3';
import {
  generateKeyPair, exportKey, signQuads, verifyQuads, importKey,
} from '@jeswr/rdfjs-sign';

const { quad, namedNode } = DataFactory;

const q1 = quad(namedNode('http://example.org/s'), namedNode('http://example.org/p'), namedNode('http://example.org/o1'));
const q2 = quad(namedNode('http://example.org/s'), namedNode('http://example.org/p'), namedNode('http://example.org/o2'));
const q3 = quad(namedNode('http://example.org/s'), namedNode('http://example.org/p'), namedNode('http://example.org/o3'));
const keyPair = await generateKeyPair();
const signature = await signQuads([q1, q2], keyPair.privateKey);

// true
await verifyQuads([q2, q1], signature, keyPair.publicKey);

// false
await verifyQuads([q1, q3], signature, keyPair.publicKey);

// true
await verifyQuads([q2, q1], signature, await importKey(await exportKey(keyPair.publicKey)));
```

## CLI Usage
To sign data with a private key
```
npx @jeswr/rdfjs-sign --private-key ./key.json --hash "abc123"
```

To sign a hash with a private key
```
npx @jeswr/rdfjs-sign --private-key ./key.json --data ./data.ttl
```

## License
©2024–present
[Jesse Wright](https://github.com/jeswr),
[MIT License](https://github.com/jeswr/rdfjs-sign/blob/master/LICENSE).

This is based on code written in [this prototype](https://github.com/SolidLabResearch/Vienna-prototype/blob/a902b3351c70dc00bb2494cc331f6f21289ad0f5/packaging/createSignedPackage.ts) in collaboration with [Ruben Dedecker](https://github.com/Dexagod) and [Wout Slabbinck](https://github.com/woutslabbinck).
npm package: @jeswr/react-lazy-render
Description: Lazy rendering for asynchronous React components
Author: Jesse Wright
Latest version: 1.0.1

# react-lazy-render
Lazy rendering for asynchronous React components.

[![GitHub license](https://img.shields.io/github/license/jeswr/react-lazy-render.svg)](https://github.com/jeswr/react-lazy-render/blob/main/LICENSE)
[![npm version](https://img.shields.io/npm/v/@jeswr/react-lazy-render.svg)](https://www.npmjs.com/package/@jeswr/react-lazy-render)
[![build](https://img.shields.io/github/workflow/status/jeswr/react-lazy-render/Node.js%20CI)](https://github.com/jeswr/react-lazy-render/tree/main/)
[![Dependabot](https://badgen.net/badge/Dependabot/enabled/green?icon=dependabot)](https://dependabot.com/)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

## Usage

```tsx
import LazyFactory from '@jeswr/react-lazy-renderer'

const LazyTextDisplay = LazyFactory<{ text: Promise<string> | string }>(
  async ({ text }) => {
    const resolvedText = `${await text}`;
    return <>{resolvedText}</>;
  },
);

function App() {
  return <LazyTextDisplay text={Promise.resolve('Foo')} />;
}
```

## License
©2021–present
[Jesse Wright](https://github.com/jeswr),
[MIT License](https://github.com/jeswr/useState/blob/master/LICENSE).
npm package: @jeswr/shacl2shex
Description: Convert SHACL to ShEx
Author: Jesse Wright
Latest version: 1.5.1

# shacl2shex

Convert basic SHACL shapes to ShEx

[![GitHub license](https://img.shields.io/github/license/jeswr/shacl2shex.svg)](https://github.com/jeswr/shacl2shex/blob/master/LICENSE)
[![npm version](https://img.shields.io/npm/v/@jeswr/shacl2shex.svg)](https://www.npmjs.com/package/@jeswr/shacl2shex)
[![build](https://img.shields.io/github/actions/workflow/status/jeswr/shacl2shex/nodejs.yml?branch=main)](https://github.com/jeswr/shacl2shex/tree/main/)
[![Dependabot](https://badgen.net/badge/Dependabot/enabled/green?icon=dependabot)](https://dependabot.com/)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

## Usage
```ts
import { DatasetCore } from '@rdfjs/types';
import { shaclStoreToShexSchema, writeShexSchema, shapeMapFromDataset, writeShapeMap } from '@jeswr/shacl2shex';

// Creates the ShexJ schema
const schema = await shaclStoreToShexSchema(store);

// Writes the ShexJ schema to .shex
console.log(await writeShexSchema(schema, prefixes));

// Extract ShapeMap from SHACL target classes (resolves issue #283)
const shapeMap = shapeMapFromDataset(store);

// Write ShapeMap to string format
console.log(writeShapeMap(shapeMap, prefixes));
```

:warning: This library is hacked together. Unsupported features include:
 - `sh:or`, `sh:and` and `sh:xone`
 - Property paths

## CLI Usage

```
npx @jeswr/shacl2shex "input <filePath|directory|url>" "output <filePath|directory>" [--shapemap|-s]
```

**Options:**
- `--shapemap, -s`: Generate a ShapeMap file alongside the ShEx output. The ShapeMap preserves SHACL target class information (from `sh:targetClass`) which is otherwise lost in the ShEx conversion.

e.g.

```
npx @jeswr/shacl2shex https://www.w3.org/ns/shacl-shacl#ShapeShape Shacl.shex
npx @jeswr/shacl2shex shapes.shaclc output.shex --shapemap
```

## ShapeMap Generation

As of version X.X.X, this library can generate ShapeMap files to preserve SHACL target information that would otherwise be lost during ShEx conversion.

SHACL's `sh:targetClass` specifies which RDF classes a shape should validate. Since ShEx doesn't have a direct equivalent, this information is typically lost. ShapeMaps provide a way to specify which nodes should be validated against which shapes.

### Example

Given this SHACL:
```shaclc
shape ex:PersonShape -> ex:Person {
    ex:name xsd:string [1..1] .
}
```

The tool generates:
1. **ShEx file** (`output.shex`):
```shex
ex:PersonShape {
    (ex:name xsd:string{1,1})
}
```

2. **ShapeMap file** (`output.shapemap`):
```
{FOCUS rdf:type ex:Person}@ex:PersonShape
```

The ShapeMap can be used with ShEx validators to specify that nodes of type `ex:Person` should be validated against `ex:PersonShape`.

## License
©2024–present
[Jesse Wright](https://github.com/jeswr),
[MIT License](https://github.com/jeswr/shacl2shex/blob/master/LICENSE).
npm package: @jeswr/stream-to-string
Description: Convert a stream to a string
Author: Jesse Wright
Latest version: 2.0.0

# stream-to-string

Convert a stream to a string

[![GitHub license](https://img.shields.io/github/license/jeswr/stream-to-string.svg)](https://github.com/jeswr/stream-to-string/blob/master/LICENSE)
[![npm version](https://img.shields.io/npm/v/@jeswr/stream-to-string.svg)](https://www.npmjs.com/package/@jeswr/stream-to-string)
[![build](https://img.shields.io/github/actions/workflow/status/jeswr/stream-to-string/nodejs.yml?branch=main)](https://github.com/jeswr/stream-to-string/tree/main/)
[![Dependabot](https://badgen.net/badge/Dependabot/enabled/green?icon=dependabot)](https://dependabot.com/)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

## Usage

```ts
import { Readable } from 'readable-stream';
import stringify from '@jeswr/stream-to-string';

// 'abc'
await stringify(Readable.from(['a', 'b', 'c']));
```

## License
©2024–present
[Jesse Wright](https://github.com/jeswr),
[MIT License](https://github.com/jeswr/stream-to-string/blob/master/LICENSE).
npm package: @jeswr/use-async-effect
Description: Convenience function for usage of useEffect with async functions in React
Author: Jesse Wright
Latest version: 1.0.0

# useAsyncEffect

Convenience function for usage of useEffect with async functions in React.

[![GitHub license](https://img.shields.io/github/license/jeswr/useAsyncEffect.svg)](https://github.com/jeswr/useState/blob/master/LICENSE)
[![npm version](https://img.shields.io/npm/v/@jeswr/use-async-effect.svg)](https://www.npmjs.com/package/@jeswr/use-async-effect)
[![build](https://img.shields.io/github/workflow/status/jeswr/useAsyncEffect/Node.js%20CI)](https://github.com/jeswr/useAsyncEffect/tree/main/)
[![Dependabot](https://badgen.net/badge/Dependabot/enabled/green?icon=dependabot)](https://dependabot.com/)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

## Why

Convenience and makes code cleaner. The following is allowed

```ts
import { useAsyncEffect } from "@jeswr/use-async-effect";

function MyComponent() {
  useAsyncEffect(async () => {
    /* Effect goes here */
  }, []);
  return /* JSX Output */
}
```

in constrast, async function calls with useEffect in React should be structured as follows:

```ts
import { useEffect } from "react";

function MyComponent() {
  useEffect(() => {
    (async () => {
      /* Effect goes here */
    })();
  }, []);
  return /* JSX Output */
}
```

## License

©2021–present
[Jesse Wright](https://github.com/jeswr),
[MIT License](https://github.com/jeswr/useAsyncEffect/blob/master/LICENSE).
npm package: @jeswr/use-promise
Description: Takes a logical statement and simplifies it.
Author: Jesse Wright
Latest version: 1.0.2

# use-promise
React hook to resolve promises

[![GitHub license](https://img.shields.io/github/license/jeswr/use-promise.svg)](https://github.com/jeswr/use-promise/blob/master/LICENSE)
[![npm version](https://img.shields.io/npm/v/@jeswr/use-promise.svg)](https://www.npmjs.com/package/@jeswr/use-promise)
[![build](https://img.shields.io/github/workflow/status/jeswr/use-promise/Node.js%20CI)](https://github.com/jeswr/use-promise/tree/main/)
[![Dependabot](https://badgen.net/badge/Dependabot/enabled/green?icon=dependabot)](https://dependabot.com/)
[![Downloads](https://img.shields.io/github/downloads/jeswr/use-promise/total)](https://img.shields.io/github/downloads/jeswr/use-promise/total)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

## Usage

The output of the hook is `undefined` whilst the promise is unresolved or rejected. When the promise resolves, the output of the hook is the resolved value of the promise.

```tsx
import usePromise from 'use-promise';

const myPromise = (async () => 'my data')();

function MyReactComponent() {
  // usePromise(myPromise) is either 'my data' or undefined
  const data: string = usePromise(myPromise) ?? '';
  return <div>{data}</div>
}
```

## License
©2021–present [Jesse Wright](https://github.com/jeswr), [MIT License](https://github.com/jeswr/use-promise/blob/main/LICENSE).
npm package: @jeswr/use-state
Description: React hook with same API as use state implemented using useReducer
Author: Jesse Wright
Latest version: 1.0.3

# useState

React hook with same API as useState (plus some extensions) implemented using useReducer

[![GitHub license](https://img.shields.io/github/license/jeswr/useState.svg)](https://github.com/jeswr/useState/blob/master/LICENSE)
[![npm version](https://img.shields.io/npm/v/@jeswr/use-state.svg)](https://www.npmjs.com/package/@jeswr/use-state)
[![build](https://img.shields.io/github/workflow/status/jeswr/useState/Node.js%20CI)](https://github.com/jeswr/useState/tree/main/)
[![Dependabot](https://badgen.net/badge/Dependabot/enabled/green?icon=dependabot)](https://dependabot.com/)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
## Why

useReducer applies dispatch calls in the order in which they are made. The native useState functionality does not.

## Usage

Using the traditional useState API

```tsx
import { useState } from '@jeswr/use-state'

function MyReactComponent() {
  const [counter, setCounter] = useState(0);
  useEffect(() => {
    setCounter(1);
  }, [])
  return <div>{counter}</div>
}
```

Using the additional `modifier` parameter

```tsx
import { useState } from '@jeswr/use-state'

function MyReactComponent() {
  const [counter, setCounter] = useState(0, props => props.value);
  useEffect(() => {
    setCounter({ value: 1 });
  }, [])
  return <div>{counter}</div>
}
```

## License
©2021–present
[Jesse Wright](https://github.com/jeswr),
[MIT License](https://github.com/jeswr/useState/blob/master/LICENSE).
npm package: @jeswr/utils
Description: This is a repo for me to put utility functions in for temporary periods before I move them upstream or factor out into a library of their own. [![GitHub license](https://img.shields.io/github/license/jeswr/utils.svg)](https://github.com/jeswr/utils/blob/m
Author: Jesse Wright
Latest version: 1.1.0

# utils
This is a repo for me to put utility functions in for temporary periods before I move them upstream or factor out into a library of their own.
[![GitHub license](https://img.shields.io/github/license/jeswr/utils.svg)](https://github.com/jeswr/utils/blob/master/LICENSE)
[![npm version](https://img.shields.io/npm/v/@jeswr/utils.svg)](https://www.npmjs.com/package/@jeswr/utils)
[![build](https://img.shields.io/github/actions/workflow/status/jeswr/utils/nodejs.yml?branch=main)](https://github.com/jeswr/utils/tree/main/)
[![Dependabot](https://badgen.net/badge/Dependabot/enabled/green?icon=dependabot)](https://dependabot.com/)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

It is not recommended that this be used by anyone else, but if you do so expect consistent breaking changes / mver bumps.

## License
©2024–present
[Jesse Wright](https://github.com/jeswr),
[MIT License](https://github.com/jeswr/utils/blob/master/LICENSE).
npm package: @jeswr/vc-queries
Description: A set of queries for the VCs generated by @jeswr/vc-cli
Author: Jesse Wright
Latest version: 1.1.0

# VC Queries

A set of SPARQL queries for working with Verifiable Credentials (VCs) generated by [@jeswr/vc-cli](https://github.com/jeswr/vc-cli).

## Installation

```bash
npm install @jeswr/vc-queries
```

## Usage

This package provides a collection of SPARQL queries that can be used to query Verifiable Credentials. The queries are designed to work with the output format of the @jeswr/vc-cli tool.

### Available Queries

The package includes the following queries:

- `can-drive.rq`: Query to check driving permissions

### Running Queries

You can run queries using the following command:

```bash
npm run query
```

This will execute the default query (can-drive.rq) against the collected.ttl file.

### Generating Test Data

To generate test data and run the queries:

```bash
npm run test
```

This will:
1. Generate test VCs using vc-cli
2. Collect them into a single TTL file
3. Run the queries against the collected data

## Development

### Prerequisites

- Node.js
- npm
- @jeswr/vc-cli

### Setup

1. Clone the repository
2. Install dependencies:
   ```bash
   npm install
   ```

### Adding New Queries

1. Create a new `.rq` file in the `queries` directory
2. Add your SPARQL query
3. Update the package.json scripts if you want to add a specific command for your query

## License

MIT © [Jesse Wright](https://github.com/jeswr/)