hello
on http://blog.literarymachine.net/ i found following example:

<?php
require_once('LibRDF/LibRDF.php');
 
$store = new LibRDF_Storage();
$model = new LibRDF_Model($store);
$model->loadStatementsFromURI(
        new LibRDF_Parser('rdfxml'),
        'http://richard.cyganiak.de/foaf.rdf');
 
$foafKnows = new LibRDF_URINode("http://xmlns.com/foaf/0.1/knows");
$foafName = new LibRDF_URINode("http://xmlns.com/foaf/0.1/name");
$results = $model->findStatements(null, $foafKnows, null);
foreach ($results as $result) {
    $person1 = $result->getSubject();
    $person2 = $result->getObject();
    $name1 = $model->getTarget($person1, $foafName);
    $name2 = $model->getTarget($person2, $foafName);
    echo "$name1 knows $name2\n";
}

which runs on my pc without error.

futher it is mentioned in the article, that it can be stored in a database
with following amendment:

$store = new LibRDF_Storage("mysql", "db",
        "new='yes',
        host='localhost',
        database='mydatabase',
        user='foo',
        password='bar'");

but when i replace the "$store = new LibRDF_Storage();" with my existing
mysql databbase i got the error message
"LibRDF_Storage->__construct('mysql', 'db', 'new='yes',?    ...')"
What is wrong in my code.
bk


  

Ihr WEB.DE Postfach immer dabei: die kostenlose WEB.DE Mail App für iPhone und Android.   
https://produkte.web.de/freemail_mobile_startseite/
_______________________________________________
redland-dev mailing list
[email protected]
http://lists.librdf.org/mailman/listinfo/redland-dev

Reply via email to