Skip to content

Conversation

@berezovskyi
Copy link
Contributor

@berezovskyi berezovskyi commented Jun 19, 2025

Description

If a query has <=, e.g. <=42, it is incorrectly treated as a URI, which will never succeed.

OSLC Query support is not very well tested, would be hard to verify this for regressions. Unit tests were added to cover the change.

Checklist

  • This PR adds an entry to the CHANGELOG. See https://keepachangelog.com/en/1.0.0/ for instructions. Minor edits are exempt.
  • This PR was tested on at least one Lyo OSLC server (e.g. manual workflow on Lyo Sample and OSLC RefImpl) or adds unit/integration tests.
  • This PR does NOT break the API

Issues

Closes #43

(use exactly this syntax to link to issues, one issue per statement only!)

@berezovskyi berezovskyi force-pushed the jules_wip_13473427422933206932 branch 5 times, most recently from 7fb10a7 to 320becb Compare July 20, 2025 11:09
@berezovskyi berezovskyi marked this pull request as ready for review July 20, 2025 11:09
@berezovskyi berezovskyi requested review from Copilot and jamsden July 20, 2025 11:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug in the OSLC Where clause parser where comparison operators < and <= followed by numeric values were incorrectly being parsed as URI references instead of comparison operations. The fix ensures that URI references must start with an alphabetic character after the opening < to avoid conflicts with comparison operators.

  • Modified the ANTLR grammar to require alphabetic characters after < for URI references
  • Added comprehensive unit tests to verify correct parsing of < and <= operators with various operand types
  • Applied code formatting improvements to align with project style guidelines

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
OslcWhere.g Updated ANTLR grammar rule to require alphabetic characters in URI references, preventing conflicts with comparison operators
BasicWhereTest.java Added extensive unit tests for < and <= operators with integers, strings, URIs, and edge cases, plus code formatting improvements

@berezovskyi berezovskyi force-pushed the jules_wip_13473427422933206932 branch from fa3bf48 to fe8c243 Compare November 2, 2025 15:02
@berezovskyi

This comment was marked as outdated.

@oslc-bot

This comment was marked as outdated.

@berezovskyi

This comment was marked as outdated.

@oslc-bot

This comment was marked as outdated.

@berezovskyi

This comment was marked as outdated.

@oslc-bot

This comment was marked as outdated.

@berezovskyi

This comment was marked as outdated.

@oslc-bot

This comment was marked as outdated.

@berezovskyi

This comment was marked as outdated.

@oslc-bot

This comment was marked as outdated.

@berezovskyi
Copy link
Contributor Author

@oslc-bot /test-all

@oslc-bot
Copy link

oslc-bot commented Dec 22, 2025

Downstream Build Status

Repository Lyo CI Job state Workflow
oslc-op/refimpl ✅ Pass completed Link
oslc/lyo-samples ✅ Pass completed Link
oslc/promcode-lyo-server ✅ Pass completed Link

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

Successfully merging this pull request may close these issues.

oslc.where: IRI_REF vs. comparison operators less/less-or-equal

2 participants