You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Nicolas Belisle <Ni...@bibl.ulaval.ca> on 2005/10/31 17:21:27 UTC

XML schema to node types

Hi,

I'm currently investigating ways to convert XML schemas to Jackrabbit node 
types declaration. This way, most metadata formats (Dublin Core, MARC21, 
etc.) could be integrated easily in a Jackrabbit repository.

Anyone has done something in that direction and would like to its share 
ideas ? Any other comments on this ?

I would certainly contribute the result back to Jackrabbit.


Regards,

Nick


Re: XML schema to node types

Posted by Michael Daglian <mi...@gmail.com>.
Hi Peeter,

Thanks for the patch. Perhaps default namespace isn't the most descriptive
and the empty URI would be a better term, i.e. an element existing in no
specified namespace within a document. In Jackrabbit, this maps to the
org.apache.jackrabbit.name.QName.NS_EMPTY_PREFIX and NS_DEFAULT_URI. This
may just be my misuse of the tool but I've had to explicitly add that
namespace to the namespace mapping and was wondering the preferred (if any)
method of handling the situation. Thanks!

Best Regards,

-- Mike

On 1/10/06, Tobias Bocanegra <to...@day.com> wrote:
>
> i committed the patch at revision: 367525
> regards, toby
>
>
> On 1/10/06, Peeter Piegaze <pe...@day.com> wrote:
> > Hi Mike,
> >
> > You are right about that bug.
> >
> > I have intermittent access to a useful computer right now (travelling)
> > and can't commit stuff (for some mysterious reason) but I have
> > arranged to have a patch applied by another committer which should fix
> > tthe specific problem. As for the more general issue of dealing with
> > the default namespace I will take a look at that when I get a chance.
> >
> > Of course your are free to fix stuff yourself and send patches to me
> > or another commiter.
> >
> > Actually could you clarify exactly what the default namespace issue is
> > again? I am not quite sure I see what you mean (though I am sure you
> > are right :-)
> >
> > Sorry I can't be of more help at the moment,
> >
> > Cheers,
> > Peet
> >
> >
> > On 1/10/06, Michael Daglian <mi...@gmail.com> wrote:
> > > Hello Peeter,
> > >
> > > Apologies if I am misusing the schema converter code you committed but
> I
> > > am a bit confused as to how to make use of the NamespaceExtractor
> class.
> > > As demonstrated in your test-case for the SchemaConverter I am
> > > attempting to use an extractor to get the additional namespaces out a
> > > schema file. However, this does not appear possible due to the use of
> > > getURI for the mapping property:
> > >
> > > <<<
> > >
> > > if (mapping.getURI(prefix) != null){...
> > >
> > > >>>
> > >
> > > The NamespaceMapping class throws an exception if the prefix is
> unmapped
> > > and thus the empty NamespaceMapping created using the default
> structure
> > > always generates this exception, which only gets caught and logged.
> > >
> > > On another note, it seems unclear how to best handle the default
> > > namespace using the NamespaceMapping class. When using the reader and
> > > explicitly mapping the namespace to be "" (i.e
> > > NamespaceMapping.setMapping("", "");), this works fine. But when
> > > outputting it writes the default namespace in a manner that the reader
> > > cannot read. Is there a recommended way of handling this case? Thanks!
> > >
> > > Best Regards,
> > >
> > > -- Mike
> > >
> > >
> > > On 12/20/05, Peeter Piegaze <pe...@day.com> wrote:
> > > >
> > > > Hi Nicolas,
> > > >
> > > > Regarding your interest in XML schema to JCR node type conversion: I
> > > > have committed the XSD to JCR node type converter into
> > > > contribs/nt-ns-util
> > > >
> > > > Cheers
> > > > Peeter
> > > >
> > > >
> > > > On 10/31/05, Nicolas Belisle <Ni...@bibl.ulaval.ca> wrote:
> > > > > Great news !
> > > > >
> > > > > I'm looking forward to this.
> > > > >
> > > > >
> > > > > Many thanks,
> > > > >
> > > > > Nick
> > > > >
> > > > >
> > > > > >Hi Nicholas, Actually, I wrote something that does this. I
> haven't
> > > > gotten
> > > > > >around to completely finishing it yet, but I will take your mail
> as a
> > > > > >motivator to do just that. Then I will commit to contribs.
> Cheers,
> > > > Peeter
> > > > > >On 10/31/05, Nicolas Belisle <Ni...@bibl.ulaval.ca>
> wrote: >
> > > > > >Hi, > > I'm currently investigating ways to convert XML schemas
> to
> > > > > >Jackrabbit node > types declaration. This way, most metadata
> formats
> > > > > >(Dublin Core, MARC21, > etc.) could be integrated easily in a
> > > > Jackrabbit
> > > > > >repository. > > Anyone has done something in that direction and
> would
> > > > like
> > > > > >to its share > ideas ? Any other comments on this ? > > I would
> > > > certainly
> > > > > >contribute the result back to Jackrabbit. > > > Regards, > > Nick
> > >
> > > > >
> > > > >
> > > >
> > >
> > >
> >
>
>
> --
> -----------------------------------------< tobias.bocanegra@day.com >---
> Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
> T +41 61 226 98 98, F +41 61 226 98 97
> -----------------------------------------------< http://www.day.com >---
>

Re: XML schema to node types

Posted by Tobias Bocanegra <to...@day.com>.
i committed the patch at revision: 367525
regards, toby


On 1/10/06, Peeter Piegaze <pe...@day.com> wrote:
> Hi Mike,
>
> You are right about that bug.
>
> I have intermittent access to a useful computer right now (travelling)
> and can't commit stuff (for some mysterious reason) but I have
> arranged to have a patch applied by another committer which should fix
> tthe specific problem. As for the more general issue of dealing with
> the default namespace I will take a look at that when I get a chance.
>
> Of course your are free to fix stuff yourself and send patches to me
> or another commiter.
>
> Actually could you clarify exactly what the default namespace issue is
> again? I am not quite sure I see what you mean (though I am sure you
> are right :-)
>
> Sorry I can't be of more help at the moment,
>
> Cheers,
> Peet
>
>
> On 1/10/06, Michael Daglian <mi...@gmail.com> wrote:
> > Hello Peeter,
> >
> > Apologies if I am misusing the schema converter code you committed but I
> > am a bit confused as to how to make use of the NamespaceExtractor class.
> > As demonstrated in your test-case for the SchemaConverter I am
> > attempting to use an extractor to get the additional namespaces out a
> > schema file. However, this does not appear possible due to the use of
> > getURI for the mapping property:
> >
> > <<<
> >
> > if (mapping.getURI(prefix) != null){...
> >
> > >>>
> >
> > The NamespaceMapping class throws an exception if the prefix is unmapped
> > and thus the empty NamespaceMapping created using the default structure
> > always generates this exception, which only gets caught and logged.
> >
> > On another note, it seems unclear how to best handle the default
> > namespace using the NamespaceMapping class. When using the reader and
> > explicitly mapping the namespace to be "" (i.e
> > NamespaceMapping.setMapping("", "");), this works fine. But when
> > outputting it writes the default namespace in a manner that the reader
> > cannot read. Is there a recommended way of handling this case? Thanks!
> >
> > Best Regards,
> >
> > -- Mike
> >
> >
> > On 12/20/05, Peeter Piegaze <pe...@day.com> wrote:
> > >
> > > Hi Nicolas,
> > >
> > > Regarding your interest in XML schema to JCR node type conversion: I
> > > have committed the XSD to JCR node type converter into
> > > contribs/nt-ns-util
> > >
> > > Cheers
> > > Peeter
> > >
> > >
> > > On 10/31/05, Nicolas Belisle <Ni...@bibl.ulaval.ca> wrote:
> > > > Great news !
> > > >
> > > > I'm looking forward to this.
> > > >
> > > >
> > > > Many thanks,
> > > >
> > > > Nick
> > > >
> > > >
> > > > >Hi Nicholas, Actually, I wrote something that does this. I haven't
> > > gotten
> > > > >around to completely finishing it yet, but I will take your mail as a
> > > > >motivator to do just that. Then I will commit to contribs. Cheers,
> > > Peeter
> > > > >On 10/31/05, Nicolas Belisle <Ni...@bibl.ulaval.ca> wrote: >
> > > > >Hi, > > I'm currently investigating ways to convert XML schemas to
> > > > >Jackrabbit node > types declaration. This way, most metadata formats
> > > > >(Dublin Core, MARC21, > etc.) could be integrated easily in a
> > > Jackrabbit
> > > > >repository. > > Anyone has done something in that direction and would
> > > like
> > > > >to its share > ideas ? Any other comments on this ? > > I would
> > > certainly
> > > > >contribute the result back to Jackrabbit. > > > Regards, > > Nick > >
> > > >
> > > >
> > >
> >
> >
>


--
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---

Re: XML schema to node types

Posted by Nicolas Belisle <Ni...@bibl.ulaval.ca>.
Hi Peeter,

(Sorry for the late response)

Many thanks for the contribution.
This is a great addition to Jackrabbit. This will ease the integration of 
existing formats.

I haven't had time to test it yet, but will have a deep look at it in a few 
weeks.

Regards,

Nicolas


Le 21:54 2006-01-09, vous avez écrit:
>Hi Mike,
>
>You are right about that bug.
>
>I have intermittent access to a useful computer right now (travelling)
>and can't commit stuff (for some mysterious reason) but I have
>arranged to have a patch applied by another committer which should fix
>tthe specific problem. As for the more general issue of dealing with
>the default namespace I will take a look at that when I get a chance.
>
>Of course your are free to fix stuff yourself and send patches to me
>or another commiter.
>
>Actually could you clarify exactly what the default namespace issue is
>again? I am not quite sure I see what you mean (though I am sure you
>are right :-)
>
>Sorry I can't be of more help at the moment,
>
>Cheers,
>Peet
>
>
>On 1/10/06, Michael Daglian <mi...@gmail.com> wrote:
> > Hello Peeter,
> >
> > Apologies if I am misusing the schema converter code you committed but I
> > am a bit confused as to how to make use of the NamespaceExtractor class.
> > As demonstrated in your test-case for the SchemaConverter I am
> > attempting to use an extractor to get the additional namespaces out a
> > schema file. However, this does not appear possible due to the use of
> > getURI for the mapping property:
> >
> > <<<
> >
> > if (mapping.getURI(prefix) != null){...
> >
> > >>>
> >
> > The NamespaceMapping class throws an exception if the prefix is unmapped
> > and thus the empty NamespaceMapping created using the default structure
> > always generates this exception, which only gets caught and logged.
> >
> > On another note, it seems unclear how to best handle the default
> > namespace using the NamespaceMapping class. When using the reader and
> > explicitly mapping the namespace to be "" (i.e
> > NamespaceMapping.setMapping("", "");), this works fine. But when
> > outputting it writes the default namespace in a manner that the reader
> > cannot read. Is there a recommended way of handling this case? Thanks!
> >
> > Best Regards,
> >
> > -- Mike
> >
> >
> > On 12/20/05, Peeter Piegaze <pe...@day.com> wrote:
> > >
> > > Hi Nicolas,
> > >
> > > Regarding your interest in XML schema to JCR node type conversion: I
> > > have committed the XSD to JCR node type converter into
> > > contribs/nt-ns-util
> > >
> > > Cheers
> > > Peeter
> > >
> > >
> > > On 10/31/05, Nicolas Belisle <Ni...@bibl.ulaval.ca> wrote:
> > > > Great news !
> > > >
> > > > I'm looking forward to this.
> > > >
> > > >
> > > > Many thanks,
> > > >
> > > > Nick
> > > >
> > > >
> > > > >Hi Nicholas, Actually, I wrote something that does this. I haven't
> > > gotten
> > > > >around to completely finishing it yet, but I will take your mail as a
> > > > >motivator to do just that. Then I will commit to contribs. Cheers,
> > > Peeter
> > > > >On 10/31/05, Nicolas Belisle <Ni...@bibl.ulaval.ca> wrote: >
> > > > >Hi, > > I'm currently investigating ways to convert XML schemas to
> > > > >Jackrabbit node > types declaration. This way, most metadata formats
> > > > >(Dublin Core, MARC21, > etc.) could be integrated easily in a
> > > Jackrabbit
> > > > >repository. > > Anyone has done something in that direction and would
> > > like
> > > > >to its share > ideas ? Any other comments on this ? > > I would
> > > certainly
> > > > >contribute the result back to Jackrabbit. > > > Regards, > > Nick > >
> > > >
> > > >
> > >
> >
> >


Re: XML schema to node types

Posted by Peeter Piegaze <pe...@day.com>.
Hi Mike,

You are right about that bug.

I have intermittent access to a useful computer right now (travelling)
and can't commit stuff (for some mysterious reason) but I have
arranged to have a patch applied by another committer which should fix
tthe specific problem. As for the more general issue of dealing with
the default namespace I will take a look at that when I get a chance.

Of course your are free to fix stuff yourself and send patches to me
or another commiter.

Actually could you clarify exactly what the default namespace issue is
again? I am not quite sure I see what you mean (though I am sure you
are right :-)

Sorry I can't be of more help at the moment,

Cheers,
Peet


On 1/10/06, Michael Daglian <mi...@gmail.com> wrote:
> Hello Peeter,
>
> Apologies if I am misusing the schema converter code you committed but I
> am a bit confused as to how to make use of the NamespaceExtractor class.
> As demonstrated in your test-case for the SchemaConverter I am
> attempting to use an extractor to get the additional namespaces out a
> schema file. However, this does not appear possible due to the use of
> getURI for the mapping property:
>
> <<<
>
> if (mapping.getURI(prefix) != null){...
>
> >>>
>
> The NamespaceMapping class throws an exception if the prefix is unmapped
> and thus the empty NamespaceMapping created using the default structure
> always generates this exception, which only gets caught and logged.
>
> On another note, it seems unclear how to best handle the default
> namespace using the NamespaceMapping class. When using the reader and
> explicitly mapping the namespace to be "" (i.e
> NamespaceMapping.setMapping("", "");), this works fine. But when
> outputting it writes the default namespace in a manner that the reader
> cannot read. Is there a recommended way of handling this case? Thanks!
>
> Best Regards,
>
> -- Mike
>
>
> On 12/20/05, Peeter Piegaze <pe...@day.com> wrote:
> >
> > Hi Nicolas,
> >
> > Regarding your interest in XML schema to JCR node type conversion: I
> > have committed the XSD to JCR node type converter into
> > contribs/nt-ns-util
> >
> > Cheers
> > Peeter
> >
> >
> > On 10/31/05, Nicolas Belisle <Ni...@bibl.ulaval.ca> wrote:
> > > Great news !
> > >
> > > I'm looking forward to this.
> > >
> > >
> > > Many thanks,
> > >
> > > Nick
> > >
> > >
> > > >Hi Nicholas, Actually, I wrote something that does this. I haven't
> > gotten
> > > >around to completely finishing it yet, but I will take your mail as a
> > > >motivator to do just that. Then I will commit to contribs. Cheers,
> > Peeter
> > > >On 10/31/05, Nicolas Belisle <Ni...@bibl.ulaval.ca> wrote: >
> > > >Hi, > > I'm currently investigating ways to convert XML schemas to
> > > >Jackrabbit node > types declaration. This way, most metadata formats
> > > >(Dublin Core, MARC21, > etc.) could be integrated easily in a
> > Jackrabbit
> > > >repository. > > Anyone has done something in that direction and would
> > like
> > > >to its share > ideas ? Any other comments on this ? > > I would
> > certainly
> > > >contribute the result back to Jackrabbit. > > > Regards, > > Nick > >
> > >
> > >
> >
>
>

Re: XML schema to node types

Posted by Michael Daglian <mi...@gmail.com>.
Hello Peeter,

Apologies if I am misusing the schema converter code you committed but I
am a bit confused as to how to make use of the NamespaceExtractor class.
As demonstrated in your test-case for the SchemaConverter I am
attempting to use an extractor to get the additional namespaces out a
schema file. However, this does not appear possible due to the use of
getURI for the mapping property:

<<<

if (mapping.getURI(prefix) != null){...

>>>

The NamespaceMapping class throws an exception if the prefix is unmapped
and thus the empty NamespaceMapping created using the default structure
always generates this exception, which only gets caught and logged.

On another note, it seems unclear how to best handle the default
namespace using the NamespaceMapping class. When using the reader and
explicitly mapping the namespace to be "" (i.e
NamespaceMapping.setMapping("", "");), this works fine. But when
outputting it writes the default namespace in a manner that the reader
cannot read. Is there a recommended way of handling this case? Thanks!

Best Regards,

-- Mike


On 12/20/05, Peeter Piegaze <pe...@day.com> wrote:
>
> Hi Nicolas,
>
> Regarding your interest in XML schema to JCR node type conversion: I
> have committed the XSD to JCR node type converter into
> contribs/nt-ns-util
>
> Cheers
> Peeter
>
>
> On 10/31/05, Nicolas Belisle <Ni...@bibl.ulaval.ca> wrote:
> > Great news !
> >
> > I'm looking forward to this.
> >
> >
> > Many thanks,
> >
> > Nick
> >
> >
> > >Hi Nicholas, Actually, I wrote something that does this. I haven't
> gotten
> > >around to completely finishing it yet, but I will take your mail as a
> > >motivator to do just that. Then I will commit to contribs. Cheers,
> Peeter
> > >On 10/31/05, Nicolas Belisle <Ni...@bibl.ulaval.ca> wrote: >
> > >Hi, > > I'm currently investigating ways to convert XML schemas to
> > >Jackrabbit node > types declaration. This way, most metadata formats
> > >(Dublin Core, MARC21, > etc.) could be integrated easily in a
> Jackrabbit
> > >repository. > > Anyone has done something in that direction and would
> like
> > >to its share > ideas ? Any other comments on this ? > > I would
> certainly
> > >contribute the result back to Jackrabbit. > > > Regards, > > Nick > >
> >
> >
>

Re: XML schema to node types

Posted by Peeter Piegaze <pe...@day.com>.
Hi Nicolas,

Regarding your interest in XML schema to JCR node type conversion: I
have committed the XSD to JCR node type converter into
contribs/nt-ns-util

Cheers
Peeter


On 10/31/05, Nicolas Belisle <Ni...@bibl.ulaval.ca> wrote:
> Great news !
>
> I'm looking forward to this.
>
>
> Many thanks,
>
> Nick
>
>
> >Hi Nicholas, Actually, I wrote something that does this. I haven't gotten
> >around to completely finishing it yet, but I will take your mail as a
> >motivator to do just that. Then I will commit to contribs. Cheers, Peeter
> >On 10/31/05, Nicolas Belisle <Ni...@bibl.ulaval.ca> wrote: >
> >Hi, > > I'm currently investigating ways to convert XML schemas to
> >Jackrabbit node > types declaration. This way, most metadata formats
> >(Dublin Core, MARC21, > etc.) could be integrated easily in a Jackrabbit
> >repository. > > Anyone has done something in that direction and would like
> >to its share > ideas ? Any other comments on this ? > > I would certainly
> >contribute the result back to Jackrabbit. > > > Regards, > > Nick > >
>
>

Re: XML schema to node types

Posted by Nicolas Belisle <Ni...@bibl.ulaval.ca>.
Great news !

I'm looking forward to this.


Many thanks,

Nick


>Hi Nicholas, Actually, I wrote something that does this. I haven't gotten 
>around to completely finishing it yet, but I will take your mail as a 
>motivator to do just that. Then I will commit to contribs. Cheers, Peeter 
>On 10/31/05, Nicolas Belisle <Ni...@bibl.ulaval.ca> wrote: > 
>Hi, > > I'm currently investigating ways to convert XML schemas to 
>Jackrabbit node > types declaration. This way, most metadata formats 
>(Dublin Core, MARC21, > etc.) could be integrated easily in a Jackrabbit 
>repository. > > Anyone has done something in that direction and would like 
>to its share > ideas ? Any other comments on this ? > > I would certainly 
>contribute the result back to Jackrabbit. > > > Regards, > > Nick > >


Re: XML schema to node types

Posted by Peeter Piegaze <pe...@day.com>.
Hi Nicholas,

Actually, I wrote something that does this. I haven't gotten around to
completely finishing it yet, but I will take your mail as a motivator
to do just that. Then I will commit to contribs.

Cheers,
Peeter

On 10/31/05, Nicolas Belisle <Ni...@bibl.ulaval.ca> wrote:
> Hi,
>
> I'm currently investigating ways to convert XML schemas to Jackrabbit node
> types declaration. This way, most metadata formats (Dublin Core, MARC21,
> etc.) could be integrated easily in a Jackrabbit repository.
>
> Anyone has done something in that direction and would like to its share
> ideas ? Any other comments on this ?
>
> I would certainly contribute the result back to Jackrabbit.
>
>
> Regards,
>
> Nick
>
>