RDFIO
RDFIO copied to clipboard
Make it work on MW 1.34 + SMW 3.1.5
Are there any plans to update this to make it work im MediaWiki 1.31 and SMW 3.x? Installation runs smooth, but
- Setup at Special:RDFIO-Administration seems to work, but once you reload it, it says again, that the DB was not set up
- every of the three special pages throw errors
@krabina Ah, I thought we had it working with SMW 3.x, but either we missed something or perhaps something in later MW, has happened.
Hope to have a look soonish (not before Sep 17).
Many thanks for reporting!
I'm on this now ...
Seems a lot of the problems are caused because the db field of the ARC2Store object is now null when instantiating it. This is causing the isSetUp() to return false, and giving other problems, as it seems.

One problem is that reportedly ARC2 is now only tested with MariaDB, while I run MySQL (Trying to install MariaDB pretty much messed up a lot of my dpkg packages and installations).
Hmm, did a little test script, which I document here for reference:
<?php
require "vendor/semsol/arc2/ARC2.php";
$store = ARC2::getStore(array(
'db_name' => 'smw',
'db_user' => 'smw',
'db_pwd' => '*******',
'db_host' => '127.0.0.1',
'cache_enabled' => true // <== activates cache
));
echo "<pre>";
print_r($store);
echo "</pre>";
It returns:
ARC2_Store Object
(
[cache:protected] =>
[db:protected] =>
[db_object:protected] =>
[a] => Array
(
[db_name] => smw
[db_user] => smw
[db_pwd] => *******
[db_host] => 127.0.0.1
[cache_enabled] => 1
)
...
That [db:protected] seems like a hint ... something added layers of authentication in MySQL? Hints and tips are welcome.
Ok, if I add one line, after creating the store:
$store->createDBCon();
... then I get in the Nginx log:
2020/03/19 18:41:35 [error] 892#892: *85 FastCGI sent in stderr: "PHP message: PHP Fatal error: Class 'ARC2\Store\Adapter\AbstractAdapter' not found in /var/www/html/w/vendor/semsol/arc2/src/ARC2/Store/Adapter/mysqliAdapter.php on line 17
PHP message: PHP Stack trace:
PHP message: PHP 1. {main}() /var/www/html/w/arc2test.php:0
PHP message: PHP 2. ARC2_Store->createDBCon() /var/www/html/w/arc2test.php:11
PHP message: PHP 3. ARC2\Store\Adapter\AdapterFactory->getInstanceFor() /var/www/html/w/vendor/semsol/arc2/store/ARC2_Store.php:88
PHP message: PHP 4. require_once() /var/www/html/w/vendor/semsol/arc2/src/ARC2/Store/Adapter/AdapterFactory.php:29" while reading response header from upstream, client: ::1, server: _, request: "GET /w/arc2test.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock:", host: "localhost"
Confusing, as I can't see anything wrong there. Digging on.
I filed an issue over at the ARC2 repo, in case they have some hints: https://github.com/semsol/arc2/issues/140
Can report that it works now, locally, with branch 59-make-work-with-mw-1.34.
Now just trying to be able to run the tests.
One of the ARC2 maintainers here.
@samuell wrote:
One problem is that reportedly ARC2 is now only tested with MariaDB, while I run MySQL (Trying to install MariaDB pretty much messed up a lot of my dpkg packages and installations).
Thats not true. In our travis.yml you can find all configurations we test against. Short version is here: https://github.com/semsol/arc2#database-systems
Also:
Seems a lot of the problems are caused because the db field of the ARC2Store object is now null when instantiating it. This is causing the isSetUp() to return false, and giving other problems, as it seems.
I wrote the adapter layer for ARC2 to support PDO besides mysqli. ~~At that time i assumed no one used internal variables (asking in the issue tracker also revealed no one). If you do and can't not at the moment, please let me know and we can discuss it.~~
EDIT: I overlooked the isSetup part. That could be a mistake on our site. What was the old behavior?
Hi @k00ni
One problem is that reportedly ARC2 is now only tested with MariaDB, while I run MySQL (Trying to install MariaDB pretty much messed up a lot of my dpkg packages and installations).
Thats not true. In our travis.yml you can find all configurations we test against. Short version is here: https://github.com/semsol/arc2#database-systems
Thanks for the clarification!
EDIT: I overlooked the isSetup part. That could be a mistake on our site. What was the old behavior?
The problem is solved now, in 06a151f. The fault is mine, I had missed this new part in the getting started guide, after the ARC2::getStore() line:
// since version 2.3+
$store->createDBCon();
I think I was a bit confused as the README.md is missing that part.
Maybe a note about that, for database backed stores, could be of use in the README.md?
Current status:
- [x] Make it stop throwing errors on all the special pages
- [x] Make unit tests pass
- [x] Make basic import work in the interface
- [x] Ensure semantic data is populated, and available in SPARQL endpoint
- [ ] Make "Output by Equivalent URI" work in web interface
- [ ] Make "Query by Equivalent URI" work in web interface
- [ ] Make roundtrip system test work
Strange, now i get error:
Construct Template not found in ARC2_SPARQLPlusParser
... when trying to import the example turtle content. Didn't get it just before. Perhaps some caching problem that is adding extra confusion.
Checking in to https://github.com/semsol/arc2/issues/80
EDIT: Solved in a612852
Latest status #63 :expressionless:
EDIT: Solved.
For information, I was able to run this extension on MW 1.40.0-alpha + SMW master (post-4.0.2). It does not work out-of-the-box with the master branch, but it works with the branch 59-make-work-with-mw-1.34 or even better with the branch 59-make-work-with-mw-1.34 of simontaurus. Imho, this branch could be promoted as master, and it would fix #56, #59, #62.
However, this extension needs some maintenance. I began creating the extension.json file and will propose it soon as a PR.
As said, I did some maintenance work on this extension in addition of the branches mentionned above and it solves this issue (well, I guess it may remain some minor issues).
It is available on WikiValley’s fork together with the fork of ARC2.
As said, I did some maintenance work on this extension in addition of the branches mentionned above and it solves this issue (well, I guess it may remain some minor issues).
It is available on WikiValley’s fork together with the fork of ARC2.
@Seb35 That's fantastic! If you are able to package it up as a clean PR, I would be happy to have a look at merging it here as well!
@Seb35 That's fantastic! If you are able to package it up as a clean PR, I would be happy to have a look at merging it here as well!
Great! :star_struck:
But it’s not as easy as a PR on this MediaWiki extension since I had to modify ARC2:
- this commit and this one add a database adapter specifically for MediaWiki: nowadays MW has strict requirements about transactions and there were issues between queries from ARC2 and queries from MW itself (I didn’t search exactly why) => it can either be integrated this MW-specific adapter in ARC2, either be added a way to define custom adapters in ARC2
- there were bugs is some SPARQL queries (mainly missing triples in the results), I modified ARC2 in 3 commits: first, second, third and there still some buggy SPARQL queries, so I’m not completely sure these patches are gold-quality
I've updated the extension page on MediaWiki.org to point to the WikiValley fork, since that seems preferable to pointing to an admittedly incompatible repository.