Metadata Rules

Comprehensive guide to View's metadata rules management system, including automated metadata generation, content processing, and data catalog integration.

Overview

The View Metadata Rules management system provides comprehensive configuration for automated metadata generation and content processing workflows. Metadata rules define how metadata is generated from content, where resultant metadata is stored, and how content is processed for analysis and cataloging within the View platform.

Key Features

  • Automated Metadata Generation: Automatically extract and generate metadata from various content types
  • Content Processing: Configure processing endpoints for text extraction, analysis, and transformation
  • Data Catalog Integration: Store generated metadata in data catalogs like Lexi for search and discovery
  • Graph Repository Integration: Emit document metadata to graph repositories for relationship analysis
  • Content Type Filtering: Apply rules based on specific content types and file sizes
  • Image Text Extraction: Extract text content from images using OCR capabilities
  • Term Extraction: Extract top terms and keywords from processed content
  • Case-Insensitive Processing: Configure case-sensitive or case-insensitive text processing
  • Flattened Representations: Generate flattened object representations for analysis

Supported Operations

  • Create: Configure new metadata rules with processing and catalog endpoints
  • Read: Retrieve metadata rule configurations and processing parameters
  • Enumerate: List all metadata rules with pagination support
  • Update: Modify existing metadata rule configurations
  • Delete: Remove metadata rules from the system
  • Existence Check: Verify metadata rule presence without retrieving details

API Endpoints

Metadata rules are managed via the Configuration server API at [http|https]://[hostname]:[port]/v1.0/tenants/[tenant-guid]/metadatarules

Supported HTTP Methods: GET, HEAD, PUT, DELETE

Metadata Rule Object Structure

Metadata rule objects contain comprehensive configuration for automated metadata generation and content processing workflows. Here's the complete structure:

{
    "GUID": "example-metadata-rule",
    "TenantGUID": "default",
    "BucketGUID": "example-data-bucket",
    "OwnerGUID": "default",
    "GraphRepositoryGUID": "default",
    "Name": "example-metadata-rule",
    "ContentType": "*",
    "MaxContentLength": 134217728,
    "ProcessingEndpoint": "http://nginx-orchestrator:8501/processor",
    "ProcessingAccessKey": "default",
    "CleanupEndpoint": "http://nginx-orchestrator:8501/processor/cleanup",
    "CleanupAccessKey": "default",
    "ImageTextExtraction": true,
    "TopTerms": 25,
    "CaseInsensitive": true,
    "IncludeFlattened": true,
    "DataCatalogEndpoint": "http://localhost:8000/",
    "DataCatalogAccessKey": "default",
    "DataCatalogType": "Lexi",
    "DataCatalogCollection": "00000000-0000-0000-0000-000000000000",
    "CreatedUtc": "2025-03-25T11:40:49.283297Z"
}

Field Descriptions

  • GUID (GUID): Globally unique identifier for the metadata rule object
  • TenantGUID (GUID): Globally unique identifier for the tenant
  • BucketGUID (GUID): GUID of the bucket to which this metadata rule should be associated
  • OwnerGUID (GUID): GUID of the user to which this rule should be attributed
  • Name (string): Display name for the metadata rule
  • CreatedUtc (datetime): UTC timestamp when the rule was created
  • ContentType (string): Content type on which this rule should match (use "*" for all types)
  • MaxContentLength (integer): Maximum content length on which this rule should match
  • ProcessingEndpoint (string): URL to be used to generate metadata for matching objects
  • ProcessingAccessKey (string): Access key for the processing endpoint
  • CleanupEndpoint (string): URL to be used when a matching object is deleted
  • CleanupAccessKey (string): Access key for the cleanup endpoint
  • ImageTextExtraction (boolean): Enable image text extraction using OCR capabilities
  • TopTerms (integer): Number of top terms to extract from processed content
  • CaseInsensitive (boolean): Whether case-insensitive text extraction should be used
  • IncludeFlattened (boolean): Whether a flattened representation of the object should be produced
  • DataCatalogEndpoint (string): URL for the data catalog (typically Lexi) to which results should be emitted
  • DataCatalogAccessKey (string): Access key for the data catalog endpoint
  • DataCatalogType (enum): Type of data catalog (currently only "Lexi")
  • DataCatalogCollection (string): Name of the data catalog collection
  • GraphRepositoryGUID (GUID): GUID of the graph repository to which document metadata should be emitted

