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

Cardinality validation query selects wrong column #327

Open
Ereski opened this issue Nov 18, 2019 · 0 comments
Open

Cardinality validation query selects wrong column #327

Ereski opened this issue Nov 18, 2019 · 0 comments

Comments

@Ereski
Copy link
Contributor

Ereski commented Nov 18, 2019

In the following example:

Term: bar

Term: foo
    Concept Type: Integer (Type)

Fact Type: bar taints foo
    Necessity: each bar taints at least one foo

sbvr-compiler generates the following validation query:

SELECT NOT EXISTS (
        SELECT 1
        FROM "bar" AS "bar.0"
        WHERE NOT EXISTS (
                SELECT "bar.0-taints-foo.1"."foo"
                FROM "bar-taints-foo" AS "bar.0-taints-foo.1"
                WHERE "bar.0-taints-foo.1"."bar" = "bar.0"."id"
        )
) AS "result";

The innermost query selects bar-taints-foo.foo, which does not exist. The correct column is bar-taints-foo.taints-foo.

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

1 participant