alcamo/rdf-literal-serializer
Composer 安装命令:
composer require alcamo/rdf-literal-serializer
包简介
(De)serialization of RDF literals
README 文档
README
namespace alcamo\rdf_literal_serializer;
use alcamo\rdf_literal\NonNegativeIntegerLiteral;
include $_composer_autoload_path ?? __DIR__ . '/../vendor/autoload.php';
$serializer = AbstractSerializer::createFromProps(
[
'class' => NonNegativeIntegerSerializer::class,
'encoding' => 'EBCDIC',
'lengthRange' => [ 6, null ]
]
);
$literal1 = new NonNegativeIntegerLiteral(123);
$serialization = $serializer->serialize($literal1);
echo "Hexdump of EBCDIC: " . bin2hex($serialization) . PHP_EOL;
$literal2 = $serializer->deserialize($serialization);
echo "Deserialized to: $literal2" . PHP_EOL;
This example is contained in this package as a file in the bin
directory. It will output
Hexdump of EBCDIC: f0f0f0f1f2f3
Deserialized to: 123
The purpose of this package is to provide configurable (de)serialization of RDF literal objects (see alcamo/rdf-literal). Most serialization methods are rather trivial as such; the added value is the fact that the serialization parameters are completely configurable. As in the above example, in most cases at least the following are configurable:
- The serializer class - the right class depends on the dataype of the literal.
- The encoding.
- The length of the output.
See the doxygen documentation for details.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2026-07-10