Skip to content
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

feat: Handle XMLLiteral Java type #214

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

feat: Handle XMLLiteral Java type #214

wants to merge 6 commits into from

Conversation

berezovskyi
Copy link
Member

Description

Lyo uses XMLLiteral type 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/11

This PR allows you to use XMLLiteral both as an OSLC ValueType and as a Java property type:

    @OslcValueType(ValueType.XMLLiteral)
    public XMLLiteral getDescription() {
        return description;
    }

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

  • This PR adds an entry to the CHANGELOG. See https://keepachangelog.com/en/1.0.0/ for instructions. Minor edits are exempt. Should add an entry after 4.1 release.
  • This PR was tested on at least one Lyo OSLC server or adds unit/integration tests.
  • This PR does NOT break the API

@berezovskyi
Copy link
Member Author

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.

@jadelkhoury
Copy link
Contributor

I also vote to wait. Then we can use and test it a bit more

@sonarcloud
Copy link

sonarcloud bot commented Feb 17, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

0.0% 0.0% Coverage
0.3% 0.3% Duplication

@sonarcloud
Copy link

sonarcloud bot commented May 13, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

0.0% 0.0% Coverage
0.3% 0.3% Duplication

@github-actions github-actions bot force-pushed the xml-literals branch 6 times, most recently from 899ef98 to 46c1f5c Compare May 2, 2023 07:43
@github-actions github-actions bot force-pushed the xml-literals branch 2 times, most recently from 6a0b161 to fd9b6b8 Compare May 24, 2023 07:43
@github-actions github-actions bot force-pushed the xml-literals branch 4 times, most recently from 857a0f8 to d82b6df Compare June 21, 2023 07:43
@berezovskyi berezovskyi modified the milestones: 5.1, 5.2 Jun 30, 2023
@berezovskyi berezovskyi changed the title Handle XMLLiteral Java type feat: Handle XMLLiteral Java type Jun 30, 2023
@berezovskyi
Copy link
Member Author

From the run output:

Error:  Errors: 
Error:    XmlLiteralTest.literalTestXmlDatatypeRDF:158->readModel:186 » Riot [line: 5, col: 33] {E211} Base URI is null, but there are relative URIs to resolve.: <>
Error:    XmlLiteralTest.literalTestXmlDatatypeXSD:143->readModel:186 » Riot [line: 5, col: 33] {E211} Base URI is null, but there are relative URIs to resolve.: <>
Error:    XmlLiteralTest.literalTestXmlParsetype:171->readModel:186 » Riot [line: 5, col: 33] {E211} Base URI is null, but there are relative URIs to resolve.: <>
Error:    XmlLiteralTest.roundtripTestXmlDatatypeRDF:54->readModel:186 » Riot [line: 5, col: 33] {E211} Base URI is null, but there are relative URIs to resolve.: <>
Error:    XmlLiteralTest.roundtripTestXmlParsetypeWithAnnotatedLiteralProperty:62->readModel:186 » Riot [line: 6, col: 33] {E211} Base URI is null, but there are relative URIs to resolve.: <>
Error:    XmlLiteralTest.roundtripTestXmlParsetypeWithAnnotatedStringProperty:70->readModel:186 » Riot [line: 6, col: 33] {E211} Base URI is null, but there are relative URIs to resolve.: <>
[INFO] 
Error:  Tests run: 216, Failures: 0, Errors: 6, Skipped: 65

I believe the errors were introduced not due to changes on master in the meantime but due to a more strict RDF parsing in newer Jena versions.

…atatype.

Signed-off-by: Andrew Berezovskyi <andriib@kth.se>
Signed-off-by: Andrew Berezovskyi <andriib@kth.se>
Signed-off-by: Andrew Berezovskyi <andriib@kth.se>
Signed-off-by: Andrew Berezovskyi <andriib@kth.se>
Signed-off-by: Andrew Berezovskyi <andriib@kth.se>
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.

None yet

2 participants