# n3 # # Categorized stuff # @prefix rdf: . @prefix s: . @prefix log: . @prefix string: . @prefix math: . @prefix q: . # #@prefix acc: . # for URIs Generated by qif2qu.n3 #acc:Default s:label "DEFAULT". @prefix os: . @prefix tax: . # @prefix : <#>. @prefix foo: <#>. @forAll :a, :c, :d, :k, :l, :p, :s, :t, :x, :y, :z. ################################################################ # Select subclasses of TaxCategories. # Must be at least one entry, and must have a label { [] a :c. :c a q:Cat; s:label []; s:subClassOf :t. :t a tax:Category; log:notEqualTo tax:Null, tax:Unclassified } log:implies { :c a :toBeDisplayed }. ################################################################## #q:Unclassified a :toBeDisplayed; s:label "Unclassified transactions". q:UnclassifiedIncome a :toBeDisplayed; s:label "Unclassified Income". q:UnclassifiedOutgoing a :toBeDisplayed; s:label "Unclassified Outgoings". "00" log:outputString """ Tax-related transactions by category

Spending and Income by category

""". { :y a :toBeDisplayed; s:label :l. (:y!log:uri ".*#(.*)") string:scrape :a. ( :l " 0000") string:concatenation :k. ( "

" :l """

""" ) string:concatenation :s . ( :l " 0000" ) string:concatenation :k. } log:implies { :k log:outputString :s }. # Each line: { [] a :y; q:payee :p; # q:amount :x; q:in_USD ?dollars; q:date :d; log:uri ?URI; q:toAccount [s:label :a]. ("%6.2f" ?dollars) string:format :x. # Check lines have to payees, a raw one (suppressed here) and one from checks-by-hand.* :p string:notMatches "^C[hH][Ee][Cc][Kk]". # Check lines should have other -- eh? :y a :toBeDisplayed; s:label :l. ( :l " " :d ?URI "0") string:concatenation :k. ( "\n") string:concatenation :s } log:implies { :k log:outputString :s }. #### Comment underneath { [] a :y; s:comment :p; q:date :d; log:uri ?URI; q:toAccount [s:label :a]. :y a :toBeDisplayed; s:label :l. ( :l " " :d ?URI "1") string:concatenation :k. ( "\n") string:concatenation :s } log:implies { :k log:outputString :s }. # Total if available { :y a :toBeDisplayed; s:label :l; q:total :x. ( :l " 9000" ) string:concatenation :k. ( "\n") string:concatenation :s } log:implies { :k log:outputString :s }. # end section: { :y a :toBeDisplayed; s:label :l. ( :l " 9999") string:concatenation :k. } log:implies { :l log:outputString "
Date Details ("payee") Amount
" (:d "^([^T]*)")!string:scrape # "" :l "" :p # "" :a "" :x "
" "" :p "
" # "" :l "" "Total" "" :x "
\n" }. "zz" log:outputString """ """. #ends