On Mon, Feb 22, 2016 at 4:30 AM, Tim Richardson <[email protected]> wrote:

> I have a data modelling problem and I'm wondering if protobuf could be the
> right tool to help me solve this problem.
>
> I have data in one schema and i want to transform it to another schema.
>
> message Dataset {
>   required string title = 1;
>   required string description = 2;
> }
> message Study {
>   required string title = 1;
>   required string title = 2;
> }
>
>
>  e.g I would like to transform two messages into a nested message.
>
> message Dataset {
>   required string title = 1;
>   required string description = 2;
>   repeated Study studies = 3;
>
>   message Study {
>     required string title = 1;
>     required string title = 2;
> }
>
>
> Are there any features or patterns in protobuf which would help me with
> this?
>
Do you have many different transformations that you want to do with a
similar pattern? Protobuf's reflection API may be of help here. You can use
the reflection API to inspect the message definitions and create new
schemas. You can find examples of how to use the reflection API in the
documentation of the Message interface:
https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message


>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to