Get the available formats based on the type of data source
This can differ from the actual available formats (e.g. a SPARQL query can return a results
from a construct or a select query, which can or can not be - respectively - be formatted in semantic formats)
public getFormatsForType ( array $source_definition ) : array | ||
$source_definition | array | |
return | array |
public function getDescriptionInfo($identifier) { $definition = $this->getEloquentDefinition($identifier); $properties = array(); $source_definition = $definition->source()->first(); foreach ($definition->getFillable() as $key) { $properties[$key] = $definition->{$key}; } $properties['type'] = strtolower($source_definition->type); $properties['description'] = @$source_definition->description; // Get the formats based on the source definition meta-data $format_helper = new FormatHelper(); $formats = $format_helper->getFormatsForType($source_definition->toArray()); $properties['formats'] = $formats; $properties['identifier'] = $identifier; unset($properties['map_property']); return $properties; }