Hi !
(First begginer question)
I have issues in understanding how RAP handles the rdf:ID in the models.
If i have this code :
<?php
define("RDFAPI_INCLUDE_DIR",$_SERVER['DOCUMENT_ROOT']."/rdf/rdfapi-php/ap=
i/");
include(RDFAPI_INCLUDE_DIR . "RdfAPI.php");
// Filename of an RDF document
$base=3D"Output.rdf";
// Create a new MemModel
$model =3D ModelFactory::getDefaultModel();
// Load and parse document
$model->load($base);
$model->index(0);
$varPrenom =3D ucfirst(strtolower($_GET['prenom']));
$varNom =3D ucfirst(strtolower($_GET['nom']));
$idPerson =3D "Output.rdf#".$varPrenom.$varNom;
if ($_GET['submit'] && $_GET['prenom'] && $_GET['nom'] && $_GET['add'] ) =
{
$statementNewPerson =3D new Statement(
new Resource("Output.rdf"),
new Resource("http://xmlns.com/foaf/0.1/person"),
new Resource($idPerson)
);
if (!$model->contains($statementNewPerson)) =
$model->add($statementNewPerson);
$statementName =3D new Statement(
new Resource($idPerson),
new Resource("http://xmlns.com/foaf/0.1/name"),
new Literal($varPrenom." ".$varNom)
);
if (!$model->contains($statementName)) $model->add($statementName);
//Others adds.
}
$model->saveAs("Output.rdf");
$model->close();
?>
I gets duplicates rdf:id.
What am I doing/understanding wrong ?=20
--=20
Olivier GENDRIN - NOVACTIVE
D=E9veloppeur Web - R=E9f=E9rent standards et accessibilit=E9
Tel : + 33 1 48 24 33 60
Fax : + 33 1 48 24 33 54
http://www.novactive.com/
|