Towards the future RDF library

September 11, 2015

RDF is an simple and powerful language to describe data. However, playing with RDF data can get very tricky - especially when doing simple things. Only by solving the user experience of RDF libraries we would really get developers to user RDF more11 In all of its forms, turtle, json-ld, and so on.. This blog post is directed to the community that works in this field and it is an open call to work on an ultimate, simpler library for RDF.

I will now show you three ways to do a very simple task (1) the current way (using rdf-ext22 I have been recently involved with the development of this library) (2) the way developers find familiar (3) the way the future RDF lib should be.

In other words, the key hack is on Object.defineProperty which enable us to redefine the getters/setters of object properties. So, in other words, we can have the power of a graph, behind some simple operations.

As a last note, as many of you may point out, these examples only show how to do operations when both the subject and the predicate are known - what about the rest?

In my opinion, this is already a big step forward simplifying RDF, maybe there are some operations would not be possible to achieve, and we can always come back to the traditional way of handling a graph me.toGraph(), or we can find together some new clever solutions that have the same spirit of simplicity.

Conclusion

I implemented most of what presented here in a library called simplerdf - please, have a look at further examples. However, as you may expect, this library is not stable at all, the APIs could change drastically in the next few days.

If you are interested, I really would like to hear from you, and maybe fork the Github repository and contribute, so that maybe, we could really write the future RDF library together.