rdfjs-wrapper
v0.15.0
Published
RDF/JS object mapping library
Maintainers
Readme
RDF/JS Wrapper
An RDF/JS object mapping library.
Background
RDF/JS Wrapper facilitates object-oriented programming over RDF (see RDF, Knowledge Graph).
RDF/JS Wrapper uses the interfaces described in the RDF/JS specifications.
Practically, to map RDF to objects, you need to:
- Write a class or use an existing class that extends TermWrapper
- Each class needs a Term, a Dataset, and a DataFactory to be instantiated
- Each class property will have an associated RDF Property (a string, generally a URL, that is defined by an ontology/vocabulary)
- Each class property depending on its type can have:
- a corresponding ValueMapping to get values, that is translating RDF Terms to JavaScript primitive values (string, number, boolean...)
- a corresponding TermMapping to set values, that is translating Javascript primitive values to RDF Terms
- a corresponding ValueMapping and TermMapping for sets of primitive values
- a corresponding TermWrapper for properties returning a class
- two corresponding TermWrappers (generally the same) for sets of classes
- Each class mutates the underlying Dataset that is passed to it for instantiation
Usage
Wrapping Terms
Wrapping Datasets
License
This work is dual-licensed under MIT and Apache 2.0. You can choose between one of them if you use this work.
SPDX-License-Identifier: MIT OR Apache-2.0
