Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A query language to get classes from model #48

Open
mertserezli opened this issue Dec 14, 2018 · 9 comments
Open

A query language to get classes from model #48

mertserezli opened this issue Dec 14, 2018 · 9 comments

Comments

@mertserezli
Copy link

mertserezli commented Dec 14, 2018

Hello,
I am trying to build an UI for a project that uses pyecore. The users want to get classes by a query.
I would like that feature.
Thanks!

@mertserezli mertserezli changed the title Aquer A query language to get classes from model Dec 14, 2018
@aranega
Copy link
Member

aranega commented Dec 14, 2018

Hi @mertserezli !

Thanks a lot for the idea! Indeed, it would be very great to have this feature into PyEcore. I try to start a student project on translation from OCL to Python that could provide a nice way of expressing queries on models. Regarding the queries and the hypotethical language, what are the expressions/constraints you need to express? If there is not so much complex queries, a first simple version could be easy to build.

@mertserezli
Copy link
Author

@aranega

  • Pick packages and its contents
  • Pick classes by names
  • Pick class's super classes
  • Pick class's sub classes
  • Pick class's with a specified function

@aranega
Copy link
Member

aranega commented Dec 14, 2018

Got it, thatnks for the examples. Did these queries are 'frozen', I mean, do your users need to write the queries themselves of do you need to write the query, your users could select bag of elements (or the full model) and select one of your queries? (just to know, as Python is quite expressive, with few methods in the later case, it would be possible to have a quick and flexible framework). Sorry for all these questions.

@mertserezli
Copy link
Author

The users should write the queries. Those queries are not frozen. Expressiveness is important here.

@aranega
Copy link
Member

aranega commented Dec 14, 2018

Ok, I got i, so it means that the user is familiar with the metamodel they will build the queries on. I'll keep this in mind and try to find a solution.
The thing is always delicate as it should be simple enough to let you express complex queries as simple as possible. I think a pure external DSL would not be a good idea as it would require the implementation of many things Python provide you for free to gain maximum expressiveness.

@CFAndy
Copy link
Contributor

CFAndy commented Dec 25, 2018

@mertserezli I think use antlr4 + pyecore is pretty easy to add a query front end. I created one for our DSL model.

@annighoefer
Copy link
Contributor

I know this is an older post, but I might steer your attention towards Essential Object Query (EOQ):

https://gitlab.com/eoq/essentialobjectquery

and its Python implementation, which is based on pyecore:

https://gitlab.com/eoq/py/pyeoq

EOQ is a query and transaction system for domain-specific models, which solved most of our issues when working with complex-domain specific models.

@aranega
Copy link
Member

aranega commented Jun 9, 2020

Wow! That's... just ... amazing! Thanks a lot for the links. I hesitate to put a section in the readme about projects using pyecore. Would it be ok if I list EOQ and the python implementation there?

@annighoefer
Copy link
Contributor

Please feel free to do so. The more people use EOQ, the better it (hopefully) becomes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants