承接 hab/ntriples 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hab/ntriples

Composer 安装命令:

composer require hab/ntriples

包简介

A simple library for publishing data encoded as N-Triples

README 文档

README

A simple library for publishing data encoded as N-Triples.

This package is copyright (c) 2015-2017 by Herzog August Bibliothek Wolfenbüttel and released under the terms of the GNU General Public License v3.

Installation

You can install this package via composer

composer require hab/ntriples

Internal representation of graphs and triples

Triple

A triple is represented as an array with subject, predicate and object as members at the position 0, 1, and 2 respectively.

URI

A URI is represented as a string.

Literal

A literal is represented as an instance of the Literal class. A Literal has a value and can have an optional datatype or language tag.

$literal = new HAB\NTriples\Literal('Hello, my darling', 'en');
echo $literal->getLanguage();

=> en

Blank Node

A blank node is represented as an instance of the BNode class. If coerced to a string it returns a unique node label.

$node = new HAB\NTriples\BNode();
echo (string)$node;

=> bnode_4c28e7db9528288b7519a1f5df639cf7

Graph

A graph is represented as an instance of the Graph class. It has an optional name and implements the Traversable interface for convenient traversal of the graph's triples.

$graph = new HAB\NTriples\Graph('http://example.com/graph/1');
$graph->add('http://example.com/subject', 'http://purl.org/dc/elements/1.1/title', 'The Example');
echo count($graph);

=> 1

Readers

All Readers adhere to the same interface. You first call open() with the URI of the source to read form. Subsequent calls to read() return an array with subject, predicate and object of the next triple or false if the source is exhausted.

You can call rewind() to try to rewind the source. A RuntimeException is thrown if the source does not support rewinding

A call to close() closes the reader.

The following source formats are currently supported:

FormatReader
NTriplesHAB\NTriples\Reader\NTriples

Serializers

All Serializers adhere to the same interface. You call serialize() with an arbitrary number of Graph instances. The serializer returns a string containing the serialized graphs.

The following serialization formats are currently supported:

FormatSerializer
NTriplesHAB\NTriples\Serializer\NTriples
NQuadsHAB\NTriples\Serializer\NQuads
RDF/XMLHAB\NTriples\Serializer\RdfXml
TriXHAB\NTriples\Serializer\TriX

统计信息

  • 总下载量: 67
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2016-08-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固