# n3 # # Categorized stuff # @prefix rdf: . @prefix s: . @prefix log: . @prefix string: . @prefix math: . @prefix q: . @prefix dc: . @prefix trip: . @prefix flow: . @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 [] } log:implies { :c a q:toBeDisplayed }. #q:Unclassified a q:toBeDisplayed; s:label "Unclassified transactions". q:UnclassifiedIncome a q:toBeDisplayed; s:label "Unclassified Income". q:UnclassifiedOutgoing a q:toBeDisplayed; s:label "Unclassified Outgoings". #################################################################### "00" log:outputString """ Spending and Income by category - personal financial report

Spending and Income by category

""". # Heading of section # Did have: (:y!log:uri "(/Financial/.*)")!string:scrape { # [] a ?y. ?y a q:toBeDisplayed; s:label ?l. ?y log:uri ?uri. (?uri ".*#(.*)") string:scrape ?a. ## (?uri "/Documents/(.*)") string:scrape ?tail . ?uri os:baseRelative ?rel. ( "

" ?l """

""" ) string:concatenation ?s . ( ?l " 00000000 " ) string:concatenation ?k. } => { ?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. :y a q:toBeDisplayed; s:label :l. ( :l " 11111111 " :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 q:toBeDisplayed; s:label :l. ( :l " 11111111 " :d ?URI "1") string:concatenation :k. ( "\n") string:concatenation :s } log:implies { :k log:outputString :s }. #### Trip underneath { [] a :y; trip:trip [dc:title :p; log:uri ?tripURI]; q:date :d; log:uri ?URI; q:toAccount [s:label :a]. :y a q:toBeDisplayed; s:label :l. (?tripURI "/Documents/(.*)") string:scrape ?tail . ( :l " 11111111 " :d ?URI "2") string:concatenation :k. ( "\n") string:concatenation :s } log:implies { :k log:outputString :s }. #### Attachment underneath { [] a :y; q:date :d; log:uri ?URI; flow:attachment [ # dc:title :p; log:uri ?fileURI]; q:toAccount [s:label :a]. (?fileURI "/Documents/(.*)") string:scrape ?tail . # Only works on local files :y a q:toBeDisplayed; s:label :l. ( :l " 11111111 " :d ?URI "3") string:concatenation :k. ( "\n") string:concatenation :s } log:implies { :k log:outputString :s }. # Total if available { :y a q:toBeDisplayed; s:label :l; q:total :x. ( :l " 90000000 " ) string:concatenation :k. ( "\n") string:concatenation :s } log:implies { :k log:outputString :s }. # end section: { :y a q:toBeDisplayed; s:label :l. ( :l " 99999999 ") string:concatenation :k. } log:implies { :l log:outputString "
Date Details ("payee") Amount
" (:d "^([^T]*)")!string:scrape # "" :l "" :p # "" :a "" :x "
" "" :p "
" " Trip: " :p "
" " See: " ?tail "
" # "" :l "" "Total" "" :x "
\n" }. "zz" log:outputString """ """. #ends