Discuss Inverse properties

From semantic-mediawiki.org

Talk pages on this wiki should primarily be used to address possible mistakes as well as missing and superseded information in the documentation.
In case you are seeking support concerning individual questions, please have a look at this page. The Semantic MediaWiki user mailing list is always a good idea for seeking help.

Contents

Thread titleRepliesLast modified
very nice rewrite409:22, 13 June 2014
Rewrite of this page000:02, 8 February 2014

very nice rewrite

Perhaps another useful way to explain this important feature is to contrast that

  • a non-inverse predicate returns pages that have the named page-property, that is, subjects of a triple
  • an inverse predicate returns pages referenced by the named page-property, that is, objects of a triple

Please note, I used the term "inverse predicate" not "inverse property" because there may be confusion with owl:inverseProperty relations, that is, it's more technically correct to reference the operation of resolving predicates than it is to reference a property per se. This general comment might affect for instance how the first sentence is worded from "The inverse of a property simply is the property that points into the other direction." to

A query, composed of predicates, normally returns pages having a certain property. An 'inverse predicate' is simply an expression that returns pages referenced by a certain property. This feature (indicated by a hyphen in a predicate expression) only applies to queries, not to annotations for a page.
For example, ...

I know it may be a pain, but if you agree that 'inverse predicates' is better, then I'd suggest the page title should be changed in accordance with this terminology.

Second, it'd be great to provide an example of what is meant by "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)."

Finally the last sentence is a bit confusing: I don't see how an inverse predicate works for text values. So, instead of "currently only supported if they are of Type:Page" how about "is only supported for page properties" ?

thanks.

23:34, 6 February 2014

Heiya John, I agree that this page should be worked on. It should be easier to grasp what it is all about. I am however not so sure about renaming this to predicate though I understand your point, at least I think I do. :) Cheers

00:08, 8 February 2014

I think a more appropriate title would be "Help:Inverse queries" and the page should be listed in the menu under "Inline queries" (rather than "Properties", as it is now).

23:27, 12 June 2014

agreed - who/how should this kind of change be made?

02:04, 13 June 2014

I am not absolutely sure since properties are being worked on within an query. I think this naming was introduced by the devs, so having their opinion on this will be nice, too.

09:22, 13 June 2014
 
 
 
 

Rewrite of this page

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

00:01, 8 February 2014