LogoLogo
  • Internet Object 1.0
  • Internet Object
    • Abstract
    • The Poetic Principles of Internet Object
    • Objectives
    • Introducing Internet Object
  • The Structure
    • Internet Object Document
      • Header
      • Data Sections
    • Structural Elements
      • Structural Characters and Literals
      • Literals
      • Other Special Characters
      • Whitespaces
    • Values Representations
      • Objects
      • Arrays
      • Strings
        • Open Strings
        • Regular Strings
        • Raw Strings
      • Numeric Values
        • Number
        • BigInt
        • Decimal
        • Special Numeric Integer Formats
          • Hexadecimal
          • Octal
          • Binary
        • NaN and Infinity
      • Binary
      • Date and Time
      • Booleans
      • Nulls
    • Comments
    • Encoding
  • The Collections
    • Collection
    • Creating Collection
    • Collection Rules
    • Data Streaming
  • The Definitions
    • Definitions
    • Variables
    • Complex Schema
  • Schema Definition Language
    • Internet Object Schema
    • The structure
    • Data Types
      • Any
      • String
        • String Derived Types
          • Email
          • URL
          • Date
          • Time
          • DateTime
      • Number
        • Derived Types
          • int
          • byte
          • int16
          • int32
      • Object
      • Array
      • Bool
    • Dynamic Schema
    • Is Object, a MemberDef or a Schema?
  • Other
    • Best Practices
    • FAQs
    • Contributors
    • License
Powered by GitBook
On this page
  • Syntax
  • Open Object
  • Closed Object
  • Object Structural Characters
  • Characteristics

Was this helpful?

Edit on GitHub
Export as PDF
  1. The Structure
  2. Values Representations

Objects

Work in Progress!

PreviousValues RepresentationsNextArrays

Last updated 3 months ago

Was this helpful?

Objects are a fundamental element in Internet Object documents, providing a clear and intuitive way to represent structured data.

An object is expressed as a sequence of values (and key/value pairs) separated by commas (, U+002C). For simplicity, clarity, and ease of reading, Internet Object supports two modes for objects: Open and Closed. The Open mode does not require enclosing values in curly brackets and is only supported for top-level objects.

Syntax

Open Object

Closed Object

Object Structural Characters

Symbol

Characters

Unicode

Description

,

Comma

U+002C

Used as a value separator

:

Colon

U+003A

Key-value separator

[

Open Square Bracket

U+005B

Begins an array boundary

]

Close Square Bracket

U+005D

Closes an array boundary

{

Open Curly

Bracket

U+007B

Begins an object boundary

}

Close Curly Bracket

U+007D

Closes an object boundary

Characteristics

Objects can contain values of various types, including other objects, arrays, strings, numbers, boolean, and null. Keys can also be attached to all or some of the values to provide more information and make the objects more self-explanatory. The keys are valid Internet Object string values, and any format of string (Open, Regular, Raw) can be used to represent them.

Basic object

An object is essentially an ordered collection of values similar to CSV records.

John Doe, 25, T

Objects with child objects and arrays.

John Doe, 25, T, {Bond Street, New York, NY}, [extrovert]

An object is not required to be wrapped inside the curly braces unless it is a child object. However, putting them in between the braces will not make it invalid.

{John Doe, 25, T, {Bond Street, New York, NY}, [extrovert]}

Object with Inline Keys

Object structure also supports unique inline keys. In the following example isActive, address, and personalities have associated keys.

{
  John Doe,
  25,
  isActive: T,
  address: {Bond Street, New York, NY},
  personalities: [extrovert]
}

Inline keys can be attached to all the values or some of them. When an object contains both types of values (key value and non-key value), the key-value pair must be placed after the non-key values (sequential values).

{
  name: John Doe,
  age: 25,
  isActive: T,
  address: {Bond Street, New York, NY},
  personalities: [extrovert]
}
{
  name: John Doe,                       # Open string key
  address: {Bond Street, New York, NY},
  peamlrsonalities: [extrovert],
  "age": 25,                             # A key in regular string!
  'isActive': T                          # A key wrapped in single quotes
}

Empty objects and empty trailing values

An empty object must be enclosed by curly braces.

{} # An empty object

An object can contain empty values. The following object contains two empty values, after the name John Doe, and the second before the address.

John Doe,,true,, {Bond Street, New York, NY}

Trailing empty commas are ignored.

John Doe,,,,,

As the object keys are valid Internet Object String values, any format of string (, , ) can be used to represent them.

Internet Object is a schema-first format. When a is applied, values can be accessed using their respective keys. Without the , values without keys can be accessed using their respective index position; or through keys, if they are provided.

Open
Regular
Raw
schema
schema
Open Object Syntax
Closed Object Syntax