Security Notes

  • Access Key Management: Store and manage access keys securely for processing and catalog endpoints
  • Endpoint Security: Ensure proper network security for processing and catalog endpoints
  • Tenant Isolation: Metadata rules are strictly isolated per tenant for enhanced security
  • Content Processing: Be aware of content processing security implications and data privacy

Create Metadata Rule

Creates a new metadata rule configuration using PUT /v1.0/tenants/[tenant-guid]/metadatarules. This endpoint allows you to configure automated metadata generation workflows with processing endpoints, data catalog integration, and content analysis parameters.

Request Parameters

Required Parameters

  • BucketGUID (GUID, Body, Required): GUID of the bucket to which this metadata rule should be associated
  • OwnerGUID (GUID, Body, Required): GUID of the user to which this rule should be attributed
  • Name (string, Body, Required): Display name for the metadata rule
  • ContentType (string, Body, Required): Content type on which this rule should match
  • ProcessingEndpoint (string, Body, Required): URL to be used to generate metadata for matching objects
  • ProcessingAccessKey (string, Body, Required): Access key for the processing endpoint
  • CleanupEndpoint (string, Body, Required): URL to be used when a matching object is deleted
  • CleanupAccessKey (string, Body, Required): Access key for the cleanup endpoint
  • DataCatalogEndpoint (string, Body, Required): URL for the data catalog to which results should be emitted
  • DataCatalogAccessKey (string, Body, Required): Access key for the data catalog endpoint
  • DataCatalogType (enum, Body, Required): Type of data catalog (currently only "Lexi")
  • DataCatalogCollection (string, Body, Required): Name of the data catalog collection
  • MaxContentLength (integer, Body, Required): Maximum content length on which this rule should match

Optional Parameters

  • GraphRepositoryGUID (GUID, Body, Optional): GUID of the graph repository to which document metadata should be emitted
  • ImageTextExtraction (boolean, Body, Optional): Enable image text extraction using OCR capabilities
  • TopTerms (integer, Body, Optional): Number of top terms to extract from processed content
  • CaseInsensitive (boolean, Body, Optional): Whether case-insensitive text extraction should be used
  • IncludeFlattened (boolean, Body, Optional): Whether a flattened representation of the object should be produced
curl --location --request PUT 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/metadatarules' \
--header 'content-type: application/json' \
--header 'Authorization: Bearer default' \
--data '{
    "BucketGUID": "00000000-0000-0000-0000-000000000000",
    "Name": "example-metadata-rule-ash",
    "OwnerGUID": "00000000-0000-0000-0000-000000000000",
    "ContentType": "*",
    "MaxContentLength": 134217728,
    "ProcessingEndpoint": "http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/processing",
    "ProcessingAccessKey": "default",
    "CleanupEndpoint": "http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/processing/cleanup",
    "CleanupAccessKey": "default",
    "TopTerms": 25,
    "CaseInsensitive": true,
    "IncludeFlattened": true,
    "DataCatalogEndpoint": "http://localhost:8000/",
    "DataCatalogAccessKey": "default",
    "DataCatalogType": "Lexi",
    "DataCatalogCollection": "00000000-0000-0000-0000-000000000000",
    "GraphRepositoryGUID": "00000000-0000-0000-0000-000000000000"
}'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "http://localhost:8000/", //endpoint
  "default", //tenant Id
  "default" //access key
 );

export const createMetaDataRules = async () => {
  try {
    const response = await api.MetadataRule.create({
      BucketGUID: "<Bucket-guid>",
      Name: "example-metadata-rule",
      ContentType: "*",
      MaxContentLength: 134217728,
      ProcessingEndpoint:
        "http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/processing",
      ProcessingAccessKey: "default",
      CleanupEndpoint:
        "http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/processing/cleanup",
      CleanupAccessKey: "default",
      TopTerms: 25,
      CaseInsensitive: true,
      IncludeFlattened: true,
      DataCatalogEndpoint: "http://localhost:8000/",
      DataCatalogAccessKey: "default",
      DataCatalogType: "Lexi",
      DataCatalogCollection: "<data-catlog-collection-id>",
      GraphRepositoryGUID: "<graph-repository-guid>",
    });
    console.log(response, "Meta data rules created successfully");
  } catch (err) {
    console.log("Error creating Meta data rules:", err);
  }
};

