Storing A Structured Document In Socrata

The document described in this article is stored in a Socrata dataset:
https://data.smcgov.org/???
Note: there are minor differences between the articles and the dataset

Other articles about Structured Documents:
Overview of a Structured Document
How a table works in a Structured Document
index.html
Note: these are drafts articles



The Raw Dataset View Of The Structured Data For Section 1





Generating HTML code for Section 1

Generate row data for OID 1, Section 1, as HTML:
https://data.smcgov.org/resource/abcd-wxyz.html?Document_name=Budget-2014-2015.pdf&OID=1.

Note: .html extension to the base URL

Generated HTML code

  <h1>1. Preamble</h1>
  <p> This is a demonstration of a strucured document.  </p>
  <h2>1.1 Welcome</h2>
  <p> This city is a great place to live.  We are proud of:  </p>
  <ul>
    <li>Our proud history.</li>
    <li>Our Diversity.</li>
  </ul>
  <h2>1.2 Summary</h2>
  <p> This is a great budget.  </p>
  <h4>1.2.2 Summary Summary of the Budget<h4>




Section 1 Rendered In HTML

1. Preamble

This is a demonstration of a strucured document.

1.1 Welcome

This city is a great place to live. We are proud of:

  • Our proud history.
  • Our Diversity.

1.2 Summary

This is a great budget.

1.2.2 Summary Summary of the Budget
Budget Table





Only Render List 1.1.2 In HTML

Render RefList OID 1.1.2, "Features of our City", as HTML:
https://data.smcgov.org/resource/abcd-wxyz.html?Document_name=Budget-2014-2015.pdf&OID=1.1.2

1.1 Features of our City

  • Our proud history.
  • Our Diversity.




Storing a Table As RefTable In A Structured Document





Rendered RefTable As HTML

Generate row data for OID 2.2.3.1, "BUDGET SUMMARY BY PROGRAM: Library", as HTML:
https://data.smcgov.org/resource/abcd-wxyz.html?Document_name=Budget-2014-2015.pdf&OID=2.2.3.1.

BUDGET SUMMARY BY PROGRAM: Library

Capital Project Funds Not Included)

DEPARTMENT AND PROGRAMACTUAL
2013-14
BUDGET 2014-15
(As amended)
ESTIMATE
2014-15
ADOPTED
2015-16
Library
Circulation / Technical Services1977239219024318749442150390
Children's / Literacy Svcs597036716890766359727454
Adult-Teen / Information Services788053878548979442900421
Administrative Services1797872203904820468012114725
Total5160200582472956675465892990




RefTable Rendered CSV

To render the table data for OID 2.2.3.1 as a CSV file:
https://data.smcgov.org/resource/abcd-wxyz.csv?Document_name=Budget-2014-2015.pdf&OID=2.2.3.1.

Note the .csv extension in the API call.

The API call returns the table in CSV format:


DeptProg,Actual,Budget,Estimate,Original,Adopted
Circulation / Technical Services,1977239,2190243,1874944,2150390
Children's / Literacy Svcs,597036,716890,766359,727454
Adult-Teen / Information Services,788053,878548,979442,900421
Administrative Services,1797872,2039048,2046801,2114725
Total,5160200,5824729,5667546,5892990




Download row data for RefTable 2.2.3.1 as JSON:
https://data.smcgov.org/resource/abcd-wxyz.json?Document_name=Budget-2014-2015.pdf&OID=2.2.3.1.





This Structured Document example is available as
http://harker.com/OpenData/StructDocs/StructDocsLighting.html

Robert Harker's Open Data blog:
http://harker.com/OpenData/