|
From: <tob...@we...> - 2006-11-10 12:25:05
|
Hi Atat,
I'm sorry for the inconvenience. I think there is a typo in our
documentation. Using
"SparqlEngine::writeQueryResultAsHtmlTable($result);" instead of
"SPARQLEngine::writeQueryResultAsHtmlTable($result);" should solve the
problem.
Tobias
> Hello,
> I'm trying to use the Sparql client to connect to a SPARQL service running on the same machine. Here is the code I used:
>
> // Include all RAP classes
> define("RDFAPI_INCLUDE_DIR", "C:/downloads/Semantic/rdfapi-php/api/");
> include(RDFAPI_INCLUDE_DIR . "RdfAPI.php");
>
> // Create a SPARQL client
> $client = ModelFactory::getSparqlClient("http://localhost:2020/sparql");
>
> $querystring = '
> PREFIX person: <http://www.owl-ontologies.com/person.owl#>
>
> SELECT ?FirstName ?LastName
> WHERE {
> ?x person:first_name ?FirstName ;
> person:last_name ?LastName
>
> }
> ';
>
> $query = new ClientQuery();
> $query->query($querystring);
> $result = $client->query($query);
>
> foreach($result as $line) {
> $value = $line['?FirstName'];
> if($value != "")
> echo $value->toString()."<br>";
> else
> echo "undbound<br>";
> }
>
> The SPARQL service is from a Joseki server. I get this message:
>
> Fatal error: Class 'SparqlClient' not found in
> C:\downloads\Semantic\rdfapi-php\api\model\ModelFactory.php on line
> 272
>
> Any ideas how to fix this? Thanx a lot!
>
>
> sts.sourceforge.net/lists/listinfo/rdfapi-php-interest
>
|