createMetaDataRules();
import view_sdk
from view_sdk import configuration

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost", 
    tenant_guid="default",
    service_ports={Service.DEFAULT: 8000},
)

def createMetaDataRules():
    metaDataRules = configuration.MetadataRule.create(
        BucketGUID="<Bucket-guid>",
        Name="example-metadata-rule-ash",
        OwnerGUID="<owner-guid>",
        ContentType="*",
        MaxContentLength=134217728,
        ProcessingEndpoint="http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/processing",
        ProcessingAccessKey="default",
        CleanupEndpoint="http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/processing/cleanup",
        CleanupAccessKey="default",
        TopTerms=25,
        CaseInsensitive=True,
        IncludeFlattened=True,
        DataCatalogEndpoint="http://localhost:8000/",
        DataCatalogAccessKey="default",
        DataCatalogType="Lexi",
        DataCatalogCollection="<data-catlog-collection-id>",
        GraphRepositoryGUID="<graph-repository-guid>"
    )
    print(metaDataRules)

createMetaDataRules()
using View.Sdk;
using View.Sdk.Configuration;

ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
            
MetadataRule request = new MetadataRule
{
    BucketGUID = Guid.Parse("<Bucket-guid>"),
    Name = "example-metadata-rule",
    ContentType = "*",
    MaxContentLength = 134217728,
    ProcessingEndpoint = "http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/processing",
    ProcessingAccessKey = "default",
    CleanupEndpoint = "http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/processing/cleanup",
    CleanupAccessKey = "default",
    MinChunkContentLength = 2,
    MaxChunkContentLength = 2048,
    MaxTokensPerChunk = 1920,
    ShiftSize = 256,
    TopTerms = 25,
    CaseInsensitive = true,
    IncludeFlattened = true,
    DataCatalogEndpoint = "http://localhost:8000/",
    DataCatalogAccessKey = "default",
    DataCatalogType = DataCatalogTypeEnum.Lexi,
    DataCatalogCollection = "<data-catlog-collection-id>",
    GraphRepositoryGUID = Guid.Parse("<graph-repository-guid>")
};

MetadataRule response = await sdk.MetadataRule.Create(request);

Response

Returns the created metadata rule object with all configuration details:

{
    "GUID": "example-metadata-rule",
    "TenantGUID": "default",
    "BucketGUID": "example-data-bucket",
    "OwnerGUID": "default",
    "GraphRepositoryGUID": "default",
    "Name": "example-metadata-rule",
    "ContentType": "*",
    "MaxContentLength": 134217728,
    "ProcessingEndpoint": "http://nginx-orchestrator:8501/processor",
    "ProcessingAccessKey": "***ault",
    "CleanupEndpoint": "http://nginx-orchestrator:8501/processor/cleanup",
    "CleanupAccessKey": "***ault",
    "ImageTextExtraction": true,
    "TopTerms": 25,
    "CaseInsensitive": true,
    "IncludeFlattened": true,
    "DataCatalogEndpoint": "http://localhost:8000/",
    "DataCatalogAccessKey": "***ault",
    "DataCatalogType": "Lexi",
    "DataCatalogCollection": "00000000-0000-0000-0000-000000000000",
    "CreatedUtc": "2025-03-25T11:40:49.283297Z"
}

Enumerate Metadata Rules

Retrieves a paginated list of all metadata rule objects in the tenant using GET /v2.0/tenants/[tenant-guid]/metadatarules. This endpoint provides comprehensive enumeration with pagination support for managing multiple metadata rules.

Request Parameters

No additional parameters required beyond authentication.

Response Structure

The enumeration response includes pagination metadata and metadata rule objects:

