Help:Subobjects and queries

This help page describes how to query for a subobject after they were added to your wiki.

Show all subobjects of a page
Using  does not print out anything on the screen. Sometimes one would like to show the subobject data directly on the page where it is defined. This can be achieved with the ask query  which is added after the definition of subobjects.

Example:

Defining two subobjects with identifiers "first" and "second":

Then to print out the subobjects one would insert this code on the same page:

Note the "-" which is necessary to make the query work (see Inverse Properties for more information).

Show properties of a subobject's parent page
In some cases one might not only want to query for subobject data but also for "usual" properties that are defined on the subobject's parent page. The process to do that contains the following steps:
 * 1) Query for a property of a subobject.
 * 2) Use.
 * 3) Add another query in this template where you ask for  .   returns the parent page of a subobject. The subobject is queried in the first query and passed on to the template as.


 * Example

In  one adds the following:

Examples/Queries/Use subobject with template

Searching for pages with certain subobject properties
When you want to query for (parent) pages that have certain subobject properties, you can use subqueries:


 * Example

This works, because with the query  (without the "-"), you are querying for the (parent) pages that have subpropeties. With the subquery, you can then select certain subobject properties. As you are queryinig for parent pages, you can select properties of the parent pages as printouts.