This repository has been archived by the owner on Aug 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from ec-europa/2split
Split rdf entity and SPARQL entity storage.
- Loading branch information
Showing
156 changed files
with
429 additions
and
11,144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/composer.lock | ||
/vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,29 @@ | ||
[![Build Status](https://travis-ci.org/ec-europa/rdf_entity.svg?branch=8.x-1.x)](https://travis-ci.org/ec-europa/rdf_entity) | ||
|
||
# Getting started | ||
A working Sparql endpoint is needed to use the rdf entity module. | ||
You could either use a remote Sparql endpoint, or you could set one up locally. | ||
|
||
Virtuoso is one of the more robust triple store solutions available, but any | ||
solution would do. | ||
|
||
@todo Create an example module that uses | ||
[http://dbpedia.org/sparql](http://dbpedia.org/sparql) | ||
|
||
## Setting up Virtuoso | ||
### On a Debian based system | ||
|
||
`apt-cache search "^virtuoso"` will show you available packages. | ||
|
||
``` | ||
$ apt-get install virtuoso-opensource | ||
$ service virtuoso-opensource-6.1 start | ||
``` | ||
|
||
(Set the password during installation) | ||
|
||
### On Mac OS X system | ||
- Install Homebrew (see http://brew.sh) | ||
- `$ brew install virtuoso` | ||
- Start Virtuoso | ||
``` | ||
# The version might be differnet than 7.2.4.2. | ||
$ cd /usr/local/Cellar/virtuoso/7.2.4.2/var/lib/virtuoso/db | ||
$ virtuoso-t -f & | ||
``` | ||
- Administer at | ||
[http://localhost:8890/conductor/](http://localhost:8890/conductor/). Login | ||
with dba/dba. | ||
|
||
### On an Arch Linux based system | ||
- Install the | ||
[Virtuoso AUR package](https://aur.archlinux.org/packages/virtuoso/). | ||
- `# systemctl start virtuoso` | ||
|
||
Go to [http://localhost:8890/conductor/](http://localhost:8890/conductor/) | ||
and login in with: dba - yourpass | ||
|
||
Grant 'update' rights to the SPARQL user: | ||
System admin -> Users -> SPARQL (edit) | ||
Account roles -> Put SPARQL_UPDATE in 'Selected' | ||
|
||
## Connecting Drupal to the Sparql endpoint | ||
The following example demonstrates the use with a local Virtuoso installation. | ||
To connect Drupal to the endpoint, the db connection should be added to the | ||
settings.php file. | ||
|
||
$databases['sparql_default']['sparql'] = [ | ||
'prefix' => '', | ||
'host' => '127.0.0.1', | ||
'port' => '8890', | ||
'namespace' => 'Drupal\\Driver\\Database\\sparql', | ||
'driver' => 'sparql', | ||
// Optional. This is actually the endpoint path. If omitted, 'sparql' will | ||
// be used. | ||
'database' => 'data/endpoint', | ||
// If the connection to the endpoint should be HTTPS secured. If omitted, | ||
// FALSE is assumed. | ||
'https' => FALSE, | ||
]; | ||
|
||
## Content translation | ||
Rdf entities support basic content translations. This is still WIP. | ||
|
||
**Note:** If content translations are enabled, the 'langcode' property | ||
**must** be mapped, otherwise entity reference fields will not store | ||
information. | ||
Mainly, [RDF Entity](https://www.drupal.org/project/rdf_entity) provides an | ||
entity type (`rdf_entity`) that uses the | ||
[SPARQL](https://en.wikipedia.org/wiki/SPARQL) backend provided by [SPARQL | ||
Entity Storage](https://www.drupal.org/project/sparql_entity_storage) module. | ||
The entity type can be used as it is, can be extended or, simply, used as a good | ||
use case of the [SPARQL Entity | ||
Storage](https://www.drupal.org/project/sparql_entity_storage) module. | ||
|
||
### Updating from `1.0-alpha16` to `alpha17` | ||
|
||
With `1.0-alpha17`, the SPARQL storage has been [split out, as a standalone | ||
module](https://github.com/ec-europa/rdf_entity/issues/17). Moving services from | ||
one module to the other is impossible with the actual Drupal core. See the | ||
[related Drupal core issue] | ||
(https://www.drupal.org/project/drupal/issues/2863986) for details. As the | ||
module is in alpha, we're not providing any update path but we recommend to | ||
follow the next steps in order to update a server in production: | ||
|
||
1. The update process is split in two consecutive deployments. | ||
1. Install an empty version of the `sparql_entity_storage` module: | ||
``` | ||
$ composer require drupal/sparql_entity_storage:dev-empty-module | ||
``` | ||
1. Enable the module. | ||
1. Deploy to production. | ||
1. Require `drupal/sparql_entity_storage` with the new `1.0-alpha17` version and | ||
perform a second deployment. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,40 @@ | ||
{ | ||
"name": "drupal/rdf_entity", | ||
"description": "This module allows you to leverage the semantic web by storing and retrieving content directly from an RDF data store using the SPARQL RDF query language.", | ||
"type": "drupal-module", | ||
"homepage": "https://drupal.org/project/rdf_entity", | ||
"support": { | ||
"issues": "https://drupal.org/project/issues/rdf_entity", | ||
"source": "https://cgit.drupalcode.org/rdf_entity" | ||
"name": "drupal/rdf_entity", | ||
"description": "This module allows you to leverage the semantic web by storing and retrieving content directly from an RDF data store using the SPARQL RDF query language.", | ||
"type": "drupal-module", | ||
"homepage": "https://drupal.org/project/rdf_entity", | ||
"support": { | ||
"issues": "https://drupal.org/project/issues/rdf_entity", | ||
"source": "https://cgit.drupalcode.org/rdf_entity" | ||
}, | ||
"license": "GPL-2.0+", | ||
"minimum-stability": "dev", | ||
"require": { | ||
"php": ">=7.1", | ||
"drupal/sparql_entity_storage": "dev-8.x-1.x" | ||
}, | ||
"require-dev": { | ||
"minimaxir/big-list-of-naughty-strings": "dev-master" | ||
}, | ||
"repositories": [ | ||
{ | ||
"type": "vcs", | ||
"url": "https://github.com/ec-europa/sparql_entity_storage.git" | ||
}, | ||
"license": "GPL-2.0+", | ||
"require": { | ||
"php": ">=7.1", | ||
"easyrdf/easyrdf": "0.10.0-alpha.1 as 0.9.2", | ||
"ml/json-ld": "^1.0" | ||
{ | ||
"type": "composer", | ||
"url": "https://packages.drupal.org/8" | ||
}, | ||
"autoload": { | ||
"classmap": [ | ||
"driver/sparql/Connection.php" | ||
] | ||
{ | ||
"type": "package", | ||
"package": { | ||
"name": "minimaxir/big-list-of-naughty-strings", | ||
"version": "dev-master", | ||
"dist": { | ||
"url": "https://github.com/minimaxir/big-list-of-naughty-strings/archive/master.zip", | ||
"type": "zip" | ||
} | ||
} | ||
} | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.