Download the PHP package ask/ask without Composer

On this page you can find all versions of the php package ask/ask. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ask

This library is no longer under development and is no longer maintained.

Ask

Library containing a PHP implementation of the Ask query language.

The implementation consists out of domain objects that represent various parts of Ask queries.

Build Status Coverage Status Scrutinizer Quality Score

On Packagist: Latest Stable Version Download count

Requirements

Installation

You can use Composer to download and install this package as well as its dependencies. Alternatively you can simply clone the git repository and take care of loading yourself.

Composer

To add this package as a local, per-project dependency to your project, simply add a dependency on ask/ask to your project's composer.json file. Here is a minimal example of a composer.json file that just defines a dependency on Ask 1.0:

{
    "require": {
        "ask/ask": "1.0.*"
    }
}

Manual

Get the Ask code, either via git, or some other means. Also get all dependencies. You can find a list of the dependencies in the "require" section of the composer.json file. Load all dependencies and the load the Ask library by including its entry point: Ask.php.

Structure

The Ask library defines the Ask query language. Its important components are:

Description

Each query has a single description which specifies which entities match. This is similar to the WHERE part of an SQL string. There different types of descriptions are listed below. Since several types of descriptions can be composed out of one or more sub descriptions, tree like structures can be created.

All descriptions reside in the Ask\Language\Description namespace.

Option

The options a query consist out of are defined by the QueryOptions class. This class contains limit, offset and sorting options.

Sorting options are defined by the SortOptions class, which contains a list of SortExpression objects.

All options related classes reside in the Ask\Language\Option namespace.

Selection

Specifying what information a query should select from matching entities is done via the selection requests in the query object. Selection requests are thus akin to the SELECT part of an SQL string. They thus have no effect on which entities match the query and are returned. All types of selection request implement abstract base class SelectionRequest and can be found in the Ask\Language\Selection namespace.

Usage

A query for the first hundred entities that are compared

A query with an offset of 50

A query to get the ''cost'' of the first hundred entities that have a ''cost'' property

This is assuming 'p42' is an identifier for a ''cost'' property.

A query to get the first hundred entities that have 9000.1 as value for their ''cost'' property.

This is assuming 'p42' is an identifier for a ''cost'' property.

A query getting the hundred entities with highest ''cost'', highest ''cost'' first

This is assuming 'p42' is an identifier for a ''cost'' property.

A query to get the hundred first entities that have a ''cost'' either equal to 42 or bigger than 9000

This is assuming 'p42' is an identifier for a ''cost'' property.

Tests

This library comes with a set up PHPUnit tests that cover all non-trivial code. You can run these tests using the PHPUnit configuration file found in the root directory. The tests can also be run via TravisCI, as a TravisCI configuration file is also provided in the root directory.

Authors

Ask has been written by Jeroen De Dauw as Wikimedia Germany employee for the Wikidata project.

This library is a reimplementation of the Ask language domain objects in Semantic MediaWiki, which have been written by Markus Krötzsch. This reimplementation is conceptually almost entirely based on the original code and contains small portions of it.

Release notes

1.0.3 (alpha)

1.0.2 (2014-10-16)

1.0.1 (2014-01-21)

1.0 (2013-11-17)

Initial release with these features:

Links


All versions of ask with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
data-values/data-values Version ~1.0|~0.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ask/ask contains the following files

Loading the files please wait ....