# Metadata Object
# Type: Object
# Fields:
# Field: Patterns
# Description:
Patterns is an array of string in which each string is a metadata pattern.
"Patterns": {
"[[Genre]] books for sale in Melbourne",
"Price under [[Price]] are found"
}
Each pattern specifies how to compose metadata in sentences to be returned.
When deciding which pattern to use, the one with all mandatory fields existing in the query will be picked. *Mandatory fields are marked in the Pattern Syntax section.
For example:
Query: Search all books of genre Sci-fi
The first "[[Genre]] books for sale in Melbourne" pattern will be composed, and a metadata sentence will be returned:
Sci-fi books for sale in Melbourne
# Pattern Syntax:
[]- Description:
- Result count
- Example:
- Pattern:
[] books in Australia - Result:
- When result count is 30:
30 books in Australia
- When result count is 30:
- Pattern:
- Description:
[[]]- Description:
- Mandatory result count
- Description:
[ASPECT]- Description:
Aspectplaceholder. TheASPECTis configured in Index section.
- Example when aspect is
Genre:- Pattern:
[Genre] books for sale in Australia - Result:
- When
GenreisFantasy: Fantasy books for sale in Australia`
- When
- Pattern:
- Description:
[[ASPECT]]- Description:
- Mandatory
Aspectplaceholder
- Mandatory
- Description:
[[ASPECT][DEFAULT_LITERAL]]- Description:
- If
Aspectis empty, useDEFAULT_LITERALinstead.
- If
- Example:
- Pattern:
Books for sell in [[State][Australia]] - Result:
- When aspect
StateisVictoria:Books for sale in Victoria - When aspect
Stateis not queried:Books for sale in Australia
- When aspect
- Pattern:
- Description:
[[ASPECT1][ASPECT2][DEFAULT_LITERAL]]- Description:
- If
Aspect1is empty, useASPECT2instead. - If both
Aspect1andAspect2are empty, useDEFAULT_LITERALinstead.
- If
- Example:
- Pattern:
Books for sale in [[State][Suburb][Australia]] - Result:
- When aspect
StateisVictoria:Books for sale in Victoria - When aspect
Stateis empty andSuburbisRichmond:Books for sale in Richmond - When aspect either
StateorSuburbis not queried:Books for sale in Australia
- When aspect
- Pattern:
- Description:
[[[Aspect1][Aspect2]...[AspectN]]]- Description:
- Mandatory aspects placeholder. Use the first non-empty aspect among
Aspect1,ASPECT2, ...AspectN.
- Mandatory aspects placeholder. Use the first non-empty aspect among
- Example:
- Pattern:
Books for sell in [[[State][City][Suburb]]] - Result:
- When aspect
StateisVictoria:Books for sell in Victoria - When aspect
Stateis empty andCityisMelbourne:Books for sell in Melbourne - When aspect
StateandCityare empty andSuburbisRichmond:Books for sell in Richmond
- When aspect
- Pattern:
- Description:
ASPECT*- Description:
- Pluralize the
aspectwith an ending asterisk*. - Pluralize the
aspectalways even if count is 1 with an ending asterisk**. - Ending
aspectasterisk can be applied to all other syntax
- Pluralize the
- Example:
- Pattern:
[Genre*] - Result:
- When
GenreisBook:Books
- When
- Pattern:
[[Genre*][Book*]] - Result:
- When
Genreisscifi:Sci-fi Books- Explain:
Bookhas been pluralized toBooksin English culture setting andscifipluralized toSci-fi.
- Explain:
- When
Genrenot queried:Books- Explain:
Bookhas been pluralized toBooksin English culture setting.
- Explain:
- When
- Pattern:
- Description:
# Type: string[]
# Field: CaseStyle
# Description:
CaseStyle formats case styles on the whole metadata object after patterns composing it.
Refer to CaseStyle.
