Data Collections. Welcome to the Fourth Dimension (and beyond) Martin Phillips Ladybridge Systems Ltd. International Spectrum Conference, 2014

Similar documents
CSC Web Technologies, Spring Web Data Exchange Formats

10/18/2017. Announcements. NoSQL Motivation. NoSQL. Serverless Architecture. What is the Problem? Database Systems CSE 414

5/1/17. Announcements. NoSQL Motivation. NoSQL. Serverless Architecture. What is the Problem? Database Systems CSE 414

Composer Help. Web Request Common Block

Introduction to JSON. Roger Lacroix MQ Technical Conference v

CSE 344 APRIL 16 TH SEMI-STRUCTURED DATA

This tutorial will help you understand JSON and its use within various programming languages such as PHP, PERL, Python, Ruby, Java, etc.

JSON is a light-weight alternative to XML for data-interchange JSON = JavaScript Object Notation

JSON Support for Junos OS


So, if you receive data from a server, in JSON format, you can use it like any other JavaScript object.

[301] JSON. Tyler Caraza-Harter

XML: Introduction. !important Declaration... 9:11 #FIXED... 7:5 #IMPLIED... 7:5 #REQUIRED... Directive... 9:11

REST. Web-based APIs

Flat triples approach to RDF graphs in JSON

Such JavaScript Very Wow

JSON as an XML Alternative. JSON is a light-weight alternative to XML for datainterchange

Relational Databases

5/2/16. Announcements. NoSQL Motivation. The New Hipster: NoSQL. Serverless. What is the Problem? Database Systems CSE 414

Parameterizing an iway Data Quality Server SQL Statement From an Input File or the Command Line

Database Systems CSE 414

Learning Objectives. Description. Your AU Expert(s) Trent Earley Behlen Mfg. Co. Shane Wemhoff Behlen Mfg. Co.

Web Services Week 10

Module 9: Managing Schema Objects

SQL Functionality SQL. Creating Relation Schemas. Creating Relation Schemas

JSON - Overview JSon Terminology

relational Key-value Graph Object Document

ADVANTAGES. Via PL/SQL, all sorts of calculations can be done quickly and efficiently without use of Oracle engine.

JAVASCRIPT AND JQUERY: AN INTRODUCTION (WEB PROGRAMMING, X452.1)

Computer Science Curriculum Content, KS5

CGS 3066: Spring 2015 JavaScript Reference

Chapter 2 The relational Model of data. Relational model introduction

JavaScript Lecture 1

Chapter 1: Getting Started. You will learn:

M359 Block5 - Lecture12 Eng/ Waleed Omar

LOON. Language Reference Manual THE LANGUAGE OF OBJECT NOTATION. Kyle Hughes, Jack Ricci, Chelci Houston-Borroughs, Niles Christensen, Habin Lee

NeoJSON. 1.1 An Introduction to JSON

DATABASE SYSTEMS. Database programming in a web environment. Database System Course, 2016

CS1622. Semantic Analysis. The Compiler So Far. Lecture 15 Semantic Analysis. How to build symbol tables How to use them to find

JME Language Reference Manual

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

JavaScript. Training Offer for JavaScript Introduction JavaScript. JavaScript Objects

Announcements. JSon Data Structures. JSon Syntax. JSon Semantics: a Tree! JSon Primitive Datatypes. Introduction to Database Systems CSE 414

SQL: Data De ni on. B0B36DBS, BD6B36DBS: Database Systems. h p:// Lecture 3

SQL User Defined Code. Kathleen Durant CS 3200

Data Formats and APIs

Announcements. Two Classes of Database Applications. Class Overview. NoSQL Motivation. RDBMS Review: Serverless

Chapter 11 Outline. A Simple PHP Example Overview of Basic Features of PHP Overview of PHP Database Programming. Slide 11-2

DaMPL. Language Reference Manual. Henrique Grando

COMS W4115: Programming Languages and Translators Language Project Proposal LOON: Language of Object Notation

JSON Home Improvement. Christophe Pettus PostgreSQL Experts, Inc. SCALE 14x, January 2016

Python in 10 (50) minutes

EWD Custom Tag Development. Built-in Custom Tags for defining and manipulating Javascript

OpenQM. Extended Character Set Support. Martin Phillips Ladybridge Systems Ltd

STIDistrict Query (Basic)

Overview of the JSON Encoding Rules (JER)

I Wish I Knew How To. Begin Programming JSON with Xojo. By Eugene Dakin. November 2015 Edition (1.1)

Interpreters. Prof. Clarkson Fall Today s music: Step by Step by New Kids on the Block

CSE 115. Introduction to Computer Science I

