百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
E

easyrdf

> 编程语言
开源

EasyRdf 是一款 PHP 库,旨在使获取和生成 RDF 变得简单。

615 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

EasyRdf 是一款 PHP 库,旨在使获取和生成 RDF 变得简单。

EasyRdf

EasyRdf is a PHP library designed to make it easy to consume and produce RDF. It was designed for use in mixed teams of experienced and inexperienced RDF developers. It is written in Object Oriented PHP and has been tested extensively using PHPUnit.

After parsing EasyRdf builds up a graph of PHP objects that can then be walked around to get the data to be placed on the page. Dump methods are available to inspect what data is available during development.

Data is typically loaded into an EasyRdf\Graph object from source RDF documents, loaded from the web via HTTP. The EasyRdf\GraphStore class simplifies loading and saving data to a SPARQL 1.1 Graph Store.

SPARQL queries can be made over HTTP to a Triplestore using the EasyRdf\Sparql\Client class. SELECT and ASK queries will return an EasyRdf\Sparql\Result object and CONSTRUCT and DESCRIBE queries will return an EasyRdf\Graph object.

Example

php
$foaf = new \EasyRdf\Graph("http://njh.me/foaf.rdf");
$foaf->load();
$me = $foaf->primaryTopic();
echo "My name is: ".$me->get('foaf:name')."\n";

Downloads

The latest stable version of EasyRdf can be downloaded from the EasyRdf website.

Links

  • EasyRdf Homepage
  • API documentation
  • Change Log
  • Source Code
  • Issue Tracker

Requirements

  • PHP 7.1 or higher

Features

  • API documentation written in phpdoc
  • Extensive unit tests written using phpunit
  • Built-in parsers and serialisers: RDF/JSON, N-Triples, RDF/XML, Turtle
  • Optional parsing support for: ARC2, rapper
  • Optional support for Zend\Http\Client
  • No required external dependencies upon other libraries (PEAR, Zend, etc...)
  • Complies with Zend Framework coding style.
  • Type mapper - resources of type foaf:Person can be mapped into PHP object of class Foaf_Person
  • Support for visualisation of graphs using GraphViz
  • Comes with a number of examples

List of Examples

  • basic.php - Basic "Hello World" type example
  • basic_sparql.php - Example of making a SPARQL SELECT query
  • converter.php - Convert RDF from one format to another
  • dump.php - Display the contents of a graph
  • foafinfo.php - Display the basic information in a FOAF document
  • foafmaker.php - Construct a FOAF document with a choice of serialisations
  • graph_direct.php - Example of using EasyRdf\Graph directly without EasyRdf\Resource
  • graphstore.php - Store and retrieve data from a SPARQL 1.1 Graph Store
  • graphviz.php - GraphViz rendering example
  • html_tag_helpers.php - Rails Style html tag helpers to make the EasyRdf examples simpler
  • httpget.php - No RDF, just test EasyRdf\Http\Client
  • open_graph_protocol.php - Extract Open Graph Protocol metadata from a webpage
  • serialise.php - Basic serialisation example
  • sparql_queryform.php - Form to submit SPARQL queries and display the result
  • uk_postcode.php - Example of resolving UK postcodes using uk-postcodes.com
  • wikidata_villages.php - Fetch and information about villages in Fife from Wikidata
  • zend_framework.php - Example of using Zend\Http\Client with EasyRdf

Contributing

We welcome any contributions. For further information please read CONTRIBUTING.md.

For further information about extending / hack EasyRdf please read DEVELOPER.md.

Running Examples

The easiest way of trying out some of the examples is to use the PHP command to run a local web server on your computer.

php -S localhost:8080 -t examples

Then open the following URL in your browser: http://localhost:8080/

Licensing

The EasyRdf library and tests are licensed under the BSD-3-Clause license. The examples are in the public domain, for more information see UNLICENSE.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

PHPphprdfsparql

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言