class VieSchemaBuilder (View source)

Generate a schema in JSON format for the VIE dataTypes validation, necessary when using nodes as semantic types.

Example schema: http://schema.rdfs.org/all.json

Properties

protected NodeTypeManager $nodeTypeManager
protected array $properties
protected array $types
protected object $configuration
protected array $superTypeConfiguration

Methods

object
generateVieSchema()

Converts the nodes types to a fully structured array in the same structure as the schema to be created.

void
readNodeTypeConfiguration(string $nodeTypeName, NodeType $nodeType)

No description

void
addProperty(string $nodeType, string $propertyName, array $propertyConfiguration)

Adds a property to the list of known properties

void
removeUndeclaredTypes(array $configuration)

Cleans up all types which are not know in given configuration array

array
getAllSubtypes(string $type)

Return all sub node types of a node type (recursively)

array
getAllAncestors(string $type)

Return all ancestors of a node type

Details

object generateVieSchema()

Converts the nodes types to a fully structured array in the same structure as the schema to be created.

The schema also includes abstract node types for the full inheritance information in VIE.

Return Value

object

protected void readNodeTypeConfiguration(string $nodeTypeName, NodeType $nodeType)

No description

Parameters

string $nodeTypeName
NodeType $nodeType

Return Value

void

protected void addProperty(string $nodeType, string $propertyName, array $propertyConfiguration)

Adds a property to the list of known properties

Parameters

string $nodeType
string $propertyName
array $propertyConfiguration

Return Value

void

protected void removeUndeclaredTypes(array $configuration)

Cleans up all types which are not know in given configuration array

Parameters

array $configuration

Return Value

void

protected array getAllSubtypes(string $type)

Return all sub node types of a node type (recursively)

Parameters

string $type

Return Value

array

protected array getAllAncestors(string $type)

Return all ancestors of a node type

Parameters

string $type

Return Value

array