euf/elm_vocabularies
PHP library providing ELM controlled vocabularies.
Maintainers
Package info
github.com/EuropeanUniversityFoundation/elm_vocabularies_php
pkg:composer/euf/elm_vocabularies
Requires
- php: >=8.2
Requires (Dev)
- brick/varexporter: ^0.7
- phpstan/phpstan: ^2.1
- squizlabs/php_codesniffer: ^4.0
- sweetrdf/easyrdf: ^1.19
- twig/intl-extra: ^3.22
- twig/twig: ^3.22
Suggests
None
Provides
None
Conflicts
None
Replaces
None
MIT babaa01cde602d34d8b52fee0bbed87fc58a32c0
- Tiago Simões <tiago.simoes.woop@uni-foundation.eu>
This package is not auto-updated.
Last update: 2026-06-30 02:30:28 UTC
README
This library provides a curated set of ELM controlled vocabularies for use in PHP applications.
The controlled vocabularies included in this package are maintained by DG EMPL and disseminated by the Publications Office of the European Union on the EU Vocabularies website.
see Copyright notice
All editorial content (non-code assets) included in this package is licensed under the Creative Commons Attribution 4.0 International licence unless otherwise indicated.
The software as such is provided under the MIT license.
Installation
composer require euf/elm_vocabularies
Usage example
<?php require_once '../vendor/autoload.php'; use Elm\AssessmentType; use Elm\LearningActivityType; use Elm\LearningOpportunityType; use Elm\LearningScheduleType; use Elm\LearningSettingType; use Elm\ModeOfLearningAndAssessment; $vocabularies = [ $assessment = new AssessmentType(), $learningActivity = new LearningActivityType(), $learningOpportunity = new LearningOpportunityType(), $learningSchedule = new LearningScheduleType(), $learningSetting = new LearningSettingType(), $learningAssessment = new ModeOfLearningAndAssessment(), ]; foreach ($vocabularies as $vocabulary) { $name = $vocabulary->getName(); echo("Vocabulary: " . $name . "\n"); $list = $vocabulary->getLabeledList(); echo(json_encode($list, JSON_PRETTY_PRINT) . "\n"); $fakeKey = '0123456789'; echo("Testing " . $fakeKey . "\n"); echo(($vocabulary->keyExists($fakeKey)) ? "True" : "False"); echo("\n"); $randomKey = array_rand($list); echo("Testing " . $randomKey . "\n"); echo(($vocabulary->keyExists($randomKey)) ? "True" : "False"); echo("\n"); $randomItem = $vocabulary->get($randomKey); echo(json_encode($randomItem, JSON_PRETTY_PRINT) . "\n"); }
