Source for file test_ManipulateModelMemory.php
Documentation is available at test_ManipulateModelMemory.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<title>Test Manipulate and Search RDF Model</title>
require_once 'RDF/Model/Memory.php';
// Filename of an RDF document
// Create a new Model_Memory
// Load and parse document
// Output model as HTML table
$model->writeAsHtmlTable ();
// Ceate new statements and add them to the model
$model->add ($statement1);
$model->add ($statement2);
$model->writeAsHtmlTable ();
// Build search index to speed up searches.
$res = $model->find ($homepage, null , null );
$res->writeAsHtmlTable ();
$statement = $model->findFirstMatchingStatement ($homepage, $description, null );
// Check if something was found and output result
echo $statement->toString ();
echo "Sorry, I didn't find anything.";
$res3 = $model->findVocabulary ("http://example.org/stuff/1.0/");
$res3->writeAsHtmlTable ();
$model->saveAs ("Output.rdf");
Documentation generated on Mon, 11 Mar 2019 15:39:30 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|