#  Find and graph all dependencies

@prefix doc: <http://www.w3.org/2000/10/swap/pim/doc#>.
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix rm:    <http://www.w3.org/2001/04/roadmap/vocab#>.   #  @@@@@@@@@@@@@
@prefix dot: <http://www.w3.org/2001/02pd/gv#>.
@prefix swws: <http://www.w3.org/2001/04/roadmap/swws#>. # rdf2dot.xsl needs namespace URIs absolutized @@
@prefix : <http://www.w3.org/2001/04/roadmap/all#>.
@prefix w:  <http://www.w3.org/2001/04/roadmap/w3c#>.

<> dot:digraph :theGraph.

:theGraph dot:label "XML character set decision $Date: 2006/01/11 18:30:56 $".


this log:forAll :n1, :n2, :p, :s.

:theGraph dot:hasNode :start.  # seed

:to a dot:EdgeProperty.
:yes a dot:EdgeProperty; dot:label "yes".
:no a dot:EdgeProperty; dot:label "no".

:start  dot:label "start"; :to :mime.

:mime a :decision; dot:label "Content-Type\\nhas charset";
    :yes :useit;
    :no :textApp.

:useit a :action;
    dot:label "Check valid under that encoding";
    :to :end.

:end dot:label "done"; dot:shape "circle".

:textApp a :decision; dot:label "text/* rather than\\napplication/*?";
    :yes :text;  :no :app.

:text a :action; dot:label "Check in US-ASCII";
    :to :end.

:app a :action; dot:label "See XML spec appendix\\nfrom now on";
    dot:URL "http://www.w3.org/XML";
    :to :byte.

:byte a :decision; dot:label "FF FE or FE FF?";
    :yes :utf16;
    :no  :ebcdic.

:utf16 a :action;
    dot:label "Conclude UTF-16\\nCheck valid\\nCheck matches any xml encoding given";
    :to :end.

:ebcdic a :decision; dot:label "(opt!) looks like EBCDIC?";
    dot:color "red";
    :yes :ebcdicyes;
    :no  :encoding.

:ebcdicyes a :action;  dot:label "Determine which\\nECBDIC flavor";
    dot:color "red";
    :to  :end.

:encoding a :decision; dot:label "?xml has\\nencoding=?";
    :yes :encyes;
    :no  :utf8.

:encyes a :action;  dot:label "Check valid\\nin that encoding";
    :to  :end.

:utf8 a :action; dot:label "Assume UTF-8\\nCheck valid."; :to :end.


# Domain and range:

{ :n1 :yes :n2 } log:implies { :n1 a :decision }.
{ :n1 :to :n2 } log:implies { :n1 a :action }.

{ :n1 a :decision } log:implies { :n1 dot:shape "diamond" }.
{ :n1 a :action } log:implies { :n1 dot:shape "ellipse" }.

# Find all the nodes:

{ :theGraph dot:hasNode :n1.
  :n1 :p :n2.
  :p a dot:EdgeProperty.
 }
   log:implies { :theGraph dot:hasNode :n2. }.

{ :theGraph dot:hasNode :n2.
  :n1 :p :n2.
  :p a dot:EdgeProperty.
 }
   log:implies { :theGraph dot:hasNode :n1. }.



# end