{
    "Success": true,
    "Timestamp": {
        "Start": "2024-10-21T02:36:37.677751Z",
        "TotalMs": 23.58,
        "Messages": {}
    },
    "MaxResults": 10,
    "IterationsRequired": 1,
    "EndOfResults": true,
    "RecordsRemaining": 16,
    "Objects": [
        {
            "GUID": "example-metadatarule",
            ... metadatarule details ...
        },
        { ... }
    ],
    "ContinuationToken": "[continuation-token]"
}
curl --location 'http://view.homedns.org:8000/v2.0/tenants/00000000-0000-0000-0000-000000000000/metadatarules/' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "http://localhost:8000/", //endpoint
  "default", //tenant Id
  "default" //access key
 );

export const enumerateMetaDataRules = async () => {
  try {
    const response = await api.MetadataRule.enumerate();
    console.log(response, "Metadata rules fetched successfully");
  } catch (err) {
    console.log("Error fetching Metadata rules:", err);
  }
};

enumerateMetaDataRules();
import view_sdk
from view_sdk import configuration

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost", 
    tenant_guid="default",
    service_ports={Service.DEFAULT: 8000},
)

def enumerateMetaDataRules():
    metaDataRules = configuration.MetadataRule.enumerate()
    print(metaDataRules)

enumerateMetaDataRules()
using View.Sdk;
using View.Sdk.Configuration;

ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
            
EnumerationResult<MetadataRule> response = await sdk.MetadataRule.Enumerate();

Response

Returns a paginated list of metadata rule objects:

{
    "Success": true,
    "Timestamp": {
        "Start": "2024-10-21T02:36:37.677751Z",
        "TotalMs": 23.58,
        "Messages": {}
    },
    "MaxResults": 10,
    "IterationsRequired": 1,
    "EndOfResults": true,
    "RecordsRemaining": 0,
    "Objects": [
        {
            "GUID": "example-metadata-rule",
            "TenantGUID": "default",
            "BucketGUID": "example-data-bucket",
            "OwnerGUID": "default",
            "GraphRepositoryGUID": "default",
            "Name": "example-metadata-rule",
            "ContentType": "*",
            "MaxContentLength": 134217728,
            "ProcessingEndpoint": "http://nginx-orchestrator:8501/processor",
            "ProcessingAccessKey": "***ault",
            "CleanupEndpoint": "http://nginx-orchestrator:8501/processor/cleanup",
            "CleanupAccessKey": "***ault",
            "ImageTextExtraction": true,
            "TopTerms": 25,
            "CaseInsensitive": true,
            "IncludeFlattened": true,
            "DataCatalogEndpoint": "http://localhost:8000/",
            "DataCatalogAccessKey": "***ault",
            "DataCatalogType": "Lexi",
            "DataCatalogCollection": "00000000-0000-0000-0000-000000000000",
            "CreatedUtc": "2025-03-25T11:40:49.283297Z"
        }
    ],
    "ContinuationToken": null
}

Read Metadata Rule

Retrieves metadata rule configuration by GUID using GET /v1.0/tenants/[tenant-guid]/metadatarules/[metadatarule-guid]. Returns the complete metadata rule configuration including all processing parameters and endpoint configurations. If the rule doesn't exist, a 404 error is returned.

Request Parameters

  • metadatarule-guid (string, Path, Required): GUID of the metadata rule object to retrieve
{
    "GUID": "example-metadata-rule",
    "TenantGUID": "default",
    "BucketGUID": "example-data-bucket",
    "OwnerGUID": "default",
    "Name": "example-metadata-rule",
    "ContentType": "*",
    "MaxContentLength": 134217728,
    "ProcessingEndpoint": "http://nginx-orchestrator:8501/processor",
    "CleanupEndpoint": "http://nginx-orchestrator:8501/processor/cleanup",
    "TypeDetectorEndpoint": "http://nginx-orchestrator:8501/processor/typedetector",
    "SemanticCellEndpoint": "http://nginx-semcell:8341/",
    "UdrEndpoint": "http://nginx-processor:8321/",
    "TopTerms": 25,
    "CaseInsensitive": true,
    "IncludeFlattened": true,
    "DataCatalogEndpoint": "http://nginx-lexi:8201/",
    "DataCatalogType": "Lexi",
    "DataCatalogCollection": "default",
    "GraphRepositoryGUID": "example-graph-repository",
    "TargetBucketGUID": "example-udr-bucket",
    "CreatedUtc": "2024-07-10T05:09:32.000000Z"
}
curl --location 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/metadatarules/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "http://localhost:8000/", //endpoint
  "default", //tenant Id
  "default" //access key
 );

