One of the objectives of the advanced development component of the Semantic Web activity is to demonstrate how RDF and Semantic Web technologies can be applied to the W3C Process to increase efficiency, reliability, etc. In the early stages of developing an RDF model of the W3C process, the tools I was using to visualize the model while working on it started working well enough that I started applying them to all sorts of stuff.
Starting with the open source graphviz toolset from AT&T research, we model the structure of its .dot input files using an RDF vocabulary of terms like digraph, hasNode, EdgeProperty, etc.; an XSLT transformation, rdf2dot.xsl, produces actual .dot syntax from RDF/xml documents that use this vocabulary. This vocabulary is documented* in gv.n3 (using a sort of wiki RDF syntax; cf. Primer: Getting into RDF & Semantic Web using N3).
* to some extent; I'm afraid the gv schema is incomplete and the XSLT code is the only complete reference as of this writing. The gv vocabulary does follow Drawing graphs with dot quite closely, though, and tracks updates to dot graph attributes to some extent.
Using our interactive XSLT service:
Now for the fun part: exploiting generic RDF rules processing to deduce facts about graphviz diagrams from facts built from other vocabularies. Suppose we know a few simple facts:
In our wiki RDF syntax, we can write this as:
:w :staff :d . :d a :Person; :name "Dan Connolly". :w a :Organization; :tla "W3C".
If you're more familiar with the XML syntax for RDF, that's:
<Organization rdf:about="#w"> <tla>W3C</tla> <staff> <Person rdf:about="#d"> <name>Dan Connolly</name> </Person> </staff> </Organization>
Now let's represent that in circles-and-arrows. First, we'll say that staff properties should be drawn as arrows, labelled "Technical Staff":
:onStaff a g:EdgeProperty; g:label "Technical Staff".
or:
<g:EdgeProperty rdf:about="#staff"> <g:label>Technical Staff</g:label> </g:EdgeProperty>
Now for the rules bit: if something is a person whose name is some string, then use that string as the label for the thing in the diagram:
this log:forAll :n, :str. { :n a :Person; :name :str } log:implies { :n g:label :str }.
I hope you don't mind if I leave the RDF/XML syntax for rules for another day... Let's look at one more rule though: if something is an organization with some string as its TLA, then label it with that string, make it 20pt white text on a blue background:
{ :n a :Organization; :tla :str } log:implies { :n g:label :str; g:style "filled"; g:color "blue"; g:fontcolor "white"; g:fontsize "20" }.
Then we put that into cwm, our rules engine, and ask it to think; i.e. apply all the rules over and over until no new conclusions come out:
python cwm.py sw-bcard.n3 --think --rdf> sw-bcard.rdf
If you look inside sw-bcard.rdf, you'll see that cwm concluded that Dan's name is also his graphic label, and that W3C is blue etc.
Then we feed sw-bcard.rdf thru rdf2dot.xsl and out comes dot syntax; from there, we use the graphviz tools to produce SVG, PNG, postscript, and the other formats supported by graphviz. And that's all there is to it.**
**Actually, there are a few limitations you should know about. rdf2dot.xsl only groks a subset of RDF syntax, so you need to use a few more cwm flags to keep the nesting to a minimum and absolutize all URI references. See the Makefile for details
These are some of the first few examples I worked on; they might be out of date in some details:
see also: PaperTrail, Conversations and State, INDECS stuff@@
I'd like to revisit my March 2000 work on XML spec dependencies and Feb 2000 issue resolution process diagrams, now that I have these tools.
note to self: CirclesAndArrowsDiagrams in one of my Feb 2001 test wikis.
All semantic web development is supposed to be done in a world-readable CVS repository, per the Semantic Web Activity statement. So this stuff should perhaps be moved near telagent/palmagent.
But for now, you should be able to just follow the links to each of the bits. Sorry about that.