This repository was archived by the owner on Aug 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSaft.wordpress.php
More file actions
42 lines (38 loc) · 1.38 KB
/
Saft.wordpress.php
File metadata and controls
42 lines (38 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
* Plugin Name: Saft.wordpress
* Plugin URI: https://github.com/SaftIng/Saft.wordpress
* Description: This plugin contains the Saft library (+ vendors) and provides a Wordpress integration. The Saft library is the aim to build a collection of components which helps anyone who wants to create applications by using Semantic Web technology.
* Author: Konrad Abicht
* Author URI: http://inspirito.de
* License: GPL3
*/
use Saft\Addition\ARC2\Store\ARC2;
use Saft\Rdf\NamedNodeImpl;
use Saft\Rdf\NodeFactoryImpl;
use Saft\Rdf\StatementFactoryImpl;
use Saft\Rdf\StatementImpl;
use Saft\Rdf\StatementIteratorFactoryImpl;
use Saft\Sparql\Query\QueryFactoryImpl;
use Saft\Sparql\Result\ResultFactoryImpl;
// include autoloaders for Saft and related vendors
require_once __DIR__ .'/Saft/vendor/autoload.php';
/*
* Initialize ARC2-instance and set it up, so that it can use current WordPress
* database to store its tables.
*/
global $saftdb, $wpdb;
$saftdb = new ARC2(
new NodeFactoryImpl(),
new StatementFactoryImpl(),
new QueryFactoryImpl(),
new ResultFactoryImpl(),
new StatementIteratorFactoryImpl(),
array(
'username' => $wpdb->dbuser,
'password' => $wpdb->dbpassword,
'host' => $wpdb->dbhost,
'database' => $wpdb->dbname,
'table-prefix' => 'saft_', // prefix of ARC2/Saft related tables
)
);