About Viewing JSON Data Guides

A JSON data guide represents the JSON schema for documents in one column with JSON content. A table can have more than one column with JSON content.

The View JSON Data Guides option is available in the context menu for a table or view in a Data Modeler diagram.

image

This is applicable for tables, views and external tables that have columns with JSON content. Columns with JSON content are identified and data guides are retrieved for each such column. This process is quicker with the existence of a JSON search index.

The JSON schema (JSON Data Guide) is presented visually like an entity-relationship diagram. Arrays are presented as one-to-many relationships, contained objects as one-to-one relationships, and "oneOf" constructs as a box that surrounds possible choices. There is a column selector at the top right part of the page enabling you to select a column with JSON content for diagram presentation.

The following example is a JSON schema and its representation in a data guide diagram.

{
  "type" : "object",
  "properties" :
  {
    "User" :
    {
      "type" : "string",
      "o:length" : 8,
      "o:preferred_column_name" : "DATA$User"
    },
    "PONumber" :
    {
      "type" : "number",
      "o:length" : 4,
      "o:preferred_column_name" : "DATA$PONumber"
    },
    "LineItems" :
    {
      "type" : "array",
      "o:length" : 1024,
      "o:preferred_column_name" : "DATA$LineItems",
      "items" :
      {
        "properties" :
        {
          "Part" :
          {
            "type" : "object",
            "o:length" : 256,
            "o:preferred_column_name" : "DATA$Part",
            "properties" :
            {
              "UPCCode" :
              {
                "type" : "number",
                "o:length" : 16,
                "o:preferred_column_name" : "DATA$UPCCode"
              },
              "UnitPrice" :
              {
                "type" : "number",
                "o:length" : 8,
                "o:preferred_column_name" : "DATA$UnitPrice"
              },
              "Description" :
              {
                "type" : "string",
                "o:length" : 128,
                "o:preferred_column_name" : "DATA$Description"
              }
            }
          },
          "Quantity" :
          {
            "type" : "number",
            "o:length" : 4,
            "o:preferred_column_name" : "DATA$Quantity"
          },
          "ItemNumber" :
          {
            "type" : "number",
            "o:length" : 1,
            "o:preferred_column_name" : "DATA$ItemNumber"
          }
        }
      }
    },
    "Reference" :
    {
      "type" : "string",
      "o:length" : 32,
      "o:preferred_column_name" : "DATA$Reference"
    },
    "Requestor" :
    {
      "type" : "string",
      "o:length" : 16,
      "o:preferred_column_name" : "DATA$Requestor"
    },
    "CostCenter" :
    {
      "type" : "string",
      "o:length" : 4,
      "o:preferred_column_name" : "DATA$CostCenter"
    },
    "ShippingInstructions" :
    {
      "type" : "object",
      "o:length" : 256,
      "o:preferred_column_name" : "DATA$ShippingInstructions",
      "properties" :
      {
        "name" :
        {
          "type" : "string",
          "o:length" : 16,
          "o:preferred_column_name" : "DATA$name"
        },
        "Phone" :
        {
          "type" : "array",
          "o:length" : 64,
          "o:preferred_column_name" : "DATA$Phone",
          "items" :
          {
            "properties" :
            {
              "type" :
              {
                "type" : "string",
                "o:length" : 8,
                "o:preferred_column_name" : "DATA$type"
              },
              "number" :
              {
                "type" : "string",
                "o:length" : 16,
                "o:preferred_column_name" : "DATA$number"
              }
            }
          }
        },
        "Address" :
        {
          "oneOf" :
          [
            {
              "type" : "string",
              "o:length" : 1,
              "o:preferred_column_name" : "DATA$Address"
            },
            {
              "type" : "object",
              "o:length" : 128,
              "o:preferred_column_name" : "DATA$Address_1",
              "properties" :
              {
                "city" :
                {
                  "type" : "string",
                  "o:length" : 32,
                  "o:preferred_column_name" : "DATA$city"
                },
                "state" :
                {
                  "type" : "string",
                  "o:length" : 2,
                  "o:preferred_column_name" : "DATA$state"
                },
                "street" :
                {
                  "type" : "string",
                  "o:length" : 32,
                  "o:preferred_column_name" : "DATA$street"
                },
                "country" :
                {
                  "type" : "string",
                  "o:length" : 32,
                  "o:preferred_column_name" : "DATA$country"
                },
                "zipCode" :
                {
                  "type" : "number",
                  "o:length" : 8,
                  "o:preferred_column_name" : "DATA$zipCode"
                }
              }
            }
          ]
        }
      }
    },
    "Special Instructions" :
    {
      "type" : "string",
      "o:length" : 16,
      "o:preferred_column_name" : "DATA$SpecialInstructions"
    }
  }
}
This image shows the JSON Data Guide in diagram format.

For more information about JSON data guides, see JSON Data Guide in Oracle Database JSON Developer’s Guide.