eclipse / lyo

Eclipse Lyo, a Java SDK for OSLC-based tool integration

Home Page:https://oslc.github.io/developing-oslc-applications/eclipse_lyo/eclipse-lyo.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

jad-elkhoury opened this issue · comments

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>

@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 :-)

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

@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?

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