Package Exports
- rdf-ext
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 (rdf-ext) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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.
- Abstract - Abstract implementation, can be used to build your own store
- LDP - Query an external Linked Data Platform via RESTful HTTP requests
- File system - Using the file system
- In Memory - Store loaded in memomory
- Single graph (memory) - Store has only a single graph
- SPARQL - Uses the Graph Store HTTP Protocol interface
- RDFStore wrapper - Store built on top of Rdfstore-js
- Multistore - Use multiple store depending on the IRI
- Local/Remote - Uses a local store or a remote store depending on the IRI
- ACL wrapper - Add ACL support to your RDF store
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.