PHPackages                             mediawiki/semantic-compound-queries - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. mediawiki/semantic-compound-queries

ActiveMediawiki-extension[API Development](/categories/api)

mediawiki/semantic-compound-queries
===================================

A Semantic Mediawiki extension to display and combine multiple #ask queries in a single visualization output

4.0.1(1w ago)7112.4k↑72.4%7[1 issues](https://github.com/SemanticMediaWiki/SemanticCompoundQueries/issues)1GPL-2.0-or-laterPHPPHP &gt;=8.1CI passing

Since Sep 21Pushed 3w ago12 watchersCompare

[ Source](https://github.com/SemanticMediaWiki/SemanticCompoundQueries)[ Packagist](https://packagist.org/packages/mediawiki/semantic-compound-queries)[ Docs](https://www.mediawiki.org/wiki/Extension:Semantic_Compound_Queries)[ Fund](https://www.semantic-mediawiki.org/wiki/Sponsorship)[ Fund](https://opencollective.com/smw)[ RSS](/packages/mediawiki-semantic-compound-queries/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (9)Versions (13)Used By (1)

Semantic Compound Queries
=========================

[](#semantic-compound-queries)

[![CI](https://github.com/SemanticMediaWiki/SemanticCompoundQueries/actions/workflows/ci.yml/badge.svg)](https://github.com/SemanticMediaWiki/SemanticCompoundQueries/actions/workflows/ci.yml)[![Code Coverage](https://camo.githubusercontent.com/c9410c09bd14fe4becbda5a99392ab13d8c1d04b181c0cdfab2e90a47925f8d8/68747470733a2f2f636f6465636f762e696f2f67682f53656d616e7469634d6564696157696b692f53656d616e746963436f6d706f756e64517565726965732f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/SemanticMediaWiki/SemanticCompoundQueries)[![Latest Stable Version](https://camo.githubusercontent.com/5bd7df1b1a6944cd0b46fcb03e406934170b1ca082027322df5899c3745dcb83/68747470733a2f2f706f7365722e707567782e6f72672f6d6564696177696b692f73656d616e7469632d636f6d706f756e642d717565726965732f762f737461626c65)](https://packagist.org/packages/mediawiki/semantic-compound-queries)[![Download count](https://camo.githubusercontent.com/b05a3acdf7e23290b466003c5e02afd3b1d5b23454edc7a7a255e00e26facf17/68747470733a2f2f706f7365722e707567782e6f72672f6d6564696177696b692f73656d616e7469632d636f6d706f756e642d717565726965732f646f776e6c6f616473)](https://packagist.org/packages/mediawiki/semantic-compound-queries)[![License](https://camo.githubusercontent.com/6194f3a82f7bf3e345177e3be60104cf31b321998abb83d35b31092e4a1f3dc8/68747470733a2f2f706f7365722e707567782e6f72672f6d6564696177696b692f73656d616e7469632d6d656469612d77696b692f6c6963656e7365)](COPYING)

Semantic Compound Queries (a.k.a. SCQ) is a [Semantic Mediawiki](https://github.com/SemanticMediaWiki/SemanticMediaWiki) extension that defines the `#compound_query` parser function, which can display the results of multiple `#ask` queries (as compound constructs) at the same time.

Requirements
------------

[](#requirements)

- PHP 8.1 or later
- MediaWiki 1.43 or later
- [Semantic MediaWiki](https://github.com/SemanticMediaWiki/SemanticMediaWiki) 7.0 or later

Installation
------------

[](#installation)

The recommended way to install Semantic Compound Queries is using [Composer](http://getcomposer.org) with [MediaWiki's built-in support for Composer](https://www.mediawiki.org/wiki/Composer).

Note that the required extension Semantic MediaWiki must be installed first according to the installation instructions provided.

### Step 1

[](#step-1)

Change to the base directory of your MediaWiki installation. If you do not have a "composer.local.json" file yet, create one and add the following content to it:

```
{
	"require": {
		"mediawiki/semantic-compound-queries": "~4"
	}
}

```

If you already have a "composer.local.json" file, add the following line to the end of the "require" section in your file:

```
"mediawiki/semantic-compound-queries": "~4"

```

Remember to add a comma to the end of the preceding line in this section.

### Step 2

[](#step-2)

Run the following command in your shell:

```
php composer.phar update --no-dev

```

Note that if you have Git installed on your system, you can add the `--prefer-source` flag to the above command.

### Step 3

[](#step-3)

Add the following line to the end of your "LocalSettings.php" file:

```
wfLoadExtension( 'SemanticCompoundQueries' );

```

Usage
-----

[](#usage)

The syntax of `#compound_query` resembles that of `#ask`, but with more than one query and the elements of each sub-query delimited by semicolons instead of pipes. Elements common across all sub-queries, like `format=` and `width=` (for maps), should be placed after all sub-queries.

### Example

[](#example)

A sample call to `#compound query`, which retrieves both biographies, along with their subject; and fiction books, along with their author; is:

```
{{#compound_query:
  [[Category:Books]]
  [[Has genre::Biography]]
  ;?Covers subject=Subject
  |
  [[Category:Books]]
  [[Has genre::Fiction]]
  ;?Has author=Author
  |format=list
}}

```

For more information, see the extension's homepage at [MediaWiki.org](https://www.mediawiki.org/wiki/Extension:Semantic_Compound_Queries).

Contribution and support
------------------------

[](#contribution-and-support)

Original author: Yaron Koren (Version 0.4.1)

If you want to contribute work to the project, please subscribe to the developer's mailing list and have a look at the contribution guidelines.

- [File an issue](https://github.com/SemanticMediaWiki/SemanticCompoundQueries/issues)
- [Submit a pull request](https://github.com/SemanticMediaWiki/SemanticCompoundQueries/pulls)
- Ask a question on [the mailing list](https://www.semantic-mediawiki.org/wiki/Mailing_list)

Tests
-----

[](#tests)

This extension provides unit and integration tests and is run by a [continuous integration platform](https://docs.github.com/en/actions)but can also be executed locally using the shortcut command `composer phpunit` from the extension base directory.

License
-------

[](#license)

[GNU General Public License, version 2 or later](https://www.gnu.org/copyleft/gpl.html).

###  Health Score

63

—

FairBetter than 99% of packages

Maintenance93

Actively maintained with recent releases

Popularity39

Limited adoption so far

Community29

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor3

3 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~356 days

Recently: every ~404 days

Total

11

Last Release

8d ago

Major Versions

1.2.0 → 2.0.02019-01-28

2.2.0 → 3.0.0-beta2025-04-24

3.0.0 → 4.0.02026-06-08

PHP version history (7 changes)1.0.0PHP &gt;=5.3.0

1.1.0PHP &gt;=5.5

1.2.0PHP &gt;=5.6

2.1.0PHP &gt;=7.0

2.2.0PHP &gt;=7.3

3.0.0-betaPHP &gt;=7.4

4.0.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/451bd4039d530fed8f9c3da91bfa519233a397d2182cdfdcad700f6cfea19b7f?d=identicon)[Jeroen De Dauw](/maintainers/Jeroen%20De%20Dauw)

![](https://avatars.githubusercontent.com/u/22235?v=4)[Stefan Wasilewski](/maintainers/SMW)[@smw](https://github.com/smw)

![](https://avatars.githubusercontent.com/u/1104078?v=4)[Karsten Hoffmeyer](/maintainers/kghbln)[@kghbln](https://github.com/kghbln)

---

Top Contributors

[![translatewiki](https://avatars.githubusercontent.com/u/24829418?v=4)](https://github.com/translatewiki "translatewiki (44 commits)")[![JeroenDeDauw](https://avatars.githubusercontent.com/u/146040?v=4)](https://github.com/JeroenDeDauw "JeroenDeDauw (40 commits)")[![kghbln](https://avatars.githubusercontent.com/u/1104078?v=4)](https://github.com/kghbln "kghbln (33 commits)")[![PeterTheOne](https://avatars.githubusercontent.com/u/666289?v=4)](https://github.com/PeterTheOne "PeterTheOne (21 commits)")[![paladox](https://avatars.githubusercontent.com/u/5727000?v=4)](https://github.com/paladox "paladox (19 commits)")[![mwjames](https://avatars.githubusercontent.com/u/1245473?v=4)](https://github.com/mwjames "mwjames (12 commits)")[![yaronkoren](https://avatars.githubusercontent.com/u/1278687?v=4)](https://github.com/yaronkoren "yaronkoren (10 commits)")[![alistair3149](https://avatars.githubusercontent.com/u/9260542?v=4)](https://github.com/alistair3149 "alistair3149 (9 commits)")[![gesinn-it-gea](https://avatars.githubusercontent.com/u/10398316?v=4)](https://github.com/gesinn-it-gea "gesinn-it-gea (7 commits)")[![gesinn-it-evl](https://avatars.githubusercontent.com/u/137869039?v=4)](https://github.com/gesinn-it-evl "gesinn-it-evl (7 commits)")[![malberts](https://avatars.githubusercontent.com/u/1428594?v=4)](https://github.com/malberts "malberts (6 commits)")[![YOUR1](https://avatars.githubusercontent.com/u/3681016?v=4)](https://github.com/YOUR1 "YOUR1 (2 commits)")[![siebrand](https://avatars.githubusercontent.com/u/210297?v=4)](https://github.com/siebrand "siebrand (2 commits)")[![alex-mashin](https://avatars.githubusercontent.com/u/11148653?v=4)](https://github.com/alex-mashin "alex-mashin (1 commits)")[![kizule](https://avatars.githubusercontent.com/u/28963303?v=4)](https://github.com/kizule "kizule (1 commits)")[![joelkp](https://avatars.githubusercontent.com/u/6118134?v=4)](https://github.com/joelkp "joelkp (1 commits)")[![reedy](https://avatars.githubusercontent.com/u/67615?v=4)](https://github.com/reedy "reedy (1 commits)")

---

Tags

mediawikimwqueryscqsemanticsemantic-mediawikismwmediawikiwikiSMWSemantic MediaWiki

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/mediawiki-semantic-compound-queries/health.svg)

```
[![Health](https://phpackages.com/badges/mediawiki-semantic-compound-queries/health.svg)](https://phpackages.com/packages/mediawiki-semantic-compound-queries)
```

###  Alternatives

[mediawiki/semantic-media-wiki

An extension to MediaWiki that lets you store and query structured data within wiki pages

622381.2k34](/packages/mediawiki-semantic-media-wiki)[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.5k10](/packages/helsingborg-stad-municipio)[mediawiki/maps

Adds various mapping features to MediaWiki

84152.3k3](/packages/mediawiki-maps)[mediawiki/semantic-result-formats

Provides additional result formats for queries using Semantic MediaWiki

56188.7k1](/packages/mediawiki-semantic-result-formats)[mediawiki/semantic-extra-special-properties

Provides extra special properties for Semantic MediaWiki

3079.9k1](/packages/mediawiki-semantic-extra-special-properties)[mediawiki/semantic-scribunto

A Semantic Mediawiki extension to natively support the Scribunto extension

3071.2k](/packages/mediawiki-semantic-scribunto)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
