queryr/term-store
Composer 安装命令:
composer require queryr/term-store
包简介
Persistence of Wikibase terms with lookups of those terms and by those terms
README 文档
README
Stores terms of Wikibase entities to facilitate
- lookup of EntityIds given a term
- lookup of term(s) given an EntityId
- storing a Fingerprint for an EntityId
- removing all terms associated with an EntityId
System dependencies
- PHP 5.5 or later (PHP 7 and HHVM are supported)
- php5-sqlite (only needed for running the tests)
Installation
To add this package as a local, per-project dependency to your project, simply add a
dependency on queryr/term-store to your project's composer.json file.
Here is a minimal example of a composer.json file that just defines a dependency on
TermStore 1.x:
{
"require": {
"queryr/term-store": "~1.0"
}
}
Usage
If you are curious what the database schema is, look at src/TermStoreInstaller.php.
All services are constructed via the TermStoreFactory class:
use Queryr\TermStore\TermStoreFactory; $factory = new TermStoreFactory( $dbalConnection, new TermStoreConfig( /* optional config */ ) );
$dbalConnection is a Connection object from Doctrine DBAL.
Writing to the store
$writer = $factory->newTermStoreWriter(); $writer->storeEntityFingerprint( $entityId, $fingerprint ); $writer->dropTermsForId( $entityId );
Lookup up an EntityId based on terms
$idLookup = $factory->newEntityIdLookup(); $idLookup->getItemIdByLabel( $languageCode, $labelText ); $idLookup->getItemIdByText( $languageCode, $termText ); $idLookup->getIdByLabel( $languageCode, $labelText );
See the EntityIdLookup interface for all methods and their documentation.
Lookup label based on EntityId and language
$labelLookup = $factory->newLabelLookup(); $labelLookup->getLabelByIdAndLanguage( $entityId, $languageCode );
See the LabelLookup interface for documentation.
Running the tests
For tests only
composer test
For style checks only
composer cs
For a full CI run
composer ci
Release notes
Version 1.3.0 (2018-01-04)
- Bumped minimum PHP version to 7.1
- Added scalar and return type hints
Version 1.2.0 (2017-02-28)
- Installation with Wikibase DataModel 6.x is now allowed
- Installation with Wikibase DataModel 5.x is now allowed
Version 1.1.0 (2015-11-10)
- Added
newLabelLookuptoTermStoreFactory - Improved documentation
Version 1.0.0 (2015-11-03)
- Installation with Wikibase DataModel 4.x is now allowed
- Installation with Wikibase DataModel 3.x is now allowed
- Changed minimum Wikibase DataModel version to 2.5
- Added ci command that runs PHPUnit, PHPCS, PHPMD and covers tags validation
- Added TravisCI and ScrutinizerCI integration
Version 0.2.2 (2014-10-21)
- Installation with Wikibase DataModel 2.x is now allowed
Version 0.2.1 (2014-10-05)
- Improved performance of
TermStore::storeEntityFingerprintvia usage of a transaction
Version 0.2 (2014-09-11)
- Added
TermStoreFactory. Service construction should now happen via this factory - Added
EntityIdLookup, which is now implemented byTermStore - Added
getItemIdByLabel,getPropertyIdByLabel,getItemIdByTextandgetPropertyIdByTexttoTermStore
Version 0.1 (2014-06-23)
- Initial release
queryr/term-store 适用场景与选型建议
queryr/term-store 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 357 次下载、GitHub Stars 达 0, 最近一次更新时间为 2015 年 11 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「terms」 「wikibase」 「DataModel」 「lookup」 「Fingerprint」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 queryr/term-store 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 queryr/term-store 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 queryr/term-store 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP implementation of the Wikibase DataModel
Serializers and deserializers for the Wikibase DataModel
Jam Taxonomy
Services around the Wikibase DataModel
Serializers and deserializers for the data access layer of Wikibase Repository
Sylius terms and conditions plugin
统计信息
- 总下载量: 357
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2015-11-03