Web Application Development (WAD) V th Sem BBAITM(Unit-1) By: Binit Patel

Decision Making in C

JavaScript. History. Adding JavaScript to a page. CS144: Web Applications

COMP9321 Web Application Engineering

IBM Informix xC2 Enhancements IBM Corporation

CS 221 Lecture. Tuesday, 4 October There are 10 kinds of people in this world: those who know how to count in binary, and those who don t.

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 14 Database Connectivity and Web Technologies

Using the JSON Parser

Assigns a number to 110,000 letters/glyphs U+0041 is an A U+0062 is an a. U+00A9 is a copyright symbol U+0F03 is an

( ) ~ 'this string' this string this string ((4 5 6)(7 8 9)) ~ ~

E-R diagrams and database schemas. Functional dependencies. Definition (tuple, attribute, value). A tuple has the form

JSON. Version 6.6. Eli Barzilay and Dave Herman. July 22, 2016

1.1 Introduction to C Language. Department of CSE

String Computation Program

DC71 INTERNET APPLICATIONS JUNE 2013

Dataflow Editor User Guide

HTML5 and CSS3 More JavaScript Page 1

NI-IMAQdx VI Reference Help

CSCI3030U Database Models

PostgreSQL 9.4 and JSON

Slide 1 CS 170 Java Programming 1 The Switch Duration: 00:00:46 Advance mode: Auto

The basic format structure of the HTTP request / response messages are similar and consist of the following:

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 27-1

INSTRUCTIONS TO CANDIDATES

CSC 337. JavaScript Object Notation (JSON) Rick Mercer

Class Overview. Two Classes of Database Applications. NoSQL Motivation. RDBMS Review: Client-Server. RDBMS Review: Serverless

Cisco IOS Shell. Finding Feature Information. Prerequisites for Cisco IOS.sh. Last Updated: December 14, 2012

Introduction to Programming Using Java (98-388)

Parser Tools: lex and yacc-style Parsing

Modern Programming Languages. Lecture LISP Programming Language An Introduction

Creating and Working with JSON in Oracle Database

The Backend of OE Mobile in OpenEdge Mike Fechner, Consultingwerk Ltd. PUG Challenge Americas, June 2013

SCoLang - Language Reference Manual

Language Basics. /* The NUMBER GAME - User tries to guess a number between 1 and 10 */ /* Generate a random number between 1 and 10 */

REST in Peace Mastering the JSDO with a Dynamic ABL backend. Mike Fechner, Consultingwerk Ltd.

PROCESSING NON-XML SOURCES AS XML. XML Amsterdam Alain Couthures - agencexml 06/11/2015

Working with JavaScript

ACT-R RPC Interface Documentation. Working Draft Dan Bothell

RC201 Creating Data Forms in REDCap. Paul Litwin - Collaborative Data Services (CDS)

Test 1 Summer 2014 Multiple Choice. Write your answer to the LEFT of each problem. 5 points each 1. Preprocessor macros are associated with: A. C B.

Rapise Visual Language (RVL) User Guide Version 5.1 Inflectra Corporation

Transcription:

Data Collections Welcome to the Fourth Dimension (and beyond) International Spectrum Conference, 2014 Martin Phillips Ladybridge Systems Ltd

Multivalue Are we at its limits? We all understand the power of the multivalue data model Discarding the First Rule of Normalisation gives us simpler, faster and more maintainable applications than relational databases Today s data may extend beyond the three dimensions that multivalue provides XML and JSON may go much further.

JSON JavaScript Object Notation JSON defines data as a character string holding name/value pairs JSON allows unlimited nesting of objects. Multivalue has excellent string processing It is not hard to write a JSON parser or update tool Achieving good performance may be much harder.

JSON JavaScript Object Notation We need to separate JSON as a data representation for transmission or storage from the need for efficient processing of arbitrarily multi-dimensional data in an application JSON is an external representation of our data Technology moves forward. JSON may be replaced by some new format in the future.

Data Collections QM supports Data Collections as arbitrarily multi-dimensional sets of name/value pairs Perhaps other multivalue vendors will follow Any apparent similarity in some concepts to MongoDB is coincidental.

Data Collections - Data Types Multivalue Basic uses type variant data items JSON objects hold values with distinct data types Strings Numbers Booleans (true, false) Null Data items can be grouped into Single dimensional arrays Nested objects Data collections must support all of this (or more).

Data Collections A data item within a data collection may be of any QM data type Some types are probably irrelevant but all are supported Because a data collection is itself a QM data type, data collections can be nested to any depth.

Parsing JSON into a Data Collection The JPARSE() function creates a data collection from a JSON string VAR = JPARSE(JSON.STRING) Parsing a realistic complex JSON string with 2600 items takes about 650µS on a 2.7GHz PC.

