Re: [Dev] Issue in representing avro records with multiple namespaces

2016-03-01 Thread Nuwan Pallewela
+1 for using "attr_" .


On Wed, Mar 2, 2016 at 11:35 AM, Sohani Weerasinghe  wrote:

> Thanks for the input. Let's use -  "name" : "attr_gender"
>
> Sohani Weerasinghe
> Software Engineer
> WSO2, Inc: http://wso2.com
>
> Mobile  : +94 716439774
> Blog :http://christinetechtips.blogspot.com/
> Twitter  : https://twitter.com/sohanichristine
>
> On Wed, Mar 2, 2016 at 11:31 AM, Susinda Perera  wrote:
>
>> How about *attr* (lowercase)
>>
>> On Wed, Mar 2, 2016 at 11:29 AM, Sohani Weerasinghe 
>> wrote:
>>
>>> I think it's better if we can use "ATR" instead of "ATT"
>>>
>>> Sohani Weerasinghe
>>> Software Engineer
>>> WSO2, Inc: http://wso2.com
>>>
>>> Mobile  : +94 716439774
>>> Blog :http://christinetechtips.blogspot.com/
>>> Twitter  : https://twitter.com/sohanichristine
>>>
>>> On Wed, Mar 2, 2016 at 11:25 AM, Sohani Weerasinghe 
>>> wrote:
>>>
 Hi All,

 When representing attributes in avro schema,  according to [1] the
 suggested approach is to use @ as a prefix.

 Since avro name should start with [A-Za-z] and subsequently contain
 only  [A-Za-z0-9_], shall we represent it as below (adding ATT as a prefix)

 "name" : "*ATT*_gender"

 [1]
 https://docs.google.com/spreadsheets/d/15eyRuxn9rFazULASqtB2DZaSAVznKqSNnIGrwvdpzic/edit?ts=56d5250b#gid=0

 Sohani Weerasinghe
 Software Engineer
 WSO2, Inc: http://wso2.com

 Mobile  : +94 716439774
 Blog :http://christinetechtips.blogspot.com/
 Twitter  : https://twitter.com/sohanichristine

 On Wed, Mar 2, 2016 at 7:47 AM, Sohani Weerasinghe 
 wrote:

>
> ​Please find the attached image which represents the prefix in the
> tree view
>
> Sohani Weerasinghe
> Software Engineer
> WSO2, Inc: http://wso2.com
>
> Mobile  : +94 716439774
> Blog :http://christinetechtips.blogspot.com/
> Twitter  : https://twitter.com/sohanichristine
>
> On Wed, Mar 2, 2016 at 7:45 AM, Sohani Weerasinghe 
> wrote:
>
>>
>>
>> Sohani Weerasinghe
>> Software Engineer
>> WSO2, Inc: http://wso2.com
>>
>> Mobile  : +94 716439774
>> Blog :http://christinetechtips.blogspot.com/
>> Twitter  : https://twitter.com/sohanichristine
>>
>> On Wed, Mar 2, 2016 at 6:28 AM, Jasintha Dasanayake <
>> jasin...@wso2.com> wrote:
>>
>>>
>>>
>>> On Tue, Mar 1, 2016 at 9:07 PM, Sohani Weerasinghe 
>>> wrote:
>>>
 Thanks Nuwan for the response.

 When generating the avro schema by adding elements to the tree
 view, user can specify the namespace (xml namespace) with the prefix, 
 so
 that when generating the the avro schema we can map the namespace to 
 doc
 and prefix to the namespace in avro.

>>>
>>> Yes that's mapping is fine , somehow we need to show at least prefix
>>> in the tree view otherwise user experience won't be nice since user 
>>> have to
>>> check it explicitly while doing the mapping
>>>
>>
>> Yes, I have implemented that and the prefix will be shown in the tree
>> view.
>>
>>>
>>> Thanks and Regards
>>> /Jasintha.
>>>

 Thanks,
 Sohani

 Sohani Weerasinghe
 Software Engineer
 WSO2, Inc: http://wso2.com

 Mobile  : +94 716439774
 Blog :http://christinetechtips.blogspot.com/
 Twitter  : https://twitter.com/sohanichristine

 On Tue, Mar 1, 2016 at 8:54 PM, Nuwan Pallewela 
 wrote:

>
>
> On Tue, Mar 1, 2016 at 7:34 PM, Sohani Weerasinghe <
> soh...@wso2.com> wrote:
>
>> Hi All,
>>
>> If we consider an XML which has multiple namespaces as below ,
>>
>> 
>> http://www.w3.org/TR/html4/;>
>>   Asian Coffee Table
>>   74
>>   129
>> 
>> http://www.w3schools.com/furniture;>
>>   African Coffee Table
>>   80
>>   120
>> 
>> 
>>
>> The avro schema should be as follows ,
>>
>> {
>>   "type" : "record",
>>   "name" : "root",
>>   "fields" : [ {
>> "type" : "record",
>> "name" : "tableRecord",
>>* "doc" : "http://www.w3.org/TR/html4/
>> ",*
>> "namespace" : "http://www.w3.org/TR/html4/;
>> "fields" : [ {
>>   "name" : "name",
>>   "type" : [ "null", "string" ]
>>   "doc" : "http://www.w3.org/TR/html4/;
>>   } , {
>>   "name" : "width",
>>   "type" : [ 

Re: [Dev] Issue in representing avro records with multiple namespaces

2016-03-01 Thread Sohani Weerasinghe
Thanks for the input. Let's use -  "name" : "attr_gender"

Sohani Weerasinghe
Software Engineer
WSO2, Inc: http://wso2.com

Mobile  : +94 716439774
Blog :http://christinetechtips.blogspot.com/
Twitter  : https://twitter.com/sohanichristine

On Wed, Mar 2, 2016 at 11:31 AM, Susinda Perera  wrote:

> How about *attr* (lowercase)
>
> On Wed, Mar 2, 2016 at 11:29 AM, Sohani Weerasinghe 
> wrote:
>
>> I think it's better if we can use "ATR" instead of "ATT"
>>
>> Sohani Weerasinghe
>> Software Engineer
>> WSO2, Inc: http://wso2.com
>>
>> Mobile  : +94 716439774
>> Blog :http://christinetechtips.blogspot.com/
>> Twitter  : https://twitter.com/sohanichristine
>>
>> On Wed, Mar 2, 2016 at 11:25 AM, Sohani Weerasinghe 
>> wrote:
>>
>>> Hi All,
>>>
>>> When representing attributes in avro schema,  according to [1] the
>>> suggested approach is to use @ as a prefix.
>>>
>>> Since avro name should start with [A-Za-z] and subsequently contain only
>>>  [A-Za-z0-9_], shall we represent it as below (adding ATT as a prefix)
>>>
>>> "name" : "*ATT*_gender"
>>>
>>> [1]
>>> https://docs.google.com/spreadsheets/d/15eyRuxn9rFazULASqtB2DZaSAVznKqSNnIGrwvdpzic/edit?ts=56d5250b#gid=0
>>>
>>> Sohani Weerasinghe
>>> Software Engineer
>>> WSO2, Inc: http://wso2.com
>>>
>>> Mobile  : +94 716439774
>>> Blog :http://christinetechtips.blogspot.com/
>>> Twitter  : https://twitter.com/sohanichristine
>>>
>>> On Wed, Mar 2, 2016 at 7:47 AM, Sohani Weerasinghe 
>>> wrote:
>>>

 ​Please find the attached image which represents the prefix in the tree
 view

 Sohani Weerasinghe
 Software Engineer
 WSO2, Inc: http://wso2.com

 Mobile  : +94 716439774
 Blog :http://christinetechtips.blogspot.com/
 Twitter  : https://twitter.com/sohanichristine

 On Wed, Mar 2, 2016 at 7:45 AM, Sohani Weerasinghe 
 wrote:

>
>
> Sohani Weerasinghe
> Software Engineer
> WSO2, Inc: http://wso2.com
>
> Mobile  : +94 716439774
> Blog :http://christinetechtips.blogspot.com/
> Twitter  : https://twitter.com/sohanichristine
>
> On Wed, Mar 2, 2016 at 6:28 AM, Jasintha Dasanayake  > wrote:
>
>>
>>
>> On Tue, Mar 1, 2016 at 9:07 PM, Sohani Weerasinghe 
>> wrote:
>>
>>> Thanks Nuwan for the response.
>>>
>>> When generating the avro schema by adding elements to the tree view,
>>> user can specify the namespace (xml namespace) with the prefix, so that
>>> when generating the the avro schema we can map the namespace to doc and
>>> prefix to the namespace in avro.
>>>
>>
>> Yes that's mapping is fine , somehow we need to show at least prefix
>> in the tree view otherwise user experience won't be nice since user have 
>> to
>> check it explicitly while doing the mapping
>>
>
> Yes, I have implemented that and the prefix will be shown in the tree
> view.
>
>>
>> Thanks and Regards
>> /Jasintha.
>>
>>>
>>> Thanks,
>>> Sohani
>>>
>>> Sohani Weerasinghe
>>> Software Engineer
>>> WSO2, Inc: http://wso2.com
>>>
>>> Mobile  : +94 716439774
>>> Blog :http://christinetechtips.blogspot.com/
>>> Twitter  : https://twitter.com/sohanichristine
>>>
>>> On Tue, Mar 1, 2016 at 8:54 PM, Nuwan Pallewela 
>>> wrote:
>>>


 On Tue, Mar 1, 2016 at 7:34 PM, Sohani Weerasinghe  wrote:

> Hi All,
>
> If we consider an XML which has multiple namespaces as below ,
>
> 
> http://www.w3.org/TR/html4/;>
>   Asian Coffee Table
>   74
>   129
> 
> http://www.w3schools.com/furniture;>
>   African Coffee Table
>   80
>   120
> 
> 
>
> The avro schema should be as follows ,
>
> {
>   "type" : "record",
>   "name" : "root",
>   "fields" : [ {
> "type" : "record",
> "name" : "tableRecord",
>* "doc" : "http://www.w3.org/TR/html4/
> ",*
> "namespace" : "http://www.w3.org/TR/html4/;
> "fields" : [ {
>   "name" : "name",
>   "type" : [ "null", "string" ]
>   "doc" : "http://www.w3.org/TR/html4/;
>   } , {
>   "name" : "width",
>   "type" : [ "null", "int" ]
>   },{
>   "name" : "length",
>   "type" : [ "null", "int" ]
>   }]
> }, {
> "type" : "record",
> "name" : "tableRecord",
>   *  "doc" : 

Re: [Dev] Issue in representing avro records with multiple namespaces

2016-03-01 Thread Awanthika Senarath
+1 to attr

Awanthika Senarath
Software Engineer, WSO2 Inc.
Mobile: +94717681791



On Wed, Mar 2, 2016 at 11:31 AM, Susinda Perera  wrote:

> How about *attr* (lowercase)
>
> On Wed, Mar 2, 2016 at 11:29 AM, Sohani Weerasinghe 
> wrote:
>
>> I think it's better if we can use "ATR" instead of "ATT"
>>
>> Sohani Weerasinghe
>> Software Engineer
>> WSO2, Inc: http://wso2.com
>>
>> Mobile  : +94 716439774
>> Blog :http://christinetechtips.blogspot.com/
>> Twitter  : https://twitter.com/sohanichristine
>>
>> On Wed, Mar 2, 2016 at 11:25 AM, Sohani Weerasinghe 
>> wrote:
>>
>>> Hi All,
>>>
>>> When representing attributes in avro schema,  according to [1] the
>>> suggested approach is to use @ as a prefix.
>>>
>>> Since avro name should start with [A-Za-z] and subsequently contain only
>>>  [A-Za-z0-9_], shall we represent it as below (adding ATT as a prefix)
>>>
>>> "name" : "*ATT*_gender"
>>>
>>> [1]
>>> https://docs.google.com/spreadsheets/d/15eyRuxn9rFazULASqtB2DZaSAVznKqSNnIGrwvdpzic/edit?ts=56d5250b#gid=0
>>>
>>> Sohani Weerasinghe
>>> Software Engineer
>>> WSO2, Inc: http://wso2.com
>>>
>>> Mobile  : +94 716439774
>>> Blog :http://christinetechtips.blogspot.com/
>>> Twitter  : https://twitter.com/sohanichristine
>>>
>>> On Wed, Mar 2, 2016 at 7:47 AM, Sohani Weerasinghe 
>>> wrote:
>>>

 ​Please find the attached image which represents the prefix in the tree
 view

 Sohani Weerasinghe
 Software Engineer
 WSO2, Inc: http://wso2.com

 Mobile  : +94 716439774
 Blog :http://christinetechtips.blogspot.com/
 Twitter  : https://twitter.com/sohanichristine

 On Wed, Mar 2, 2016 at 7:45 AM, Sohani Weerasinghe 
 wrote:

>
>
> Sohani Weerasinghe
> Software Engineer
> WSO2, Inc: http://wso2.com
>
> Mobile  : +94 716439774
> Blog :http://christinetechtips.blogspot.com/
> Twitter  : https://twitter.com/sohanichristine
>
> On Wed, Mar 2, 2016 at 6:28 AM, Jasintha Dasanayake  > wrote:
>
>>
>>
>> On Tue, Mar 1, 2016 at 9:07 PM, Sohani Weerasinghe 
>> wrote:
>>
>>> Thanks Nuwan for the response.
>>>
>>> When generating the avro schema by adding elements to the tree view,
>>> user can specify the namespace (xml namespace) with the prefix, so that
>>> when generating the the avro schema we can map the namespace to doc and
>>> prefix to the namespace in avro.
>>>
>>
>> Yes that's mapping is fine , somehow we need to show at least prefix
>> in the tree view otherwise user experience won't be nice since user have 
>> to
>> check it explicitly while doing the mapping
>>
>
> Yes, I have implemented that and the prefix will be shown in the tree
> view.
>
>>
>> Thanks and Regards
>> /Jasintha.
>>
>>>
>>> Thanks,
>>> Sohani
>>>
>>> Sohani Weerasinghe
>>> Software Engineer
>>> WSO2, Inc: http://wso2.com
>>>
>>> Mobile  : +94 716439774
>>> Blog :http://christinetechtips.blogspot.com/
>>> Twitter  : https://twitter.com/sohanichristine
>>>
>>> On Tue, Mar 1, 2016 at 8:54 PM, Nuwan Pallewela 
>>> wrote:
>>>


 On Tue, Mar 1, 2016 at 7:34 PM, Sohani Weerasinghe  wrote:

> Hi All,
>
> If we consider an XML which has multiple namespaces as below ,
>
> 
> http://www.w3.org/TR/html4/;>
>   Asian Coffee Table
>   74
>   129
> 
> http://www.w3schools.com/furniture;>
>   African Coffee Table
>   80
>   120
> 
> 
>
> The avro schema should be as follows ,
>
> {
>   "type" : "record",
>   "name" : "root",
>   "fields" : [ {
> "type" : "record",
> "name" : "tableRecord",
>* "doc" : "http://www.w3.org/TR/html4/
> ",*
> "namespace" : "http://www.w3.org/TR/html4/;
> "fields" : [ {
>   "name" : "name",
>   "type" : [ "null", "string" ]
>   "doc" : "http://www.w3.org/TR/html4/;
>   } , {
>   "name" : "width",
>   "type" : [ "null", "int" ]
>   },{
>   "name" : "length",
>   "type" : [ "null", "int" ]
>   }]
> }, {
> "type" : "record",
> "name" : "tableRecord",
>   *  "doc" : "http://www.w3schools.com/furniture
> ",*
> "namespace" : "http://www.w3schools.com/furniture;
> "fields" : 

Re: [Dev] Issue in representing avro records with multiple namespaces

2016-03-01 Thread Susinda Perera
How about *attr* (lowercase)

On Wed, Mar 2, 2016 at 11:29 AM, Sohani Weerasinghe  wrote:

> I think it's better if we can use "ATR" instead of "ATT"
>
> Sohani Weerasinghe
> Software Engineer
> WSO2, Inc: http://wso2.com
>
> Mobile  : +94 716439774
> Blog :http://christinetechtips.blogspot.com/
> Twitter  : https://twitter.com/sohanichristine
>
> On Wed, Mar 2, 2016 at 11:25 AM, Sohani Weerasinghe 
> wrote:
>
>> Hi All,
>>
>> When representing attributes in avro schema,  according to [1] the
>> suggested approach is to use @ as a prefix.
>>
>> Since avro name should start with [A-Za-z] and subsequently contain only
>>  [A-Za-z0-9_], shall we represent it as below (adding ATT as a prefix)
>>
>> "name" : "*ATT*_gender"
>>
>> [1]
>> https://docs.google.com/spreadsheets/d/15eyRuxn9rFazULASqtB2DZaSAVznKqSNnIGrwvdpzic/edit?ts=56d5250b#gid=0
>>
>> Sohani Weerasinghe
>> Software Engineer
>> WSO2, Inc: http://wso2.com
>>
>> Mobile  : +94 716439774
>> Blog :http://christinetechtips.blogspot.com/
>> Twitter  : https://twitter.com/sohanichristine
>>
>> On Wed, Mar 2, 2016 at 7:47 AM, Sohani Weerasinghe 
>> wrote:
>>
>>>
>>> ​Please find the attached image which represents the prefix in the tree
>>> view
>>>
>>> Sohani Weerasinghe
>>> Software Engineer
>>> WSO2, Inc: http://wso2.com
>>>
>>> Mobile  : +94 716439774
>>> Blog :http://christinetechtips.blogspot.com/
>>> Twitter  : https://twitter.com/sohanichristine
>>>
>>> On Wed, Mar 2, 2016 at 7:45 AM, Sohani Weerasinghe 
>>> wrote:
>>>


 Sohani Weerasinghe
 Software Engineer
 WSO2, Inc: http://wso2.com

 Mobile  : +94 716439774
 Blog :http://christinetechtips.blogspot.com/
 Twitter  : https://twitter.com/sohanichristine

 On Wed, Mar 2, 2016 at 6:28 AM, Jasintha Dasanayake 
 wrote:

>
>
> On Tue, Mar 1, 2016 at 9:07 PM, Sohani Weerasinghe 
> wrote:
>
>> Thanks Nuwan for the response.
>>
>> When generating the avro schema by adding elements to the tree view,
>> user can specify the namespace (xml namespace) with the prefix, so that
>> when generating the the avro schema we can map the namespace to doc and
>> prefix to the namespace in avro.
>>
>
> Yes that's mapping is fine , somehow we need to show at least prefix
> in the tree view otherwise user experience won't be nice since user have 
> to
> check it explicitly while doing the mapping
>

 Yes, I have implemented that and the prefix will be shown in the tree
 view.

>
> Thanks and Regards
> /Jasintha.
>
>>
>> Thanks,
>> Sohani
>>
>> Sohani Weerasinghe
>> Software Engineer
>> WSO2, Inc: http://wso2.com
>>
>> Mobile  : +94 716439774
>> Blog :http://christinetechtips.blogspot.com/
>> Twitter  : https://twitter.com/sohanichristine
>>
>> On Tue, Mar 1, 2016 at 8:54 PM, Nuwan Pallewela 
>> wrote:
>>
>>>
>>>
>>> On Tue, Mar 1, 2016 at 7:34 PM, Sohani Weerasinghe 
>>> wrote:
>>>
 Hi All,

 If we consider an XML which has multiple namespaces as below ,

 
 http://www.w3.org/TR/html4/;>
   Asian Coffee Table
   74
   129
 
 http://www.w3schools.com/furniture;>
   African Coffee Table
   80
   120
 
 

 The avro schema should be as follows ,

 {
   "type" : "record",
   "name" : "root",
   "fields" : [ {
 "type" : "record",
 "name" : "tableRecord",
* "doc" : "http://www.w3.org/TR/html4/
 ",*
 "namespace" : "http://www.w3.org/TR/html4/;
 "fields" : [ {
   "name" : "name",
   "type" : [ "null", "string" ]
   "doc" : "http://www.w3.org/TR/html4/;
   } , {
   "name" : "width",
   "type" : [ "null", "int" ]
   },{
   "name" : "length",
   "type" : [ "null", "int" ]
   }]
 }, {
 "type" : "record",
 "name" : "tableRecord",
   *  "doc" : "http://www.w3schools.com/furniture
 ",*
 "namespace" : "http://www.w3schools.com/furniture;
 "fields" : [ {
   "name" : "name",
   "type" : [ "null", "string" ]
   } , {
   "name" : "width",
   "type" : [ "null", "int" ]
   },{
   "name" : "length",
   "type" : [ "null", "int" ]
   }]

Re: [Dev] Issue in representing avro records with multiple namespaces

2016-03-01 Thread Sohani Weerasinghe
I think it's better if we can use "ATR" instead of "ATT"

Sohani Weerasinghe
Software Engineer
WSO2, Inc: http://wso2.com

Mobile  : +94 716439774
Blog :http://christinetechtips.blogspot.com/
Twitter  : https://twitter.com/sohanichristine

On Wed, Mar 2, 2016 at 11:25 AM, Sohani Weerasinghe  wrote:

> Hi All,
>
> When representing attributes in avro schema,  according to [1] the
> suggested approach is to use @ as a prefix.
>
> Since avro name should start with [A-Za-z] and subsequently contain only
>  [A-Za-z0-9_], shall we represent it as below (adding ATT as a prefix)
>
> "name" : "*ATT*_gender"
>
> [1]
> https://docs.google.com/spreadsheets/d/15eyRuxn9rFazULASqtB2DZaSAVznKqSNnIGrwvdpzic/edit?ts=56d5250b#gid=0
>
> Sohani Weerasinghe
> Software Engineer
> WSO2, Inc: http://wso2.com
>
> Mobile  : +94 716439774
> Blog :http://christinetechtips.blogspot.com/
> Twitter  : https://twitter.com/sohanichristine
>
> On Wed, Mar 2, 2016 at 7:47 AM, Sohani Weerasinghe 
> wrote:
>
>>
>> ​Please find the attached image which represents the prefix in the tree
>> view
>>
>> Sohani Weerasinghe
>> Software Engineer
>> WSO2, Inc: http://wso2.com
>>
>> Mobile  : +94 716439774
>> Blog :http://christinetechtips.blogspot.com/
>> Twitter  : https://twitter.com/sohanichristine
>>
>> On Wed, Mar 2, 2016 at 7:45 AM, Sohani Weerasinghe 
>> wrote:
>>
>>>
>>>
>>> Sohani Weerasinghe
>>> Software Engineer
>>> WSO2, Inc: http://wso2.com
>>>
>>> Mobile  : +94 716439774
>>> Blog :http://christinetechtips.blogspot.com/
>>> Twitter  : https://twitter.com/sohanichristine
>>>
>>> On Wed, Mar 2, 2016 at 6:28 AM, Jasintha Dasanayake 
>>> wrote:
>>>


 On Tue, Mar 1, 2016 at 9:07 PM, Sohani Weerasinghe 
 wrote:

> Thanks Nuwan for the response.
>
> When generating the avro schema by adding elements to the tree view,
> user can specify the namespace (xml namespace) with the prefix, so that
> when generating the the avro schema we can map the namespace to doc and
> prefix to the namespace in avro.
>

 Yes that's mapping is fine , somehow we need to show at least prefix in
 the tree view otherwise user experience won't be nice since user have to
 check it explicitly while doing the mapping

>>>
>>> Yes, I have implemented that and the prefix will be shown in the tree
>>> view.
>>>

 Thanks and Regards
 /Jasintha.

>
> Thanks,
> Sohani
>
> Sohani Weerasinghe
> Software Engineer
> WSO2, Inc: http://wso2.com
>
> Mobile  : +94 716439774
> Blog :http://christinetechtips.blogspot.com/
> Twitter  : https://twitter.com/sohanichristine
>
> On Tue, Mar 1, 2016 at 8:54 PM, Nuwan Pallewela 
> wrote:
>
>>
>>
>> On Tue, Mar 1, 2016 at 7:34 PM, Sohani Weerasinghe 
>> wrote:
>>
>>> Hi All,
>>>
>>> If we consider an XML which has multiple namespaces as below ,
>>>
>>> 
>>> http://www.w3.org/TR/html4/;>
>>>   Asian Coffee Table
>>>   74
>>>   129
>>> 
>>> http://www.w3schools.com/furniture;>
>>>   African Coffee Table
>>>   80
>>>   120
>>> 
>>> 
>>>
>>> The avro schema should be as follows ,
>>>
>>> {
>>>   "type" : "record",
>>>   "name" : "root",
>>>   "fields" : [ {
>>> "type" : "record",
>>> "name" : "tableRecord",
>>>* "doc" : "http://www.w3.org/TR/html4/
>>> ",*
>>> "namespace" : "http://www.w3.org/TR/html4/;
>>> "fields" : [ {
>>>   "name" : "name",
>>>   "type" : [ "null", "string" ]
>>>   "doc" : "http://www.w3.org/TR/html4/;
>>>   } , {
>>>   "name" : "width",
>>>   "type" : [ "null", "int" ]
>>>   },{
>>>   "name" : "length",
>>>   "type" : [ "null", "int" ]
>>>   }]
>>> }, {
>>> "type" : "record",
>>> "name" : "tableRecord",
>>>   *  "doc" : "http://www.w3schools.com/furniture
>>> ",*
>>> "namespace" : "http://www.w3schools.com/furniture;
>>> "fields" : [ {
>>>   "name" : "name",
>>>   "type" : [ "null", "string" ]
>>>   } , {
>>>   "name" : "width",
>>>   "type" : [ "null", "int" ]
>>>   },{
>>>   "name" : "length",
>>>   "type" : [ "null", "int" ]
>>>   }]
>>> } ]
>>> }
>>>
>>> When representing this using the Visual DataMapper Editor, in order
>>> to differentiate the two records, we can add a namespace prefix to the 
>>> name
>>> of the record as shown below.
>>>
>>>
>>> ​But when 

Re: [Dev] Issue in representing avro records with multiple namespaces

2016-03-01 Thread Sohani Weerasinghe
Hi All,

When representing attributes in avro schema,  according to [1] the
suggested approach is to use @ as a prefix.

Since avro name should start with [A-Za-z] and subsequently contain only
 [A-Za-z0-9_], shall we represent it as below (adding ATT as a prefix)

"name" : "*ATT*_gender"

[1]
https://docs.google.com/spreadsheets/d/15eyRuxn9rFazULASqtB2DZaSAVznKqSNnIGrwvdpzic/edit?ts=56d5250b#gid=0

Sohani Weerasinghe
Software Engineer
WSO2, Inc: http://wso2.com

Mobile  : +94 716439774
Blog :http://christinetechtips.blogspot.com/
Twitter  : https://twitter.com/sohanichristine

On Wed, Mar 2, 2016 at 7:47 AM, Sohani Weerasinghe  wrote:

>
> ​Please find the attached image which represents the prefix in the tree
> view
>
> Sohani Weerasinghe
> Software Engineer
> WSO2, Inc: http://wso2.com
>
> Mobile  : +94 716439774
> Blog :http://christinetechtips.blogspot.com/
> Twitter  : https://twitter.com/sohanichristine
>
> On Wed, Mar 2, 2016 at 7:45 AM, Sohani Weerasinghe 
> wrote:
>
>>
>>
>> Sohani Weerasinghe
>> Software Engineer
>> WSO2, Inc: http://wso2.com
>>
>> Mobile  : +94 716439774
>> Blog :http://christinetechtips.blogspot.com/
>> Twitter  : https://twitter.com/sohanichristine
>>
>> On Wed, Mar 2, 2016 at 6:28 AM, Jasintha Dasanayake 
>> wrote:
>>
>>>
>>>
>>> On Tue, Mar 1, 2016 at 9:07 PM, Sohani Weerasinghe 
>>> wrote:
>>>
 Thanks Nuwan for the response.

 When generating the avro schema by adding elements to the tree view,
 user can specify the namespace (xml namespace) with the prefix, so that
 when generating the the avro schema we can map the namespace to doc and
 prefix to the namespace in avro.

>>>
>>> Yes that's mapping is fine , somehow we need to show at least prefix in
>>> the tree view otherwise user experience won't be nice since user have to
>>> check it explicitly while doing the mapping
>>>
>>
>> Yes, I have implemented that and the prefix will be shown in the tree
>> view.
>>
>>>
>>> Thanks and Regards
>>> /Jasintha.
>>>

 Thanks,
 Sohani

 Sohani Weerasinghe
 Software Engineer
 WSO2, Inc: http://wso2.com

 Mobile  : +94 716439774
 Blog :http://christinetechtips.blogspot.com/
 Twitter  : https://twitter.com/sohanichristine

 On Tue, Mar 1, 2016 at 8:54 PM, Nuwan Pallewela 
 wrote:

>
>
> On Tue, Mar 1, 2016 at 7:34 PM, Sohani Weerasinghe 
> wrote:
>
>> Hi All,
>>
>> If we consider an XML which has multiple namespaces as below ,
>>
>> 
>> http://www.w3.org/TR/html4/;>
>>   Asian Coffee Table
>>   74
>>   129
>> 
>> http://www.w3schools.com/furniture;>
>>   African Coffee Table
>>   80
>>   120
>> 
>> 
>>
>> The avro schema should be as follows ,
>>
>> {
>>   "type" : "record",
>>   "name" : "root",
>>   "fields" : [ {
>> "type" : "record",
>> "name" : "tableRecord",
>>* "doc" : "http://www.w3.org/TR/html4/
>> ",*
>> "namespace" : "http://www.w3.org/TR/html4/;
>> "fields" : [ {
>>   "name" : "name",
>>   "type" : [ "null", "string" ]
>>   "doc" : "http://www.w3.org/TR/html4/;
>>   } , {
>>   "name" : "width",
>>   "type" : [ "null", "int" ]
>>   },{
>>   "name" : "length",
>>   "type" : [ "null", "int" ]
>>   }]
>> }, {
>> "type" : "record",
>> "name" : "tableRecord",
>>   *  "doc" : "http://www.w3schools.com/furniture
>> ",*
>> "namespace" : "http://www.w3schools.com/furniture;
>> "fields" : [ {
>>   "name" : "name",
>>   "type" : [ "null", "string" ]
>>   } , {
>>   "name" : "width",
>>   "type" : [ "null", "int" ]
>>   },{
>>   "name" : "length",
>>   "type" : [ "null", "int" ]
>>   }]
>> } ]
>> }
>>
>> When representing this using the Visual DataMapper Editor, in order
>> to differentiate the two records, we can add a namespace prefix to the 
>> name
>> of the record as shown below.
>>
>>
>> ​But when generating the Avro Schema, if we pass this value as the
>> name of the node it  throws *org.apache.avro.SchemaParseException:
>> Illegal character in: y:tableRecord.*
>>
>
> AVRO name should start with [A-Za-z] and subsequently contain only  
> [A-Za-z0-9_].
> So we can not pass name with namespace prefix.
>
>>
>> So, if we use only the name (tableRecord, by removing the prefix) to
>> create the avro schema, how are we going to differentiate the records
>> 

Re: [Dev] Issue in representing avro records with multiple namespaces

2016-03-01 Thread Sohani Weerasinghe
​Please find the attached image which represents the prefix in the tree view

Sohani Weerasinghe
Software Engineer
WSO2, Inc: http://wso2.com

Mobile  : +94 716439774
Blog :http://christinetechtips.blogspot.com/
Twitter  : https://twitter.com/sohanichristine

On Wed, Mar 2, 2016 at 7:45 AM, Sohani Weerasinghe  wrote:

>
>
> Sohani Weerasinghe
> Software Engineer
> WSO2, Inc: http://wso2.com
>
> Mobile  : +94 716439774
> Blog :http://christinetechtips.blogspot.com/
> Twitter  : https://twitter.com/sohanichristine
>
> On Wed, Mar 2, 2016 at 6:28 AM, Jasintha Dasanayake 
> wrote:
>
>>
>>
>> On Tue, Mar 1, 2016 at 9:07 PM, Sohani Weerasinghe 
>> wrote:
>>
>>> Thanks Nuwan for the response.
>>>
>>> When generating the avro schema by adding elements to the tree view,
>>> user can specify the namespace (xml namespace) with the prefix, so that
>>> when generating the the avro schema we can map the namespace to doc and
>>> prefix to the namespace in avro.
>>>
>>
>> Yes that's mapping is fine , somehow we need to show at least prefix in
>> the tree view otherwise user experience won't be nice since user have to
>> check it explicitly while doing the mapping
>>
>
> Yes, I have implemented that and the prefix will be shown in the tree
> view.
>
>>
>> Thanks and Regards
>> /Jasintha.
>>
>>>
>>> Thanks,
>>> Sohani
>>>
>>> Sohani Weerasinghe
>>> Software Engineer
>>> WSO2, Inc: http://wso2.com
>>>
>>> Mobile  : +94 716439774
>>> Blog :http://christinetechtips.blogspot.com/
>>> Twitter  : https://twitter.com/sohanichristine
>>>
>>> On Tue, Mar 1, 2016 at 8:54 PM, Nuwan Pallewela  wrote:
>>>


 On Tue, Mar 1, 2016 at 7:34 PM, Sohani Weerasinghe 
 wrote:

> Hi All,
>
> If we consider an XML which has multiple namespaces as below ,
>
> 
> http://www.w3.org/TR/html4/;>
>   Asian Coffee Table
>   74
>   129
> 
> http://www.w3schools.com/furniture;>
>   African Coffee Table
>   80
>   120
> 
> 
>
> The avro schema should be as follows ,
>
> {
>   "type" : "record",
>   "name" : "root",
>   "fields" : [ {
> "type" : "record",
> "name" : "tableRecord",
>* "doc" : "http://www.w3.org/TR/html4/
> ",*
> "namespace" : "http://www.w3.org/TR/html4/;
> "fields" : [ {
>   "name" : "name",
>   "type" : [ "null", "string" ]
>   "doc" : "http://www.w3.org/TR/html4/;
>   } , {
>   "name" : "width",
>   "type" : [ "null", "int" ]
>   },{
>   "name" : "length",
>   "type" : [ "null", "int" ]
>   }]
> }, {
> "type" : "record",
> "name" : "tableRecord",
>   *  "doc" : "http://www.w3schools.com/furniture
> ",*
> "namespace" : "http://www.w3schools.com/furniture;
> "fields" : [ {
>   "name" : "name",
>   "type" : [ "null", "string" ]
>   } , {
>   "name" : "width",
>   "type" : [ "null", "int" ]
>   },{
>   "name" : "length",
>   "type" : [ "null", "int" ]
>   }]
> } ]
> }
>
> When representing this using the Visual DataMapper Editor, in order to
> differentiate the two records, we can add a namespace prefix to the name 
> of
> the record as shown below.
>
>
> ​But when generating the Avro Schema, if we pass this value as the
> name of the node it  throws *org.apache.avro.SchemaParseException:
> Illegal character in: y:tableRecord.*
>

 AVRO name should start with [A-Za-z] and subsequently contain only  
 [A-Za-z0-9_].
 So we can not pass name with namespace prefix.

>
> So, if we use only the name (tableRecord, by removing the prefix) to
> create the avro schema, how are we going to differentiate the records
> separately when generating the mapping config?
>

  We should add above xml namespace prefix as the namespace of AVRO
 record. Then two elements can be differentiated.
 For Eg:

 {
   "type" : "record",
   "name" : "root",
   "fields" : [ {
 "type" : "record",
 "name" : "tableRecord",
* "doc" : "http://www.w3.org/TR/html4/
 ",*
 "namespace" : "N1",
 "fields" : [ {
   "name" : "name",
   "type" : [ "null", "string" ],
   "doc" : "http://www.w3.org/TR/html4/;
   } , {
   "name" : "width",
   "type" : [ "null", "int" ],
   "doc" : "http://www.w3.org/TR/html4/;
   },{
   "name" : 

Re: [Dev] Issue in representing avro records with multiple namespaces

2016-03-01 Thread Sohani Weerasinghe
Sohani Weerasinghe
Software Engineer
WSO2, Inc: http://wso2.com

Mobile  : +94 716439774
Blog :http://christinetechtips.blogspot.com/
Twitter  : https://twitter.com/sohanichristine

On Wed, Mar 2, 2016 at 6:28 AM, Jasintha Dasanayake 
wrote:

>
>
> On Tue, Mar 1, 2016 at 9:07 PM, Sohani Weerasinghe 
> wrote:
>
>> Thanks Nuwan for the response.
>>
>> When generating the avro schema by adding elements to the tree view, user
>> can specify the namespace (xml namespace) with the prefix, so that when
>> generating the the avro schema we can map the namespace to doc and prefix
>> to the namespace in avro.
>>
>
> Yes that's mapping is fine , somehow we need to show at least prefix in
> the tree view otherwise user experience won't be nice since user have to
> check it explicitly while doing the mapping
>

Yes, I have implemented that and the prefix will be shown in the tree view.

>
> Thanks and Regards
> /Jasintha.
>
>>
>> Thanks,
>> Sohani
>>
>> Sohani Weerasinghe
>> Software Engineer
>> WSO2, Inc: http://wso2.com
>>
>> Mobile  : +94 716439774
>> Blog :http://christinetechtips.blogspot.com/
>> Twitter  : https://twitter.com/sohanichristine
>>
>> On Tue, Mar 1, 2016 at 8:54 PM, Nuwan Pallewela  wrote:
>>
>>>
>>>
>>> On Tue, Mar 1, 2016 at 7:34 PM, Sohani Weerasinghe 
>>> wrote:
>>>
 Hi All,

 If we consider an XML which has multiple namespaces as below ,

 
 http://www.w3.org/TR/html4/;>
   Asian Coffee Table
   74
   129
 
 http://www.w3schools.com/furniture;>
   African Coffee Table
   80
   120
 
 

 The avro schema should be as follows ,

 {
   "type" : "record",
   "name" : "root",
   "fields" : [ {
 "type" : "record",
 "name" : "tableRecord",
* "doc" : "http://www.w3.org/TR/html4/
 ",*
 "namespace" : "http://www.w3.org/TR/html4/;
 "fields" : [ {
   "name" : "name",
   "type" : [ "null", "string" ]
   "doc" : "http://www.w3.org/TR/html4/;
   } , {
   "name" : "width",
   "type" : [ "null", "int" ]
   },{
   "name" : "length",
   "type" : [ "null", "int" ]
   }]
 }, {
 "type" : "record",
 "name" : "tableRecord",
   *  "doc" : "http://www.w3schools.com/furniture
 ",*
 "namespace" : "http://www.w3schools.com/furniture;
 "fields" : [ {
   "name" : "name",
   "type" : [ "null", "string" ]
   } , {
   "name" : "width",
   "type" : [ "null", "int" ]
   },{
   "name" : "length",
   "type" : [ "null", "int" ]
   }]
 } ]
 }

 When representing this using the Visual DataMapper Editor, in order to
 differentiate the two records, we can add a namespace prefix to the name of
 the record as shown below.


 ​But when generating the Avro Schema, if we pass this value as the name
 of the node it  throws *org.apache.avro.SchemaParseException: Illegal
 character in: y:tableRecord.*

>>>
>>> AVRO name should start with [A-Za-z] and subsequently contain only  
>>> [A-Za-z0-9_].
>>> So we can not pass name with namespace prefix.
>>>

 So, if we use only the name (tableRecord, by removing the prefix) to
 create the avro schema, how are we going to differentiate the records
 separately when generating the mapping config?

>>>
>>>  We should add above xml namespace prefix as the namespace of AVRO
>>> record. Then two elements can be differentiated.
>>> For Eg:
>>>
>>> {
>>>   "type" : "record",
>>>   "name" : "root",
>>>   "fields" : [ {
>>> "type" : "record",
>>> "name" : "tableRecord",
>>>* "doc" : "http://www.w3.org/TR/html4/
>>> ",*
>>> "namespace" : "N1",
>>> "fields" : [ {
>>>   "name" : "name",
>>>   "type" : [ "null", "string" ],
>>>   "doc" : "http://www.w3.org/TR/html4/;
>>>   } , {
>>>   "name" : "width",
>>>   "type" : [ "null", "int" ],
>>>   "doc" : "http://www.w3.org/TR/html4/;
>>>   },{
>>>   "name" : "length",
>>>   "type" : [ "null", "int" ],
>>>   "doc" : "http://www.w3.org/TR/html4/;
>>>   }]
>>> }, {
>>> "type" : "record",
>>> "name" : "tableRecord",
>>>   *  "doc" : "http://www.w3schools.com/furniture
>>> ",*
>>> "namespace" : "N2",
>>> "fields" : [ {
>>>   "name" : "name",
>>>   "type" : [ "null", "string" ],
>>>   *"doc" : "http://www.w3schools.com/furniture
>>> 

Re: [Dev] Issue in representing avro records with multiple namespaces

2016-03-01 Thread Jasintha Dasanayake
On Tue, Mar 1, 2016 at 9:07 PM, Sohani Weerasinghe  wrote:

> Thanks Nuwan for the response.
>
> When generating the avro schema by adding elements to the tree view, user
> can specify the namespace (xml namespace) with the prefix, so that when
> generating the the avro schema we can map the namespace to doc and prefix
> to the namespace in avro.
>

Yes that's mapping is fine , somehow we need to show at least prefix in the
tree view otherwise user experience won't be nice since user have to check
it explicitly while doing the mapping

Thanks and Regards
/Jasintha.

>
> Thanks,
> Sohani
>
> Sohani Weerasinghe
> Software Engineer
> WSO2, Inc: http://wso2.com
>
> Mobile  : +94 716439774
> Blog :http://christinetechtips.blogspot.com/
> Twitter  : https://twitter.com/sohanichristine
>
> On Tue, Mar 1, 2016 at 8:54 PM, Nuwan Pallewela  wrote:
>
>>
>>
>> On Tue, Mar 1, 2016 at 7:34 PM, Sohani Weerasinghe 
>> wrote:
>>
>>> Hi All,
>>>
>>> If we consider an XML which has multiple namespaces as below ,
>>>
>>> 
>>> http://www.w3.org/TR/html4/;>
>>>   Asian Coffee Table
>>>   74
>>>   129
>>> 
>>> http://www.w3schools.com/furniture;>
>>>   African Coffee Table
>>>   80
>>>   120
>>> 
>>> 
>>>
>>> The avro schema should be as follows ,
>>>
>>> {
>>>   "type" : "record",
>>>   "name" : "root",
>>>   "fields" : [ {
>>> "type" : "record",
>>> "name" : "tableRecord",
>>>* "doc" : "http://www.w3.org/TR/html4/
>>> ",*
>>> "namespace" : "http://www.w3.org/TR/html4/;
>>> "fields" : [ {
>>>   "name" : "name",
>>>   "type" : [ "null", "string" ]
>>>   "doc" : "http://www.w3.org/TR/html4/;
>>>   } , {
>>>   "name" : "width",
>>>   "type" : [ "null", "int" ]
>>>   },{
>>>   "name" : "length",
>>>   "type" : [ "null", "int" ]
>>>   }]
>>> }, {
>>> "type" : "record",
>>> "name" : "tableRecord",
>>>   *  "doc" : "http://www.w3schools.com/furniture
>>> ",*
>>> "namespace" : "http://www.w3schools.com/furniture;
>>> "fields" : [ {
>>>   "name" : "name",
>>>   "type" : [ "null", "string" ]
>>>   } , {
>>>   "name" : "width",
>>>   "type" : [ "null", "int" ]
>>>   },{
>>>   "name" : "length",
>>>   "type" : [ "null", "int" ]
>>>   }]
>>> } ]
>>> }
>>>
>>> When representing this using the Visual DataMapper Editor, in order to
>>> differentiate the two records, we can add a namespace prefix to the name of
>>> the record as shown below.
>>>
>>>
>>> ​But when generating the Avro Schema, if we pass this value as the name
>>> of the node it  throws *org.apache.avro.SchemaParseException: Illegal
>>> character in: y:tableRecord.*
>>>
>>
>> AVRO name should start with [A-Za-z] and subsequently contain only  
>> [A-Za-z0-9_].
>> So we can not pass name with namespace prefix.
>>
>>>
>>> So, if we use only the name (tableRecord, by removing the prefix) to
>>> create the avro schema, how are we going to differentiate the records
>>> separately when generating the mapping config?
>>>
>>
>>  We should add above xml namespace prefix as the namespace of AVRO
>> record. Then two elements can be differentiated.
>> For Eg:
>>
>> {
>>   "type" : "record",
>>   "name" : "root",
>>   "fields" : [ {
>> "type" : "record",
>> "name" : "tableRecord",
>>* "doc" : "http://www.w3.org/TR/html4/
>> ",*
>> "namespace" : "N1",
>> "fields" : [ {
>>   "name" : "name",
>>   "type" : [ "null", "string" ],
>>   "doc" : "http://www.w3.org/TR/html4/;
>>   } , {
>>   "name" : "width",
>>   "type" : [ "null", "int" ],
>>   "doc" : "http://www.w3.org/TR/html4/;
>>   },{
>>   "name" : "length",
>>   "type" : [ "null", "int" ],
>>   "doc" : "http://www.w3.org/TR/html4/;
>>   }]
>> }, {
>> "type" : "record",
>> "name" : "tableRecord",
>>   *  "doc" : "http://www.w3schools.com/furniture
>> ",*
>> "namespace" : "N2",
>> "fields" : [ {
>>   "name" : "name",
>>   "type" : [ "null", "string" ],
>>   *"doc" : "http://www.w3schools.com/furniture
>> "*
>>   } , {
>>   "name" : "width",
>>   "type" : [ "null", "int" ]
>>   *"doc" : "http://www.w3schools.com/furniture
>> "*
>>   },{
>>   "name" : "length",
>>   "type" : [ "null", "int" ],
>>   *"doc" : "http://www.w3schools.com/furniture
>> "*
>>   }]
>> } ]
>> }
>>
>> Then the full names of the two tableRecords will be N1.tableRecord 

Re: [Dev] Issue in representing avro records with multiple namespaces

2016-03-01 Thread Sohani Weerasinghe
Thanks Nuwan for the response.

When generating the avro schema by adding elements to the tree view, user
can specify the namespace (xml namespace) with the prefix, so that when
generating the the avro schema we can map the namespace to doc and prefix
to the namespace in avro.

Thanks,
Sohani

Sohani Weerasinghe
Software Engineer
WSO2, Inc: http://wso2.com

Mobile  : +94 716439774
Blog :http://christinetechtips.blogspot.com/
Twitter  : https://twitter.com/sohanichristine

On Tue, Mar 1, 2016 at 8:54 PM, Nuwan Pallewela  wrote:

>
>
> On Tue, Mar 1, 2016 at 7:34 PM, Sohani Weerasinghe 
> wrote:
>
>> Hi All,
>>
>> If we consider an XML which has multiple namespaces as below ,
>>
>> 
>> http://www.w3.org/TR/html4/;>
>>   Asian Coffee Table
>>   74
>>   129
>> 
>> http://www.w3schools.com/furniture;>
>>   African Coffee Table
>>   80
>>   120
>> 
>> 
>>
>> The avro schema should be as follows ,
>>
>> {
>>   "type" : "record",
>>   "name" : "root",
>>   "fields" : [ {
>> "type" : "record",
>> "name" : "tableRecord",
>>* "doc" : "http://www.w3.org/TR/html4/
>> ",*
>> "namespace" : "http://www.w3.org/TR/html4/;
>> "fields" : [ {
>>   "name" : "name",
>>   "type" : [ "null", "string" ]
>>   "doc" : "http://www.w3.org/TR/html4/;
>>   } , {
>>   "name" : "width",
>>   "type" : [ "null", "int" ]
>>   },{
>>   "name" : "length",
>>   "type" : [ "null", "int" ]
>>   }]
>> }, {
>> "type" : "record",
>> "name" : "tableRecord",
>>   *  "doc" : "http://www.w3schools.com/furniture
>> ",*
>> "namespace" : "http://www.w3schools.com/furniture;
>> "fields" : [ {
>>   "name" : "name",
>>   "type" : [ "null", "string" ]
>>   } , {
>>   "name" : "width",
>>   "type" : [ "null", "int" ]
>>   },{
>>   "name" : "length",
>>   "type" : [ "null", "int" ]
>>   }]
>> } ]
>> }
>>
>> When representing this using the Visual DataMapper Editor, in order to
>> differentiate the two records, we can add a namespace prefix to the name of
>> the record as shown below.
>>
>>
>> ​But when generating the Avro Schema, if we pass this value as the name
>> of the node it  throws *org.apache.avro.SchemaParseException: Illegal
>> character in: y:tableRecord.*
>>
>
> AVRO name should start with [A-Za-z] and subsequently contain only  
> [A-Za-z0-9_].
> So we can not pass name with namespace prefix.
>
>>
>> So, if we use only the name (tableRecord, by removing the prefix) to
>> create the avro schema, how are we going to differentiate the records
>> separately when generating the mapping config?
>>
>
>  We should add above xml namespace prefix as the namespace of AVRO record.
> Then two elements can be differentiated.
> For Eg:
>
> {
>   "type" : "record",
>   "name" : "root",
>   "fields" : [ {
> "type" : "record",
> "name" : "tableRecord",
>* "doc" : "http://www.w3.org/TR/html4/
> ",*
> "namespace" : "N1",
> "fields" : [ {
>   "name" : "name",
>   "type" : [ "null", "string" ],
>   "doc" : "http://www.w3.org/TR/html4/;
>   } , {
>   "name" : "width",
>   "type" : [ "null", "int" ],
>   "doc" : "http://www.w3.org/TR/html4/;
>   },{
>   "name" : "length",
>   "type" : [ "null", "int" ],
>   "doc" : "http://www.w3.org/TR/html4/;
>   }]
> }, {
> "type" : "record",
> "name" : "tableRecord",
>   *  "doc" : "http://www.w3schools.com/furniture
> ",*
> "namespace" : "N2",
> "fields" : [ {
>   "name" : "name",
>   "type" : [ "null", "string" ],
>   *"doc" : "http://www.w3schools.com/furniture
> "*
>   } , {
>   "name" : "width",
>   "type" : [ "null", "int" ]
>   *"doc" : "http://www.w3schools.com/furniture
> "*
>   },{
>   "name" : "length",
>   "type" : [ "null", "int" ],
>   *"doc" : "http://www.w3schools.com/furniture
> "*
>   }]
> } ]
> }
>
> Then the full names of the two tableRecords will be N1.tableRecord and
> N2.tableRecord and AVRO can differentiate these two fields.
>
>>
>> eg: If we are to map a field in  y:tableRecord with a field
>> in y:tableRecord etc. How can we differentiate this?
>>
>> This usecase of having multiple namespaces can be displayed graphically
>> in the Design view by appending a namespace prefix, but it seems this will
>> have issues in generating the avro schema and the mapping config.
>>
>
> Mapping configuration does not need to be aware 

Re: [Dev] Issue in representing avro records with multiple namespaces

2016-03-01 Thread Nuwan Pallewela
On Tue, Mar 1, 2016 at 7:34 PM, Sohani Weerasinghe  wrote:

> Hi All,
>
> If we consider an XML which has multiple namespaces as below ,
>
> 
> http://www.w3.org/TR/html4/;>
>   Asian Coffee Table
>   74
>   129
> 
> http://www.w3schools.com/furniture;>
>   African Coffee Table
>   80
>   120
> 
> 
>
> The avro schema should be as follows ,
>
> {
>   "type" : "record",
>   "name" : "root",
>   "fields" : [ {
> "type" : "record",
> "name" : "tableRecord",
>* "doc" : "http://www.w3.org/TR/html4/
> ",*
> "namespace" : "http://www.w3.org/TR/html4/;
> "fields" : [ {
>   "name" : "name",
>   "type" : [ "null", "string" ]
>   "doc" : "http://www.w3.org/TR/html4/;
>   } , {
>   "name" : "width",
>   "type" : [ "null", "int" ]
>   },{
>   "name" : "length",
>   "type" : [ "null", "int" ]
>   }]
> }, {
> "type" : "record",
> "name" : "tableRecord",
>   *  "doc" : "http://www.w3schools.com/furniture
> ",*
> "namespace" : "http://www.w3schools.com/furniture;
> "fields" : [ {
>   "name" : "name",
>   "type" : [ "null", "string" ]
>   } , {
>   "name" : "width",
>   "type" : [ "null", "int" ]
>   },{
>   "name" : "length",
>   "type" : [ "null", "int" ]
>   }]
> } ]
> }
>
> When representing this using the Visual DataMapper Editor, in order to
> differentiate the two records, we can add a namespace prefix to the name of
> the record as shown below.
>
>
> ​But when generating the Avro Schema, if we pass this value as the name of
> the node it  throws *org.apache.avro.SchemaParseException: Illegal
> character in: y:tableRecord.*
>

AVRO name should start with [A-Za-z] and subsequently contain only
[A-Za-z0-9_].
So we can not pass name with namespace prefix.

>
> So, if we use only the name (tableRecord, by removing the prefix) to
> create the avro schema, how are we going to differentiate the records
> separately when generating the mapping config?
>

 We should add above xml namespace prefix as the namespace of AVRO record.
Then two elements can be differentiated.
For Eg:

{
  "type" : "record",
  "name" : "root",
  "fields" : [ {
"type" : "record",
"name" : "tableRecord",
   * "doc" : "http://www.w3.org/TR/html4/
",*
"namespace" : "N1",
"fields" : [ {
  "name" : "name",
  "type" : [ "null", "string" ],
  "doc" : "http://www.w3.org/TR/html4/;
  } , {
  "name" : "width",
  "type" : [ "null", "int" ],
  "doc" : "http://www.w3.org/TR/html4/;
  },{
  "name" : "length",
  "type" : [ "null", "int" ],
  "doc" : "http://www.w3.org/TR/html4/;
  }]
}, {
"type" : "record",
"name" : "tableRecord",
  *  "doc" : "http://www.w3schools.com/furniture
",*
"namespace" : "N2",
"fields" : [ {
  "name" : "name",
  "type" : [ "null", "string" ],
  *"doc" : "http://www.w3schools.com/furniture
"*
  } , {
  "name" : "width",
  "type" : [ "null", "int" ]
  *"doc" : "http://www.w3schools.com/furniture
"*
  },{
  "name" : "length",
  "type" : [ "null", "int" ],
  *"doc" : "http://www.w3schools.com/furniture
"*
  }]
} ]
}

Then the full names of the two tableRecords will be N1.tableRecord and
N2.tableRecord and AVRO can differentiate these two fields.

>
> eg: If we are to map a field in  y:tableRecord with a field
> in y:tableRecord etc. How can we differentiate this?
>
> This usecase of having multiple namespaces can be displayed graphically in
> the Design view by appending a namespace prefix, but it seems this will
> have issues in generating the avro schema and the mapping config.
>

Mapping configuration does not need to be aware of the namespaces as long
as they can be differentiate in the diagram. Output from the mapping will
look into the output schema and will build the output message with desired
namespaces.

>
> Your suggestions are highly appreciated.
>
> Thanks,
> Sohani
> Sohani Weerasinghe
> Software Engineer
> WSO2, Inc: http://wso2.com
>
> Mobile  : +94 716439774
> Blog :http://christinetechtips.blogspot.com/
> Twitter  : https://twitter.com/sohanichristine
>



-- 
--

*Nuwan Chamara Pallewela*


*Software Engineer*

*WSO2, Inc. *http://wso2.com
*lean . enterprise . middleware*

Email   *nuw...@wso2.com *
Mobile  *+94719079739@*
___
Dev mailing 

[Dev] Issue in representing avro records with multiple namespaces

2016-03-01 Thread Sohani Weerasinghe
Hi All,

If we consider an XML which has multiple namespaces as below ,


http://www.w3.org/TR/html4/;>
  Asian Coffee Table
  74
  129

http://www.w3schools.com/furniture;>
  African Coffee Table
  80
  120



The avro schema should be as follows ,

{
  "type" : "record",
  "name" : "root",
  "fields" : [ {
"type" : "record",
"name" : "tableRecord",
   * "doc" : "http://www.w3.org/TR/html4/
",*
"namespace" : "http://www.w3.org/TR/html4/;
"fields" : [ {
  "name" : "name",
  "type" : [ "null", "string" ]
  "doc" : "http://www.w3.org/TR/html4/;
  } , {
  "name" : "width",
  "type" : [ "null", "int" ]
  },{
  "name" : "length",
  "type" : [ "null", "int" ]
  }]
}, {
"type" : "record",
"name" : "tableRecord",
  *  "doc" : "http://www.w3schools.com/furniture
",*
"namespace" : "http://www.w3schools.com/furniture;
"fields" : [ {
  "name" : "name",
  "type" : [ "null", "string" ]
  } , {
  "name" : "width",
  "type" : [ "null", "int" ]
  },{
  "name" : "length",
  "type" : [ "null", "int" ]
  }]
} ]
}

When representing this using the Visual DataMapper Editor, in order to
differentiate the two records, we can add a namespace prefix to the name of
the record as shown below.


​But when generating the Avro Schema, if we pass this value as the name of
the node it  throws *org.apache.avro.SchemaParseException: Illegal
character in: y:tableRecord.*

So, if we use only the name (tableRecord, by removing the prefix) to create
the avro schema, how are we going to differentiate the records separately
when generating the mapping config?

eg: If we are to map a field in  y:tableRecord with a field
in y:tableRecord etc. How can we differentiate this?

This usecase of having multiple namespaces can be displayed graphically in
the Design view by appending a namespace prefix, but it seems this will
have issues in generating the avro schema and the mapping config.

Your suggestions are highly appreciated.

Thanks,
Sohani
Sohani Weerasinghe
Software Engineer
WSO2, Inc: http://wso2.com

Mobile  : +94 716439774
Blog :http://christinetechtips.blogspot.com/
Twitter  : https://twitter.com/sohanichristine
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev