GraphGists

This gist is explain the Open Source Licensing Graph, based on the wonderful data from ChoosALicense.com, a github service. I wrote a small blogpost around it too on my blog.

First we have to load the data into the graph. This was a bit of work - but not difficult at all:

The actual graph then looks like this:

Then we can do some easy queries. Like for example: show me the requirements of the GPLv3:

MATCH (n:License {name:"GPLv3"})-[r]-(m:Characteristic)
RETURN n.name as License, type(r) as Qualifier, m.name as Characteristic;

The results are interesting:

Or lets try to see how the GPLv3 and Apache licenses are connected:

MATCH p = AllShortestPaths((n:License {name:"GPLv3"})-[*]-(m:License {name:"Apache"}))
RETURN p;

This is interesting: there seems to be a contradiction here, which we can explore:

MATCH (n:License {name:"GPLv3"})-[r1]-(c:Characteristic)-[r2]-(m:License {name:"Apache"})
WHERE type(r1)<>type(r2)
RETURN n.name as License1, type(r1) as Qualifier1, c.name as Characteristic, type(r2) as Qualifier2, m.name as License2;

Let’s see if we can do something similar for other licenses?

MATCH (n:License)-[r1:PERMITS|FORBIDS]->(c:Characteristic)<-[r2:PERMITS|FORBIDS]-(m:License)
WHERE type(r1)<>type(r2)
RETURN distinct n.name as License1, type(r1) as Qualifier1, c.name as Characteristic, type(r2) as Qualifier2, m.name as License2;

So there we go! All the contradictions between all of the different licenses!

To play some more, use the console below. Enjoy!

This gist was created by Rik Van Bruggen