Skip to content
This repository was archived by the owner on Aug 25, 2022. It is now read-only.

2split #94

Merged
merged 28 commits into from
May 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
fa6b18d
Issue #17: Require sparql_entity_storage.
claudiu-cristea Dec 11, 2018
e8101e3
Issue #17: Remove the SPARQL database driver.
claudiu-cristea Dec 11, 2018
4a1cecb
Issue #17: Move the graph handler service.
claudiu-cristea Dec 11, 2018
9dd75d0
Issue #17: Move the SPARQL endpoint service.
claudiu-cristea Dec 11, 2018
56aa766
Issue #17: Move the SPARQL entity ID plugin manager service.
claudiu-cristea Dec 11, 2018
b9e91d5
Issue #17: Move the SPARQL query factory service.
claudiu-cristea Dec 11, 2018
6beb546
Issue #17: Remove the Webprofiler broken integration.
claudiu-cristea Dec 11, 2018
f6bcffa
Issue #17: Move the SPARQL entity param converter service.
claudiu-cristea Dec 11, 2018
4a922f1
Issue #17: Move the route processor service.
claudiu-cristea Dec 11, 2018
90a5ca0
Issue #17: Move the SPARQL field handler service.
claudiu-cristea Dec 11, 2018
fee2ef9
Issue #17: Rename graph handler from RDF to SPARQL.
claudiu-cristea Dec 11, 2018
bd0679c
Issue #17: Remove the RDF entity ID generator plugin interface & abst…
claudiu-cristea Dec 11, 2018
6547ecf
Issue #17: Rename field handler from RDF to SPARQL.
claudiu-cristea Dec 11, 2018
a1007f2
Issue #17: Refactor the rest of the code.
claudiu-cristea Dec 11, 2018
dcc17d4
Issue #17: Add the autoloading setting.
claudiu-cristea Dec 19, 2018
ca5a57e
Issue #17: Fix the searializer coding standards.
claudiu-cristea May 7, 2019
f90da45
Issue #17: Temporary host sparql_entity_storage module.
claudiu-cristea May 7, 2019
84113fe
Issue #17: Fix composer deprecation.
claudiu-cristea May 13, 2019
97063e4
Issue #17: Add backward compatibility for some notable services.
claudiu-cristea May 7, 2019
47e76d2
Issue #17: Move the SPARQL serializer.
claudiu-cristea May 14, 2019
54ac63e
Issue #17: Provide an update path.
claudiu-cristea May 14, 2019
bda0145
Issue #17: Move sparql_entity_storage in its own project.
claudiu-cristea May 15, 2019
153fdae
Issue #17: Fix dependecies as the module is external now.
claudiu-cristea May 15, 2019
e1c9e49
Issue #17: Document alpha16 > 17 update path.
claudiu-cristea May 17, 2019
07a9f3e
Fix typo.
idimopoulos May 22, 2019
4987d22
An alpha release has been created. Use that version.
idimopoulos May 23, 2019
5556a78
Require a specific version from the git repo instead.
idimopoulos May 23, 2019
13e6269
Go with the dev branch for now.
idimopoulos May 23, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/composer.lock
/vendor/
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ before_install:
# Deploy the codebase.
- test ${TEST} == "PHP_CodeSniffer" || cp ${TRAVIS_BUILD_DIR}/tests/travis-ci/fixtures/composer.json.dist ${SITE_DIR}/composer.json
- test ${TEST} == "PHP_CodeSniffer" || cp ${TRAVIS_BUILD_DIR}/tests/travis-ci/fixtures/phpunit.xml.dist ${SITE_DIR}/web/phpunit.xml
- test ${TEST} == "PHP_CodeSniffer" || sed -i -e 's#\$TRAVIS_BUILD_DIR#'${TRAVIS_BUILD_DIR}'#g' composer.json
- test ${TEST} == "PHP_CodeSniffer" || composer require drupal/core:$TEST --no-interaction
- test ${TEST} == "PHP_CodeSniffer" || perl -i -pe's/\$\{([^}]+)\}/$ENV{$1}/' composer.json
- test ${TEST} == "PHP_CodeSniffer" || composer require drupal/core:${TEST} --no-interaction
# Virtuoso setup.
- test ${TEST} == "PHP_CodeSniffer" || mkdir ${SITE_DIR}/virtuoso
- test ${TEST} == "PHP_CodeSniffer" || docker run --name virtuoso -p 8890:8890 -p 1111:1111 -e SPARQL_UPDATE=true -v ${SITE_DIR}/virtuoso:/data -d tenforce/virtuoso
Expand Down
99 changes: 0 additions & 99 deletions API.md

This file was deleted.

99 changes: 27 additions & 72 deletions README.md
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.
51 changes: 35 additions & 16 deletions composer.json
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"
}
}
}
]
}
7 changes: 0 additions & 7 deletions config/install/rdf_entity.graph.default.yml

This file was deleted.

103 changes: 0 additions & 103 deletions config/schema/rdf_entity.schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,106 +16,3 @@ rdf_entity.rdfentity.*:
help:
type: text
label: 'Explanation or submission guidelines'

field.storage.*.*.third_party.rdf_entity:
type: mapping
mapping:
'mapping':
type: sequence
label: 'Column'
sequence:
type: mapping
mapping:
predicate:
type: string
label: 'Predicate'
format:
type: string
label: 'Value format'

field.widget.settings.auto_uri:
type: mapping
label: 'Settings regarding the uri field.'
mapping:
prefix:
type: string
label: 'Behaviour'

field.widget.settings.datetime_create_update:
type: mapping
label: 'Behaviour of the field'
mapping:
behaviour:
type: string
label: 'Behaviour'

field.formatter.third_party.joinup:
type: mapping
label: 'Theme settings for Joinup project.'
mapping:
template_suggestion:
type: string

rdf_entity.graph.*:
type: config_entity
label: 'RDF entity graph'
mapping:
id:
type: string
label: ID
weight:
type: integer
label: Weight
name:
type: label
label: Name
description:
type: text
label: Description
entity_types:
type: sequence
nullable: true
label: 'Entity types'
sequence:
type: string
label: 'Entity type'

rdf_entity.mapping.*:
type: config_entity
label: 'Stores the mapping between Drupal bundle settings and RDF representation'
mapping:
id:
type: string
label: ID
entity_type_id:
type: string
label: 'Referred entity type'
bundle:
type: string
label: 'Referred bundle'
rdf_type:
type: string
label: 'RDF type mapping'
graph:
type: sequence
sequence:
type: string
label: 'The mapping of a graph definition to a graph URI.'
base_fields_mapping:
type: sequence
label: 'The base fields mapping'
sequence:
type: sequence
label: 'Column'
sequence:
type: mapping
mapping:
predicate:
type: string
label: 'Predicate'
format:
type: string
label: 'Value format'
entity_id_plugin:
type: string
label: 'The plugin that generates the entity ID'
Loading