You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Martynas Jusevičius <ma...@graphity.org> on 2013/12/09 00:08:41 UTC

RDF/XML writer bug in 2.11.0?

Hey,

I've upgraded to Jena 2.11.0 as part of SPIN API 1.3.1. As a result,
previously working RDF/XML output breaks:

com.hp.hpl.jena.shared.BadURIException: Only well-formed absolute
URIrefs can be included in RDF/XML output: <#> Code:
57/REQUIRED_COMPONENT_MISSING in SCHEME: A component that is required
by the scheme is missing.
com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.checkURI(BaseXMLWriter.java:820)
com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.xmlnsDecl(BaseXMLWriter.java:339)
com.hp.hpl.jena.xmloutput.impl.Basic.writeRDFHeader(Basic.java:64)
com.hp.hpl.jena.xmloutput.impl.Basic.writeBody(Basic.java:47)
com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.writeXMLBody(BaseXMLWriter.java:492)
com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:464)
com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:450)
com.hp.hpl.jena.rdf.model.impl.ModelCom.write(ModelCom.java:333)
org.graphity.processor.provider.OntologyProvider.getOntModel(OntologyProvider.java:122)

I really hope I can work around this as I spent the whole weekend
upgrading to 2.11.0 :/
This seems to be related to relative URIs of the form <#>. Attached is
the code to reproduce the issue:

        Model test = ModelFactory.createDefaultModel();
        test.read("jena-test.ttl");
        test.write(System.out, "RDF/XML");

jena-test.ttl content:

@base           <http://localhost:8080/graphity-client/> .
@prefix : <#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<.> rdfs:isDefinedBy : .


Martynas
graphityhq.com

Re: RDF/XML writer bug in 2.11.0?

Posted by Andy Seaborne <an...@apache.org>.
On 09/12/13 10:12, Martynas Jusevičius wrote:
> I understand from your description that I can work around this by
> avoiding relative prefixes.
> I replaced instances of : with <#> and removed the prefix and it seems
> to work now.

Yes.  It's the @prefix causing the problem.

Or sort out the model prefix map afterwards or print with different 
prefixes.

It's only the prefixes affected.  URI resolution is OK.

	Andy

>
> On Mon, Dec 9, 2013 at 10:45 AM, Andy Seaborne <an...@apache.org> wrote:
>> Recorded:
>>
>> https://issues.apache.org/jira/browse/JENA-606
>>
>>
>> On 08/12/13 23:08, Martynas Jusevičius wrote:
>>>
>>> Hey,
>>>
>>> I've upgraded to Jena 2.11.0 as part of SPIN API 1.3.1. As a result,
>>> previously working RDF/XML output breaks:
>>>
>>> com.hp.hpl.jena.shared.BadURIException: Only well-formed absolute
>>> URIrefs can be included in RDF/XML output: <#> Code:
>>> 57/REQUIRED_COMPONENT_MISSING in SCHEME: A component that is required
>>> by the scheme is missing.
>>>WriterStreamRDFTupWriterStreamRDFTuplesles
>>> com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.checkURI(BaseXMLWriter.java:820)
>>>
>>> com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.xmlnsDecl(BaseXMLWriter.java:339)
>>> com.hp.hpl.jena.xmloutput.impl.Basic.writeRDFHeader(Basic.java:64)
>>> com.hp.hpl.jena.xmloutput.impl.Basic.writeBody(Basic.java:47)
>>>
>>> com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.writeXMLBody(BaseXMLWriter.java:492)
>>> com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:464)
>>> com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:450)
>>> com.hp.hpl.jena.rdf.model.impl.ModelCom.write(ModelCom.java:333)
>>>
>>> org.graphity.processor.provider.OntologyProvider.getOntModel(OntologyProvider.java:122)
>>>
>>> I really hope I can work around this as I spent the whole weekend
>>> upgrading to 2.11.0 :/
>>> This seems to be related to relative URIs of the form <#>. Attached is
>>> the code to reproduce the issue:
>>>
>>>           Model test = ModelFactory.createDefaultModel();
>>>           test.read("jena-test.ttl");
>>>           test.write(System.out, "RDF/XML");
>>>
>>> jena-test.ttl content:
>>>
>>> @base           <http://localhost:8080/graphity-client/> .
>>> @prefix : <#> .
>>> @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
>>>
>>> <.> rdfs:isDefinedBy : .
>>>
>>>
>>> Martynas
>>> graphityhq.com
>>>
>>


