W3C home > Mailing lists > Public > public-cwm-talk@w3.org > July to September 2004

gleaning RDF from omnigraffle diagrams

From: Dan Connolly <connolly@w3.org>
Date: Thu, 30 Sep 2004 00:32:16 -0500
Message-Id: <16F20905-12A2-11D9-BB22-000D9338C596@w3.org>
Cc: Tim Berners-Lee <timbl@w3.org>, public-cwm-talk@w3.org
To: Eric Miller <em@w3.org>

EricM, I think you asked me about using omnigraffle as an authoring 
tool for RDF.

I made some progress tonight.

Omnigraffle files are plists. I started a transformation for those
a while ago:

I just enhanced it (v 1.3 2004/09/30 04:49:27) to do datatypes the 
modern way.

So we start with an omnigraffle file, which looks like...

<plist version="1.0">

and then...

$ xsltproc plist2rdf.xsl foo.graffle

and out comes...


now I can hardly read the datatype syntax, but I checked it with cwm 

$ xsltproc plist2rdf.xsl foo.graffle | python cwm.py --rdf --n3>,xxx.n3

and now I can read it...

       [      :CanvasColor  [
                  :a "1";
                  :w "1" ];
              :ColumnAlign 0;
              :ColumnSpacing 36.0;

The main problem with this approach is that it puts all plist keys in 
one namespace...

  @prefix : <http://www.w3.org/2000/10/swap/util/applePList@@#> .

which is a fib. Omnigraffle's :CanvasColor property might not be the 
same as
some other app's :CanvasColor property. Maybe the namespace should
be a parameter to the plist2rdf.xsl thingy. I dunno... anyway...

I was wondering if the information about which arrows are connected to 
which circles comes thru, and it does:

                      r:rest ();
                      :Class "LineGraphic";
                      :Head  [
                          :ID 3 ];
                      :ID 5;
                      :Style  [
                          :stroke  [
                              :HeadArrow "FilledArrow";
                              :LineType 1;
                              :TailArrow "0" ] ];
                      :Tail  [
                          :ID 2 ] ]

(I dunno where the r:rest () bit comes from; cwm bug, I think.)

Anyway, the point is, I have a square connected to a circle
by an arrow. I can write rules to match that graphic structure
and transform it to, say, :neighbor relationships:

{ ?L :Head [ :ID ?HEADID ];
      :Tail [ :ID ?TAILID ].
   [] :ID ?HEADID; :Shape ?HEADSHAPE.
   [] :ID ?TAILID; :Shape ?TAILSHAPE.
          :neighbor ( ?HEADID ?HEADSHAPE) }.

$ python ../cwm.py ,xxx.n3 --filter=,linefilter.n3

and out comes:

       ( 2 "Rectangle"  ) :neighbor  ( 3 "Circle"  ) .

more or less... I stripped namespace decls, comments,
and rearranged the whitespace.

But I hope you get the idea. It's sort of the "putting the
toothpaste back into the tube" version of

  Circles and arrows diagrams using stylesheet rules

Dan, still getting used to the Apple OS X Mail.app
p.s. I was thinking of formatting this as "Rich Text" but
I don't see how to make links.
Received on Thursday, 30 September 2004 05:32:03 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:01:04 UTC