export const getMetaDataRule = async () => {
  try {
    const response = await api.MetadataRule.read(
      "<metadatarule-guid>"
    );
    console.log(response, "Metadata rule fetched successfully");
  } catch (err) {
    console.log("Error fetching Metadata rule:", err);
  }
};

getMetaDataRule();
import view_sdk
from view_sdk import configuration

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost", 
    tenant_guid="default",
    service_ports={Service.DEFAULT: 8000},
)

def readMetaDataRules():
    metaDataRules = configuration.MetadataRule.retrieve("<metadatarule-guid>")
    print(metaDataRules)

readMetaDataRules()
using View.Sdk;
using View.Sdk.Configuration;

ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
            
MetadataRule response = await sdk.MetadataRule.Retrieve(Guid.Parse("metadatarule-guid"));

Response

Returns the complete metadata rule configuration:

{
    "GUID": "example-metadata-rule",
    "TenantGUID": "default",
    "BucketGUID": "example-data-bucket",
    "OwnerGUID": "default",
    "GraphRepositoryGUID": "default",
    "Name": "example-metadata-rule",
    "ContentType": "*",
    "MaxContentLength": 134217728,
    "ProcessingEndpoint": "http://nginx-orchestrator:8501/processor",
    "ProcessingAccessKey": "***ault",
    "CleanupEndpoint": "http://nginx-orchestrator:8501/processor/cleanup",
    "CleanupAccessKey": "***ault",
    "ImageTextExtraction": true,
    "TopTerms": 25,
    "CaseInsensitive": true,
    "IncludeFlattened": true,
    "DataCatalogEndpoint": "http://nginx-lexi:8201/",
    "DataCatalogAccessKey": "***ault",
    "DataCatalogType": "Lexi",
    "DataCatalogCollection": "default",
    "CreatedUtc": "2024-07-10T05:09:32.000000Z"
}

Note: the HEAD method can be used as an alternative to get to simply check the existence of the object. HEAD requests return either a 200/OK in the event the object exists, or a 404/Not Found if not. No response body is returned with a HEAD request.

Read All Metadata Rules

Retrieves all metadata rule objects in the tenant using GET /v1.0/tenants/[tenant-guid]/metadatarules/. Returns an array of metadata rule objects with complete configuration details for all rules in the tenant.

Request Parameters

No additional parameters required beyond authentication.

curl --location 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/metadatarules/' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "http://localhost:8000/", //endpoint
  "default", //tenant Id
  "default" //access key
 );

export const getMetaDataRules = async () => {
  try {
    const response = await api.MetadataRule.readAll();
    console.log(response, "Metadata rules fetched successfully");
  } catch (err) {
    console.log("Error fetching Metadata rules:", err);
  }
};

getMetaDataRules();
import view_sdk
from view_sdk import configuration

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost", 
    tenant_guid="default",
    service_ports={Service.DEFAULT: 8000},
)

def readAllMetaDataRules():
    metaDataRules = configuration.MetadataRule.retrieve_all()
    print(metaDataRules)

readAllMetaDataRules()
using View.Sdk;
using View.Sdk.Configuration;

ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
            
List<MetadataRule> response = await sdk.MetadataRule.RetrieveMany();

Response

Returns an array of all metadata rule objects:

[
    {
        "GUID": "example-metadata-rule",
        "TenantGUID": "default",
        "BucketGUID": "example-data-bucket",
        "OwnerGUID": "default",
        "GraphRepositoryGUID": "default",
        "Name": "example-metadata-rule",
        "ContentType": "*",
        "MaxContentLength": 134217728,
        "ProcessingEndpoint": "http://nginx-orchestrator:8501/processor",
        "ProcessingAccessKey": "***ault",
        "CleanupEndpoint": "http://nginx-orchestrator:8501/processor/cleanup",
        "CleanupAccessKey": "***ault",
        "ImageTextExtraction": true,
        "TopTerms": 25,
        "CaseInsensitive": true,
        "IncludeFlattened": true,
        "DataCatalogEndpoint": "http://nginx-lexi:8201/",
        "DataCatalogAccessKey": "***ault",
        "DataCatalogType": "Lexi",
        "DataCatalogCollection": "default",
        "CreatedUtc": "2024-07-10T05:09:32.000000Z"
    },
    {
        "GUID": "another-metadata-rule",
        "TenantGUID": "default",
        "BucketGUID": "another-data-bucket",
        "OwnerGUID": "default",
        "GraphRepositoryGUID": "another-graph-repository",
        "Name": "Another metadata rule",
        "ContentType": "text/plain",
        "MaxContentLength": 67108864,
        "ProcessingEndpoint": "http://nginx-orchestrator:8501/processor",
        "ProcessingAccessKey": "***ault",
        "CleanupEndpoint": "http://nginx-orchestrator:8501/processor/cleanup",
        "CleanupAccessKey": "***ault",
        "ImageTextExtraction": false,
        "TopTerms": 50,
        "CaseInsensitive": false,
        "IncludeFlattened": false,
        "DataCatalogEndpoint": "http://nginx-lexi:8201/",
        "DataCatalogAccessKey": "***ault",
        "DataCatalogType": "Lexi",
        "DataCatalogCollection": "another-collection",
        "CreatedUtc": "2024-07-10T06:30:15.456789Z"
    }
]

Update Metadata Rule

Updates an existing metadata rule configuration using PUT /v1.0/tenants/[tenant-guid]/metadatarules/[metadatarule-guid]. This endpoint allows you to modify metadata rule parameters while preserving certain immutable fields.

Request Parameters

  • metadatarule-guid (string, Path, Required): GUID of the metadata rule object to update

Updateable Fields

All configuration parameters can be updated except for:

  • GUID: Immutable identifier
  • TenantGUID: Immutable tenant association
  • CreatedUtc: Immutable creation timestamp

Important Notes

  • Field Preservation: Certain fields cannot be modified and will be preserved across updates
  • Complete Object: Provide a fully populated object in the request body
  • Validation: All updated parameters will be validated before applying changes

Request body:

{
    "BucketGUID": "example-data-bucket",
    "OwnerGUID": "default",
    "Name": "Updated metadata rule",
    "ContentType": "*",
    "MaxContentLength": 134217728,
    "ProcessingEndpoint": "http://nginx-orchestrator:8501/processor",
    "CleanupEndpoint": "http://nginx-orchestrator:8501/processor/cleanup",
    "TypeDetectorEndpoint": "http://nginx-orchestrator:8501/processor/typedetector",
    "SemanticCellEndpoint": "http://nginx-semcell:8341/",
    "UdrEndpoint": "http://nginx-processor:8321/",
    "TopTerms": 25,
    "CaseInsensitive": true,
    "IncludeFlattened": true,
    "DataCatalogEndpoint": "http://nginx-lexi:8201/",
    "DataCatalogType": "Lexi",
    "DataCatalogCollection": "default",
    "GraphRepositoryGUID": "example-graph-repository",
    "TargetBucketGUID": "example-udr-bucket",
    "CreatedUtc": "2024-07-10T05:09:32.000000Z"
}
curl --location --request PUT 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/metadatarules/00000000-0000-0000-0000-000000000000' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "BucketGUID": "00000000-0000-0000-0000-000000000000",
    "Name": "My updated metadata rule",
    "ContentType": "*",
    "MaxContentLength": 134217728,
    "ProcessingEndpoint": "http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/processing",
    "ProcessingAccessKey": "default",
    "CleanupEndpoint": "http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/processing/cleanup",
    "CleanupAccessKey": "default",
    "MinChunkContentLength": 2,
    "MaxChunkContentLength": 2048,
    "MaxTokensPerChunk": 1920,
    "ShiftSize": 256,
    "TopTerms": 25,
    "CaseInsensitive": true,
    "IncludeFlattened": true,
    "DataCatalogEndpoint": "http://localhost:8000/",
    "DataCatalogAccessKey": "default",
    "DataCatalogType": "Lexi",
    "DataCatalogCollection": "00000000-0000-0000-0000-000000000000",
    "GraphRepositoryGUID": "00000000-0000-0000-0000-000000000000"
}'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "http://localhost:8000/", //endpoint
  "default", //tenant Id
  "default" //access key
 );

