Re: SPDX RDF visualization

Yev Bronshteyn

Hi, Michael,


I don’t know much about RDF graphing tools, but here’s a trick to make any tool you already have produce a better graph.


You can use this sparql query to reduce an SPDX document to an RDF where every relationship is reduced to a single triple:


prefix spdx: <>


construct { ?sub ?pred ?obj }

where {

     ?sub spdx:relationship ?rel .

     ?rel spdx:relationshipType ?pred .

     ?rel spdx:relatedSpdxElement ?obj .




Here’s how you can apply this query with Apache Jena:


1.       Load your spdx document into Jena’s triple store:

tdbloader --loc=data mydoc.rdf


In the example above, “data” is an empty directory where you have write access (where Jena will build its datastore) and mydoc.rdf is your SPDX document.


2.       Apply the query, which in this example is loaded into “relConcat.sparql”. Pipe the results into a file.

tdbquery --loc=data --query=../relConcat.sparql --results=RDF



The resulting RDF should be a much more straightforward graph of all the relationsips.


From: <spdx-bounces@...> on behalf of "STAIR, MICHAEL A" <ms1784@...>
Date: Wednesday, September 21, 2016 at 2:16 PM
To: "spdx@..." <spdx@...>
Subject: SPDX RDF visualization




I was wondering if anyone can suggest a tool to visually in a graph (ideally interactive) SPDX RDF files, specifically to follow relationships? I am currently using gruff ( , but it’s a little tedious. Thanks.



Michael Stair
Principal Member of Technical Staff
AT&T Chief Security Office (CSO)

Join { to automatically receive all group messages.