Toy example: School
The school example features a simple EMF model and some simple graph patterns to show the very basics of using EMF-IncQuery.
Obtaining the example
- Check out the source projects from this Subversion folder: https://viatra.inf.mit.bme.hu/svn/incquery/trunk/examples/code/school/
- In the workspace of your runtime Eclipse, check out the example project: https://viatra.inf.mit.bme.hu/svn/incquery/trunk/examples/models/school/
Source projects
- school/
This project contains the EMF metamodel for representing schools, years, classes, students, teachers, and courses. Also accompanied by the projects school.edit and school.editor, automatically generated by EMF.
- school.incquery/
This is the EMF-IncQuery project, that hosts the graph patterns as well as the generated Eclipse plug-in code. Important locations:
- models/vtcl/
Put your graph patterns in this folder in .vtcl format. The example ships with a file defining some simple queries.
- models/model.vpml
A Viatra2 model space that can help you test and debug your graph patterns before code generation. If you are not familiar with Viatra2, you can ignore this file.
- models/generator.incquery
This is the EMF-IncQuery generator model. Right click and issue "EMF-IncQuery / Generate EMF-IncQuery Source Code" to generate Java code from the graph patterns.
- src-gen/
Generated Java code will go here.
- src/
It is possible to put your own code here, and it will be left intact by the code generator; although the folder is currently unused.
- school.incquery.ui.sample/
This is the sample UI integration project, automatically generated by issuing "EMF-IncQuery / Generate Sample UI project for EMF-IncQuery" on the generator model. It invokes EMF-IncQuery to evaluate graph patterns in your model when you right-click a .school file.