export const updateMetaDataRule = async () => {
  try {
    const response = await api.MetadataRule.update({
      GUID: "<metadatarule-guid>",
      TenantGUID: "<tenant-guid>",
      BucketGUID: "<Bucket-guid>",
      OwnerGUID: "<owner-guid>",
      GraphRepositoryGUID: "<graph-repository-guid>",
      Name: "example-metadata-rule-updated-from-sdk",
      ContentType: "*",
      MaxContentLength: 134217728,
      ProcessingEndpoint:
        "http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/processing",
      ProcessingAccessKey: "default",
      CleanupEndpoint:
        "http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/processing/cleanup",
      CleanupAccessKey: "default",
      ImageTextExtraction: true,
      TopTerms: 25,
      CaseInsensitive: true,
      IncludeFlattened: true,
      DataCatalogEndpoint: "http://localhost:8000/",
      DataCatalogAccessKey: "default",
      DataCatalogType: "Lexi",
      DataCatalogCollection: "<data-catlog-collection-id>",
      CreatedUtc: "2025-03-25T12:19:28.976056Z",
    });
    console.log(response, "Metadata rule updated successfully");
  } catch (err) {
    console.log("Error updating Metadata rule:", err);
  }
};

updateMetaDataRule();
import view_sdk
from view_sdk import configuration

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost", 
    tenant_guid="default",
    service_ports={Service.DEFAULT: 8000},
)

def updateMetaDataRules():
    metaDataRules = configuration.MetadataRule.update("<metadatarule-guid>",
         BucketGUID="<Bucket-guid>",
        Name="example-metadata-rule-ash-updated",
        OwnerGUID="<owner-guid>",
        ContentType="*",
        MaxContentLength=134217728,
        ProcessingEndpoint="http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/processing",
        ProcessingAccessKey="default",
        CleanupEndpoint="http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/processing/cleanup",
        CleanupAccessKey="default",
        TopTerms=25,
        CaseInsensitive=True,
        IncludeFlattened=True,
        DataCatalogEndpoint="http://localhost:8000/",
        DataCatalogAccessKey="default",
        DataCatalogType="Lexi",
        DataCatalogCollection="<data-catlog-collection-id>",
        GraphRepositoryGUID="<graph-repository-guid>")
    print(metaDataRules)

updateMetaDataRules()
using View.Sdk;
using View.Sdk.Configuration;

ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
            
var request = new MetadataRule
{
   GUID = Guid.Parse("<metadatarule-guid>"),
   BucketGUID = Guid.Parse("<Bucket-guid>"),
   Name = "example-metadata-rule-updated-from-sdk",
   ContentType = "*",
   MaxContentLength = 134217728,
   ProcessingEndpoint = "http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/processing",
   ProcessingAccessKey = "default",
   CleanupEndpoint = "http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/processing/cleanup",
   CleanupAccessKey = "default",
   MinChunkContentLength = 2,
   MaxChunkContentLength = 2048,
   MaxTokensPerChunk = 1920,
   ShiftSize = 256,
   TopTerms = 25,
   CaseInsensitive = true,
   IncludeFlattened = true,
   DataCatalogEndpoint = "http://localhost:8000/",
   DataCatalogAccessKey = "default",
   DataCatalogType = DataCatalogTypeEnum.Lexi,
   DataCatalogCollection = "<data-catlog-collection-id>",
   GraphRepositoryGUID = Guid.Parse("<graph-repository-guid>")
};

MetadataRule response = await sdk.MetadataRule.Update(request);        

Response

Returns the updated metadata rule object with all configuration details:

{
    "GUID": "example-metadata-rule",
    "TenantGUID": "default",
    "BucketGUID": "example-data-bucket",
    "OwnerGUID": "default",
    "Name": "Updated metadata rule",
    "ContentType": "*",
    "MaxContentLength": 134217728,
    "ProcessingEndpoint": "http://nginx-orchestrator:8501/processor",
    "CleanupEndpoint": "http://nginx-orchestrator:8501/processor/cleanup",
    "TypeDetectorEndpoint": "http://nginx-orchestrator:8501/processor/typedetector",
    "SemanticCellEndpoint": "http://nginx-semcell:8341/",
    "UdrEndpoint": "http://nginx-processor:8321/",
    "TopTerms": 25,
    "CaseInsensitive": true,
    "IncludeFlattened": true,
    "DataCatalogEndpoint": "http://nginx-lexi:8201/",
    "DataCatalogType": "Lexi",
    "DataCatalogCollection": "default",
    "GraphRepositoryGUID": "example-graph-repository",
    "TargetBucketGUID": "example-udr-bucket",
    "CreatedUtc": "2024-07-10T05:09:32.000000Z"
}

