首页 > 编程, 语义网 > 一个简单的PHP的RIF Parser

一个简单的PHP的RIF Parser

目前支持了RIF-Core

代码很简单,目前乱七八糟的。可以读XML格式的输入,做presentation syntax的输出。正在做LP(logic program)格式的输出(这样就可以用LP的推理机来做推理),还没搞完。

使用的例子:

require_once("../rif2pres.php");
require_once("../rif2lp.php");

// parse XML syntax
$rifdoc = new RifDocument();
$rifdoc->load("ex8.rif");
	
// write in presentation syntax
$writer = new Rif2Presentation();
$writer->writeAnnotation = true;
$syntax = $writer->toPresentationSyntax($rifdoc);
echo $syntax;

//write in LP syntax
$writer = new Rif2LP();
$writer->toLP($rifdoc);
//print_r($writer->getLP());
echo $writer->getLP()->toString();

如果有兴趣参与,请和我联系(baojie@gmail.com)

SVN在这里
http://php-rif.svn.sourceforge.net/

Advertisements
分类:编程, 语义网
  1. 还没有评论。
  1. 2011/04/24 @ 14:59
  2. 2012/04/16 @ 01:32

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: