Skip to main content
diagram

Predicate Types

TypeDescriptionOperators
Binary predicateCompares a property value against a constant using a comparison operatoreq, ne, gt, ge, lt, le, contains
Composite predicateCombines multiple predicates with logical AND or ORand, or
Unary predicateNegates a predicatenot

Binary Predicate Syntax

A binary predicate compares a single entity property against a value:
{
  "propertyName": { "operator": "value" }
}
Shorthand equality syntax:
{
  "propertyName": "value"
}

Supported Binary Operators

OperatorAliasType SupportDescription
eq==String, number, booleanExact equality comparison. Case-sensitive for strings.
ne!=String, number, booleanInequality comparison.
gt>Number, dateGreater than. Works with Integer, Double, Long.
ge>=Number, dateGreater than or equal.
lt<Number, dateLess than.
le<=Number, dateLess than or equal.
containsStringSubstring matching. Case-sensitive.

Examples

Equality:
{
  "title": { "eq": "System Requirement 1" }
}
Numeric comparison:
{
  "priority": { "gt": 3 }
}
String contains:
{
  "title": { "contains": "safety" }
}

Null Predicates

Check for property presence or absence:
{
  "title": { "ne": null }
}
{
  "title": { "eq": null }
}
Null checks are translated to Polarion Lucene syntax: "eq": null becomes NOT HAS_VALUE:title and "ne": null becomes HAS_VALUE:title. See Lucene Integration.

Composite Predicates

AND Predicate

All conditions must match:
{
  "and": [
    { "status": { "eq": "approved" } },
    { "priority": { "gt": 2 } }
  ]
}

OR Predicate

Any condition may match:
{
  "or": [
    { "status": { "eq": "draft" } },
    { "status": { "eq": "in_review" } }
  ]
}

Nested Composites

AND and OR predicates can be nested for complex logic:
{
  "and": [
    { "priority": { "ge": 3 } },
    {
      "or": [
        { "status": "approved" },
        { "status": "in_review" }
      ]
    }
  ]
}
Each operand in AND/OR arrays is parenthesized during Lucene translation to maintain correct precedence.

Unary NOT Predicate

Negates any predicate:
{
  "not": { "status": { "eq": "rejected" } }
}
NOT can wrap composite predicates:
{
  "not": {
    "or": [
      { "status": "rejected" },
      { "status": "obsolete" }
    ]
  }
}

ObjectId Predicates

Query by Polarion work item ID:
{
  "objectId": "UN-001"
}
With project prefix:
{
  "objectId": "myProject/UN-001"
}
The project prefix format project/id expands to a compound query: project.id:"myProject" AND id:"UN-001".

Data Property Predicates

Predicates on entity data properties are validated against the entity type schema before execution. Only scalar (non-navigation) properties are supported in direct predicates. Navigation property filtering uses the constraint system. See Document Filtering and Project Scoping.

Document and Project Predicates

Document and project predicates filter by navigation properties:
{
  "document": {
    "moduleName": "Requirements",
    "moduleFolder": "Specifications"
  }
}
{
  "project": {
    "id": "myProject"
  }
}
Document and project predicates are extracted and processed separately from data property predicates. They are resolved and validated against the Document and Project entity type metadata respectively.

Query Execution Methods

The query engine provides filtering operations on entity collections:
MethodDescription
filter()Returns all entities matching the predicate
count()Returns the count of matching entities without loading them
any()Returns true if at least one entity matches (short-circuit)
all()Returns true if every entity matches

Complete YAML Example

sources:
  - id: filtered-requirements
    title: Active Requirements
    model: rtm
    query:
      from: UserNeed
      where:
        and:
          - title:
              ne: null
          - status:
              ne: rejected
    constraints:
      applyCurrentDocumentTo: UserNeed
    expand:
      - name: systemRequirements

Sources: Code: Query.java, QueryExecutorTest.java, QueryToLuceneTest.java, PolarionQueryProcessor.java, odata-where-merger.test.ts
Source Code
  • Query.java
  • QueryExecutorTest.java
  • prod-powersheet-src/com.nextedy.powersheet.client/ltc-repo/__tests__/odata-where-merger.test.ts
  • PolarionQueryProcessor.java
  • QueryToLuceneTest.java