-
Notifications
You must be signed in to change notification settings - Fork 18
feat: Handle XMLLiteral Java type #214
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
base: master
Are you sure you want to change the base?
Conversation
|
We did a screenshare review with Jad. The question is if we want to include it in Lyo 4.1 release. I would suggest to keep it for 4.2/5.0. |
|
I also vote to wait. Then we can use and test it a bit more |
|
SonarCloud Quality Gate failed. |
360e1b8 to
cb41849
Compare
|
SonarCloud Quality Gate failed. |
3ba8840 to
74a94b7
Compare
899ef98 to
46c1f5c
Compare
6a0b161 to
fd9b6b8
Compare
fd9b6b8 to
1ac77ea
Compare
857a0f8 to
d82b6df
Compare
d82b6df to
018e75d
Compare
|
From the run output: I believe the errors were introduced not due to changes on |
0c15b1c to
d3e8077
Compare
|
@oslc-bot /test-all |
# Conflicts: # core/oslc4j-core/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/JenaModelHelper.java
There was a problem hiding this 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 adds support for using XMLLiteral as both an OSLC ValueType and a Java property type, resolving inconsistencies in how Lyo handles XML Literals in RDF. Previously, Lyo used the XMLLiteral type for extended properties but required String type for annotated Java properties, causing processing differences based on property naming.
- Added
XMLLiteralto the class-to-valuetype mapping inResourceShapeFactory - Implemented marshaling and unmarshaling support for
XMLLiteralproperties inJenaModelHelper - Added comprehensive test coverage with multiple RDF serialization formats
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| core/oslc4j-core/src/main/java/org/eclipse/lyo/oslc4j/core/model/ResourceShapeFactory.java | Maps XMLLiteral class to ValueType.XMLLiteral and updates validation to accept both String and XMLLiteral for XMLLiteral value types |
| core/oslc4j-core/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/JenaModelHelper.java | Adds marshaling and unmarshaling logic for XMLLiteral properties |
| core/oslc4j-core/src/test/java/org/eclipse/lyo/oslc4j/core/model/ResourceShapeFactoryTest.java | Adds unit tests for XMLLiteral type validation |
| core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/test/XmlLiteralTest.java | Comprehensive test suite for XMLLiteral handling across different RDF formats |
| core/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/test/resources/TestResourceWithLiterals.java | Test resource with both XMLLiteral and String properties annotated with XMLLiteral value type |
| core/oslc4j-jena-provider/src/test/resources/xml_literals/*.{ttl,rdf} | Test data covering valid and invalid XMLLiteral scenarios |
| trs/server/src/test/resources/simplelogger.properties | Updated logging configuration for more detailed test output |
| trs/client/trs-client/src/test/resources/simplelogger.properties | Updated logging configuration for more detailed test output |
| core/oslc4j-jena-provider/src/test/resources/simplelogger.properties | New logging configuration for test output |
| .editorconfig | Added max_line_length settings for code formatting consistency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @Test(expected = RiotException.class) | ||
| public void invalidLiteralTest_BadXml() { | ||
| final Model diskModel = | ||
| readModel("/xml_literals/invalid_badxml.rdf", RDFLanguages.strLangTurtle); |
Copilot
AI
Dec 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The RDF language constant is incorrect. The file path indicates an RDF/XML file (invalid_badxml.rdf), but the code uses RDFLanguages.strLangTurtle. This should be RDFLanguages.strLangRDFXML to correctly parse the RDF/XML format.
| readModel("/xml_literals/invalid_badxml.rdf", RDFLanguages.strLangTurtle); | |
| readModel("/xml_literals/invalid_badxml.rdf", RDFLanguages.strLangRDFXML); |
fac1c9e to
bb6382b
Compare








Description
Lyo uses
XMLLiteraltype for XML Literals in RDF when creating extended properties but uses String type for annotated Java properties for the same RDF type. This caused differences in processing of the same content depending on the property name. See https://forum.open-services.net/t/oslc4j-cannot-get-a-changerequest-that-contains-special-characters/492/11This PR allows you to use XMLLiteral both as an OSLC ValueType and as a Java property type:
This may result in more strict handling of the property value. No existing behaviour is expected to change. See #213 for a helper to check if a String contains valid XML.
Checklist