Help:Unions of results

Disjunctions are OR-conditions that admit several alternative conditions on query results. A disjunction requires that at least one (but maybe more than one) of the possible alternatives is satisfied (logical OR).

Semantic MediaWiki has two ways of writing disjunctions in queries:
 * The operator   is used for taking the union of two queries.
 * The operator   is used for disjunctions in property values, page names and category names.

For example, a query that describes pages of actors in  or , or in both of them, can be written as:

or more concisely,

Similarly, a query that describes all pages of people born in Boston or New York can be written using one of these operators:

or again more concisely,

Note that  does not always offer an alternative to. For example,

cannot be expressed with.

OR operates on the query, not on a single element of the query. Thus in the following query, which is intended to list actors born in Boston or in New York, the category name needs to be repeated:

To combine multiple queries, you can also use.