Jump to content

Extension talk:SemanticActions/Flow

About this board

How to use this extension with cargo ?

3
89.93.242.157 (talkcontribs)

Hello,

I want to use this extension with cargo ? Is it possible ? What do I modify to achieve this ?

Regards

JMU

Darenwelsh (talkcontribs)

That's still a work in progress. Seehttps://github.com/enterprisemediawiki/SemanticActions/issues/21 for some of the work necessary. That said, you should be able to use Actionable board cargo instead of the Actionable board template to try Cargo out.

One important thing to note is that Cargo has one flaw for this use case, in my opinion. Cargo queries do not include results where values are redirects.

Let's say there's a page called Action:60 and it has the value of "Puppy" as a value for Related_article. But "Puppy" is just a redirect to the page called "Dog". Action:60 will not show up in the results of a query filtering on the value of the redirected-to page "Dog".

Such a query would look like the following example.

{{#cargo_query:
tables=Actionable
|fields=Action_ID, _pageName, Related_article__full = Related article
|where=Related_article HOLDS 'Dog'
|group by=Related_article
}}

Demo

Cargo

Query for "Puppy" value of Related_article

{{#cargo_query: tables=Actionable |fields=Action_ID, _pageName, Related_article__full = Related article |where=Related_article HOLDS 'Puppy' |group by=Related_article }}

Query for "Dog" value of Related_article

{{#cargo_query: tables=Actionable |fields=Action_ID, _pageName, Related_article__full = Related article |where=Related_article HOLDS 'Dog' |group by=Related_article }}

SMW

Query for "Puppy" value of Related_article

{{#ask: [[Related article::Puppy]] |?Action ID |?Related article }}

Query for "Dog" value of Related_article

{{#ask: [[Related article::Dog]] |?Action ID |?Related article }}

Discussion

This is because Cargo treats a redirect to a page and that redirect-to page as separate entities. Technically speaking, they are. But when using SMW they are treated as equal. We have 8+ years of treating redirects as equal to the redirected-to pages.

This means two very important things if you are going to use Cargo:

  1. Users cannot use redirect pages as values in cargo properties if they want to query based on the redirect-to page.
  2. Any time a page is moved and a redirect is left behind, you must use Special:ReplaceText to find that pagename in any template fields and updated it.

See related discussion topic (mediawiki.org).

89.93.242.157 (talkcontribs)

















thanks for your quick answer.

Regards

JMU

Reply to "How to use this extension with cargo ?"
There are no older topics