load($base);
// Now store the model in database
// An unique modelURI will be generated
$rdf_database->putModel($memModel);
// You can also provide an URI for the model to be stored
$modelURI = "example1.rdf";
// But then you must check if there already is a model with the same modelURI
// otherwise the method putModel() will return FALSE
if ($rdf_database->modelExists($modelURI))
echo "Model with the same URI: '$modelURI' already exists";
else
$rdf_database->putModel($memModel, $modelURI);
## 3. Create a new database model
## ------------------------------
$modelURI = "newDbModel";
// Base URI of the new model (optional)
$baseURI = "baseURIofMyNewDbModel#";
// get a new DbModel
if ($rdf_database->modelExists($modelURI))
echo "Model with the same URI: '$modelURI' already exists";
else
$dbModel = $rdf_database->getNewModel($modelURI, $baseURI);
## 4. List all models stored in database
## -------------------------------------
// Get an array with modelURI and baseURI of all models stored in rdf database
$list = $rdf_database->listModels();
// Show the database contents
foreach ($list as $model) {
echo "modelURI: " .$model['modelURI'] ."
";
echo "baseURI : " .$model['baseURI'] ."
";
}
?>