本文整理汇总了PHP中MemModel::saveAs方法的典型用法代码示例。如果您正苦于以下问题:PHP MemModel::saveAs方法的具体用法?PHP MemModel::saveAs怎么用?PHP MemModel::saveAs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MemModel
的用法示例。
在下文中一共展示了MemModel::saveAs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testRdfSerializer
function testRdfSerializer()
{
$_SESSION['test'] = 'Rdf- Parser Empty Resource test';
$mod1 = new MemModel();
$mod2 = new MemModel();
$mod3 = new MemModel();
$mod1->load('multipleTypes.rdf');
$mod1->saveAs('mt1.rdf', 'rdf');
$mod3->load('mt1.rdf');
$mod2->load('multipleTypes.rdf');
$_SESSION['mod1'] = $mod3;
$_SESSIOn['mod2'] = $mod2;
if ($mod3->equals($mod2)) {
$pass = true;
} else {
$pass = false;
}
$this->assertTrue($pass);
}
示例2: Resource
$model->add($statement1);
$model->add($statement2);
$model->writeAsHtmlTable();
echo "<P>";
// Search model 1
$homepage = new Resource("http://www.w3.org/Home/Lassila");
$res = $model->find($homepage, NULL, NULL);
$res->writeAsHtmlTable();
echo "<P>";
// Search model 2
$description = new Resource("http://description.org/schema/Description");
$statement = $model->findFirstMatchingStatement($homepage, $description, NULL);
// Check if something was found and output result
if ($statement) {
echo $statement->toString();
} else {
echo "Sorry, I didn't find anything.";
}
echo "<P>";
// Search model 3
$res3 = $model->findVocabulary("http://example.org/stuff/1.0/");
$res3->writeAsHtmlTable();
echo "<P>";
// Write model as RDF
$model->writeAsHtml();
// Save model to file
$model->saveAs("Output.rdf");
?>
</body>
</html>