Skip to content

ontola/link-lib

This branch is 1 commit ahead of, 142 commits behind rescribet/link-lib:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b7b726c · Sep 24, 2019
Apr 24, 2019
Sep 27, 2018
Sep 24, 2019
Feb 7, 2018
Feb 7, 2018
Jun 28, 2017
Jan 18, 2019
Sep 27, 2018
Aug 22, 2019
Apr 23, 2019
Feb 7, 2018
Jan 18, 2019
Sep 25, 2018
Jul 30, 2019

Repository files navigation

Link Library

A Link to the Web

CircleCI

This package aims to make building rich web applications quick and easy by providing a wrapper around rdflib.js's store, adding high-level API's for view rendering, data querying & manipulation, and API communication. See the link-redux package on how to use this in a React project.

To transform your Rails application into a linked-data serving beast, see our Active Model Serializers plugin.

This was built at Argu, if you like what we do, these technologies or open data, send us a mail.

Example

See the TODO app for a live example and link-redux-todo for the implementation. Mind that it isn't connected to a back-end, so it's only a demo for the view rendering mechanism.

Installation

yarn add link-lib rdflib@npm:link-rdflib

The package externalizes the Promise API, so make sure to include your own when targeting platforms without native support.

Usage

See the Hypermedia API page for documentation on how to execute actions against the service.

See Link Redux for documentation on how to use Link in a React application.

Included namespace prefixes

See the utilities for the namespaces included by default.

Changes to rdflib.js

This library instantiates rdflib.js for some core tasks (low-level querying, processing), but also makes some changes to its inner workings. See the RDFStore for the main wrapper and DataProcessor for changes to the rdflib Fetcher.

Following are some of the most important changes;

  • All named nodes MUST be instantiated via the memoization mechanism (see the utilities). This is done to enable the use of nested number arrays over string (iri) maps for performance gains.
  • To be able to keep track of changes, principles of immutability should be maintained, it is assumed that changes are either server provided or done via well-documented API's. Return values from the store might be frozen, and making changes directly will result in unexpected behaviour.
  • Some additional work is done to make the return values from rdflib more consistent (e.g. returning empty arrays over null or undefined).

Contributing

The usual stuff. Open an issue to discuss a change, open PR's from topic-branches targeted to master for bugfixes and refactors.

About

Linked Data Rendering for humans

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 99.4%
  • JavaScript 0.6%