class COIDParser

The COIDParser can be used to validate COIDs and extract information.

Constants

COID_INVALID

COID_ROOT

COID_UNVERSIONED

COID_VERSIONED

COID_VERSION_WILDCARD

REGEX_HOSTNAME

REGEX_SEGMENT

REGEX_VERSION_WILDCARD

Methods

static IRI
fromString(string $coidString)

Creates a new IRI object representing a COID from a string.

static int|null
getType(IRI $coid)

Get the type of a COID.

static boolean
isValidCOID(IRI $coid)

Checks whether the given IRI object is a valid COID.

static string|null
getName(IRI $coid)

Get the name segment of a valid COID or null if not available.

static string|null
getVersion(IRI $coid)

Get the version segment of a valid, versioned COID or null if not available.

static string|null
getVersionWildcard(IRI $coid)

Get the version segment of a versioned or version wildcard COID or null if not available.

static IRI|null
getNamespaceCOID(IRI $coid)

Returns the COID itself if it is a root COID or a new IRI object representing the namespace underlying the given COID.

Details

at line 34
static IRI fromString(string $coidString)

Creates a new IRI object representing a COID from a string.

Adds the "coid://" prefix if necessary and normalizes case.

Parameters

string $coidString A COID string.

Return Value

IRI

at line 48
static int|null getType(IRI $coid)

Get the type of a COID.

Parameters

IRI $coid

Return Value

int|null

at line 84
static boolean isValidCOID(IRI $coid)

Checks whether the given IRI object is a valid COID.

Parameters

IRI $coid

Return Value

boolean

at line 94
static string|null getName(IRI $coid)

Get the name segment of a valid COID or null if not available.

Parameters

IRI $coid

Return Value

string|null

at line 109
static string|null getVersion(IRI $coid)

Get the version segment of a valid, versioned COID or null if not available.

Parameters

IRI $coid

Return Value

string|null

at line 124
static string|null getVersionWildcard(IRI $coid)

Get the version segment of a versioned or version wildcard COID or null if not available.

Parameters

IRI $coid

Return Value

string|null

at line 139
static IRI|null getNamespaceCOID(IRI $coid)

Returns the COID itself if it is a root COID or a new IRI object representing the namespace underlying the given COID.

Parameters

IRI $coid

Return Value

IRI|null