RDF Interfaces Extension
Attention: a lot of work has gone through rdf-ext 0.3.0 and it doesn't match this documentation. Right now you can have a look at the tests and at the different packages under the rdf-ext organization. Documentation will be updated soon
RDF-Ext provides a JavaScript library for working with RDF & Linked Data.
Parsing
Serializing
Stores
For persistence, RDF-Ext provides several store implementations.
Design
RDF-Ext is an extension of the RDF Interfaces specification. The RDF Interfaces specification defines interfaces for graphs, triples, nodes and parsers/serializers. However, the spec does not define an interface to access triplestores using NamedGraph IRIs. RDF-Ext fills this gap by providing a definition of a Store-Interface with an asynchronous API.
The motivation for an asynchronous API is simple: A JSON-LD context for example can be defined as an URL. The parsing and serialization process must therefore be asynchronous. The RDF-Ext spec contains an extended interface for parsers and serializers to work asynchronously.
With ECMAScript 6 (ES6) JavaScript introduces some new features. RDF-Ext uses the new Promise feature to handle asynchronous function calls easier.
Requirements
RDF-Ext requires a library, which implements the W3C RDF Interfaces API.
Here is a list of known working implementations:
Usage
In general, consult the documentation for the RDF Interfaces and RDF-Ext specifications for details about how to interact with the library.
node.js
RDF-Ext is available on npm
, to install it run:
npm install rdf-ext
In the code, import RDF-Ext:
var rdf = require('rdf-ext');
Browser
Just import RDF-Ext:
<script src="/js/rdf-ext.js"></script>
If you want to use rdfstore-js it must be imported first.
Because rdfstore-js comes with an outdated version of JSON-LD it must be deleted afterwards:
<script src="/js/rdfstore.js"></script>
<script>delete jsonld;</script>
Support
Issues & feature requests should be reported on Github.
Pull requests are very welcome.