Skip to content
ARC RDF Classes for PHP
PHP JavaScript Other
Branch: master
Clone or download
k00ni Merge pull request #126 from cbinding/patch-2
Fixing failing tests (issue #125)
Latest commit 47fca87 Jan 25, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.travis travis: finalized transition to multi database backend tests May 13, 2018
doc small refinements Jun 20, 2018
extractors Update outdated @homepage and @license URLs in inline docs Nov 24, 2015
parsers applied PSR-2 to all files in parser and serializers folder May 8, 2018
serializers applied PSR-2 to all files in parser and serializers folder May 8, 2018
sparqlscript Update outdated @homepage and @license URLs in inline docs Nov 24, 2015
src/ARC2/Store/Adapter AdapterFactory: better check if user wants to use the cache Jul 16, 2018
store Potential fix for #122 and #114 Jan 9, 2019
tests Update LoadQueryTest.php Jan 25, 2019
.coveralls.yml added Coveralls support Jun 8, 2017
.editorconfig extended documentation, moved files in new doc folder; added .editorc… Jun 14, 2018
.gitignore introduced PHP CS Fixer to make all files in store folder PSR2 compliant May 6, 2018
.php_cs added src folder to PHP CS Fixer setup Jun 15, 2018
.travis.yml travis: removed unneccessary CACHE related tests Jun 21, 2018
ARC2.php Adding basic JSON-LD serializer Oct 7, 2016
ARC2_Class.php prepared ARC2 to be able to run with mysqli and PDO adapter Jun 12, 2018
ARC2_Graph.php Update outdated @homepage and @license URLs in inline docs Nov 24, 2015
ARC2_Reader.php Refactored out URI part inference for relative URIs Oct 25, 2018
ARC2_Resource.php Update outdated @homepage and @license URLs in inline docs Nov 24, 2015
ARC2_getFormat.php Update outdated @homepage and @license URLs in inline docs Nov 24, 2015
ARC2_getPreferredFormat.php Update outdated @homepage and @license URLs in inline docs Nov 24, 2015
LICENSE added LICENSE document, containing license texts for W3C software lic… May 13, 2018
Makefile related to #118 (cache) - implemented cache on SPARQL level Jun 20, 2018 README: updated composer call Oct 29, 2018
build.xml Add automated test suite. Apr 3, 2013
composer.json composer: extended symfony/cache to work with 3.4-* or 4.* Jun 21, 2018
phpunit.xml reorganized test environment into suites; added Makefile Jun 14, 2018


Build Coverage Status Latest Stable Version Total Downloads Latest Unstable Version License

ARC2 is a PHP 5.6+ library for working with RDF. It also provides a MySQL-based triplestore with SPARQL support.


Package available on Composer.

If you're using Composer to manage dependencies, you can use

composer require semsol/arc2:^2


2.3.1 was latest stable version for a long time. But recent developments lead to version 2.4, which is the next minor version of the 2.x-branch, containing stabilizations, wider test coverage and a couple of new features (e.g. PDO adapter for RDF store). Primary focus was to keep backward compatibility, so that an upgrade doesn't mess up your application. Its not clear how long the 2.x-branch will be maintained, so please consider upgrading to 3.x.

Version 3.x introduces new features and develops the backend further. Unfortunately, overall backward compatibility can not be maintained. One of the major changes is the transition from MyISAM to InnoDB table engine (RDF store).



5.6 7.0 7.1 7.2
✔️(1) ✔️ ✔️ ✔️

(1) It is compatible with PHP 5.3+ but old versions are no longer tested.

Database systems

5.5 5.6 5.7 8.0
MySQL ✔️ ✔️ ✔️ 💥 (1)
10.0 10.1 10.2 10.3
MariaDB ✔️ ✔️ ✔️ ✔️

(1) As long as ARC2 uses mysqli, a connection to MySQL Server 8.0 is not possible. For more information, please look here. But its planned to switch to PDO (issue)

RDF triple store

SPARQL support

Please have a look into to see which SPARQL 1.0/1.1 features are currently supported.

Use cache

The RDF store implementation provides a hash-based query cache. It works on two levels: SQL and SPARQL, which means, that it checks given SPARQL queries as well as internally generated SQL queries.

To use it, just add the following to the database configuration:

$store = ARC2::getStore(array(
    'db_name' => 'testdb',
    'db_user' => 'root',
    'db_pwd'  => '',
    'db_host' => '',
    // ...
    'cache_enabled' => true // <== activates cache

Per default it uses a file based cache, which stores items in the default temp folder of the system (in Linux its usually /tmp). But you can use another cache solution, such as memcached.

PSR-16 compatibility

Our cache solution is PSR-16 compatible, which means, that you can use your own cache instance. To do that, add the following to the database configuration:

$store = ARC2::getStore(array(
    'db_name' => 'testdb',
    'db_user' => 'root',
    'db_pwd'  => '',
    'db_host' => '',
    // ...
    'cache_enabled' => true
    'cache_instance' => new ArrayCache() // <=== example Cache instance, managed by yourself

ARC2 uses Symfony Cache , which provides many connectors out of the box (Overview). This allows you to attach ARC2 to a Redis server, for instance.

Known problems/restrictions with database systems

In this section you find known problems with MariaDB or MySQL, regarding certain features. E.g. MySQL 5.5 doesn't allow FULLTEXT indexes in InnoDB. We try to encapsulate any differences in the DB adapters, so that you don't have to care about them. In case you run into problems, this section might be of help.

MySQL 8.0 and mysqli

Using mysqli with MySQL 8.0 as backend throws the following exception:

mysqli_connect(): The server requested authentication method unknown to the client [caching_sha2_password]

Based on this source, one has to change the my.cnf, adding the following entry:

[mysqld] default-authentication-plugin=mysql_native_password

Internal information for developers

Please have a look here to find information about maintaining and extending ARC2.

Docker setup

For ARC2 developers we recommend this following Docker setup. It provides a pre-configured set of software (for PHP, DBS etc.) and allows quick switches between different software versions.

For more information have a look here.

You can’t perform that action at this time.