Values Representations
Overview of value types in Internet Object
Last updated
Was this helpful?
Overview of value types in Internet Object
Last updated
Was this helpful?
Was this helpful?
Internet Object supports a rich set of value types that represent different kinds of data. Values are the fundamental building blocks of Internet Object documents, ranging from simple scalar values like numbers and strings to complex structured values like objects and arrays.
All values in Internet Object are designed to be:
Human-readable: Easy to read and write by humans
Machine-parseable: Efficiently processed by computers
Type-safe: Clear distinction between different data types
Expressive: Rich enough to represent complex data structures
Internet Object values are organized into several categories:
Scalar values represent single, atomic pieces of data:
Numbers - Numeric values including integers, floats, and special numeric types
Strings - Text data with various encoding and formatting options
Booleans - True/false values
Null - Absence of value
Base64 Byte Strings - Binary data encoded as Base64
Date and Time - Temporal values with ISO 8601 compatibility
Structured values contain other values and provide organization:
Internet Object provides several string types to handle different text scenarios:
"text"
or 'text'
Standard quoted strings with escape sequences
General text, user input, formatted content
r"text"
or r'text'
Literal strings without escape processing
File paths, regex patterns, code snippets
Internet Object supports various numeric types for different precision and range requirements:
Internet Object provides built-in support for date and time values:
Date
d'2024-03-20'
Date-only values
d'2024-03-20'
, d'2024'
Time
t'14:30:45'
Time-only values
t'14:30:45.123'
, t'09:00'
DateTime
dt'2024-03-20T14:30:45Z'
Combined date and time
dt'2024-03-20T14:30:45.123Z'
For binary data representation, Internet Object uses:
Base64 Byte Strings (b'SGVsbG8='
) - Efficient encoding of binary data as text
Here's a quick reference of value syntax in Internet Object:
# Scalar Values
42 # Number
"Hello, World!" # Regular string
'Single quotes work too' # Regular string
unquoted string # Open string
r"C:\Users\file.txt" # Raw string
true # Boolean
false # Boolean
null # Null
b'SGVsbG8gV29ybGQ=' # Base64 byte string
d'2024-03-20' # Date
t'14:30:45' # Time
dt'2024-03-20T14:30:45Z' # DateTime
# Structured Values
{ # Object
name: "John Doe",
age: 30,
active: true
}
[1, 2, 3, "four", true] # Array
Internet Object maintains strict type boundaries:
No implicit conversion: Values retain their declared types
Explicit parsing: Type conversion happens during parsing based on syntax
Validation: Type constraints are enforced during processing
Preservation: Original format and type information is maintained
Values can be accompanied by:
Comments: # This is a comment
Whitespace: Flexible spacing and indentation
Line breaks: Multi-line value formatting
{
# User information
name: "John Doe", # Full name
age: 30, # Age in years
# Contact details
email: "[email protected]"
}
Internet Object values support:
Unicode: Full Unicode character set (UTF-8 encoding)
Escape sequences: Standard escape codes in regular strings
Raw representation: Literal character preservation in raw strings
Normalization: Unicode normalization for consistent processing
Scalar Types: Numbers • Strings • Booleans • Null • Binary Data • Date & Time
Text Data: String Types - Regular, Open, and Raw strings
Numeric Data: Number Types - Standard, BigInt, Decimal, and Special values
Temporal Data: Date and Time - Dates, times, and datetimes
Binary Data: Base64 Byte Strings - Encoded binary content
Internet Object Structure Overview - Understanding the overall document structure
Schema Definition Language - Type definitions and validation
Best Practices - Guidelines for effective Internet Object usage