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

Problem with function fetchRow() ARC2_Store.php on line 761 #130

Open
excel007 opened this issue May 10, 2019 · 4 comments
Open

Problem with function fetchRow() ARC2_Store.php on line 761 #130

excel007 opened this issue May 10, 2019 · 4 comments
Labels
no-bug store Related to the RDF store.

Comments

@excel007
Copy link

excel007 commented May 10, 2019

Hello

I setup new arc2 with on a PHP server Version 5.6.31.
I follow from https://github.com/semsol/arc2.
But when I coding these php code :

<?php

include_once(dirname(__FILE__).'/arc/ARC2.php'); // path to the file ARC2.php
include_once(dirname(__FILE__).'/config.php');

$store = ARC2::getStore($arc_config);
$store->query('LOAD <http://chatlogs.planetrdf.com/swig/2009-07-26>');

?>

I have a problem. It shows message

( ! ) Fatal error: Call to a member function fetchRow() on null in ...\arc\store\ARC2_Store.php on line 761

Please help me for this error.
Thank you


EDIT by @k00ni: Fix code highlighting

@k00ni
Copy link
Collaborator

k00ni commented May 20, 2019

Hi @excel007, sorry for the late answer.

It seems internal variables are not initialized properly is the problem. Its not your fault, our documentation is missing this. Please try the following code:

<?php 

include_once(dirname(__FILE__).'/arc/ARC2.php'); // path to the file ARC2.php
include_once(dirname(__FILE__).'/config.php');

$store = ARC2::getStore($arc_config);

// NEW
$store->createDBCon(); // <== creates DB connection
$store->setup(); // <== checks if required tables are exist

$store->query('LOAD <http://chatlogs.planetrdf.com/swig/2009-07-26>');

If you installed ARC2 without composer you might have to include further files to get ARC2 running. The old "way" with including the ARC2 file is not valid anymore, since 2.4, unfortunately. I forgot to adapt the ARC2 to include all required files (#106). That is an unsolved issue.

Please respond how it went.

@excel007
Copy link
Author

Thank you :)

It can be load into MySQL.

Hi @excel007, sorry for the late answer.

It seems internal variables are not initialized properly is the problem. Its not your fault, our documentation is missing this. Please try the following code:

<?php 

include_once(dirname(__FILE__).'/arc/ARC2.php'); // path to the file ARC2.php
include_once(dirname(__FILE__).'/config.php');

$store = ARC2::getStore($arc_config);

// NEW
$store->createDBCon(); // <== creates DB connection
$store->setup(); // <== checks if required tables are exist

$store->query('LOAD <http://chatlogs.planetrdf.com/swig/2009-07-26>');

If you installed ARC2 without composer you might have to include further files to get ARC2 running. The old "way" with including the ARC2 file is not valid anymore, since 2.4, unfortunately. I forgot to adapt the ARC2 to include all required files (#106). That is an unsolved issue.

Please respond how it went.

@k00ni k00ni added no-bug store Related to the RDF store. labels May 22, 2019
@fishfree
Copy link

fishfree commented Jan 5, 2021

The same problem existes in the latest version: v2.5.1, please reopen this issue.

@k00ni k00ni reopened this Jan 5, 2021
@k00ni
Copy link
Collaborator

k00ni commented Jan 5, 2021

@fishfree can you post a simple script which shows the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-bug store Related to the RDF store.
Projects
None yet
Development

No branches or pull requests

3 participants