Loading...
 
Features / Usability

Features / Usability


PluginLIST - How does "relation" filter work?

posts: 26

Hi folks,

I'm trying to configure PluginLIST to filter on semantic links between wiki pages. For example, with this code I expect to find all pages connected to the page with object_id=1 via a "participant" semantic link:

{LIST()}
 {filter relation=1}
 {filer objecttype = "wiki page"}
 {filter qualifier = "participant"}
{LIST}


This code produces the ERROR: "Missing objectype or qualifier for relation filter." Could anyone show me the correct syntax? Also, is there a way to specify that one side of the relation should be grounded in the current page that the code is on without specifying an object_id?

Thank you,
-d. vyd

posts: 8356 Israel

Hello Da’ud,

Sorry I can’t give a clear answer just some comments after experimenting.
(thanks for your question, I learned something). 😉

I never used the relation filter and qualifier but with relation tracker field: http://doc.tiki.org/PluginList-filter-control-block#Related_items

Checking : http://doc.tiki.org/Search-and-List-from-Unified-Index
I see wiki page have a relations field so I tried to follow the output of this field and there is one.

I suggest you go to your Search admin control panel, tab tools.
There use the "Experiment with plugin LIST" with the output template.

{filter type="wiki page"}
{output(template="debug")}


Check and use the correct output of the fields:
relations
relation_objects
relation_types
relation_count

I tested quickly and I had results using:

{filter relation="page_1" objecttype="wiki page" qualifier="tiki.link.related"}
{output(template="debug")}

(result: page_2)

{filter relation="page_2" objecttype="wiki page" qualifier="tiki.link.related.invert"}
{output(template="debug")}

(result: page_1)

Seems working with backlink and with alias is the quick way but I guess you can have your own.

I stopped here my investigation, but from here you should be able to dig and find what to filter and how for your use case.

Good luck !

posts: 26

Thanks for your efforts Bernard. I will continue to experiment based on your advice. I'm seeing results like those below. The "relations" value starts with "token" and looks like a hashcode. How do I turn it into a qualifier like you used "tiki.link.related" ? I tried "tiki.semantic.participant", "tiki.semantic_link.participant", "participant", etc. Nothing worked.

Array (24)
id => "101"
object_type => "wiki page"
object_id => "Star Fire Program"
title => "Star Fire Program"
creation_date => "2021-03-01 17:36:39"
modification_date => "2021-03-04 07:48:37"
date => "2021-03-01 17:36:39"
language => "unknown"
view_permission => "tiki_p_view"
geo_located => "n"
allowed_groups => "tokenrpqtevrqrpatuytyuxdxwwwpbtaafzvt..."
relations => "tokenxxcppaqxabzebbwrubccxedudrbrrbup"
relation_types => "tokenrpfdbuaqtzupwwfbvpudqvdwywetdqzc"
relation_count => "tokenpzarxdxcyufxxcctqvcduurfybeczuxr"
title_initial => "S"
title_firstword => "Star"
searchable => "y"
url => "tiki-index.php?page=Star-Fire-Program"
contents => " Star Fire Program 2021-03-01 17:36..."
contributors => "tokenqpqrqfqywauwauawtrxytazetaxzpfcr"
page_id => "7"
comment_count => "0"
categories => "tokenctcatqrxazbyqrxqzdccuzyavfwuxtyb"
deep_categories => "tokenctcatqrxazbyqrxqzdccuzyavfwuxtyb"

posts: 8356 Israel
Da'ud Vyd wrote:

Thanks for your efforts Bernard. I will continue to experiment based on your advice. I'm seeing results like those below. The "relations" value starts with "token" and looks like a hashcode.

Array (24)
id = "101"
object_type = "wiki page"
object_id = "Star Fire Program"
title = "Star Fire Program"
creation_date = "2021-03-01 17:36:39"
modification_date = "2021-03-04 07:48:37"
date = "2021-03-01 17:36:39"
language = "unknown"
view_permission = "tiki_p_view"
geo_located = "n"
allowed_groups = "tokenrpqtevrqrpatuytyuxdxwwwpbtaafzvt..."
relations = "tokenxxcppaqxabzebbwrubccxedudrbrrbup"


Aoutch...
I tested on 2 different Tikis and get the same results. (I don’t use a lot those so I check on tiki.org websites - Tiki22)

May be on of those can help ?

relations => Array (10)
  0 => "tiki.link.alias:wiki page:One-click i..."
  1 => "tiki.link.alias:wiki page:ControlPanel"
  2 => "tiki.link.alias:wiki page:Control Panels"
  3 => "tiki.link.alias:wiki page:Control Panel"
  4 => "tiki.link.alias:wiki page:One-click i..."
  5 => "tiki.link.alias:wiki page:Auto installer"
  6 => "tiki.link.alias:wiki page:Auto-instal..."
  7 => "tiki.link.alias:wiki page:Auto instal..."
  8 => "tiki.link.alias:wiki page:Auto-installer"
  9 => "tiki.link.alias:wiki page:ControlPane..."

relations => Array (1)
  0 => "tiki.wiki.include.invert:wiki page:Co..."

relations => Array (1)
  0 => "tiki.link.related.invert:wiki page:Br..."


Or may be you have a setting that "obscur" it ?


posts: 8356 Israel

Welcome 😉

I would use {{page}} but you may have to set it in a template (not directly in the wiki page).

posts: 26
Bernard Sfez / Tiki Specialist wrote:
I would use { {page} } (no extra space) but you may have to set it in a template (not directly in the wiki page).


I think I'm getting closer. I still can't figure out what the qualifier should be (below in red). Is there a way to specify the qualifier to match anything, like a wildcard?

{LIST()}
{filter relation="{{page}}" objecttype="wiki page" qualifier="tiki.some.semantic.link"}
{output(template="debug")}
{LIST}

posts: 126729 United Kingdom

I think it's probably tiki.link.semantic or something, there's a list of them here: Object Attributes and Relations.

To check have a look in your database in the table tiki_object_relations, hmm there are lots of tiki.link.xxxx ones in mine, so actually i expect you want tiki.link.alias for this?

HTH

posts: 26
Thank you Jonny and Bernard. I'll take a look at my database and post what I find here.