当前位置: 首页>>代码示例>>PHP>>正文


PHP MemModel::writeAsHtmlTable方法代码示例

本文整理汇总了PHP中MemModel::writeAsHtmlTable方法的典型用法代码示例。如果您正苦于以下问题:PHP MemModel::writeAsHtmlTable方法的具体用法?PHP MemModel::writeAsHtmlTable怎么用?PHP MemModel::writeAsHtmlTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MemModel的用法示例。


在下文中一共展示了MemModel::writeAsHtmlTable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: MemModel

	<title>Test Manipulate and Search RDF Model</title>
</head>
<body>

<?php 
// Include RAP
define("RDFAPI_INCLUDE_DIR", "./../api/");
include RDFAPI_INCLUDE_DIR . "RdfAPI.php";
// Filename of an RDF document
$base = "example1.rdf";
// Create a new MemModel
$model = new MemModel();
// Load and parse document
$model->load($base);
// Output model as HTML table
$model->writeAsHtmlTable();
echo "<P>";
// Ceate new statements and add them to the model
$statement1 = new Statement(new Resource("http://www.w3.org/Home/Lassila"), new Resource("http://description.org/schema/Description"), new Literal("Lassila's personal Homepage", "en"));
$statement2 = new Statement(new Resource("http://www.w3.org/Home/Lassila"), new Resource("http://description.org/schema/Description"), new Literal("Lassilas persönliche Homepage ", "de"));
$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");
开发者ID:Gigi33,项目名称:exif2rdf,代码行数:31,代码来源:test_ManipulateMemModel.php

示例2: Statement

$model2->add(new Statement($myhomepage, $creator, $me));
$creation_date = new Resource("http://www.example.org/terms/creation-date");
$August16 = new Literal("August 16, 2002");
$model->add(new Statement($myhomepage, $creation_date, $August16));
$model2->add(new Statement($myhomepage, $creation_date, $August16));
$language = new Resource("http://www.example.org/terms/language");
$deutsch = new Literal("Deutsch", "de");
$model->add(new Statement($myhomepage, $language, $deutsch));
$name = new Resource("http://www.example.org/terms/Name");
$chrisbizer = new Literal("Chris Bizer");
$model2->add(new Statement($me, $name, $chrisbizer));
// Output as Table
echo "<h5>Model 1</h5>";
$model->writeAsHtmlTable();
echo "<h5>Model 2</h5>";
$model2->writeAsHtmlTable();
echo "<P>";
echo "<h3>2. Make some tests</h3>";
echo "Test: Model 2 contains any statements from model 1 :" . $model2->containsAny($model) . "<p>";
echo "Test: Model 1 contains any statements from model 2 :" . $model->containsAny($model2) . "<p>";
echo "Test: Model 2 contains all statements from model 1 :" . $model2->containsAll($model) . "<p>";
echo "Test: Model 1 contains all statements from model 2 :" . $model->containsAll($model2) . "<p>";
echo "Test: Model 1 equals model 2 :" . $model->equals($model2) . "<p>";
echo "<h3>3. Unite model 1 and model 2</h3>";
$model3 =& $model->unite($model2);
$model3->writeAsHtmlTable();
echo "<h3>4. Intersect model 1 and model 2</h3>";
$model4 =& $model->intersect($model2);
$model4->writeAsHtmlTable();
echo "<h3>5. Substract model 2 from model 1</h3>";
$model5 =& $model->subtract($model2);
开发者ID:Gigi33,项目名称:exif2rdf,代码行数:31,代码来源:test_setoperations.php


注:本文中的MemModel::writeAsHtmlTable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。