|
From: Michele P. <mic...@gm...> - 2008-04-01 15:10:19
|
Hi all,
I'm getting this error with the MemModel - when adding properties to a
resource which has been previously created, instead of getting the rdf:About
...ResourceID construct, the output is rdf:ID='ResourceID'. Not sure
whether it's an error or not, but the w3cRDF-validator apparently says so:
Error: {W105} Redefinition of ID: node_node1[Line = 20, Column = 38]
Error: {W105} Previous definition of 'node_node1'.[Line = 16, Column = 32]
Here's the complete RDF code I've generated:
;;;;;;;;;;;;;;;;;;;;;;;;
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Generated by RdfSerializer.php from RDF RAP.
# http://www.wiwiss.fu-berlin.de/suhl/bizer/rdfapi/index.html !-->
<rdf:RDF
xml:base="http://cohereweb.net/ontology/cohere.owl#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:vcard="http://www.w3.org/2001/vcard-rdf/3.0#"
xmlns:ns1="http://cohereweb.net/ontology/cohere.owl#">
<ns1:node rdf:ID="node1"/>
<ns1:cohere_user rdf:ID="michele"/>
<rdf:Description rdf:ID="node1">
<ns1:has_creator rdf:resource="#michele"/>
</rdf:Description>
</rdf:RDF>
;;;;;;;;;;;;;;;;;;;;;;;;;;
And here's the PHP code:
................
//test function
function get_result2 ($nodeID, $nodeName, $nodeDescription, $authorID) {
//load all it's necessary
loadRapLibraries("../import/rdfapi-php/api/");
//create a new model
$model = getCohereModel();
//create resources using my own vocabulary
$newnode = new Resource(COHERE_NS . $nodeID);
$newauthor = new Resource(COHERE_NS . $authorID);
// create statements
$statement1 = new Statement ($newnode, RDF_RES::TYPE(), COHERE_RES::NODE());
$statement2 = new Statement ($newauthor, RDF_RES::TYPE(),
COHERE_RES::COHERE_USER());
$statement3 = new Statement ($newnode, COHERE_RES::HAS_CREATOR(),
$newauthor);
//add the statements
$model->addWithoutDuplicates($statement1);
$model->addWithoutDuplicates($statement2);
$model->addWithoutDuplicates($statement3);
$ret = $model->writeAsHtml();
return $ret;
}
echo get_result2("node1", "myNode", "myDesc", "michele");
................
I can't figure out where the mistake is - can anybody help please?
Thanks a lot,
mikele
|