Monday 30 December 2013

Go and the Semantic Web: Creating Go language bindings for the Redland libRdf C library

Recently I began work on a small project that makes use of several Semantic Web Technologies (namely RDF, SPARQL and triplestores).   I chose to use this project as an opportunity to explore the Go language and have been happy with the results.

The main output of this work so far is a set of Go language bindings, tests and examples for the Redland libRDF C library.  I have made this available on github:


The Redland libRDF library provides parsers for several RDF syntaxes along with RDF storage and querying support.

The Go language standard library is fairly comprehensive, however this does not extend to RDF support and hence the need for a library such as Redland libRDF.  Go through the use of CGO has good support for calling into C code.

I was able to use the set of Redland C examples as a basis for creating equivalent Go examples in the form of tests.  Go has a built-in automated testing package and tests can be executed using the same go command used to compile.
 
After trying a couple of different IDEs for this work, I settled on Sublime Text 2 with the GoSublime package.


As Go relies on folder structure / file location to infer package structure, and has a simple but powerful command line; a tool like Sublime Text, which has a terminal window, makes an effective IDE for Go development.

I am currently using these bindings on small web-project which I hope to describe in more detail in the future.

No comments:

Post a Comment