Skip to content

Releases: vaticle/typeql

TypeQL 2.24.0

20 Sep 15:22
a3847bf
Compare
Choose a tag to compare

TypeQL Grammar and Language Library distributions for Java

<repositories>
    <repository>
        <id>repo.vaticle.com</id>
        <url>https://repo.vaticle.com/repository/maven/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.vaticle.typeql</groupId>
        <artifactId>typeql-grammar</artifactId>
        <version>2.24.0</version>
    </dependency>
    <dependency>
        <groupId>com.vaticle.typeql</groupId>
        <artifactId>typeql-lang</artifactId>
        <version>2.24.0</version>
    </dependency>
</dependencies>

TypeQL Grammar distribution for Python

Available through https://pypi.org

pip install typeql-grammar==2.24.0

New Features

  • Introduce expressions and computed value variables in typeql-rust

    We introduce in typeql-rust the ability to perform arithmetic computation and store the results in a "value variable" - denoted by a preceding ?, the same as introduced in typeql-java by #260.

    All redundant parenthesis from original query will not persist in the string representation of the parsed expression anymore. If we get this query:

    match
      $p isa person, has salary $s;
      ?net = (($s - 12500) * 0.8 + 12500);
    

    it will be transformed into

    match
      $p isa person, has salary $s;
      ?net = ($s - 12500) * 0.8 + 12500;
    
  • Implement formatted code accessor for the TypeQL/common error macro

    We implement the format_code() accessor for the generated error types, as well as expose the PREFIX string.

  • Debug formatting Errors
    We improve the debug formatting for macro-generated errors, by including more detail about the error. This solves issue vaticle/typedb-driver-rust#44

Bugs Fixed

  • Sanitise rust macros to avoid forcing user's environment

    Problem is described in #298: we have macros that need access to other items in our crate. Paths to these items were not absolute, and users had to import that particular items and were able to use their own objects with the same names and use it in the macros. Now all paths are absolute, based on the $crate metavariable.

  • Relation variable name in rule 'then' must not be present.

    Check that relation variables used to infer new relations in then clause should be anonymous

  • Implement common error traits for Error

    We implement cloning, equality comparison, and the standard error trait for the main Error type.

  • Fix Rust parser for definables and variables

    While parsing Variable, visit_pattern_variable() panicked because of incorrect argument format. We fixed it and added unit tests. Similar errors ware while parsing definables and patterns.

Code Refactors

Other Improvements

  • Enable Rust crate deployment

    We enable the TypeQL Rust crate deployment jobs in CI.

  • Remove header from template

TypeQL 2.18.0

30 May 16:54
8dd5504
Compare
Choose a tag to compare

TypeQL

This release includes exciting changes such as expression-based computation (for an initially limited set of functions) and new annotation for attribute ownership: @unique.

TypeQL Grammar and Language Library distributions for Java

<repositories>
    <repository>
        <id>repo.vaticle.com</id>
        <url>https://repo.vaticle.com/repository/maven/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.vaticle.typeql</groupId>
        <artifactId>typeql-grammar</artifactId>
        <version>2.18.0</version>
    </dependency>
    <dependency>
        <groupId>com.vaticle.typeql</groupId>
        <artifactId>typeql-lang</artifactId>
        <version>2.18.0</version>
    </dependency>
</dependencies>

TypeQL Grammar distribution for Python

Available through https://pypi.org

pip install typeql-grammar==2.18.0

