RDF Data Visualization

There was a "software to draw RDF graph diagrams" thread on semantic-web@w3.org. I was checking out the options and figured I'd record them here so others could be as lazy as I would have liked to have been.

I downloaded ontology-visualization.

git clone https://github.com/fatestigma/ontology-visualization
Cloning into 'ontology-visualization'...
remote: Counting objects: 44, done.
remote: Compressing objects: 100% (31/31), done.
remote: Total 44 (delta 19), reused 34 (delta 12), pack-reused 0
Unpacking objects: 100% (44/44), done.

It came with a tiny chunk of demo data:

:John a :Man ;
    :name "John" ;
    :hasSpouse :Mary .
:Mary a :Woman ;
    :name "Mary" ;
    :hasSpouse :John .
:John_jr a :Man ;
    :name "John Jr." ;
    :hasParent :John, :Mary .
:Time_Span a owl:Class .
:event a :Activity ;
    :has_time_span [
        a :Time_Span ;
        :at_some_time_within_date "2018-01-12"^^xsd:date
        ] .
:u129u-klejkajo-2309124u-sajfl a :Person ;
    :name "John Doe" .

I installed the python rdflib (sudo pip install rdflib) and rendered it with ontology-visualization:

python ./ontology_viz.py -o test.dot test.ttl -O ontology.ttl
[WARNING] Class http://dig.isi.edu/Time_Span doesn't exist in the ontology!
[WARNING] Property http://dig.isi.edu/at_some_time_within_date doesn't exist in the ontology!
dot -Tsvg -o test-ontology-visualization.svg test.dot

ontology-visualization

The EasyRdf Converter required no installation. I just pasted the Turtle in and selected SVG. Otoh, it rendered the result in a giant <pre/> rather than rendering the SVG inline in the response. I manually re-ordered the EasyRdf's graphviz output in order to better compare it to ontology-visualization. Here are the original EasyRdf dot and EasyRdf SVG and the tweaked dot.

EasyRdf Converter

Folks suggested yEd and Visio but those require manual drawing. You can also convert from yEd to RDF and ShEx. Someone mentioned Gruff but that requires installation of AllegroGraph (transcript below). The default rendering of the test data was again somewhat arbitrary in its layout but I again heroically alligned it with the ontology-visualization output for easy comparison. I didn't figure out how to export so here's a screenshot.

Gruff

Conclusion


Installing Gruff

Gruff has to talk to a database endpoint. I wasn't sure if it could be any SPARQL endpoint but in order to minimize impedence, I went strait to Allegrograph. The Franz downloads page has Gruff and Allegrograph.

Allegrograph

tar xzf ~/Downloads/agraph-6.4.4-linuxamd64.64.tar.gz
mkdir agraph-inst
./agraph-6.4.4/install-agraph /tmp/agraph-inst/
/tmp/agraph-inst/ already exists.
Overwrite? (config files will not be affected) [y/n] y

Welcome to the AllegroGraph configuration program.  This script will
help you establish a baseline AllegroGraph configuration. 

You will be prompted for a few settings.  In most cases, you can hit return
to accept the default value.

Location of configuration file to create:
[/tmp/agraph-inst/lib/agraph.cfg]: 
Directory to store data and settings:
[/tmp/agraph-inst/data]: 
/tmp/agraph-inst/data does not exist.
Would you like me to create it?:
[y]: 
Directory to store log files:
[/tmp/agraph-inst/log]: 
/tmp/agraph-inst/log does not exist.
Would you like me to create it?:
[y]: 
Location of file to write server process id:
[/tmp/agraph-inst/data/agraph.pid]: 
Port:
[10035]: 

Now you must set up an initial user account for AllegroGraph.  This
account will have "super user" privileges in AllegroGraph.

SuperUser account name:
[super]: 
SuperUser account password:
SuperUser account password (again):
Instance timeout seconds:
[604800]: 

/tmp/agraph-inst/lib/agraph.cfg has been created.  

If desired, you may modify the configuration.  When you are satisfied,
you may start the agraph service.

You can start AllegroGraph by running: 
/tmp/agraph-inst/bin/agraph-control --config /tmp/agraph-inst/lib/agraph.cfg start

You can stop AllegroGraph by running: 
/tmp/agraph-inst/bin/agraph-control --config /tmp/agraph-inst/lib/agraph.cfg stop
Removing staged installations from all hosts.
Installation complete.
./agraph-inst/bin/agraph-control start

AllegroGraph Server Edition 6.4.4, built on September 06, 2018 08:22:54 GMT-0700
Copyright (c) 2005-2018 Franz Inc.  All Rights Reserved.
AllegroGraph contains patented and patent-pending technologies.

current-time    : Sunday, September 09, 2018 04:00:34 AM 

Daemonizing...
Server started normally: Running with free license of 5,000,000 triples; no-expiration.
Access AGWebView at http://127.0.0.1:10035
    

Gruff

tar xzf ~/Downloads/gruff-7.2.2-AG6.4.4-linuxamd64.64-ACL10.1.tar.gz
./gruff
International Allegro CL [master]
10.1 [64-bit Linux (x86-64)] (Sep 6, 2018 8:35)
Copyright (C) 1985-2017, Franz Inc., Oakland, CA, USA.  All Rights Reserved.

This dynamic runtime copy of Allegro CL was built by:
   Franz Inc. Staff

;; Optimization settings: safety 1, space 1, speed 1, debug 2.
;; For a complete description of all compiler switches given the
;; current optimization settings evaluate (explain-compiler-settings).
;;---
;; Current reader case mode: :case-sensitive-lower

(gruff:4886): Gdk-WARNING **: 03:49:25.992: gdk_window_set_icon_list: icons too large