@zazuko/shacl-playground
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

@zazuko/shacl-playground

Helps you build links to https://shacl-playground.zazuko.com

import type { DatasetCore } from '@rdfjs/types'
import { createPlaygroundUrl } from '@zazuko/shacl-playground'

let shapes: DatasetCore
let data: DatasetCore

const link = createPlaygroundUrl(shapes, data)

The URLs may be quite long. Shorten with @zazuko/s

import { shorten } from '@zazuko/s'

let link: string
const shortUrl = await shorten(link)

Options

An optional, third argument can be provided

interface Options {
  /**
   * URL of a playground instance.
   *
   * Default to the official instance running on https://shacl-playground.zazuko.com/
   */
  instanceUrl?: string
  /**
   * Serialisation of the data graph
   *
   * `text/turtle` by default
   */
  dataGraphFormat?: string
  /**
   * Serialisation of the shapes graph
   *
   * `text/turtle` by default
   */
  shapesGraphFormat?: string
  /**
   * A map of prefixes for the data graph
   */
  dataGraphCustomPrefixes?: Record<string, string>
  /**
   * A map of prefixes for the shapes graph
   */
  shapesGraphCustomPrefixes?: Record<string, string>
}

dataGraphFormat and shapesGraphFormat must be any RDF media type supported by @rdfjs-elements/formats-pretty

Readme

Keywords

none

Package Sidebar

Install

npm i @zazuko/shacl-playground

Weekly Downloads

52

Version

2.0.0

License

none

Unpacked Size

4.95 kB

Total Files

6

Last publish

Collaborators

  • zazuko-bot
  • tpluscode
  • ludovicm67
  • ktk