From: Roberto SL <ref...@gm...> - 2006-06-17 12:54:21
|
Hi all, I am testing the RDF PHP API because it is my intention to integrate it in an open source project. However, while testing I have the following issues: 1. Error: Resource expected as predicate, no blank node allowed. in xx/xx/Statement.php on line 66 Here is the code taken from the tutorial about MemModel (http://www.wiwiss.fu-berlin.de/suhl/bizer/rdfapi/tutorial/usingthemodelapi.htm ) and which is generating that error: <?php define("RDFAPI_INCLUDE_DIR", "../rdfapi-php/api/"); include(RDFAPI_INCLUDE_DIR . "RdfAPI.php"); $someDoc = new Resource ("http://www.example.org/someDocument.html"); $creator = new Resource ("http://www.purl.org/dc/elements/1.1/creator"); $statement1 = new Statement ($someDoc, $creator, new Literal ("Radoslaw Oldakowski")); $model1 = ModelFactory::getDefaultModel(); $model1->add($statement1); $model2 = ModelFactory::getDefaultModel(); $model2->add(new Statement($someDoc, new Resource("http://www.example.org/myVocabulary/title"), new Literal("RAP tutorial"))); $model2->add(new Statement($someDoc, new Resource("http://www.example.org/myVocabulary/language"), new Literal("English"))); $model1->addModel($model2); $bNode = new BlankNode($model1); $model1->replace(NULL, NULL, new Literal("Radoslaw Oldakowski"), $bNode); $model1->add(new Statement($bNode, $VCARD_FN, new Literal("Radoslaw Oldakowski"))); $model1->add(new Statement($bNode, $VCARD_EMAIL, new Literal("ra...@gm..."))); echo "\$model1 contains " .$model1->size() ." statements"; echo "<b>Output the MemModel as HTML table: </b><p>"; $model1->writeAsHtmlTable(); $model1->saveAs("model1.rdf", "rdf"); $model1->saveAs("model1.n3", "n3"); ?> 2. I have noticed that beside the GENERAL_PREFIX_BASE variable there is a number which derives from . $this->m_nextAutomaticPrefixIndex specified in the RdfSerializer.php . Why there is that number and is it possible to disable it? Thanks again, RSL |