EntityListWorksheet
in package
Uses
MetadataSpreadsheetTrait
Description of EntityList
Tags
Table of Contents
Constants
- STRICT_OPTIONAL = 3
- STRICT_RECOMMENDED = 2
- STRICT_REQUIRED = 1
- ORGANISATION_CLASSES = ['https://vocabs.acdh.oeaw.ac.at/schema#Organisation', 'https://vocabs.acdh.oeaw.ac.at/schema#Agent', 'https://vocabs.acdh.oeaw.ac.at/schema#Person']
- SKIP_PROPERTIES = ['https://vocabs.acdh.oeaw.ac.at/schema#hasPid']
Properties
- $classes : array<string, WorksheetConfig>
- $defaultLang : string
- $horizontal : bool
- $log : LoggerInterface|null
- $ontology : Ontology
- $path : string
- $schema : Schema
- $valueMaps : array<string, array<string, NamedNode>>
- Stores value maps for cells with list-controlled values.
Methods
- __construct() : mixed
- readEntities() : Generator<string|int, DatasetNode>
- checkEntity() : bool
- getPropertyLang() : array<string|int, string>
- getValue() : NamedNode|Literal|null
- loadEntities() : array<string|int, mixed>
- mapReferenceCells() : void
- mapReferenceCols() : void
- mapReferenceRows() : void
- mapWorksheets() : void
Constants
STRICT_OPTIONAL
public
mixed
STRICT_OPTIONAL
= 3
STRICT_RECOMMENDED
public
mixed
STRICT_RECOMMENDED
= 2
STRICT_REQUIRED
public
mixed
STRICT_REQUIRED
= 1
ORGANISATION_CLASSES
private
mixed
ORGANISATION_CLASSES
= ['https://vocabs.acdh.oeaw.ac.at/schema#Organisation', 'https://vocabs.acdh.oeaw.ac.at/schema#Agent', 'https://vocabs.acdh.oeaw.ac.at/schema#Person']
SKIP_PROPERTIES
private
mixed
SKIP_PROPERTIES
= ['https://vocabs.acdh.oeaw.ac.at/schema#hasPid']
Properties
$classes
private
array<string, WorksheetConfig>
$classes
= []
$defaultLang
private
string
$defaultLang
$horizontal
private
bool
$horizontal
$log
private
LoggerInterface|null
$log
= null
$ontology
private
Ontology
$ontology
$path
private
string
$path
$schema
private
Schema
$schema
$valueMaps
Stores value maps for cells with list-controlled values.
private
array<string, array<string, NamedNode>>
$valueMaps
Needs to be recomputed with mapReferenceCols() every time you change the sheet.
Methods
__construct()
public
__construct(string $path, Ontology $ontology, Schema $schema, string $defaultLang[, int $strictness = self::STRICT_OPTIONAL ][, LoggerInterface|null $log = null ]) : mixed
Parameters
readEntities()
public
readEntities() : Generator<string|int, DatasetNode>
Return values
Generator<string|int, DatasetNode>checkEntity()
private
checkEntity(DatasetNode $entity, array<string, PropertyDesc> $properties) : bool
Parameters
- $entity : DatasetNode
- $properties : array<string, PropertyDesc>
Return values
boolgetPropertyLang()
private
getPropertyLang(string $value, string $defaultLang) : array<string|int, string>
Parameters
- $value : string
- $defaultLang : string
Return values
array<string|int, string>getValue()
private
getValue(Cell $cell, PropertyDesc $propDesc, string|null $defaultLang) : NamedNode|Literal|null
Parameters
- $cell : Cell
- $propDesc : PropertyDesc
- $defaultLang : string|null
Return values
NamedNode|Literal|nullloadEntities()
private
loadEntities(WorksheetConfig $cfg) : array<string|int, mixed>
Parameters
- $cfg : WorksheetConfig
Return values
array<string|int, mixed>mapReferenceCells()
private
mapReferenceCells(Spreadsheet $worksheet, DataValidation $validation, string $mapName) : void
Parameters
- $worksheet : Spreadsheet
- $validation : DataValidation
- $mapName : string
mapReferenceCols()
private
mapReferenceCols(WorksheetConfig $cfg) : void
Parameters
- $cfg : WorksheetConfig
mapReferenceRows()
private
mapReferenceRows(Worksheet $sheet, array<string, PropertyMapping> $propertyMap, string $valueColumn) : void
Parameters
- $sheet : Worksheet
- $propertyMap : array<string, PropertyMapping>
- $valueColumn : string
mapWorksheets()
private
mapWorksheets(Spreadsheet $spreadsheet, int $strictness) : void
Parameters
- $spreadsheet : Spreadsheet
- $strictness : int