Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Duplicate sublines in cross table
Duplicate sublines in cross table [message #1711493] Fri, 16 October 2015 12:44 Go to next message
Denis Nikiforov is currently offline Denis NikiforovFriend
Messages: 337
Registered: August 2013
Senior Member
Hi

Let for simplicity there is a model with articles, experts and comparisions. Each expert may compare any two articles. Each comparision has the following attributes: expert, fristArticle, secondArticle, rating.

I need to create a cross table for such comparisions with the following structure:

Columns: Article1 | Article2 | Article3 | ...

Lines:
Expert1
- Article1
- Article2
- Article3
- ...
Expert2
- Article1
- Article2
- Article3
- ...
...

To display comparisions I created the intersection:
Domain Class: Comparision
Line Finder Expression: aql:self.firstArticle
Column Finder Expression: aql:self.secondArticle

The problem is that each comparision is shown for each expert despite it related only to one expert.
Is it possible to bind cells not only to sublines, but also to parent lines?

This is the first question.


Actually I resolved my issue by means of some hacks. I've created the followng intersection
Domain Class: Model (root object of my model)
Line Finder Expression: aql:self.articles
Column Finder Expression: aql:self.articles
Label Expression: aql:self.getComparision(line, column).rating

getComparision() service gets the parent line which targets Expert. And so I can display right rating.

It works. But I can't edit comparisions or create a new ones. Because Label Edit and Create Cell Tools doesn't have line and column variables. Instead they has only lineSemantic and columnSemantic. And I can't get neither parent line, nor expert targeted by parent line. I can't determine to which expert this rating must be related.

And so my second question: is it possible to pass line and column variables to these tools. Or is possible to pass to them a semantic element of the parent line? Or is there another solution for my problem?

Thanks!

[Updated on: Mon, 19 October 2015 05:23]

Report message to a moderator

Re: Duplicate sublines in cross table [message #1711497 is a reply to message #1711493] Fri, 16 October 2015 13:00 Go to previous messageGo to next message
Denis Nikiforov is currently offline Denis NikiforovFriend
Messages: 337
Registered: August 2013
Senior Member
Another solution for my problem is to allow to refer a current object (comparision) in Precondition Expression.
But Precondition Expression has only the following variables: table, line, lineSemantic, column, columnSemantic. I can't refer comparision here.

[Updated on: Mon, 19 October 2015 05:24]

Report message to a moderator

Re: Duplicate sublines in cross table [message #1711499 is a reply to message #1711497] Fri, 16 October 2015 13:04 Go to previous messageGo to next message
Denis Nikiforov is currently offline Denis NikiforovFriend
Messages: 337
Registered: August 2013
Senior Member
One more solution for me is to find rigth comparision in "Associated elements expression". But I can't refer to these associated elements in Label Edit or Create Cell Tools.
Re: Duplicate sublines in cross table [message #1711500 is a reply to message #1711499] Fri, 16 October 2015 13:20 Go to previous messageGo to next message
Denis Nikiforov is currently offline Denis NikiforovFriend
Messages: 337
Registered: August 2013
Senior Member
And one more solution for me is to pass somehow a current DCell view into external Java action. But I don't understand how to achive this.
Re: Duplicate sublines in cross table [message #1711727 is a reply to message #1711500] Mon, 19 October 2015 12:58 Go to previous messageGo to next message
Denis Nikiforov is currently offline Denis NikiforovFriend
Messages: 337
Registered: August 2013
Senior Member
I've found a solution. At first I thought that it's too complex. But now I think it's a best approach.

One need to create:
1) a new domain class ExpertArticle with two references: expert and article.
2) a new singleton class which either creates on demand new ExpertArticle object (for the pair of Expert and Article) or returns an existing one
3) And nested line must be bound to ExpertArticle instead of Article.
Re: Duplicate sublines in cross table [message #1711788 is a reply to message #1711493] Mon, 19 October 2015 16:50 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 570
Registered: May 2011
Senior Member
Hi Denis,

You will find my comments below.

Regards,
Steve

Le 16/10/2015 14:44, Denis Nikiforov a écrit :
> Hi
>
> Let for simplicity there is a model with articles, experts and
> comparisions. Each expert may compare any two articles. Each comparision
> has the following attributes: expert, fristArticle, secondArticle, rating.
>
> I need to create a cross table for such comparisions with the following
> structure:
>
> Columns: Article1 | Article2 | Article3 | ...
>
> Lines:
> Expert1
> - Article1
> - Article2
> - Article3
> - ...
> Expert2
> - Article1
> - Article2
> - Article3
> - ...
> ..
>
> To display comparisions I created the intersection:
> Domain Class: Comparision
> Line Finder Expression: aql:self.firstArticle
> Column Finder Expression: aql:self.secondArticle
>
> The problem is that each comparision is shown for each expert despite it
> related only to one expert.
> Is it possible to bind cells not only to sublines, but also to parent
> lines?
In the advanced tab, you have a "Precondition expression" field. As you
can see in the help, there is a line variable that returns the current
DLine element. You should use this variable to access the parent line
and filter the proper comparison.
>
> This is the first question.
>
>
> Actually I resolved my issue by means of some hacks. I've created the
> followng intersection
> Domain Class: Model (root object of my model)
> Line Finder Expression: aql:self.articles
> Column Finder Expression: aql:self.articles
> Label Expression: aql:self.getComparision(line, column).rating
>
> getComparision() service gets the parent line which targets Expert. And
> so I can display right rating.
>
> It works. But I can't edit comparisions or create a new ones. Because
> Label Edit and Create Cell Tools doesn't have line and column variables.
> Instead they has only lineSemantic and columnSemantic. And I can't get
> neither parent line, nor expert targeted by parent line. I can't
> determine to which expert this rating must be related.
>
> And so my second question: is it possible to pass line and column
> variables to these tools. Or is possible to pass to them a semantic
> element of the parent line? Or is there another solution to my problem?
Indeed the line and column element could be among the variables in these
tools. Can you add a comment to Bugzilla 466412
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=466412) please?

For the edition it should not be an issue, as with the previous answer
you now have only one comparison presented in the cell. Therefore you
can use the "element" variable to edit it.
However, you would need a "line" variable. I guess you could workaround
it by creating a comparison for each combinaison of article, for each
Expert.
>
> Thanks!


--
Steve Monnier - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Duplicate sublines in cross table [message #1711845 is a reply to message #1711788] Tue, 20 October 2015 06:27 Go to previous message
Denis Nikiforov is currently offline Denis NikiforovFriend
Messages: 337
Registered: August 2013
Senior Member
Hi Steve

Thanks for answer!

> In the advanced tab, you have a "Precondition expression" field. As you
> can see in the help, there is a line variable that returns the current
> DLine element. You should use this variable to access the parent line
> and filter the proper comparison.

Yes, I can access lines and columns in precondition. But I can't access semantic object of the current cell. Because self variable is bound to current line' semantic object.
I think that for domain based intersections self variable must refer domain object instead of current line.
In other words, in the example self refers Article instead of Comparision. I think it's wrong...
So I can't use a precondition...

And also I think that than I select a cell in cross table I must see Comparision in Property View. But I see Article (current' line semantic object) instead.

> Indeed the line and column element could be among the variables in these
> tools. Can you add a comment to Bugzilla 466412
> (https://bugs.eclipse.org/bugs/show_bug.cgi?id=466412) please?

Yep, I've added.

> For the edition it should not be an issue, as with the previous answer
> you now have only one comparison presented in the cell. Therefore you
> can use the "element" variable to edit it.
> However, you would need a "line" variable. I guess you could workaround
> it by creating a comparison for each combinaison of article, for each
> Expert.

As I see, there are two problems with this solution.
I can't bind cell to right Comparision, because postconditions doesn't work as expected (see above).
The lists of articles and experts are very dynamic and I would like to avoid creating comparisions for each combination...

If it will be interesting for somebody, my current implementation is available here: https://github.com/AresEkb/ahp
Actually the model is a little bit more generic. It's not just about experts and articles, it implements a very simplified version of https://en.wikipedia.org/wiki/Analytic_hierarchy_process
Previous Topic:Draw location for new nodes
Next Topic:Auto-completion for semantic property
Goto Forum:
  


Current Time: Fri Sep 01 18:12:02 GMT 2023

Powered by FUDForum. Page generated in 0.01773 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top