|
From: Olivier G. <o.g...@no...> - 2008-01-07 13:52:21
|
Hello !
The following code :
<?php
define("RDFAPI_INCLUDE_DIR", =
$_SERVER['DOCUMENT_ROOT']."/rdf/rdfapi-php094/api/");
include(RDFAPI_INCLUDE_DIR . "RdfAPI.php");
// Cr=E9er le mod=E8le memmodel
$foaffile =3D ModelFactory::getDefaultModel();
//Charger le fichier RDF concern=E9 en m=E9moire o=F9 $uri est le chemin =
vers le fichier
$foaffile->load("foaf.rdf");
//la requ=EAte en SPARQL, c'est la requ=EAte que j'utilise pour afficher =
la photo du commentateur sur les petites cases.
$querystring=3D '
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?image
WHERE {
?user foaf:depiction ?image.
}';
$result =3D $foaffile->sparqlQuery($querystring);
foreach($result as $line){
$photo=3D$line['?image']->uri;
$Img=3D"<img";
$Img.=3D" src=3D\"" . $photo . "\" alt=3D'Avatar'>";
echo $Img;
}?>
Work with RAP 0.9.4, and fails with 0.9.5, with error code "Fatal error: =
Class 'DbModel' not found in =
/var/www/html/NOVACTIVE/testphp5.novactive.com/rdf/rdfapi-php/api/sparql/=
SparqlEngine.php on line 109".
I run php 5.0.4 :=20
Begun of phpinfo() :
System FreeBSD Sirius 5.4-STABLE FreeBSD 5.4-STABLE #0: Tue Jun 28 =
17:45:23 UTC 2005 =
**********@FreeB.novactive.local:/usr/obj/usr/src/sys/MYKERNEL i386
Build Date Sep 5 2005 13:53:21
Configure Command './configure' '--enable-versioning' =
'--enable-memory-limit' '--with-layout=3DGNU' =
'--with-config-file-scan-dir=3D/usr/local/etc/php' '--disable-all' =
'--enable-libxml' '--with-libxml-dir=3D/usr/local' '--enable-spl' =
'--with-regex=3Dphp' '--with-apxs2=3D/usr/local/sbin/apxs' =
'--prefix=3D/usr/local' 'i386-portbld-freebsd5.4'
--=20
Olivier G.
|