0.4.1 • Published 5 years ago

@tpluscode/fun-ddr-sparql-graph-repository v0.4.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

SPARQL Graph Store for fun-ddr

Installation

npm i --save @tpluscode/fun-ddr-sparql-graph-repository hydra-box

Usage

  1. Create a repository
import rdfFetch from 'hydra-box/lib/rdfFetch'
import { SparqlGraphRepository } from '@tpluscode/fun-ddr-sparql-graph-repository'
import { expand } from '@zazuko/rdf-vocabularies'

const sparqlClient = new SparqlHttp({
  endpointUrl,
  updateUrl,
  fetch: rdfFetch,
})

// The namespace URI for resources
const base = 'http://my.resource.ns/'

// JSON-LD context document for (de)serializing
const context = {
  '@vocab': 'https://my.vocabulary.ns/',
  name: expand('schema:name'),
}

// A frame used to deserialize triples
const frame  = {
  '@type': 'Person',
}

export const people = new SparqlGraphRepository<T>(sparqlClient, base, context, frame)
  1. Use it to retrieve and save aggregates
import { people } from './repository/people'

const person = await people.load('...')

person.mutate(changeLastName)({ newName: 'Doe', reason: 'marriage' })
  .commit(people)
  .catch(console.error)
0.4.1

5 years ago

0.4.0

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.10

5 years ago

0.2.9

6 years ago

0.2.8

6 years ago

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago