Re: SPDX RDF visualization
Yev Bronshteyn
A slight correction to the above – the sparql query in my previous email may be too simplistic in that it does not include files that are inside of packages (as package contents are not necessarily described with relationships).
This should produce the graph of both relationships and file contents:
prefix spdx: <http://spdx.org/rdf/terms#>
construct { ?sub ?pred ?obj . ?sub2 spdx:hasFile ?file} where { ?sub spdx:relationship ?rel . ?rel spdx:relationshipType ?pred . ?rel spdx:relatedSpdxElement ?obj . ?sub2 spdx:hasFile ?file .
} From: <spdx-bounces@...> on behalf of Yev Bronshteyn <ybronshteyn@...>
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: <http://spdx.org/rdf/terms#>
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.
The resulting RDF should be a much more straightforward graph of all the relationsips.
From: <spdx-bounces@...> on behalf of "STAIR, MICHAEL A" <ms1784@...>
Hello,
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 (http://franz.com/agraph/gruff/) , but it’s a little tedious. Thanks.
Mike _____________________________ |
|