Germany


Germany is a country located in Europe.

Inverse relationships[edit]

The sample pages use Property:Located in, for example the Berlin article states the fact located in::Germany. If you want to also show this information here in the article for the object of the relationship, there are several ways to do this:

  • Special:Browse (the "eye" symbol in the factbox below) shows a page's object relationships.
  • You can query for all things located in Germany, using a query like the following. (Using the MediaWiki variables PAGENAME/FULLPAGENAME for the current pagename/pagename-with-namespace makes the query generic.)
Syntax
{{#ask:
 [[Located in::{{FULLPAGENAME}}]]
 |intro=Things located in {{PAGENAME}}:_ 
 |link=all
}}
Result

Things located in Demo:Germany: Demo:Berlin, Demo:Cologne, Demo:Frankfurt, Demo:Munich, Demo:Stuttgart, Demo:Würzburg

  • You could create the inverse property Location of and annotate pages with this. Semantic MediaWiki does not internally support inverse relationships, so it is up to you to keep the two properties in sync. One way to do this is to use an inline query that outputs the wiki text for the semantic annotation of the inverse property, so it would put the wiki text [[Location of::Berlin]], [[Location of::Hannover]], etc. on this page. The help documentation provides an inline query whose output you can paste in. Embedding it within a property page is complicated and requires nested templates, see California.

«Transitive» relationships[edit]

Some pages may not directly state that they are located in Germany, and only state they are located somewhere that in turn is located in Germany. To find things located in things located in Germany, you have to nest a subquery:


Note that this does of course not realise true transitivity, but only a limited number of steps along the property «located in».

🖨 🚪