2017 © Pedro Peláez
 

library term-store

Persistence of Wikibase terms with lookups of those terms and by those terms

image

queryr/term-store

Persistence of Wikibase terms with lookups of those terms and by those terms

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 2 Open issues
  • 10 Versions
  • 2 % Grown

The README.md

QueryR TermStore

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version Download count, (*1)

Stores terms of Wikibase entities to facilitate, (*2)

  • 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:, (*3)

{
    "require": {
        "queryr/term-store": "~1.0"
    }
}

Usage

If you are curious what the database schema is, look at src/TermStoreInstaller.php., (*4)

All services are constructed via the TermStoreFactory class:, (*5)

use Queryr\TermStore\TermStoreFactory;
$factory = new TermStoreFactory(
    $dbalConnection,
    new TermStoreConfig( /* optional config */ )
);

$dbalConnection is a Connection object from Doctrine DBAL., (*6)

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., (*7)

Lookup label based on EntityId and language

$labelLookup = $factory->newLabelLookup();
$labelLookup->getLabelByIdAndLanguage( $entityId, $languageCode );

See the LabelLookup interface for documentation., (*8)

Running the tests

For tests only, (*9)

composer test

For style checks only, (*10)

composer cs

For a full CI run, (*11)

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 newLabelLookup to TermStoreFactory
  • 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::storeEntityFingerprint via 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 by TermStore
  • Added getItemIdByLabel, getPropertyIdByLabel, getItemIdByText and getPropertyIdByText to TermStore

Version 0.1 (2014-06-23)

  • Initial release

The Versions

03/02 2018

dev-master

9999999-dev https://github.com/JeroenDeDauw/TermStore

Persistence of Wikibase terms with lookups of those terms and by those terms

  Sources   Download

GPL-2.0+ GPL-2.0-or-later

The Requires

 

The Development Requires

wikibase fingerprint lookup terms datamodel

04/01 2018

1.3.0

1.3.0.0 https://github.com/JeroenDeDauw/TermStore

Persistence of Wikibase terms with lookups of those terms and by those terms

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

wikibase fingerprint lookup terms datamodel

01/03 2017

1.2.0

1.2.0.0 https://github.com/JeroenDeDauw/TermStore

Persistence of Wikibase terms with lookups of those terms and by those terms

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

wikibase fingerprint lookup terms datamodel

10/11 2015

1.1.0

1.1.0.0 https://github.com/JeroenDeDauw/TermStore

Persistence of Wikibase terms with lookups of those terms and by those terms

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

wikibase fingerprint lookup terms datamodel

03/11 2015

1.0.0

1.0.0.0 https://github.com/JeroenDeDauw/TermStore

Persistence of Wikibase terms with lookups of those terms and by those terms

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

wikibase fingerprint lookup terms datamodel

03/11 2015

0.2.3

0.2.3.0

  Sources   Download

The Requires

 

The Development Requires

21/10 2014

0.2.2

0.2.2.0

  Sources   Download

The Requires

 

The Development Requires

05/10 2014

0.2.1

0.2.1.0

  Sources   Download

The Requires

 

The Development Requires

11/09 2014

0.2.0

0.2.0.0

  Sources   Download

The Requires

 

The Development Requires

23/06 2014

0.1

0.1.0.0

  Sources   Download

The Requires

 

The Development Requires