Skip to content

runcrypto/jsonld-cpp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsonld-cpp

JSON-LD Implementation for C++

This is a C++ implementation of JSON-LD (http://json-ld.org)

Development is still in progress--currently it only supports the expand(), toRdf() and normalize() functions.

Building jsonld-cpp

To build jsonld-cpp, you will need:

  • cmake
  • g++, clang or Visual Studio (community edition)

jsonld-cpp uses a pretty standard cmake build system:

mkdir build
cd build
cmake ..
make

You can also run all the tests:

make test

Installing prerequirements

If the above doesn't work, you probably need to install some prerequirements. For example, on a fresh Debian Stretch system:

$ sudo apt-get install make gcc g++ libboost-dev

It is worth getting the latest cmake, so you may want to install that the hard way:

wget https://cmake.org/files/v3.13/cmake-3.16.1.tar.gz
tar xzf cmake-3.16.1.tar.gz
cd cmake-3.16.1
./configure
make 
sudo make install

Now you can again try to build jsonld-cpp.

Examples

You can find in the examples directory a simple application showing how to interface with the library called jsonld2rdf. It can convert a json-ld document into normalized RDF data in NQuads format. There are also two example files showing how the normalized RDF could be hashed to show that the two documents are equivalent:

$ ./build/debug/examples/jsonld2rdf examples/ex01a.jsonld | shasum -a 256
cb92d57d8b7abf09e4642338049bd9ee91a0ee0fe327e0a6061a8bbc2f4314bf  -
$ ./build/debug/examples/jsonld2rdf examples/ex01b.jsonld | shasum -a 256
cb92d57d8b7abf09e4642338049bd9ee91a0ee0fe327e0a6061a8bbc2f4314bf  -

About

JSON-LD Implementation for C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 88.9%
  • Python 8.2%
  • CMake 0.8%
  • Shell 0.7%
  • M4 0.4%
  • Starlark 0.4%
  • Other 0.6%