rdf-ext / Rdf Ext
Programming Languages
Projects that are alternatives of or similar to Rdf Ext
RDF Interfaces Extension
RDF-Ext provides a low-level JavaScript library for working with RDF & Linked Data. This module contains the core classes to handle RDF Model data. Additional modules may be required to handle data in different formats (Turtle, JSON-LD) or stores (Web, SPARQL). The module section lists the most common modules.
By including this package, you will get an implementation of:
- The RDF/JS Datamodel specification, provided by @rdfjs/data-model
- A fast implementation of the RDF/JS Dataset specification, provided by rdf-dataset-indexed
- A simple N-Triples Serializer, provided by @rdfjs/to-ntriples
- A RDF Dataset Normalization, provided by rdf-normalize
This should be all needed for starting to work with RDF in JavaScript. If you interact with named nodes directly we recommend namespace, which gives a nice interface for creating named nodes.
If you are looking for a more high-level interaction with RDF in JavaScript you might consider the graph traversal library clownface and another abstraction on top of clownface called RDFine. RDF-Ext provides the technical foundation and is included in both projects.
Usage
In general, consult the RDFJS specification for details about how to interact with the library.
Node
RDF-Ext is available on npm
, to install it run:
npm install rdf-ext
In the code, import RDF-Ext:
const rdf = require('rdf-ext')
Browser
The preferred way to use RDF-Ext in the browser is using browserify.
Distribution
It's also possible to use a prebuilt or custom distribution using the RDF-Ext distribution builder. This can be also done using the RDF-Ext distribution builder site.
Than just import the RDF-Ext distribution:
<script src="/js/rdf-ext.js"></script>
Everything is attached to the global variable rdf
.
Support
Issues & feature requests should be reported on Github.
Pull requests are very welcome.
Modules
There are many modules for parsing, serializing, stores for persistence and simplified data handling. In general, all modules are available at npm and you can use the Github repository name to install them.
Parsers
- JSON-LD - Uses the reference implementation that supports all document forms
- Turtle & N-Triples - Uses N3.js for parsing
- RDF/XML - A fast, streaming RDF/XML parser that outputs RDFJS-compliant quads.
- RDFa Streaming Parser - A fast and lightweight streaming RDFa parser for JavaScript
- CSV on the Web streaming parser - A CSV on the Web parser with RDFJS Stream interface.
- XLSX (Excel) parser - A CSV on the Web based XLSX (Excel) parser with RDFJS Stream interface
If you want to get out of the box support for the most common formats, use Common Formats.
Serializers
- JSON-LD - Outputs JSON-LD in flat document form
- or JSON-LD - Outputs JSON-LD with prefix support and more document forms
- N-Triples - Outputs N-Triples
- CSV - CSV on the Web serializer that implements the RDFJS Sink interface.
If you want to get out of the box support for the most common formats, use Common Formats.
Stores
Implementations of the RDFJS Store interface.
- Dataset - Wrapper around an in memory Dataset
- SPARQL - Uses the SPARQL 1.1 Protocol
- Filesystem - Filesystem based RDF Store that follows the RDF/JS: Stream interfaces specification.
- Web - Query an external Linked Data via RESTful HTTP requests
Others
- Common Formats - Loads parsers and serializers for the most common formats
- Clownface - A graph traversal library inspired by Gremlin which allows querying any RDF dataset in a concise and readable way.
- Express-Handler - Handle incoming and outgoing RDF data in Express
- Fetch - Uses Fetch to send and receive RDF-Ext Graphs over HTTP
- Fetch lite - Same as above but does not include common parsers and serializers so it is lightweight
- Namespace - The package exports a factory to create builders for Named Nodes.