Special property "Subproperty of"

From Linux Web Expert

(Redirected from Help:Parent property)

Subproperty of
Lets you indicate that one property is a subproperty of another
Further Information
Provided by: extension "Semantic MediaWiki "No description was provided.
Added: 1.0
Removed: still in use
Alias: has no alias
Optional: no
Visible: yes
Annotable: yes
Declarative: yes
Key: _SUBP
Setting: not specified
Focus: not specified
In this wiki: Property:Subproperty of
Table of Contents

Template:Interlanguagelink: en The Subproperty of property is a special property in Semantic MediaWiki with a built-in meaning: it lets you indicate that one property is a subproperty of another, which we call its head property. This enables you to query on one or multiple subproperties by querying on their common head property, without having to resort to elaborate OR criteria property by property. It means, for instance, that a query for pages with the head property should also return pages that have the subproperty.

In addition to straightforward child-parent relationships, SMW also supports a deeper hierarchy, the maximum depth of which depends on configuration parameter $smwgQSubpropertyDepthSets the maximum level of subproperty inclusion (steps within property hierarchy) (10 by default). A property may also have multiple head properties as direct parents.

Example

On this wiki, Property:Has chair is a head property with multiple subproperties ("Has financial chair", "Has program chair", "Has online chair", etc.). Each subproperty uses the special property [[Subproperty of::Has chair]].

Querying for the property "Has chair" should also find you pages with its subproperties. You can query on those subproperties by querying on the head property. For instance,

{{#ask: [[Has chair::+]] }}

returns all pages that use the head property ("Has chair") and its subproperties ("Has financial chair", etc.).

The same works for inverse queries. To find all users who have been chairs, regardless of their precise role, you could use a query like:

{{#ask: [[Category:User]] [[-Has chair::+]] }}

Limitations

Chained properties in query conditions

A head property cannot be part of a property chain in a query condition unless it comes at the end, before the value. For example, if the head property were called "organised by", then the following example will not work, but it would been fine if "member of" had been a parent property instead:

{{#ask: [[organised by.member of::SMW community]] ... }}

Using head properties as printout parameters

If a head property is used as a printout parameter in a query, the corresponding results will be the values of the head property only. To ensure that those of its subproperties are included as well, each relevant subproperty must be explicitly specified as printout parameter.

For instance, in our earlier example :

{{#ask: [[Has chair::+]]
 |?Has financial chair
 |?Has online chair
 |?Has general chair
 |?Has local chair
 |?Has program chair
 |?Has sponsorship chair
 ...
}}

Notes

If property P is a subproperty of property P', then all pairs of resources which are related by P are also related by P'.
  • A property's wiki page shows its subproperties (since Semantic MediaWiki 1.2.1Released on an unknown date unknown versions of MediaWiki). The page of the head property does not, however, list the values of its subproperties.
  • If no pages (or very few pages) in the wiki use a property, then even if lots of pages use its subproperties:
    • The property's page will list no (or few) pages under "Pages using the property"
    • The property will not appear in Special:Properties (or will appear with a caution This property is hardly used within the wiki!).

See also


References

  1. ^ gh:smw:3733