Help talk:Tree format

From semantic-mediawiki.org
Jump to: navigation, search

Contents

Thread titleRepliesLast modified
Tree format query does not render as a nested list322:27, 8 November 2017
Limit Depth007:49, 13 September 2016
SRF Tree fails in combination TreeAndMenu Extension and template119:07, 12 December 2014
Tree format and subobjects - link to parents doesn't work012:54, 3 September 2014
sep seems not to work for tree format611:49, 27 August 2013

Tree format query does not render as a nested list

Hi everyone,

I'm a bit of a SMW beginner and I was just recently playing around with this result format.

Unfortunately, I don't seem to understand how it is supposed to work.

If I take the example query from the help page and substitute Category:Place with Category:City, it just renders a plain, old unordered list without any nesting.

Example:

{{#ask: [[Category:City]] [[Located in::+]]
 | format = tree
 | parent = Located in
 | limit = 5
}}

Result:

Shouldn't the cities be grouped by country, or am I misunderstanding something here? Or do I need to include the parent pages in the query somehow?

Blackice (talk)14:46, 7 November 2017

The issue is that the countries e.g. Netherlands are not assigned to the "City" category. In your query you are asking for pages which are in the category "City" only. Have a look at more examples in the sandbox wiki.

[[kgh]] (talk)15:05, 8 November 2017

Thanks for the reply. Seems like I overestimated what a result format can do.

Including a country in the query does indeed have the desired effect:

{{#ask:
 [[Germany]]
 OR
 [[Category:City]] [[Located in::Germany]]
 | format = tree
 | parent = Located in
 | limit = 5
}}

Result:

Nice :)

Blackice (talk)18:58, 8 November 2017

Some result formats indeed need a special data structure to work on. Here it appears more to be a matter of selecting pages. Have a look at Inferencing too.

[[kgh]] (talk)22:27, 8 November 2017
 
 
 

Limit Depth

Can the depth of the tree be limited?

Alexander Mashintalk07:49, 13 September 2016

SRF Tree fails in combination TreeAndMenu Extension and template

The following tree works as expected

{{#tree:id=ProcessTree|root=Processes|
{{#ask:[[Category:Process]][[Is Part Of::+]]
   |format=tree
   |parent=Is Part Of
}}}}

When adding a template= parameter, the first tree item is rendered outside the TreeAndMenu structure

{{#tree:id=ProcessTree|root=Processes|
{{#ask:[[Category:Process]][[Is Part Of::+]]
   |format=tree
   |template=SrfProcessTree
   |parent=Is Part Of
   |link=none
}}}}

The SrfProcessTree template is a simple {{{1}}}

SMW 1.8.x, MW 1.19.x, SRF 1.8/latest SRF_tree.php from git

Can someone confirm that?

Alexander Gesinn (talk)18:45, 12 December 2014

Can't confirm, but what happens if you try it like this:

{{#tree:id=ProcessTree|root=Processes|<nowiki/>
{{#ask:[[Category:Process]][[Is Part Of::+]]
   |format=tree
   |template=SrfProcessTree
   |parent=Is Part Of
   |link=none
}}}}
Stephan Gambke (talk)19:07, 12 December 2014
 

Tree format and subobjects - link to parents doesn't work

Hi all,

I stumbled upon a problem with the tree format, perhaps somebody here can help me. I use MW 1.23.2, SMW 2.0 and SRF 1.9 alpha.

As an example, I store locations in my wiki. For locations with a lot of information, I create a page, for locations with only some semantic data, I only create a subobject. The sematic attributes are the same for both. Both have the attributes "name is" and "located in".

I'd like to use the tree format to display a hierarchy of the places. I use the following query:

{{#ask: [[name is::+]] | ?name is | format=tree | parent=located in }}

All locations are found and listed, regardless if its only a subobject or not. However, the link with "located in" doesn't work with subobjects: If the parent is a subobject, its children are not listed below it. Is there any way to fix this?

Thanks in advance for your support!

Tobias.r (talk)10:43, 28 August 2014

sep seems not to work for tree format

Hi everyone,

using the tree format with SRF 1.7.1, I get results like this:

So the properties printed in the brackets are not separated at all. I tried to use the parameter

|sep=,&nbps;

but it did not prove to have any effect.

Is this a bug or a case of misconfiguration? Any help appreciated!

PS I can see a bunch of fantastic new formats having come with SRF 1.8, really looking forward to using them. Thanks to all contributors!

Argi (talk)11:46, 19 December 2012

So far I have not used this result format though I am looking forward to. Hmm, just by looking at the documentation it should work to get a separator in there somehow. Did you just try |sep=, to see what happens?

[[kgh]] (talk)02:15, 20 December 2012

Hi kgh,

sorry for the late reply. Of course I tried, as mentioned above.

Kind regards

Argi (talk)17:02, 1 February 2013

Heiya Argi, cool that this worked out for you. :) Cheers

[[kgh]] (talk)22:00, 1 February 2013
 
 

Hi Argi, I reworked the treeview format lately. I did not specifically target this bug, but it could well have been solved in the process. Could you try if it works in the latest development version of SRF and if not raise a bug in [1]?

Stephan Gambke (talk)21:25, 13 May 2013

Hi F.trott,

due to a change in employment I do not have access to the installation anymore and thus cannot validate a fix. Next time I set up a wiki using it, I will take a look. Still, I cannot say when this is about to be. ;ö)

Thanks and regards

Nico

Argi (talk)21:56, 11 June 2013

Everything qorking fine with MW 1.21 and SMW 1.8.0.4. :)

Regards

Nico

Argi (talk)11:49, 27 August 2013