You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by "Dr. Chavdar Ivanov" <ch...@outlook.de> on 2020/06/23 06:02:14 UTC
RDFXML write in plain with properties
Dear all,
I am struggling with the ways to write the RDF
I need to
- output in file (xml),
- declare xmlbase and show it in the file,
- use property "showXmlDeclaration"
- use the "relativeURIs" with "same-document", but want to have "#foo" kind of reference
- have RDXXML_PLAIN output - not nesting
I tried with using RDFWriter to set properties and I could get most of above except the "#foo" and the plain export. I get "foo" without the # independently if the xml base has # at the end or not
If I use RDFDataMgr plain export kind of works, but I cannot set the properties
Is there some way to combine or use another trick?
Best regards
Chavdar
RE: RDFXML write in plain with properties
Posted by "Dr. Chavdar Ivanov" <ch...@outlook.de>.
Hi Andy,
Thank you
I was looking into this, but I was getting the message "Cannot resolve method 'create ' in RDFWriter"
It was due to the import of the RDF writer from rdf.model and not from riot. SO now I can go a step further 😊
�
Best regards
Chavdar
�
-----Original Message-----
From: Andy Seaborne <an...@apache.org>
Sent: Tuesday, 23 June, 2020 11:18
To: users@jena.apache.org
Subject: Re: RDFXML write in plain with properties
�
Hi Chavdar,
�
Here's an example of setting properties specific to the RDF/XML writer.
�
https://github.com/apache/jena/blob/master/jena-arq/src-examples/arq/examples/riot/ExRIOT_RDFXML_WriteProperties.java
�
RDFFormat.RDFXML_PLAIN wil get you the unnested form.
�
It's a two step way to define the context which is difefrent for RDF/XML.
�
Andy
�
On 23/06/2020 07:02, Dr. Chavdar Ivanov wrote:
> Dear all,
>
> I am struggling with the ways to write the RDF
>
> I need to
> - output in file (xml),
> - declare xmlbase and show it in the file,
> - use property "showXmlDeclaration"
> - use the "relativeURIs" with "same-document", but want to have "#foo" kind of reference
> - have RDXXML_PLAIN output - not nesting
>
> I tried with using RDFWriter to set properties and I could get most of above except the "#foo" and the plain export. I get "foo" without the # independently if the xml base has # at the end or not
>
> If I use RDFDataMgr plain export kind of works, but I cannot set the properties
>
> Is there some way to combine or use another trick?
>
> Best regards
> Chavdar
>
Re: RDFXML write in plain with properties
Posted by Andy Seaborne <an...@apache.org>.
Hi Chavdar,
Here's an example of setting properties specific to the RDF/XML writer.
https://github.com/apache/jena/blob/master/jena-arq/src-examples/arq/examples/riot/ExRIOT_RDFXML_WriteProperties.java
RDFFormat.RDFXML_PLAIN wil get you the unnested form.
It's a two step way to define the context which is difefrent for RDF/XML.
Andy
On 23/06/2020 07:02, Dr. Chavdar Ivanov wrote:
> Dear all,
>
> I am struggling with the ways to write the RDF
>
> I need to
> - output in file (xml),
> - declare xmlbase and show it in the file,
> - use property "showXmlDeclaration"
> - use the "relativeURIs" with "same-document", but want to have "#foo" kind of reference
> - have RDXXML_PLAIN output - not nesting
>
> I tried with using RDFWriter to set properties and I could get most of above except the "#foo" and the plain export. I get "foo" without the # independently if the xml base has # at the end or not
>
> If I use RDFDataMgr plain export kind of works, but I cannot set the properties
>
> Is there some way to combine or use another trick?
>
> Best regards
> Chavdar
>