Throughout these guides, you will find that different data types are needed for certain features. The RichRelevance platform does not have its own programming language; it accepts flat text and HTTP data, and returns JSON data. These formats do not always adhere to strict typing requirements, and correct data types are not required in the same way that they may be in, say, C or Python. However, to minimize the risk of error, we have specified which data types we expect to receive in each context. In this guide you will learn what each of these mean.
Data Type Guide
ASCII data conforms to the ASCII character set (control characters excluded). It is limited to the characters found on the American keyboard and is sufficient for most ID data.
The text data type, also referred to as a string, is the most inclusive and forgiving. Since the RichRelevance platform is fully UTF-8 compatible, any UTF-8 string will be acceptable as text. This includes:
- Alphanumeric data ("1234567890", "A Clockwork Orange")
- Punctuation and special characters ("!@#$", "™", "&")
- Multibyte characters ("東京タワー", "አየሩ ደስ ይላል", "בהתחלה")
This includes any real number, with or without decimal places. Integers are acceptable as numbers (but not all numbers are acceptable as integers). Do not transmit number data in scientific notation, however; it will not be parsed correctly.
Decimals, also known as floats, are real numbers with decimal points and any number of decimal places (although for things like price data and ratings, two points of precision is the most common form).
Integers include any positive or negative real whole number.
Booleans represent true or false values only. How these values are written differs from programming language to programming language, but a boolean will only ever have two possible values: true and false. At RichRelevance we accept booleans written as "true"/"false", "1"/"0", "Y"/"N", or even "on"/"off". In addition, these values are not case-sensitive. We do ask that you stick with the same representation throughout, however, as this reduces the chance of errors when working with your files.
Most dates in RichRelevance are transmitted in YYYY-MM-DD format. For example, January 3rd, 2017 would be written as "2017-01-03".
Sometimes, we require more date information than just year, month, and day. In those cases, we will ask for the ISO 8601 Date Format. This is a more precise format that includes time and makes note of the time zone offset to yield an exact and specific time that requires no adjustments or transformations to be understandable, even by a computer system halfway around the world. In this format, for example, the date we used above, January 3rd, 2017, plus the added time information of 3pm and the time zone offset of Osaka, Japan, would be written "2017-01-03T15:00:00+09:00".
Enumerations, or enums, are sets of predetermined and enforced strings that submitted values are limited to. Booleans are a good example of an enumerated type in that they only have two possible values; true and false. For the purpose of our solutions, ours is not a strict enumeration, in that the values you specify are not saved anywhere and they are not validated. In terms of enforcement, this is just another text field. However, we indicate that it should be an enumeration when you should limit your values to a small set of recurring values that should cover all possible cases for the item. What those strings are, though, is completely up to you.