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

Was this helpful?

Edit on GitHub
Export as PDF
  1. Schema Definition Language
  2. Data Types
  3. String
  4. String Derived Types

URL

PreviousEmailNextDate

Last updated 4 years ago

Was this helpful?

Similar to Email, an URL can also be passed as a string. The URL format is derived from the recommended by W3C.

URL format follows the syntax specified in the

The code snippet shows how to define an url In the Internet Object Document.

# Defining an url
website: url
---
https://example.com

In the case of the url format, the data must be valid URL.

# valid and Invaliid url
website: url
---

https://example.com # the input will be accepted by the IO parser

Example.com # input will not be accepted as it is not a valid url 

MemberDef

The Email is derived from the String type, hence it shares the same as the String. However, URL enforces additional constraints with the respective url format.

Choices

The choices can be added to member variables in the url so that it is restricted to the fixed set of available choices. Choices must be an array of valid url. The code snippet here shows how to add choices for the url.

# Set the choices for companyWeburl
companyWeburl: {
  type: url, 
    choices: [https://example1.com, 
     https://example2.com, https://example3.com]           
}
---
https://example1.com

pattern

User may specify pattern for the url by defining pattern as,

# Set pattern for the referenceUrl
referenceUrl: {
  type: url, 
   pattern: 'https?://(?:[-\w.]|(?:%[\da-fA-F]{2}))+'
 }
---
http://example.com, http://example2.com

HTML 5.1-Forms Email syntax
HTML 5.1 W3C recommendation under section 4.10.5.1.4.
MemberDef