#  n3
#
#  Find unclassified income   if argv(1)
#
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix string: <http://www.w3.org/2000/10/swap/string#>.
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
@prefix q:  <http://www.w3.org/2000/10/swap/pim/qif#>.

@prefix os: <http://www.w3.org/2000/10/swap/os#>.
@prefix tax:  <http://www.w3.org/2000/10/swap/pim/tax.n3#>.    #@@

#
@prefix : <#>.
@prefix foo: <#>.

@forAll :d, :p, :s, :t, :x, :y, :z.


"00" log:outputString
"""<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Personal financial report</title>
  <link type="text/css" rel="stylesheet" href="report.css" />
</head>

<body>
<table>
<tbody>
<tr><th>Date</th><th>Details ("payee")</th><th>Amount</th></tr>
""".

# {   :t is os:argv of "1" } log:implies { "0" log:outputString :s }

{  
    [] q:payee :p; q:amount :x; q:date :d.
 ( "<tr><td class='date'>" :d
       "</td><td class='payee'>" :p
       "</td><td class='amount'>" :x "</td></tr>\n") string:concatenation :s
} log:implies {
   :d log:outputString :s
}.

"99" log:outputString """</tbody></table>
</html>
""".

#ends

