sweetrdf/in-memory-store-sqlite
Composer 安装命令:
composer require sweetrdf/in-memory-store-sqlite
包简介
RDF in-memory quad store implementation using PDO and SQLite.
关键字:
README 文档
README
Proof-of-concept RDF in-memory quad store implementation using PDO and SQLite.
Installation
To install this library use Composer via:
composer require sweetrdf/in-memory-store-sqlite
Usage
Use InMemoryStoreSqlite::createInstance() to get a ready-to-use store instance (see example below).
Sending SPARQL queries can be done via query method.
Your data is stored inside an in-memory SQLite database file.
After the script ends all your data inside the store will be gone.
Examples
Example 1 (First steps)
Create a store instance, load a few triples into it and run a query.
use sweetrdf\InMemoryStoreSqlite\Store\InMemoryStoreSqlite; // get ready to use store instance $store = InMemoryStoreSqlite::createInstance(); // send a SPARQL query which creates two triples $store->query('INSERT INTO <http://example.com/> { <http://s> <http://p1> "baz" . <http://s> <http://xmlns.com/foaf/0.1/name> "label1" . }'); // send another SPARQL query asking for all triples $res = $store->query('SELECT * WHERE {?s ?p ?o.}'); $triples = $res['result']['rows']; echo \count($triples); // outputs: 2 // $triples contains result set, which consists of arrays and scalar values
SPARQL support
Store supports a lot of SPARQL 1.0/1.1 features. For more information please read SPARQL-support.md.
Performance
Store uses an in-memory SQLite file configured with:
PRAGMA synchronous = OFFPRAGMA journal_mode = OFFPRAGMA locking_mode = EXCLUSIVEPRAGMA page_size = 4096
Check PDOSQLiteAdapter.php for more information.
When adding several hundred or more triples at once you may experience increased execution time. Local tests showed that per second around 1500 triples can be added.
License
This work is licensed under the terms of the GPL 2.
Acknowledgement
This work is based on the code of ARC2 from https://github.com/semsol/arc2 (by Benjamin Nowak and contributors). To see what was extracted check pull request #1. ARC2 is dual licensed under the terms of GPL 2 (or later) as well as W3C Software License.
sweetrdf/in-memory-store-sqlite 适用场景与选型建议
sweetrdf/in-memory-store-sqlite 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 501 次下载、GitHub Stars 达 3, 最近一次更新时间为 2021 年 04 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「RDF」 「sparql」 「in-memory store」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 sweetrdf/in-memory-store-sqlite 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sweetrdf/in-memory-store-sqlite 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 sweetrdf/in-memory-store-sqlite 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
identity-map php library
SPARQL abstraction layer for PHP
This PHP library can easily parse xml files, especially RSS1.0, RSS2.0 and ATOM.
Wikibase extension that allows defining RDF mappings for Wikibase Entities
ARC2 RDF library for PHP
统计信息
- 总下载量: 501
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2021-04-06