Help with inheritance in semantic hierarchies

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Help with inheritance in semantic hierarchies

rkevans
Hello,

Looking for help/advice on how to implement Option 1 of the 2 workarounds offered to the problem of inheritance in semantic hierarchies as discussed here:

https://www.semantic-mediawiki.org/wiki/Help:Inheritance_in_hierarchies#The_problem

.. my system is new and so I can setup my schema's to support the requirements of option 1

I've never used the "subsumes" and would like to ask here for advice

Given three classes: Building, Room, Spot
(each with dedicated Category, Template, and Form as made by "Create a Class" page)

Page "MyBuilding1" is in "Category:Building" with Property:Has Building Number=123

Page "MyRoom1" is in "Category:Room" and has Property:Belongs to Building=MyBuilding1 along with Property:Has-Room-Number=456

Page "MySpot1" is on "Category:Spot" and has Property:Belongs-to-Room=MyRoom1

How do I use the #SET and "Subsumes" syntax to cause MySpot1 to inherit the properties available to both the MyRoom1 and MyBuilding1 pages...

ultimately.. I'd like to create a semantic query that finds all pages in Category:Spot whose inherited building number is 123

I think Option 1 is very doable for me to achieve this, but I just need a little coaching.

Who knows how to do this? :-)

As always, thanks in advance!
-Rich
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help with inheritance in semantic hierarchies

rkevans
for example. when it says:

In the same template, include something like the following

{{#set:
|Subsumes items={{FULLPAGENAME}}
|Subsumes items={{#ask: [[-Subsumes items::<q>[[Member of::{{FULLPAGENAME}}]]</q>]]|format=list|link=none}}|+sep=,
}}

would I add this code to the Template:Spot to import all the room properties to the new spot page when the user chooses the page value for Property:Has-Room-Number,

... and then would I also add it to the Template:Room to import all the building properties of the building page pointed to by the property:Belongs-to-Building

I just need one concrete example

ty
Loading...