JSPM

  • Created
  • Published
  • Downloads 21649
  • Score
    100M100P100Q145416F
  • License MIT

Zazuko's RDF/JS Environment

Package Exports

  • @zazuko/env
  • @zazuko/env/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@zazuko/env) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Zazuko's RDF/JS Environment

Like rdf-ext, with the addition of @tpluscode/rdf-ns-builders

import env from '@zazuko/env'

// bind namespace to create named nodes
const tbbt = env.namespace('https://tbbt.tv/')

// use clownface for easy graph manipulation
const sheldonCooper = env.clownface()
  .namedNode(tbbt.sheldon)
  // use common vocabularies out-of-the box  
  .addOut(env.ns.rdf.type, env.ns.schema.Person)
  .addOut(env.ns.schema.knows, tbbt.leonard)

Also, provides TypeScript types for the default environment and a mapped type, which helps declare derived environment type, which combines existing envirnment with additional factories

import { create, DefaultEnv, DerivedEnvironment } from '@zazuko/env'

class MyFactory {}

const myEnv: DerivedEnvironment<MyFactory> = create(MyFactory)