Skip to content

Google Sheet Documentation

isaacsquires edited this page Dec 30, 2019 · 1 revision

Google Sheet Documentation

Summary

The pseudo-backend for this tool uses Tabletop.js to retrieve the data from a public Google sheet. The Google sheet containing the standards datastore has restricted edit access and is made view only for public access. Tabletop returns the entire spreadsheet as a JSON object, which is then sorted and manipulated as needed in the frontend.

Data Structure

The datastore is organised as follows

serial url title_full abstract date_published tag0 tag1 tag2 tag3 tag4 tag5 tag6 tag7 organisation type ICS
  • serial - The serial code of the standard
  • url - The url to the standard webpage
  • title_full - The full title of the standard
  • abstract - The abstract of the standard
  • date_published - The date of publication of the standard
  • tag0 - The primary tag of the standard. This is selected from a dropdown menu which is restricted by the predetermined 'category tree'
  • tag1, tag2, ..., tag7 - The remaining seven tags are not restricted, these are the chosen to be the most useful tags or categories as possible. As many or as few tags can be entered as needed. More tag columns can be added if required, as long as they are named 'tag_' (N.B. This is hardcoded and must be carefully adhered to for successful further development). These are referred to as subtags
  • organisation - The name of the organisation that produced the standard
  • type - Type of standard (deprecated)
  • ICS - International Classification for Standards code

Category Tree

The category tree is in development. Currently, it has one layer

Smart City Governance Data Management & AI Citizen Centric Services Smart City ICT Internet of Things MIMs Environment Mobility Utilities Buildings Health Public Realm

The current structure necessitates one primary tag (determined by the category tree) and multiple subtags (created as required). This system retains some structure in the categorisation to allow easier navigation, whilst leaving some openness in the tagging to allow for a flexible and evolving description of the standards.

Data Import

The data import code can be found in src/api/spreadsheet.js.

There are five key variables to note

  • rows is an array of JSON objects containing each row of the spreadsheet. Each row is herein referred to as a standard object. For example, an standard object in rows may be
{
abstract: "HyperCat Specification: This PAS specifies a protocol whereby any compliant software client can automatically discover data that is stored within any compliant software server, without either the client or server having to be written to have been explicitly compatible with each other."
date_published: "30/11/2017"
organisation: "BSI"
serial: "PAS 212:2016"
tag0: "Internet of Things"
tag1: "Interoperability"
tag2: "Discovery"
tag3: ""
tag4: ""
tag5: ""
tag6: ""
tag7: ""
title_full: "PAS 212:2016 Automatic resource discovery for the Internet of Things"
type: "Specification"
url: "https://shop.bsigroup.com/forms/PASs/PAS-212-2016-download/"
ICS: "35.080, 35.240.01"
}
  • tag0Unique is an array containing all unique tag0 values.

  • tagAllUnique is an array containing all unique subtags (tag1, tag2, ..., tag7) filtered by a tag0. This array is returned by the getTags function, that takes the arguments rows and a string specifying which tag0 to filter by.

  • filteredStandards is an array containing standard objects filtered by a tag0. This array is also returned by the getTags function.

  • filteredSubStandards is an array containing standard objects filtered by a subtag. This array is returned by the function getFilteredSubStandards, that takes the arguments filteredStandards, array, and arraySelector, where array is an array of subtags and arraySelector is a string denoting the selected subtag.