|
From: Richard C. <ri...@cy...> - 2006-02-28 08:26:51
|
Hi Charles,
This seems to be caused by a bug in RAP. Here's a snippet from model/=20
Model.php:
function & getOntModel($vocabulary) {
require_once( RDFAPI_INCLUDE_DIR . PACKAGE_ONTMODEL);
return new OntModel(& $this, $vocab);
}
The problem is $vocabulary/$vocab, the fix should be obvious.
You could fix it in your own copy of RAP, or set up the OntModel =20
directly, without using getOntModel.
Richard
On 28 Feb 2006, at 01:08, Charles Nepote wrote:
> Hi,
>
> I'm not very familiar with OOP and I wonder how to use OntModel =20
> methods on a DbModel. I write here an example in order to precise =20
> my context.
>
> <?php
> define("RDFAPI_INCLUDE_DIR", "/var/www/wikisem/rdfapi-php/api/");
> include(RDFAPI_INCLUDE_DIR . "RdfAPI.php");
> include("/var/www/wikisem/config.inc.php"); // Define $config array
>
> $wiki =3D new Wiki($config);
>
> Class Wiki
> {
> function Wiki($config)
> {
> $store =3D ModelFactory::getDbStore(
> $config['db_engine'],
> $config['db_server'],
> $config['db_database'],
> $config['db_user'],
> $config['db_password']);
> $this->dbModel =3D =
$store->getModel('http://ex.net/2006/02/07');
> $this->ontModel =3D =
$this->dbModel->getOntModel(RDFS_VOCABULARY);
> $test =3D new =
OntResource("http://www.w3.org/1999/02/22-rdf-syntax-=20
> ns#type");
> $sup =3D $test->listRDFTypes();
> }
> =09
> }
> ?>
>
> produce a "Fatal error: Call to a member function on a non-object =20
> in /var/www/wikisem/rdfapi-php093/api/ontModel/OntResource.php on =20
> line 402"
>
> To test this example, RDF and RDFS have been loaded in the dbmodel =20
> "http://ex.net/2006/02/07".
>
> Thanks in advance,
> Charles N=E9pote
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting =20
> language
> that extends applications into web and mobile media. Attend the =20
> live webcast
> and join the prime developer group breaking into this new coding =20
> territory!
> http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=110944&bid$1720&dat=121642=
> _______________________________________________
> Rdfapi-php-interest mailing list
> Rdf...@li...
> https://lists.sourceforge.net/lists/listinfo/rdfapi-php-interest
>
|