JanusGraph / JanusGraph/janusgraph

QueryUtil::constraints2QNF does not always generate QNF condition

Open
#2,775 0 comments 0 reactions 0 assignees View on GitHub
kind/bug/possible
Dominant language
Java
Stars
5.8k
Forks
1.2k
Avg merge
13h 53m
Merged PRs (30d)
6

Description

As discussed https://github.com/JanusGraph/janusgraph/pull/2774#discussion_r693342967, QueryUtil::constraints2QNF does not necessarily generate a QNF form. For example, it might generate a condition `PredicateCondition1 OR (PredicateCondition2 AND PredicateCondition3)`, which is not in QNF form, JanusGraph variant of CNF (conjunctive normal form) with negation inlined.

At the moment, I am not sure whether and why we MUST generate a QNF form. If so, we need to fix QueryUtil::constraints2QNF method. The above example should be transformed to `(PredicateCondition1 OR PredicateCondition2) AND (PredicateCondition1 OR PredicateCondition3)`.

If we don't really have to generate a QNF form, we should rename the method (and may need to rewrite some other places too) to avoid confusion.

Contributor guide

Open the contributing guide

Research direction

Start with QueryUtil::constraints2QNF and read the linked pull-request discussion for the context behind the QNF requirement. Determine whether JanusGraph requires this method to produce QNF or whether its name and related uses should change. Done means either the example is transformed into the stated QNF form with suitable coverage, or the naming and affected references are consistently corrected.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.