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

Jena warnings when marshelling rdf/xml resources, where the property is XMLLiteral #211

Open
jad-elkhoury opened this issue Nov 15, 2021 · 4 comments

Comments

@jad-elkhoury
Copy link
Contributor

Apache Jena produces a warning when it tries to read a XMLLiteral Property.

org.apache.jena.riot - Lexical form 'some text with strange & unstrange stuff' not valid for datatype XSD XMLLiteral

To reproduce this probem, run the rm-adaptor from https://github.com/OSLC/lyo-adaptor-sample-modelling/tree/Bug_XmlLiterals

a GET request on http://localhost:8083/adaptor-rm/services/requirements/3, with accept application/rdf+xml returns the content below. No warnings are produces.

Now try to do a PUT on the same URL, with content-type application/rdf+xml.
Jena produces the warning above.
This warning is produced in JMH, when one tries to read the model from the input stream. (before any Oslc-specific code is run).

The relevant property to focus on is oslc_rm:testProperty

<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:dcterms="http://purl.org/dc/terms/"
    xmlns:oslc_data="http://open-services.net/ns/servicemanagement/1.0/"
    xmlns:oslc="http://open-services.net/ns/core#"
    xmlns:oslc_rm="http://open-services.net/ns/rm#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
    <oslc_rm:Requirement rdf:about="http://localhost:8083/adaptor-rm/services/requirements/3">
        <oslc_rm:testProperty rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"
    >some text with strange &amp; unstrange stuff</oslc_rm:testProperty>
        <dcterms:title>aTitle with id:3</dcterms:title>
        <dcterms:identifier>3</dcterms:identifier>
        <dcterms:description>A sample Requirement with id:3</dcterms:description>
    </oslc_rm:Requirement>
</rdf:RDF>

@jad-elkhoury
Copy link
Contributor Author

@berezovskyi !

I thought we ought to fix this problem since the problem occurs when Lyo tries to read input that Lyo produces. So we have no one else to blame :-)

@dhakehurst
Copy link

Its been a couple of years?
anyone able to fix this...I'm hitting the same issue

@berezovskyi
Copy link
Member

berezovskyi commented May 28, 2024

@dhakehurst you are right, it's been quite some time. I think #214 is the fix for this but we have been a bit reluctant to merge it without broader testing given the potential regression surface.

Would you be able to check if that PR resolves the problem for you without introducing any undesirable side effects, please?

@dhakehurst
Copy link

Sorry, I'm unable to build a version with that PR, to test against, at present.

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

No branches or pull requests

3 participants