PayloadGrammar
in package
FinalYes
Grammars of the GEDCOM 7.0 data types (specification chapter 2), as regular expressions with linear complexity. Dates are checked by DateGrammar.
Table of Contents
Constants
- AGE : mixed = 'https://gedcom.io/terms/v7/type-Age'
- DATE : mixed = 'https://gedcom.io/terms/v7/type-Date'
- DATE_EXACT : mixed = 'https://gedcom.io/terms/v7/type-Date#exact'
- DATE_PERIOD : mixed = 'https://gedcom.io/terms/v7/type-Date#period'
- DATES : mixed = [self::DATE => true, self::DATE_PERIOD => true,...
- Types checked by DateGrammar.
- ENUM : mixed = 'https://gedcom.io/terms/v7/type-Enum'
- EXT_TAG : mixed = '/^_[A-Z0-9_]+$/'
- FILE_PATH : mixed = 'https://gedcom.io/terms/v7/type-FilePath'
- INTEGER : mixed = 'http://www.w3.org/2001/XMLSchema#nonNegativeIn...
- LANGUAGE : mixed = 'http://www.w3.org/2001/XMLSchema#Language'
- LATITUDE : mixed = 'https://gedcom.io/terms/v7/type-Latitude'
- LIST_ENUM : mixed = 'https://gedcom.io/terms/v7/type-List#Enum'
- LIST_TEXT : mixed = 'https://gedcom.io/terms/v7/type-List#Text'
- LONGITUDE : mixed = 'https://gedcom.io/terms/v7/type-Longitude'
- MEDIA_TYPE : mixed = 'http://www.w3.org/ns/dcat#mediaType'
- NAME : mixed = 'https://gedcom.io/terms/v7/type-Name'
- NAMES : mixed = [self::INTEGER => 'a non-negative integer', sel...
- Human-readable names for messages.
- OPTIONAL : mixed = [self::TEXT => true, self::LIST_TEXT => true, s...
- Types whose payload may be omitted: those whose grammar matches the empty string, which a missing payload is equal to (7.0 section 1: "1 EVEN" is an EVEN with an empty Text). The structure still needs a payload or a substructure (KV3007).
- TAG_DEF : mixed = 'https://gedcom.io/terms/v7/type-TagDef'
- TEXT : mixed = 'http://www.w3.org/2001/XMLSchema#string'
- TIME : mixed = 'https://gedcom.io/terms/v7/type-Time'
- URI : mixed = 'http://www.w3.org/2001/XMLSchema#anyURI'
Methods
- fragment() : string
- At most 20 characters of a value: diagnostics end up in logs.
- isEnumValue() : bool
- Whether a value is an enumeration value: a standard one from the set, or any extension tag.
- listItems() : array<int, string>
- matches() : bool
- Whether the value matches the data type; true for types this class does not check.
Constants
AGE
public
mixed
AGE
= 'https://gedcom.io/terms/v7/type-Age'
DATE
public
mixed
DATE
= 'https://gedcom.io/terms/v7/type-Date'
DATE_EXACT
public
mixed
DATE_EXACT
= 'https://gedcom.io/terms/v7/type-Date#exact'
DATE_PERIOD
public
mixed
DATE_PERIOD
= 'https://gedcom.io/terms/v7/type-Date#period'
DATES
Types checked by DateGrammar.
public
mixed
DATES
= [self::DATE => true, self::DATE_PERIOD => true, self::DATE_EXACT => true]
ENUM
public
mixed
ENUM
= 'https://gedcom.io/terms/v7/type-Enum'
EXT_TAG
public
mixed
EXT_TAG
= '/^_[A-Z0-9_]+$/'
FILE_PATH
public
mixed
FILE_PATH
= 'https://gedcom.io/terms/v7/type-FilePath'
INTEGER
public
mixed
INTEGER
= 'http://www.w3.org/2001/XMLSchema#nonNegativeInteger'
LANGUAGE
public
mixed
LANGUAGE
= 'http://www.w3.org/2001/XMLSchema#Language'
LATITUDE
public
mixed
LATITUDE
= 'https://gedcom.io/terms/v7/type-Latitude'
LIST_ENUM
public
mixed
LIST_ENUM
= 'https://gedcom.io/terms/v7/type-List#Enum'
LIST_TEXT
public
mixed
LIST_TEXT
= 'https://gedcom.io/terms/v7/type-List#Text'
LONGITUDE
public
mixed
LONGITUDE
= 'https://gedcom.io/terms/v7/type-Longitude'
MEDIA_TYPE
public
mixed
MEDIA_TYPE
= 'http://www.w3.org/ns/dcat#mediaType'
NAME
public
mixed
NAME
= 'https://gedcom.io/terms/v7/type-Name'
NAMES
Human-readable names for messages.
public
mixed
NAMES
= [self::INTEGER => 'a non-negative integer', self::NAME => 'a personal name (text with at most one /surname/)', self::LANGUAGE => 'a BCP 47 language tag, e.g. "uk" or "en-US"', self::MEDIA_TYPE => 'a media type, e.g. "image/jpeg"', self::AGE => 'an age, e.g. "35y 3m" or "< 1y"', self::TIME => 'a time, e.g. "14:30" or "14:30:15Z"', self::LATITUDE => 'a latitude, e.g. "N50.45"', self::LONGITUDE => 'a longitude, e.g. "E30.52"', self::FILE_PATH => 'a file path: a relative path or an ftp, http, https or file URL', self::URI => 'a URI reference', self::TAG_DEF => 'an extension tag and a URI, e.g. "_UID https://…"', self::DATE => 'a date, e.g. "6 DEC 1907", "ABT JULIAN 1650" or "BET 1900 AND 1910"', self::DATE_PERIOD => 'a date period, e.g. "FROM 1900 TO 1910" or "TO 1850"', self::DATE_EXACT => 'an exact Gregorian date, e.g. "6 DEC 1907"']
OPTIONAL
Types whose payload may be omitted: those whose grammar matches the empty string, which a missing payload is equal to (7.0 section 1: "1 EVEN" is an EVEN with an empty Text). The structure still needs a payload or a substructure (KV3007).
public
mixed
OPTIONAL
= [self::TEXT => true, self::LIST_TEXT => true, self::AGE => true, self::DATE => true, self::DATE_PERIOD => true]
TAG_DEF
public
mixed
TAG_DEF
= 'https://gedcom.io/terms/v7/type-TagDef'
TEXT
public
mixed
TEXT
= 'http://www.w3.org/2001/XMLSchema#string'
TIME
public
mixed
TIME
= 'https://gedcom.io/terms/v7/type-Time'
URI
public
mixed
URI
= 'http://www.w3.org/2001/XMLSchema#anyURI'
Methods
fragment()
At most 20 characters of a value: diagnostics end up in logs.
public
static fragment(string $value) : string
Parameters
- $value : string
Return values
stringisEnumValue()
Whether a value is an enumeration value: a standard one from the set, or any extension tag.
public
static isEnumValue(string $value, array<int, string> $permitted) : bool
Parameters
- $value : string
- $permitted : array<int, string>
Return values
boollistItems()
public
static listItems(string $value) : array<int, string>
Parameters
- $value : string
Return values
array<int, string> —items of a List:Enum: comma-separated, spaces around the commas
matches()
Whether the value matches the data type; true for types this class does not check.
public
static matches(string $type, string $value) : bool
Parameters
- $type : string
- $value : string