You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Andy Seaborne <an...@apache.org> on 2014/02/03 21:42:13 UTC

Re: Schemagen as Maven plugin

On 31/01/14 08:56, Julien Plu wrote:
> Hello !
>
> I saw in the latest Jena version (2.11.1) that there was a new module to
> run schemagen as a Maven plugin.
>
> I wanted to know how is-it possible to use it ? There is a doc somewhere ?
>
> Thanks in advance.
>
> Julien.
>

I can see some documentation in our staging area, but not the published 
site so it may well not be finished yet: e.g. version number of the 
plugin will need adjusting to whatever the release one is (which will 
not be "SNAPSHOT")

http://jena.staging.apache.org/documentation/tools/schemagen-maven.html

	Andy


Re: Schemagen as Maven plugin

Posted by Julien Plu <ju...@redaction-developpez.com>.
Very nice thank you :-)

My ontology test is simply DBpedia ontology :
http://mappings.dbpedia.org/server/ontology/dbpedia.owl

For now to fix badly this issue I call an external python script just after
the translation of the ontologies and just before the compilation which do
the job to convert the java files in UTF-8.

Best.

Julien.


2014-02-04 Ian Dickinson <i....@gmail.com>:

> Hi Julien,
> On Tue, Feb 4, 2014 at 8:53 AM, Julien Plu
> <ju...@redaction-developpez.com> wrote:
> > Thank you that link helped me a lot and it works pretty well. Unless for
> > one thing, all the .java files created by schemagen are encoded in
> Windows
> > encoding, I think it's cp1252, and throw me some warnings at the
> > compilation step :
> >
> > "unmappable character for encoding utf-8"
> >
> > Because all my other files are encoded in UTF-8 and my args for the
> > "maven-compiler-plugin" are :
> >
> > <configuration>
> >        <source>1.7</source>
> >        <target>1.7</target>
> >        <encoding>UTF-8</encoding>
> >        <argLine>-Dfile.encoding=UTF-8</argLine>
> > </configuration>
> >
> > And this as properties :
> >
> > <properties>
> >     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> >
> >
> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
> > </properties>
> >
> > So there is a way to configure the schemagen plugin to create java files
> > encoded directly in UTF-8 ?
>
> Hmm. This is not currently possible in schemagen - I would need to add
> a configuration option to set the output file encoding. Recorded as
> JENA-636
>
> https://issues.apache.org/jira/browse/JENA-636
>
> Can you please attach a fragment of the ontology that you're
> translating to that JIRA item, so that I have a realistic test case?
>
> As a workaround, you can use iconv[1] (Linux, Mac or cygwin) to change
> the character encoding of a file.
>
> Thanks,
> Ian
>
> [1] http://en.wikipedia.org/wiki/Iconv
>

Re: Schemagen as Maven plugin

Posted by Ian Dickinson <i....@gmail.com>.
Hi Julien,
On Tue, Feb 4, 2014 at 8:53 AM, Julien Plu
<ju...@redaction-developpez.com> wrote:
> Thank you that link helped me a lot and it works pretty well. Unless for
> one thing, all the .java files created by schemagen are encoded in Windows
> encoding, I think it's cp1252, and throw me some warnings at the
> compilation step :
>
> "unmappable character for encoding utf-8"
>
> Because all my other files are encoded in UTF-8 and my args for the
> "maven-compiler-plugin" are :
>
> <configuration>
>        <source>1.7</source>
>        <target>1.7</target>
>        <encoding>UTF-8</encoding>
>        <argLine>-Dfile.encoding=UTF-8</argLine>
> </configuration>
>
> And this as properties :
>
> <properties>
>     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>
> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
> </properties>
>
> So there is a way to configure the schemagen plugin to create java files
> encoded directly in UTF-8 ?

Hmm. This is not currently possible in schemagen - I would need to add
a configuration option to set the output file encoding. Recorded as
JENA-636

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

Can you please attach a fragment of the ontology that you're
translating to that JIRA item, so that I have a realistic test case?

As a workaround, you can use iconv[1] (Linux, Mac or cygwin) to change
the character encoding of a file.

Thanks,
Ian

[1] http://en.wikipedia.org/wiki/Iconv

Re: Schemagen as Maven plugin

Posted by Julien Plu <ju...@redaction-developpez.com>.
Hello !

Thank you that link helped me a lot and it works pretty well. Unless for
one thing, all the .java files created by schemagen are encoded in Windows
encoding, I think it's cp1252, and throw me some warnings at the
compilation step :

"unmappable character for encoding utf-8"

Because all my other files are encoded in UTF-8 and my args for the
"maven-compiler-plugin" are :

<configuration>
       <source>1.7</source>
       <target>1.7</target>
       <encoding>UTF-8</encoding>
       <argLine>-Dfile.encoding=UTF-8</argLine>
</configuration>

And this as properties :

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

So there is a way to configure the schemagen plugin to create java files
encoded directly in UTF-8 ?

Thanks in advance.

Best.

Julien.


2014/2/3 Andy Seaborne <an...@apache.org>

> On 31/01/14 08:56, Julien Plu wrote:
>
>> Hello !
>>
>> I saw in the latest Jena version (2.11.1) that there was a new module to
>> run schemagen as a Maven plugin.
>>
>> I wanted to know how is-it possible to use it ? There is a doc somewhere ?
>>
>> Thanks in advance.
>>
>> Julien.
>>
>>
> I can see some documentation in our staging area, but not the published
> site so it may well not be finished yet: e.g. version number of the plugin
> will need adjusting to whatever the release one is (which will not be
> "SNAPSHOT")
>
> http://jena.staging.apache.org/documentation/tools/schemagen-maven.html
>
>         Andy
>
>