Re: RDF/XML writer bug in 2.11.0?

Posted by Martynas Jusevičius <ma...@graphity.org>.
I understand from your description that I can work around this by
avoiding relative prefixes.
I replaced instances of : with <#> and removed the prefix and it seems
to work now.

On Mon, Dec 9, 2013 at 10:45 AM, Andy Seaborne <an...@apache.org> wrote:
> Recorded:
>
> https://issues.apache.org/jira/browse/JENA-606
>
>
> On 08/12/13 23:08, Martynas Jusevičius wrote:
>>
>> Hey,
>>
>> I've upgraded to Jena 2.11.0 as part of SPIN API 1.3.1. As a result,
>> previously working RDF/XML output breaks:
>>
>> com.hp.hpl.jena.shared.BadURIException: Only well-formed absolute
>> URIrefs can be included in RDF/XML output: <#> Code:
>> 57/REQUIRED_COMPONENT_MISSING in SCHEME: A component that is required
>> by the scheme is missing.
>>
>> com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.checkURI(BaseXMLWriter.java:820)
>>
>> com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.xmlnsDecl(BaseXMLWriter.java:339)
>> com.hp.hpl.jena.xmloutput.impl.Basic.writeRDFHeader(Basic.java:64)
>> com.hp.hpl.jena.xmloutput.impl.Basic.writeBody(Basic.java:47)
>>
>> com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.writeXMLBody(BaseXMLWriter.java:492)
>> com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:464)
>> com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:450)
>> com.hp.hpl.jena.rdf.model.impl.ModelCom.write(ModelCom.java:333)
>>
>> org.graphity.processor.provider.OntologyProvider.getOntModel(OntologyProvider.java:122)
>>
>> I really hope I can work around this as I spent the whole weekend
>> upgrading to 2.11.0 :/
>> This seems to be related to relative URIs of the form <#>. Attached is
>> the code to reproduce the issue:
>>
>>          Model test = ModelFactory.createDefaultModel();
>>          test.read("jena-test.ttl");
>>          test.write(System.out, "RDF/XML");
>>
>> jena-test.ttl content:
>>
>> @base           <http://localhost:8080/graphity-client/> .
>> @prefix : <#> .
>> @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
>>
>> <.> rdfs:isDefinedBy : .
>>
>>
>> Martynas
>> graphityhq.com
>>
>

Re: RDF/XML writer bug in 2.11.0?

Posted by Andy Seaborne <an...@apache.org>.
Recorded:

https://issues.apache.org/jira/browse/JENA-606

On 08/12/13 23:08, Martynas Jusevičius wrote:
> Hey,
>
> I've upgraded to Jena 2.11.0 as part of SPIN API 1.3.1. As a result,
> previously working RDF/XML output breaks:
>
> com.hp.hpl.jena.shared.BadURIException: Only well-formed absolute
> URIrefs can be included in RDF/XML output: <#> Code:
> 57/REQUIRED_COMPONENT_MISSING in SCHEME: A component that is required
> by the scheme is missing.
> com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.checkURI(BaseXMLWriter.java:820)
> com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.xmlnsDecl(BaseXMLWriter.java:339)
> com.hp.hpl.jena.xmloutput.impl.Basic.writeRDFHeader(Basic.java:64)
> com.hp.hpl.jena.xmloutput.impl.Basic.writeBody(Basic.java:47)
> com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.writeXMLBody(BaseXMLWriter.java:492)
> com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:464)
> com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:450)
> com.hp.hpl.jena.rdf.model.impl.ModelCom.write(ModelCom.java:333)
> org.graphity.processor.provider.OntologyProvider.getOntModel(OntologyProvider.java:122)
>
> I really hope I can work around this as I spent the whole weekend
> upgrading to 2.11.0 :/
> This seems to be related to relative URIs of the form <#>. Attached is
> the code to reproduce the issue:
>
>          Model test = ModelFactory.createDefaultModel();
>          test.read("jena-test.ttl");
>          test.write(System.out, "RDF/XML");
>
> jena-test.ttl content:
>
> @base           <http://localhost:8080/graphity-client/> .
> @prefix : <#> .
> @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
>
> <.> rdfs:isDefinedBy : .
>
>
> Martynas
> graphityhq.com
>