| Duplicate sublines in cross table [message #1711493] |
Fri, 16 October 2015 12:44  |
Denis Nikiforov 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 #1711788 is a reply to message #1711493] |
Mon, 19 October 2015 16:50   |
|
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  |
Denis Nikiforov 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
|
|
|
Powered by
FUDForum. Page generated in 0.01773 seconds