Description:
browse an agency's budget data (summary and account details) using three Public Budget datasets.
interesting observations
This demo uses SPARQL to combine data from
dataset 401 budget authority (money allocated by Congress),
dataset 402 budget outlays (actual expenses) and
dataset 403 recipient by various government accounts from 1976 to 2014 (values from the present to 2014 are projected).
- not all agencies show up in all datasets, and a lot of them are not mentioned in Dataset 403 (Public Budget Database - Governmental receipts 1962-2015, Executive Office of the President).
- there are both positive and negative figures in the budget, further investigations are needed
- Example 1
- Reforms and Recoveries for Elementary and Secondary Education
Comparison between Budget Authority and Budget Outlays
|
Budget Outlays for "Education Reform" account (yearly column chart)
|
Budget Outlays for "Education Reform" account (aggregated sum)
|
Budget Authority for "... Recovery Act" account (yearly column chart)
|
Budget Authority for "... Recovery Act" account (aggregated sum)
|
Technology highlights
SPARQL queries were used to aggregate data from three datasets
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?p sum(xsd:integer (?o)) ?g
WHERE
{GRAPH ?g
{
# match the specific BGP first, then filter based on account_name.
# only join with the completely unbound triple pattern after the filter so that the intermediate result size isn't large.
{
?s <http://data-gov.tw.rpi.edu/vocab/p/401/agency_name> "Department of the Interior" .
?s <http://data-gov.tw.rpi.edu/vocab/p/401/bureau_name> "Departmental Offices" .
?s <http://data-gov.tw.rpi.edu/vocab/p/401/account_name> ?account_name.
filter (regex(?p,"num"))
}
?s ?p ?o.
}
}
group by ?g ?p