Rewrite of this page

From semantic-mediawiki.org

Introduction[edit]

The inverse of a property simply is the property that points into the other direction. For example, if "developer of" connects a person to a software tool, then the inverse of "developer of" connects software tools to persons. So far, it was very hard to use properties in other directions. In our example, you could, e.g., have an ask query showing the all persons who develop some open source tool, but you could not have a query that shows all software tools that are developed by people living in Argentina. To do the latter, you would have had to use a property "is developed by" that explicitly connects software tools to their developers, and you would have had to add data for that again. If you need both directions, you would have to maintain both properties individually, which is not very convenient.

Feature Details[edit]

SMW (SVN) now allows you to directly refer to the inverse of any property by simply putting a "-" in front of its name. For example, "-developer of" gives you access to what I called "is developed by" above. This can be used in any place where property names occur, including browsing special pages, ask queries, and output directives of queries. So the projects developed by people from Argentina can be obtained with a query

{{#ask: [[-developer of:: <q>[[lives in::Argentina]]</q> ]] }} or simply

{{#ask: [[-developer of.lives in::Argentina]] }}


If applicable, inverse properties generally are linked to the page of the corresponding property (so "-developer of" links to "Property:developer of"). It is strongly suggested not to create property pages that are called like inverse properties (it won't destroy anything, but it might create unnecessary confusion). Also, you cannot use inverse properties to enter semantic data into the wiki: all annotations must be on the page that is the subject of the non-inverted property.

Inverses in queries are currently only supported if they are of Type:Page.

See this thread

01:01, 8 February 2014