addwiki/wikibase-query

Wikibase Query library

dev-main / 3.1.x-dev 2022-06-03 07:34 UTC

This package is auto-updated.

Last update: 2024-03-01 00:14:07 UTC


README

GitHub issue custom search in repo Latest Stable Version Download count

Issue tracker: https://github.com/addwiki/addwiki/issues

Installation

Use composer to install the library and all its dependencies:

composer require "addwiki/wikibase-query:~3.0"

Examples

Use the SimpleQueryService with wikidata.

use Addwiki\Wikibase\Query\WikibaseQueryFactory;
use Addwiki\Wikibase\Query\PrefixSets;

$factory = new WikibaseQueryFactory(
    "https://query.wikidata.org/sparql",
    PrefixSets::WIKIDATA
);

$r = $factory->newSimpleQueryService()->query(["P31:Q1"]);