Fix parsing of date-only values with xsd:dateTime type#847
Open
Fix parsing of date-only values with xsd:dateTime type#847
Conversation
Co-authored-by: berezovskyi <64734+berezovskyi@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix parsing issue for createdOn dateTime property
Fix parsing of date-only values with xsd:dateTime type
Nov 29, 2025
Contributor
|
@copilot Also add a test that ensures that the correct dateTime processing is not affected by this change, i.e. when the datetime has the time. |
…ng is not affected Co-authored-by: berezovskyi <64734+berezovskyi@users.noreply.github.com>
Contributor
Author
Added Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Contributor
|
@oslc-bot /test-all |
Contributor
|
@oslc-bot /test-all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When OSLC systems like DOORS send date values in xsd:date format (e.g.,
2020-08-10) but annotated as xsd:dateTime, parsing fails withDatatypeFormatException. In non-strict mode, this incorrectly returnedUnparseableLiteralinstead of aDate.Fix: In
JenaModelHelper.handleExtendedPropertyValue(), when xsd:dateTime parsing fails in non-strict mode, attempt to parse as xsd:date before falling back toUnparseableLiteral.Tests Added:
testDateOnlyValueWithDateTimeType(): Verifies that date-only values (e.g.,2020-08-10) with xsd:dateTime type are correctly parsed as Date objectstestFullDateTimeValueStillParsesCorrectly(): Ensures that full dateTime values with time components (e.g.,2020-08-10T14:30:45Z) are still correctly parsed, confirming the fix doesn't affect normal dateTime processingCloses #242
Checklist
@oslc-bot /test-allif not sure) or adds unit/integration tests.mvn package org.openrewrite.maven:rewrite-maven-plugin:run spotless:apply -DskipTests -P'!enforcer'if not, commit & push)Original prompt
This section details on the original issue you should resolve
<issue_title>Property #createdOn could not be parsed as datatype #dateTime</issue_title>
<issue_description>I have a slight issue when trying to read requirements from DOORS via DWA via OSLC via LYO. For most attribute values this works. However, for the dates, the following error is shown: