Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it work on MW 1.34 + SMW 3.1.5 #59

Open
krabina opened this issue Sep 11, 2019 · 17 comments
Open

Make it work on MW 1.34 + SMW 3.1.5 #59

krabina opened this issue Sep 11, 2019 · 17 comments
Assignees
Labels

Comments

@krabina
Copy link

krabina commented Sep 11, 2019

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
@samuell
Copy link
Member

samuell commented Sep 14, 2019

@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!

@samuell
Copy link
Member

samuell commented Mar 18, 2020

I'm on this now ...

@samuell
Copy link
Member

samuell commented Mar 19, 2020

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.
Selection_0087

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).

@samuell
Copy link
Member

samuell commented Mar 19, 2020

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.

@samuell
Copy link
Member

samuell commented Mar 19, 2020

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.

@samuell
Copy link
Member

samuell commented Mar 19, 2020

I filed an issue over at the ARC2 repo, in case they have some hints: semsol/arc2#140

@samuell
Copy link
Member

samuell commented Mar 19, 2020

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.

@k00ni
Copy link

k00ni commented Mar 20, 2020

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?

@samuell
Copy link
Member

samuell commented Mar 20, 2020

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?

@samuell samuell changed the title Make it work on MW 1.31 Make it work on MW 1.34 + SMW 3.1.5 Mar 20, 2020
@samuell
Copy link
Member

samuell commented Mar 20, 2020

Current status:

  • Make it stop throwing errors on all the special pages
  • Make unit tests pass
  • Make basic import work in the interface
  • 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

@samuell
Copy link
Member

samuell commented Mar 28, 2020

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 semsol/arc2#80

EDIT: Solved in a612852

@samuell samuell closed this as completed Mar 28, 2020
@samuell samuell reopened this Mar 28, 2020
@samuell
Copy link
Member

samuell commented Mar 28, 2020

Latest status #63 😑

EDIT: Solved.

@Seb35
Copy link

Seb35 commented Oct 5, 2022

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.

@Seb35
Copy link

Seb35 commented May 22, 2023

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.

@samuell
Copy link
Member

samuell commented May 23, 2023

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
Copy link

Seb35 commented May 24, 2023

@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! 🤩

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

@pppery
Copy link

pppery commented Sep 24, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants