2.0.0 • Published 3 months ago

@zazuko/shacl-playground v2.0.0

Weekly downloads
-
License
-
Repository
-
Last release
3 months ago

@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

2.0.0

3 months ago

1.0.0

1 year ago