@prefix dc: <http://purl.org/dc/elements/1.1/>.

<> dc:description """build consolidated WG schedule report""",
   "$Id: wg-sched-report.n3,v 1.8 2002/04/26 21:31:27 connolly Exp $".

@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix str: <http://www.w3.org/2000/10/swap/string#>.
@prefix math: <http://www.w3.org/2000/10/swap/math#>.

@prefix r: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

@prefix con: <http://www.w3.org/2000/10/swap/pim/contact#> .
@prefix org: <http://www.w3.org/2001/04/roadmap/org#> .
@prefix doc: <http://www.w3.org/2000/10/swap/pim/doc#> .
@prefix tr: <http://www.w3.org/2001/02pd/rec54#>.


"1" log:outputString """
<html xmlns='http://www.w3.org/1999/xhtml'>
 <head><title>W3C Schedule of Working Group Deliverables</title>
  <link rel='stylesheet' href='wg-sched-style.css' />
 </head>
 <body>
<p><a href="../../../">W3C</a></p>
<h1>W3C Schedule of Working Group Deliverables</h1>

 <address>DRAFT in progress, Apr 2001<br />
@@generated by code by DanC based on data from /Member/Mail, /TR/, etc. see <a href="Makefile">Makefile</a> for details.</address>

<p><em>Note</em>: publications older than 18 months are elided.</p>
<p><em>Note</em>: WG start dates are not shown.</p>

  <table border="0">
  <tr>
   <td colspan="3">&#160;</td>
   <th colspan="12">2001</th>
   <th colspan="12">2002</th>
   <th colspan="12">2003</th>
  </tr>
  <tr><th>Group</th><th>&#160;</th><th>Title</th>
     <th>01</th>
     <th>02</th>
     <th>03</th>
     <th>04</th>
     <th>05</th>
     <th>06</th>
     <th>07</th>
     <th>08</th>
     <th>09</th>
     <th>10</th>
     <th>11</th>
     <th>12</th>

     <th>01</th>
     <th>02</th>
     <th>03</th>
     <th>04</th>
     <th>05</th>
     <th>06</th>
     <th>07</th>
     <th>08</th>
     <th>09</th>
     <th>10</th>
     <th>11</th>
     <th>12</th>

     <th>01</th>
     <th>02</th>
     <th>03</th>
     <th>04</th>
     <th>05</th>
     <th>06</th>
     <th>07</th>
     <th>08</th>
     <th>09</th>
     <th>10</th>
     <th>11</th>
     <th>12</th>

  </tr>
""".

"z" log:outputString """
  </table>
 </body>

</html>
""".

@prefix : <wg-sched-report#>.

this log:forAll
  :pgAddr, :pg, :work, :tr, :docT, :stat,
  :mbox, :gN, :when, :yyyy, :mm, :grp,
  :k, :k2, :txt, :span, :cellClass,
  :s, :p, :o,
  :x, :y, :z.


# colors moved to wg-sched-style.css
tr:NOTE a :Status; :label "N".
tr:WD a :Status; :label "WD".
tr:CR a :Status; :label "CR".
tr:PR a :Status; :label "PR".
tr:REC a :Status; :label "REC".


{
  <groups.rdf> log:semantics [ log:includes {
     :grp a org:WorkingGroup; org:name :gN;
       con:mailbox :mbox;
       con:homePageAddress :pgAddr
       .
   }
  ].

  :pg log:uri :pgAddr.

  <wg-charters.n3> log:semantics [ log:includes {
    :pg is con:homePage of [
      org:charter :work ].
    :work doc:expires :when.
  } ].

  (:when "(\\d\\d\\d\\d)-") str:scrape :yyyy.
  (:when "\\d\\d\\d\\d-(\\d\\d)") str:scrape :mm.

  :span is math:sum of (
    [ is math:product of ([ is math:difference of (:yyyy "2001") ] "12")]
    :mm).

  :mbox log:uri :x.
  (:x "mailto:([^@]+)@w3.org") str:scrape :y.

  ("1." :when :y) str:concatenation :k.

  ("<tr><td colspan='2'><a href='" :pgAddr "'>" :gN "</a></td>"

   "<td>&#160;</td>" # skip past TR title stuff
   "<td align='center' class='charter' colspan='" :span "'><a href='"
     [ is log:uri of :work ] "'>charter</a> thru "
   :when "</td>"
   "</tr>\n")
	str:concatenation :txt.
}
  log:implies {
    :k log:outputString :txt.

    :grp a org:WorkingGroup; org:name :gN;
       con:mailbox :mbox;
       con:homePage :pg;
       :_reportKey :k.
  }.


# published TRs

{
  :grp con:mailbox :mbox; :_reportKey :k.

  <wg-doc.n3> log:semantics [ log:includes {
    [ con:mailbox :mbox;
      org:deliverable :work
    ]
  } ].


  :stat a :Status.

  <tr2.rdf> log:semantics [ log:includes {
    :tr a :stat; doc:versionOf :work; dc:date :when; dc:title :docT.
  }].


  (:k :when) str:concatenation :k2.


  (:when "(\\d\\d\\d\\d)-") str:scrape :yyyy.
  (:when "\\d\\d\\d\\d-(\\d\\d)") str:scrape :mm.

  :span is math:sum of (
    [ is math:product of ([ is math:difference of (:yyyy "2001") ] "12")]
    :mm
    "-1").


  ("<tr><td>&#160;</td>"
   "<td class='" [ is :label of :stat ]
        "' colspan='2'><a href='" [ is log:uri of :tr ] "'>" :docT "</a></td>"

   "<td colspan='" :span "'>&#160;</td>"
   "<td class='" [ is :label of :stat ] "'>" 
   "<a href='" [ is log:uri of :tr ] "'>"
         [ is :label of :stat ]  "</a></td><td colspan='4'>" :when "</td>"

   "</tr>\n")
	str:concatenation :txt.
}
  log:implies {
    :k2 log:outputString :txt.
  }.



# scheduled TRs
@prefix apr: <chairs2002Apr#>.

{
  :grp con:mailbox :mbox; :_reportKey :k.

  <wg-doc.n3> log:semantics [ log:includes {
    [ con:mailbox :mbox;
      org:deliverable :work
    ]
  } ].


  :stat a :Status.

  <chairs2002Apr.n3> log:semantics [ log:includes {
    :tr a :stat; doc:versionOf :work; apr:schedDate :when.
  }].
  <tr2.rdf> log:semantics [ log:includes {
    [ doc:versionOf :work; dc:title :docT].
  }].


  (:k :when "sched") str:concatenation :k2.


  (:when "(\\d\\d\\d\\d)-") str:scrape :yyyy.
  (:when "\\d\\d\\d\\d-(\\d\\d)") str:scrape :mm.

  :span is math:sum of (
    [ is math:product of ([ is math:difference of (:yyyy "2001") ] "12")]
    :mm
    "-1").

  ( "sched" [ is :label of :stat ]) str:concatenation :cellClass.

  ("<tr><td>&#160;</td>"
   "<td class='" :cellClass
        "' colspan='2'><a href='" [ is log:uri of :tr ] "'>" :docT "</a></td>"

   "<td colspan='" :span "'>&#160;</td>"
   "<td class='" [ is :label of :stat ] "'>" 
   "<a href='" [ is log:uri of :tr ] "'>"
         [ is :label of :stat ]  "</a></td><td colspan='4'>" :when "</td>"

   "</tr>\n")
	str:concatenation :txt.
}
  log:implies {
    :k2 log:outputString :txt.
  }.