Delete Metadata Rule

Deletes a metadata rule object by GUID using DELETE /v1.0/tenants/[tenant-guid]/metadatarules/[metadatarule-guid]. This operation permanently removes the metadata rule configuration. Use with caution as this action cannot be undone and may affect content processing workflows.

Request Parameters

  • metadatarule-guid (string, Path, Required): GUID of the metadata rule object to delete
curl --location --request DELETE 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/metadatarules/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••' \
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "http://localhost:8000/", //endpoint
  "default", //tenant Id
  "default" //access key
 );

export const deleteMetaDataRule = async () => {
  try {
    const response = await api.MetadataRule.delete(
      "<metadatarule-guid>"
    );
    console.log(response, "Metadata rule deleted successfully");
  } catch (err) {
    console.log("Error deleting Metadata rule:", err);
  }
};

deleteMetaDataRule();
import view_sdk
from view_sdk import configuration

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost", 
    tenant_guid="default",
    service_ports={Service.DEFAULT: 8000},
)

def deleteMetaDataRules():
    metaDataRules = configuration.MetadataRule.delete("<metadatarule-guid>")
    print(metaDataRules)

deleteMetaDataRules() 
using View.Sdk;
using View.Sdk.Configuration;

ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
        
bool deleted = await sdk.MetadataRule.Delete(Guid.Parse("<metadatarule-guid>"));

Response

Returns 204 No Content on successful deletion. No response body is returned.

Check Metadata Rule Existence

Verifies if a metadata rule object exists without retrieving its configuration using HEAD /v1.0/tenants/[tenant-guid]/metadatarules/[metadatarule-guid]. This is an efficient way to check metadata rule presence before performing operations.

Request Parameters

  • metadatarule-guid (string, Path, Required): GUID of the metadata rule object to check
curl --location --head 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/metadatarules/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "http://localhost:8000/", //endpoint
  "default", //tenant Id
  "default" //access key
 );

export const existsMetaDataRule = async () => {
  try {
    const response = await api.MetadataRule.exists('<MetadataRule-guid>');
    console.log(response, 'Metadata rule exists');
  } catch (err) {
    console.log('Error checking Metadata rule:', err);
  }
};

existsMetaDataRule();
import view_sdk
from view_sdk import configuration

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost", 
    tenant_guid="default",
    service_ports={Service.DEFAULT: 8000},
)

def existsMetaDataRules():
    metaDataRules = configuration.MetadataRule.exists("<metadatarule-guid>")
    print(metaDataRules)

existsMetaDataRules()
using View.Sdk;
using View.Sdk.Configuration;

ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
        
bool exists = await sdk.MetadataRule.Exists(Guid.Parse("<metadatarule-guid>"));

Response

  • 200 No Content: Metadata rule exists
  • 404 Not Found: Metadata rule does not exist
  • No response body: Only HTTP status code is returned

Note: HEAD requests do not return a response body, only the HTTP status code indicating whether the metadata rule exists.

Best Practices

When managing metadata rules in the View platform, consider the following recommendations for optimal performance and security:

  • Endpoint Security: Ensure proper network security for processing and catalog endpoints
  • Access Key Management: Store and manage access keys securely for processing and catalog endpoints
  • Content Type Filtering: Use specific content types instead of "*" when possible for better performance
  • Processing Optimization: Configure appropriate content length limits and processing parameters
  • Data Catalog Integration: Properly configure data catalog endpoints and collections for metadata storage

Next Steps

After successfully configuring metadata rules, you can:

  • Content Processing: Implement automated metadata generation for various content types
  • Data Catalog Integration: Store and search generated metadata in data catalogs like Lexi
  • Graph Analytics: Emit document metadata to graph repositories for relationship analysis
  • Image Processing: Enable OCR text extraction from images and documents
  • Content Analysis: Implement term extraction and content analysis workflows