Glossary

Definitions for key terms used across the Nomad Media platform and API.

Glossary

Rule Syntax for Config Files

The various Nomad Media config files use a SQL-based rule parser for enabling and disabling processors, profiles, and other configuration aspects.

General Syntax

Rules are valid SQL statements written against asset properties. For example:

ImageHeight >= 500

Compound statements using AND, OR, and NOT:

ImageHeight >= 500 AND ContentLength = 66992

Use parentheses to force precedence:

ImageHeight >= 1200 AND (ContentType LIKE '%jpeg' OR ContentType LIKE '%jpg')

Available Asset Properties

Rules can reference any of the following properties (plus custom metadata properties):

PropertyExample Value
bucketType3
assetType2
assetTypeDisplay"File"
storageEventName"ObjectCreated:Put"
originalObjectKey"Content/Public/Media/image.jpg"
contentLength66992
contentType"image/jpeg"
mediaType1
mediaTypeDisplay"Image"
imageHeight500
imageWidth800
audioTrackCount0
hasAudiofalse
storageClass1
createdDate"2022-08-26T08:41:51.541Z"

C# Example

string rule = "url LIKE '%content/wsls/2022/09/06/noon 1 hour 9.6.22/%'";
CaseInsensitiveDictionary<object> properties = new CaseInsensitiveDictionary<object>();
properties.SetValue("url", "nomad-dev-04-system-content-rc46y2f3ixyo::Content/WSLS/2022/09/06/Noon 1 HOUR 9.6.22/AM NATIONAL SUICIDE PRE_WSLS5QWD.mxf");

bool ruleValue = SqlRuleParserRepository.Value.ProcessRule(rule, properties, null);
Assert.True(ruleValue);

SQL Syntax Reference

Comparison Operators

OperatorDescription
<Less than
>Greater than
<=Less than or equal
>=Greater than or equal
<>Not equal
=Equal
INValue in list
LIKEPattern match

Arithmetic Operators

OperatorDescription
+Addition
-Subtraction
*Multiplication
/Division
%Modulus

Boolean Operators

AND, OR, NOT. AND has precedence over OR. Use parentheses to override:

(LastName = 'Smith' OR LastName = 'Jones') AND FirstName = 'John'

Wildcard Characters

Both * and % can be used interchangeably as wildcards in a LIKE comparison. Wildcards are allowed at the start, end, or both ends of a pattern — but not in the middle:

"ItemName LIKE '*product*'"
"ItemName LIKE '*product'"
"ItemName LIKE 'product*'"

Note: 'te*xt' is not allowed (wildcard in the middle).

Aggregate Functions

FunctionDescription
Sum(expr)Sum
Avg(expr)Average
Min(expr)Minimum
Max(expr)Maximum
Count(expr)Count
StDev(expr)Statistical standard deviation
Var(expr)Statistical variance

Example:

Sum(Price)
Avg(Child.Price)

Built-in Functions

FunctionSyntaxDescription
CONVERTConvert(expression, type)Converts to a .NET type (e.g. Convert(total, 'System.Int32'))
LENLEN(expression)Returns the length of a string
ISNULLISNULL(expression, replacementvalue)Returns replacement if expression is null
IIFIIF(expr, truepart, falsepart)Conditional — returns truepart or falsepart
TRIMTRIM(expression)Removes leading/trailing whitespace (\r, \n, \t, space)
SUBSTRINGSUBSTRING(expression, start, length)Returns a substring

Examples:

Convert(total, 'System.Int32')
Len(ItemName)
IsNull(price, -1)
IIF(total>1000, 'expensive', 'cheap')
SUBSTRING(phone, 7, 8)