Accessing Data in a Data Collection Referencing a value in a data collection is very similar to referencing a dynamic array Instead of numeric positions (field, value, subvalue), we use element names ITEM = VAR{name} We can use a quoted constant, a variable or an expression for the name.

Accessing Data in a Data Collection To access a value in a nested object, we need two or more names ITEM = VAR{name1, name2} This is no different from accessing a value position in a dynamic array Because a nested object is just a data item, we could do this as ITEM = VAR{name1} {name2}

Element Paths We can also use an element path in which the names are separated by forward slashes ADDR = VAR{ client/address } This is useful when the structure of the data is not fixed The different syntaxes can be mixed.

Building a JSON String The JBUILD() function builds a JSON string from a data collection JSON.STRING = JBUILD(VAR) It is important that parsing and rebuilding a JSON string should produce a result that is equivalent to the original data.

Numeric Values JSON provides several formats for numeric data: 123 123.00 1.23E2 12300E-2 In QM, all of these will be held in memory as integer value 123 Floating point values are used where necessary Building a JSON string will produce equivalent values but perhaps not the same format.

Boolean Values Multivalue uses 1 and 0 for True and False It is not acceptable that parsing a JSON true value and then rebuilding the JSON string replaces it with a numeric 1 Since release 3.2-2 (October 2013), QM has supported an internal Boolean data type This is completely compatible with use of numeric values, converting as needed.

The Null Value QM release 3.2-2 also added the SQL style null value data type Values can be set or tested as null but dynamic operations on null items is not currently supported.

Working with Data Collections An empty collection is created with CLIENT = COLLECTION() Or another collection is copied with CLIENT = COLLECTION(OTHER.CLIENT) Copying a collection variable gives a second reference to the same collection, not a copy CLIENT = OTHER.CLIENT This is similar to file variables and some others.

Working with Data Collections The member names in a collection can be determined using ENUMERATE() NAMES = ENUMERATE(VAR) Nested collections must be enumerated separately.

Modifying Data Collections Members of a collection can be added or updated using CLIENT{ name } = CLIENT.NAME Alternatively, a modified form of the INS statement can be used INS CLIENT.NAME AS VAR{ name }

Modifying Data Collections Intermediate levels are inserted automatically (just like dynamic arrays) CLIENT = COLLECTION() CLIENT{ address/zip } = 96439

Modifying Data Collections Members are deleted using the DEL statement. DEL CLIENT{ phone }

Arrays in Data Collections Collections can include single dimensional arrays An empty array is created with CLIENT{ contacts } = MAT() A standard dimensioned array can be copied to a collection CLIENT{ contacts } = MAT(CONTACT.NAMES)

Arrays in Data Collections Array elements are referenced by using their element number as the name or NAME = CLIENT{ contacts/1 } NAME = CLIENT{ contacts, 1} Arrays automatically resize to fit the content INS and DEL can be used to insert or delete array elements.

Arrays in Data Collections An element path may contain an asterisk as the member name within an array to return a multivalued list of element values PRODUCTS = ORDER{ detail/*/prod.no } Use of a second asterisk returns a subvalue list SERIAL = ORDER{ detail/*/serial.no/* }

Data Collection Files A data collection can be stored in JSON form in a standard data file The COLLECTION option of CREATE.FILE creates a file in which the records are data collections stored in an optimised format Reading a record from the file creates a collection variable Data written to the file must be a collection variable.

Data Collection Files The dictionary of a collection file may only use a field number (0) to reference the record id Collection members are referenced using E-type (element) dictionary items These are like D-type but have the element path in field 2 The element path may use the asterisk syntax to return multivalued data. I-type dictionary items are supported, including TRANS() to fetch data from another collection file.

Data Collection Files Data collection files may use: Indices Record level encryption Replication Transactions Triggers

Linked Data Collection Files A string value in a collection can be used to reference another collection record file:id or :id The EXPAND() function follows the link and updates the data collection in memory to include the linked item. OK = EXPAND(VAR{link.path}) OK = EXPAND(VAR{link.path}, file.var)

Data Collection Files in Queries The query processor can create reports based on data from data collection files by use of E-type dictionary items The ELEMENT keyword can be used to reference an item by element path if there is no dictionary item LIST CLIENTS ELEMENT address/zip

The Data Collection Editor Use as a command or as a subroutine Allows viewing and editing of collections.

Summary Data collections allow us to process data that goes beyond the three dimensions supported by the multivalue model The concepts that an application developer must learn are very close to the dynamic array operations that they already use.

QUESTIONS?