openeuropa / rdf_skos
Drupal module that contains the RDF SKOS entity types.
Installs: 119 815
Dependents: 10
Suggesters: 0
Security: 0
Stars: 0
Watchers: 19
Forks: 3
Open Issues: 4
Type:drupal-module
Requires
- php: >=8.1
- drupal/core: ^10
- drupal/sparql_entity_storage: ^2.0.0-alpha12
Requires (Dev)
- composer/installers: ^1.11
- drupal/core-composer-scaffold: ^10
- drupal/drupal-extension: ^5.0
- drush/drush: ^12
- mikey179/vfsstream: ^1.6.10
- nikic/php-parser: ^4
- openeuropa/behat-transformation-context: ^0.2
- openeuropa/code-review: ^2.0.0-alpha6
- openeuropa/task-runner-drupal-project-symlink: ^1.0-beta6
- phpspec/prophecy-phpunit: ^2
- symfony/phpunit-bridge: ^6.2
- 1.x-dev
- 1.0.0
- 1.0.0-alpha10
- 1.0.0-alpha9
- 1.0.0-alpha8
- 1.0.0-alpha7
- 1.0.0-alpha6
- 1.0.0-alpha5
- 1.0.0-alpha4
- 1.0.0-alpha3
- 1.0.0-alpha2
- 1.0.0-alpha1
- 0.x-dev
- 0.12.0.x-dev
- 0.12.0
- 0.11.0
- 0.10.0
- 0.9.0
- 0.8.0
- 0.7.0
- 0.6.0
- 0.5.0
- 0.4.0
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.1
- 0.2.0
- 0.1.0
- dev-OEL-3065
- dev-OES-1106
- dev-release-1.0.0-alpha4
- dev-release-1.0.0-alpha3
- dev-master
- dev-EWPP-727-0.x
- dev-release-1.0.0-alpha1
- dev-EWPP-176
- dev-OPENEUROPA-3048-test
- dev-OPENEUROPA-2258-test-php72
This package is auto-updated.
Last update: 2024-10-26 14:03:29 UTC
README
This module provides a dedicated entity type for SKOS modeling. The module requires access to a triplestore database, such as Virtuoso 7.
Upgrade from 0.11.0 to 1.0.0-alpha1
On 1.0.0-alpha1
, the rdf_entity
module dependency has been removed and instead the sparql_entity_storage
module has been
introduced (see the rdf_entity module's Readme for more information).
As suggested by the rdf_entity
module itself, the following steps can be taken in order to update rdf_skos
in production:
The update process needs to be split in three deployments, which will likely result into separate site releases.
First deployment
- Before you update
rdf_skos
to1.0.0-alpha1
, require an empty version of thedrupal/sparql_entity_storage
module:$ composer require drupal/sparql_entity_storage:dev-empty-module
- Deploy to production.
- Enable the module (this can be part of the deployment procedure above, depending on your setup).
At this point your site's composer.json
should look like this:
{
...
"openeuropa/rdf_skos": "~0.11.0",
"drupal/sparql_entity_storage": "dev-empty-module",
...
}
Second deployment
- Remove the empty
drupal/sparql_entity_storage
module requirement from yourcomposer.json
. - Require
drupal/rdf_entity
with the new1.0-alpha21
version andopeneuropa/rdf_skos
with the new1.0.0-alpha1
version. - Deploy to production.
- Uninstall the
drupal/rdf_entity
module (this can be part of the deployment procedure above, depending on your setup).
At this point your site's composer.json
should look like this:
{
...
"openeuropa/rdf_skos": "~1.0.0-alpha1",
"drupal/rdf_entity": "~1.0-alpha21",
...
}
Third deployment
- Remove the
drupal/rdf_entity
dependency. - Deploy to production.
At this point your site's composer.json
should look like this:
{
...
"openeuropa/rdf_skos": "~1.0.0-alpha1",
...
}
After these steps your site should have the latest version drupal/rdf_skos
module using drupal/sparql_entity_storage
and the drupal/rdf_entity
module should no longer be in your codebase.
Technical details and constraints
The module allows loading SKOS concept schemes and concepts as entities in Drupal. The entities will be loaded from the graph IRIs specified in the related configuration.
Since all the graphs are passed to the methods for loading entities, this enforces the limitation of having unique IRIs (IDs in Drupalese) for the SKOS entities present in all the graphs.
Development setup
Initial setup
You can build the test site by running the following steps.
- Install Virtuoso. The easiest way to do this is by using the OpenEuropa Triple store development Docker container which also pre-imports the main Europa vocabularies.
- Install all the composer dependencies:
$ composer install
-
Customize build settings by copying
runner.yml.dist
torunner.yml
and changing relevant values, like your database credentials. -
Setup test site by running:
$ ./vendor/bin/run drupal:site-setup
This will symlink the module in the proper directory within the test site and
perform token substitution in test configuration files such as behat.yml.dist
.
Please note: project files and directories are symlinked within the test site by using the OpenEuropa Task Runner's Drupal project symlink command.
If you add a new file or directory in the root of the project, you need to re-run drupal:site-setup
in order to make
sure they are be correctly symlinked.
If you don't want to re-run a full site setup for that, you can simply run:
$ ./vendor/bin/run drupal:symlink-project
- Install test site by running:
$ ./vendor/bin/run drupal:site-install
Your test site will be available at ./build
.
Using Docker Compose
Alternatively you can build a test site using Docker and Docker-compose with the provided configuration.
Requirements:
You can make any alterations you need for your local Docker setup. However, the defaults should be enough to set the project up.
Run:
$ docker-compose up -d
Then:
$ docker-compose exec web composer install
$ docker-compose exec web ./vendor/bin/run drupal:site-install
Your test site will be available at http://localhost:8080/build.
To run the grumphp test:
$ docker-compose exec web ./vendor/bin/grumphp run
To run the phpunit test:
$ docker-compose exec web ./vendor/bin/phpunit
To run the behat test:
$ docker-compose exec web ./vendor/bin/behat
Working with content
The project ships with the following Task Runner commands to work with content in the RDF store, they require Docker Compose services to be up and running.
Purge all data:
$ docker-compose exec sparql ./vendor/bin/robo purge
Or, if you can run commands on your host machine:
$ ./vendor/bin/run sparql:purge
Import default data:
$ docker-compose exec sparql ./vendor/bin/robo import
Or, if you can run commands on your host machine:
$ ./vendor/bin/run sparql:import
Reset all data, i.e. run purge and import:
$ docker-compose exec sparql ./vendor/bin/robo purge
$ docker-compose exec sparql ./vendor/bin/robo import
Or, if you can run commands on your host machine:
$ ./vendor/bin/run sparql:reset