Skip to content

Commit

Permalink
Finalize release 2.7
Browse files Browse the repository at this point in the history
This change adds a missing artifact to archive by the builds and adds a
few minor documentation updates.
  • Loading branch information
ujhelyiz committed Mar 9, 2022
1 parent b175687 commit 5ba6221
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ pipeline {
archiveArtifacts artifacts: 'releng/org.eclipse.viatra.update/target/org.eclipse.viatra.update-*.zip'
archiveArtifacts artifacts: 'query/tests/org.eclipse.viatra.query.rcptt/org.eclipse.viatra.query.rcptt.tests/target/results/**'
archiveArtifacts artifacts: 'releng/org.eclipse.viatra.docs/target/reference/api/**'
archiveArtifacts artifacts: 'query/tests/org.eclipse.viatra.query.runtime.cps.tests/BasicCpsTest_coverage.html'
javadoc javadocDir: 'releng/org.eclipse.viatra.docs/target/reference/api', keepAll: false
junit testResults: '**/tests/**/target/surefire-reports/*.xml'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,17 @@ The most basic pattern constraints are type declarations: use EClasses, ERelatio
4. In the above constraints, wherever you could reference a variable in a pattern body, you can also use:
* Constant literals of primitive types, such as `10`, or `"Hello World"`.
* Constant literals of enumeration types, such as `MyEEnum::MY_LITERAL`
* Java constants, more specifically, public static final fields can be represented after the java keyword, such as `java Integer::MAX_VALUE`.
* Aggregation of multiple matches of a called pattern into a single value, in a syntax analogous to negative pattern calls:
* The simplest case is match counting: `howManyNeighbors == count find neighborPattern(myEntityVariable, _);`
* Since v1.4, we provide additional out-of-the-box aggregators. `sum` computes the sum of numbers. `min`/`max` select the smallest / greatest of a nonempty bag of number, date or string values. Unlike match counting, these aggregators require a marker symbol `#` to indicate which parameter of the called pattern shall be aggregated (e.g. summed).
* `ageOfOldestFriendOfPerson == max find friendsAge(person, _friendOfPerson, #ageOfFriend);`
* Attribute expression evaluation: the `eval()` construct lets you compute values by Java (actually https://www.eclipse.org/xtend/[Xbase]) expressions referencing variables of EDataTypes and java values.
* `qualifiedName == eval(parentName + "." + simpleName);`
* The Java types of variables are inferred based on the EMF Ecore specification (using the generated Java classes)
* `eval unwind (...)` lets you compute values for each member of a Set object
* `eval unwind (...)` lets you compute values for each member of a Set object (available since version 2.7)
* The returned set *should not* contain duplicate values. Adding duplicate values would not cause duplicate results in the match set of the pattern but increases processing time.
* As of version 2.7 the functionality was not tested with large sets returned. If such cases result in slow query evaluation, please open a bug report with as much details as possible to help finetuning the responsible algorithms.
5. Additional attribute constraints using the check() construct, similarly to eval():
* `check(aNumberVariable > aStringVariable.length());`
* Semantically equivalent to `true == eval(aNumberVariable > aStringVariable.length());`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ ifndef::imagesdir[:imagesdir: {rootdir}/../images]

= VIATRA 2.7

Release date:: 2022-03-xx
Release date:: 2022-03-16
More information:: https://projects.eclipse.org/projects/modeling.viatra/releases/2.7.0

== New and Noteworthy

In addition to bugfixes, VIATRA 2.7 introduces a new language feature: now it is possible to reference Java constants, more precisely, public static final fields of Java classes from pattern specifications.
In addition to bugfixes, VIATRA 2.7 introduces two new language features: the capability to reference *Java constants*, and the use of *eval unwinding*.

For the first case, Java constants more precisely, public static final fields of Java classes from pattern specifications everywhere where variables or constant literals can be used.

[source,vql]
----
Expand All @@ -19,7 +21,7 @@ pattern maxInteger(value : java Integer) {
}
----

Another new language feature in version 2.7 is eval unwinding: it is now possible to return multiple different values from any given attribute value. This feature is useful for extracting data from otherwise unstructured information, e.g. multiple URLs from a specific documentation field.
Eval unwinding allows the processing of collections inside pattern bodies: by writing a specific eval expression with the marked with the `unwind` keyword, the returned Set is processed one by one (as separate matches). This feature is useful for extracting data from otherwise unstructured information, e.g. multiple URLs from a specific documentation field.

[source,vql]
----
Expand Down

0 comments on commit 5ba6221

Please sign in to comment.