atlanmod / emfviews

Lightweight views for your models
https://www.atlanmod.org/emfviews/
Eclipse Public License 2.0
15 stars 3 forks source link

Inherited classes do not virtualize all attributes from the parent class #12

Open jameswpm opened 1 year ago

jameswpm commented 1 year ago

Eclipse version: Eclipse Modeling Tools Version: 2022-12 (4.26.0)

EMF Views version: 0.4.0

Branch (when relevant): master

Repeatable: Always

Problem description When the metamodel includes some inheritance, selecting attributes from parent classes for virtualization is impossible. The problem arises both in the autocomplete function of VPDL language and when using the "*" operator that should virtualize everything from the class (including inherited attributes)

Used metamodels/models (when relevant) The metamodel used to reproduce the problem is adapted from the one used in the EMF Views examples but includes the mentioned inheritance. It is published in the examples repository for download if needed.

To Reproduce Steps to reproduce the behavior:

  1. Create the VPDL file like the one below:
    
    create view getJournal as

select publications.Journal.desc, publications.Publications.journals,

from 'http://publications' as publications,


2. The VPDL file will raise the error indicating the inexistence of the "desc" attribute and will not generate the viewpoint. Trying `publications.Publication.desc` will work fine, meaning the problem with the inherited class "Journal."

3.  Another option to show the problem is to try to use `publications.Journal.*,` which will not raise errors in the VPDL and viewpoint generation
4.  See the error (screenshot below) when opening the view within MoDisco Browser. The Journal element is correctly virtualized but contains no attribute from the parent class. 

**Expected behavior**
The view should include parent class attributes, allowing users to navigate in the view like it happens in the original model.

**Screenshots**

Metamodel used in the example
![2023-03-07_09-49](https://user-images.githubusercontent.com/10038328/223371194-42aeddd1-842e-4441-8ab5-a02b712bafbb.png)

VPDL file with the error when trying to access inherited attributes
![2023-03-07_09-45](https://user-images.githubusercontent.com/10038328/223370385-9d0f28e4-a74b-48da-9b57-5c43e5d86bd7.png)

MoDisco browser showing only `Journal` attributes without the attributes from parent `Publication` class
![2023-03-07_09-46](https://user-images.githubusercontent.com/10038328/223370380-af23c074-77d9-4aa2-9495-870ac79878ae.png)
jameswpm commented 1 year ago

The problem is solved in the AIDOaRt branch

The issue will be closed when changes are merged into the master branch.