New Features

  • Introduce expressions and computed value variables

    We introduce the ability to perform arithmetic computation and store the results in a 'value variable' - denoted by a preceding ?. For example:

    match
      $x isa triangle, has base $b, has height $h;
      ?area = 0.5 * $b * $h;
    

    Or through the java api:

    TypeQLMatch query = match(
            cVar("x").isa("triangle").has("base", cVar("b")).has("height", cVar("h")),
            vVar("area").assign(Expression.constant(0.5).mul(cVar("b").mul(cVar("h"))))))
    );

    Rules now also support value-variable conclusions:

    define
    rule computation-cost-dollars-to-pounds: when {
      $c isa computation, has cost-dollars $c;
      $_ isa exchange-rate, has name "dollar-pound", has rate $rate;
      ?pounds = $rate * $c;
    } then {
      $c has cost-pounds ?pounds;
    };
    

    The expression on the right hand side of an assignment can be functions, operations, variables or constants:

    • This PR implements infix operators: +, -, *, /, ^, %,
    • This PR implements prefix functions: min, max, floor, ceil, round, abs
    • This PR implements parantheses: (...) and instantiation of constants eg. 12, 0.25, false, "abc", etc.

    These constructs are currently defined on double and long valued Attribute instances or Value instances.

    The language implements order-of-operations for infix operators in this order: (), ^, *, |, %, +, -.

    Deprecation warnings

    • Using = can should no longer be used to denote value-equality. = now represents value-assignment, with == representing value equality. For the time being, concept variables $x will still support the old syntax, = and the new ==, however expect $x = to be removed from the language in future releases.

    Breaking changes

    • var is no longer part of the TypeQL builder API, being replaced by cVar to create concept variables ($x) and vVar to create a value variable (?y).
  • Implement unique annotation in TypeQL Rust

    We generalise the annotation syntax and parsing to be able to handle a new type of annotation: the @unique annotation, which is available only on the owns constraint: define person sub entity, owns email @unique;

    The @unique annotation has been introduced first in TypeQL Java in #273.

  • Introduce unique annotation in TypeQL Java

    We generalise the annotation syntax and parsing to be able to handle a new type of annotation: the @unique annotation, which is available only on the owns constraint:

    define
    person sub entity, owns email @unique;
    email sub attribute, value string;
    

    This annotation indicates that any emails a person owns must be unique to that person. It does not place any restrictions on the number of emails any given person may own.

    The language builder API has also been updated to use a generalised form of any number of annotations, rather than having a particular boolean per annotation type (now, pass annotation UNIQUE or KEY instead of booleans).

Bugs Fixed

  • Fix rule validation

    While parsing a rule with has and without relation in then part expect_valid_inference() function panicked. Now it returns an Error.

  • Fix TypeQL Python build

    We fix the issue with grammar-python producing empty pip packages.

Code Refactors

  • Remove unnecessary parentheses

    As per the Rust compiler:

    warning: unnecessary parentheses around type
    
        |
    306 | impl<const N: usize> From<([(&str, token::Order); N])> for Sorting {
        |                           ^                         ^
        |
        = note: `#[warn(unused_parens)]` on by default
    help: remove these parentheses
        |
    306 - impl<const N: usize> From<([(&str, token::Order); N])> for Sorting {
    306 + impl<const N: usize> From<[(&str, token::Order); N]> for Sorting {
        |
    

Other Improvements

  • Update release notes workflow

    We integrate the new release notes tooling. The release notes are now to be written by a person and committed to the repo.

  • Don't use bazel-cache for building all targets, which includes Python targets

  • Set up remote bazel cache

TypeQL 2.17.0

24 Apr 14:23
faf41f4
Compare
Choose a tag to compare

TypeQL Grammar and Language Library distributions for Java

<repositories>
    <repository>
        <id>repo.vaticle.com</id>
        <url>https://repo.vaticle.com/repository/maven/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.vaticle.typeql</groupId>
        <artifactId>typeql-grammar</artifactId>
        <version>2.17.0</version>
    </dependency>
    <dependency>
        <groupId>com.vaticle.typeql</groupId>
        <artifactId>typeql-lang</artifactId>
        <version>2.17.0</version>
    </dependency>
</dependencies>

TypeQL Grammar distribution for Python

Available through https://pypi.org

pip install typeql-grammar==2.17.0

New Features

  • Update rule printing in TypeQL Rust

    We update the way rules and queries are printed in the TypeQL rust implementation, following the format introduced in #275.

  • Export error enum generation macro

    We repackage the error_message! macro to be importable by other crates. That involved packaging all other macros used by error_messages! as private methods and internal rules within error_messages! (e.g. max_code() and @format).

  • Idiomatic Rust error message enum

    We replace the Message error struct with the TypeQLError enum, which greatly simplifies error handling on the user side.

  • Pattern normalisation

    We implement pattern normalisation: a conjunction or a disjunction becomes a flat disjunction of conjunctions. Negations are not expanded.

  • Enable BDD testing

    We enable cucumber BDD tests and add them to the CI.

Bugs Fixed

Code Refactors

  • Simplify rule pretty printing

    We update and simplify the way rules are pretty-printed. Rules now print the when inline and produce a more compact output:

    define
    rule a-rule: when {
        $x isa person;
        not {
            $x has name "Alice";
            $x has name "Bob";
        };
        {
            ($x) isa friendship;
        } or {
            ($x) isa employment;
        };
    } then {
        $x has is_interesting true;
    };
    
  • Migrate TypeQL rust to use pest for parsing

    We replace the parser generator library that we use from antlr-rust to pest.

Other Improvements

  • Update typedb-common

  • Trigger release

  • Update VERSION to 2.17.0

  • Regenerate maven artifacts

  • Fix build

  • Update dependencies

  • Update crate assembly

    We update dependencies and explicitly specify the root of the typeql-rust crate. This allows us to have non-lib.rs root to our library in the assembled crate. Cf. vaticle/bazel-distribution#366

  • Migrate to crate-universe

    We update dependencies and the Bazel build files to reflect the new style of crate imports using crate-universe instead of cargo-raze.

TypeQL 2.14.0

24 Nov 15:47
Compare
Choose a tag to compare

TypeQL Grammar and Language Library distributions for Java

<repositories>
    <repository>
        <id>repo.vaticle.com</id>
        <url>https://repo.vaticle.com/repository/maven/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.vaticle.typeql</groupId>
        <artifactId>typeql-grammar</artifactId>
        <version>2.14.0</version>
    </dependency>
    <dependency>
        <groupId>com.vaticle.typeql</groupId>
        <artifactId>typeql-lang</artifactId>
        <version>2.14.0</version>
    </dependency>
</dependencies>

TypeQL Grammar distribution for Python

Available through https://pypi.org

pip install typeql-grammar==2.14.0

New Features

  • Regex validation

    We perform validation of the regex in a RegexConstraint.

  • Parameter and structure validation in TypeQL Rust

    We implement methods that allow us to check the validity of parsed and constructed typeql queries and patterns, and that provide a report of all the errors discovered during validation.

  • Enable disjunctions in rules
    Enables disjunctions in rules, and updates rule-validation accordingly.

Bugs Fixed

Code Refactors

  • Delete Rust dependencies that were added to patch issue building on M1 Macs

    We deleted some unnecessary Rust dependencies that were added to patch an issue building on M1 Macs in #250.

  • Add transitive Rust deps that aren't included by default on M1 Macs

    We added core-foundation-sys and libc explicitly as Rust dependencies. They are conditional transitive dependencies of antlr-rust and chrono respectively. Due to vaticle/dependencies#385 they are not included by default.

  • Add Rust IDE sync tool

    We added the Rust IDE sync tool to enable Rust development in IDEs.

Other Improvements

  • bump VERSION to 2.14.0

TypeQL 2.12.0

03 Nov 10:53
Compare
Choose a tag to compare

TypeQL Grammar and Language Library distributions for Java

<repositories>
    <repository>
        <id>repo.vaticle.com</id>
        <url>https://repo.vaticle.com/repository/maven/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.vaticle.typeql</groupId>
        <artifactId>typeql-grammar</artifactId>
        <version>2.12.0</version>
    </dependency>
    <dependency>
        <groupId>com.vaticle.typeql</groupId>
        <artifactId>typeql-lang</artifactId>
        <version>2.12.0</version>
    </dependency>
</dependencies>

TypeQL Grammar distribution for Python

Available through https://pypi.org

pip install typeql-grammar==2.12.0

New Features

  • Implement group and aggregate queries in TypeQL Rust

    We implement grouping and aggregation (e.g. count, mean) support for match queries. This change completes TypeQL parser and builder.

  • Define queries support in TypeQL Rust

    We add support for schema queries, viz. define/undefine, and schema query concepts such as rules.

  • Implement Insert and Delete queries in Rust

    We implement the data write queries, viz. delete, insert, and delete-insert, aka "update".

  • Feature complete match query handling in TypeQL Rust

    We complete the implementation of the match query building and parsing by adding handlers for inequality and string predicates and logical operations (and, or, not).

  • TypeQL Rust prototype

    We implement a subset of the TypeQL parser in Rust. The scope encompasses basic, i.e. non-aggregate, match queries like:

    match
    $brando "Marl B" isa name;
    (actor: $brando, $char, movie: $movie);
    $movie has title $title,
        has release-date 2020-05-07T00:00;
    get $char, $title; sort $title;
    
  • Allow sorting per-variable

    TypeQL can support sorting each variable in either Ascending or Descending order independently. Previously, TypeQL only supported ordering all the variables in the same order.

Bugs Fixed

  • Rule conclusion must explicitly specify role types

    Enforce roles in the conclusion of a rule to be specified.
    Since role-types in rule-conclusion must be unambiguous, best practice dictates the user writes explicit, and not variabilised, roles.

Code Refactors

  • Rust code style refactor

    Refactor the code to be more idiomatic: use established traits and avoid star imports.

  • Remove error propagation and force error handling as early as possible

    We create a macro emulating an unstable try-blocks feature that enables us to restrict the Result<...> return type to fallible function calls only. We also remove error propagation through builder functions.

  • Introduce unformatted toString

    We introduce an unformatted toString method which will not introduce any indentation or newlines.

    This fixes a bug where a user's strings with newlines in them receive indentation in the middle of the attribute. Now, to avoid this visual or downstream effect the API exists to disable newlines and indentation.

  • Rust Architecture Refactor

    We restructure TypeQL Rust for ease of development down the line.

  • Split delete_or_update in the grammar into separate parser rules

    We split the delete and update queries into separate parser rules in the TypeQL grammar, resolving a TODO in the process.

  • Remove obsolete tests

    We remove a test that used to test functionality that is no longer supported, namely, match queries with no named variables.

Other Improvements

  • update release-validate-deps

  • Bump dependencies and python version for GitHub deployment

    We've fixed the Python version learned from the successful GitHub deployment of typedb-common a definite working version of Python for this job.

  • Migrate to Factory

    We've migrated our continuous integration for this repo to Vaticle Factory from Grabl.

  • bump vaticle_typedb_behaviour

  • remove space at end of query

  • bump vaticle_typedb_behaviour

  • Fix toString() spacing

  • reformat toString()

  • update @vaticle_typedb_behaviour dependency

  • sort order defaults to ASC

  • Invert sort exception case

  • Bump typedb-common dependency
    Bump commit-marker to update outdated typedb-common.

  • Update link in README

  • Extend license checkstyle tests and update licenses

    We introduce a test that ensures that the license text is correct.

  • Trigger CI

  • Update link to Rust

  • Temporarily exclude LICENSE file from //rust:checkstyle

  • Add LICENSE file for //rust

  • Add license headers to //rust and fixed checkstyle

  • Merge typeql-lang-rust into typeql repository

  • Add 'rust/' from commit '2d16f83487931c1ef48440a4213760a444e198e8'

  • Temporarily exclude //java/LICENSE from checkstyle_test

  • Update maven snapshot an fixed checkstyle rule

  • Fixed broken automation.yml and bump @vaticle_dependencies

  • Fixed typo in grammar/README.md

  • Merged typeql-lang-java into typeql repository

  • Add 'java/' from commit '931c47b7f76bd50b840038f771c0529fb36e896d'

  • Bump copyright year to 2022 (#11)

  • Bump copyright year to 2022

    We update the copyright header year to 2022.

  • Update keywords to typeql pip and crate package

  • re-release as 2.11.0

  • update VERSION to 2.10.0

  • Fixed Parser logic to capture all error when it fails to parse, by constructing new Lexer and TokenStream each time a parse rule is executed

  • Update @vaticle_dependencies

  • Update @vaticle_dependencies

  • bump VERSION to 2.9.0

  • Update @vaticle_typeql

  • Upgrade to Bazel 5 (#10)

  • Improve error message for an invalid rule has syntax (#9)

  • Fixed test cases in MavenApplicationTest

  • New TypeQL code style: patterns and constraints are printed on new, indented lines

  • Minor cleanups

  • Implement missing BDD step

  • Bazel Cache is disabled temporarily until SSL is fixed

  • Bump VERSION to 2.8.0 and use latest deps

  • Deleted TypeQL Compute language framework

  • Bump @vaticle_typeql

  • Cleaned up import statements

  • Expose TypeQLLexer through public API: TypeQL.lexer()

  • Update dependencies and VERSION to 2.6.1

  • Update environment variable for the 'create notes' script

  • Update @vaticle_dependencies

  • bump dependencies with fixed create-notes script

  • Include @vaticle_typedb_common maven artifacts

  • bump dependencies to released and update VERSION to 2.6.0

  • Update artifacts.snapshot

  • Update build jobs to use Ubuntu 21.04

  • Bring in typeql_grammar as a dependency

  • Add mock modules and assemble/deploy targets

  • Initial project structure

  • Update @vaticle_dependencies and the release notes creation script

  • Strip leading and trailing whitespace prior to parsing (#8)

  • implement new reasoning BDD steps

  • regenerate maven artifacts

  • fix dependency on tag

  • update dependencies and VERSION for 2.4.0

  • update dependencies and VERSION for 2.4.0

  • Allow sorting on multiple variables (#6)

  • regenerate maven artifacts snapshot

  • update VERSION and dependencies

  • Fix error messages being duplicated (#5)

  • add missing exception string argument

  • delete erroneous sout

  • Update README.md

  • New README.md

  • Validate pattern variables have a named variable (#3)

  • cleanup release template

  • load pip deps

  • bump VERSION and deps to released tags

  • Update usage of rules_antlr (#2)

  • Upgrade @rules_antlr usage (#1)

  • Update all dependencies

  • Update @vaticle_dependencies

  • Update @vaticle_dependencies and remove an unneeded assemble_maven field

  • Set repository name to typeql-lang-java

  • Renamed workspace to vaticle_typeql_lang_java

  • Fixed CI and BUILD file

  • Upgrade to vaticle/typedb-behaviour@e3c74f8

  • Fixed CI test-typeql-java

  • Update package structure documentation

  • Deleted //grammar and //plugins package, and change license to Apache

TypeQL 2.9.0

20 May 13:25
Compare
Choose a tag to compare

Distribution (for Java)

<repositories>
    <repository>
        <id>repo.vaticle.com</id>
        <url>https://repo.vaticle.com/repository/maven/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.vaticle.typeql</groupId>
        <artifactId>typeql-grammar</artifactId>
        <version>2.9.0</version>
    </dependency>
</dependencies>

Distribution (for Python)

Available through https://pypi.org

pip install typeql-grammar==2.9.0

New Features

Bugs Fixed

Code Refactors

Other Improvements

  • bump VERSION to 2.9.0

  • Update CI jobs to use Python 3.7

  • Update @vaticle_dependencies

  • Upgrade to Bazel 5

Make the repository use Bazel 5. Bazel 4 and below only work with the deprecated Python 2, which is no longer included in some operating systems such as the latest Mac OS X.

TypeQL 2.8.0

22 Mar 12:01
Compare
Choose a tag to compare

Distribution (for Java)

<repositories>
    <repository>
        <id>repo.vaticle.com</id>
        <url>https://repo.vaticle.com/repository/maven/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.vaticle.typeql</groupId>
        <artifactId>typeql-grammar</artifactId>
        <version>2.8.0</version>
    </dependency>
</dependencies>

Distribution (for Python)

Available through https://pypi.org

pip install typeql-grammar==2.8.0

New Features

Bugs Fixed

Code Refactors

Other Improvements

  • Bazel Cache is disabled temporarily until SSL is fixed

  • bump VERSION to 2.8.0

  • Delete TypeQL Compute grammar from ANTLR grammar file

  • Update environment variable for the 'create notes' script

  • Update @vaticle_dependencies

  • Update artifacts.snapshot

  • Update build jobs to use Ubuntu 21.04

  • Bump @vaticle_dependencies

  • Replace hyphens with underscore for rust targets

  • Complete checkstyle coverage

  • Rename rust grammar package to typeql-grammar

  • Split //grammar into /rust /java and /python

  • Bump @vaticle_dependencies

  • Make typeql-grammar for Rust use the latest assemble_crate

Utilize the latest version of assemble_crate rule which automatically retrieves crate's dependencies from rust_library's deps attribute

  • Assemble and deploy TypeQL Rust package

Assemble and deploy typeql-grammar package to allow Rust migration

  • Update @vaticle_dependencies and the release notes creation script

TypeQL 2.4.0

17 Sep 09:23
6a28e61
Compare
Choose a tag to compare

Distribution (for Java)

<repositories>
    <repository>
        <id>repo.vaticle.com</id>
        <url>https://repo.vaticle.com/repository/maven/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.vaticle.typeql</groupId>
        <artifactId>typeql-grammar</artifactId>
        <version>2.4.0</version>
    </dependency>
</dependencies>

Distribution (for Python)

Available through https://pypi.org

pip install typeql-grammar==2.4.0

New Features

  • Allow sorting on multiple variables
    To enable vaticle/typedb#6434, we add in the grammar that sorting on multiple (ordered) variables is allowed.

Bugs Fixed

Code Refactors

Other Improvements

TypeQL 2.3.0

23 Jul 15:48
Compare
Choose a tag to compare

Distribution (for Java)

<repositories>
    <repository>
        <id>repo.vaticle.com</id>
        <url>https://repo.vaticle.com/repository/maven/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.vaticle.typeql</groupId>
        <artifactId>typeql-grammar</artifactId>
        <version>2.3.0</version>
    </dependency>
</dependencies>

Distribution (for Python)

Available through https://pypi.org

pip install typeql-grammar==2.3.0

New Features

Bugs Fixed

Code Refactors

Other Improvements

TypeQL 2.1.0

20 May 12:05
Compare
Choose a tag to compare

Distribution (for Java)

<repositories>
    <repository>
        <id>repo.vaticle.com</id>
        <url>https://repo.vaticle.com/repository/maven/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.vaticle.typeql</groupId>
        <artifactId>typeql-grammar</artifactId>
        <version>2.1.0</version>
    </dependency>
</dependencies>

Distribution (for Python)

Available through https://pypi.org

pip install typeql-grammar==2.0.1

New Features

  • Assemble and deploy TypeQL Python package
    Assemble and deploy typeql-grammar package to help TypeQL adoption

Bugs Fixed

Code Refactors

Other Improvements

  • Update usage of rules_antlr
    Eliminate possible inconsistencies by loading ANTLR version from a constant

  • Upgrade @rules_antlr usage
    Update usage of @rules_antlr to match latest @vaticle_dependencies

  • Correcting AGPL date in README