Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SemanticString
02-11-2018, 12:35 PM (This post was last modified: 02-12-2018 04:40 PM by lingu.)
Post: #1
SemanticString
A semantic string is programmingly of type SemanticString, which defines a message with type information and a byte sequence content. It has the following message layout.

Code:
{
   int64 format;  // format ID. 1: raw byte sequence.                        
   int64 Blen;   // size in bytes not including format and Blen
   varda: variable data {
      short data: 6B
      or {                                  
       ... more header fields ... (nil for raw byte sequence)                      
       byte sequence
      }
   }                                                                
   padding to 8B boundary                                                      
}

Currently, the following format IDs are identified.

1: raw byte sequence
2: PlainMessage
9: Composite: the semantic string contains multiple substrings which are semantic strings in themselves.

Programs
SemanticString and CompositeSemanticString abstract the behavior of SemanticString. CompositeSemanticString extends SemanticString so that I expect polymorphism would work. But I am not sure because I dont know much about java.

---
20180212/gl: Add composite type.
20180211/gl: Add PlainMessage.
Find all posts by this user
Quote this message in a reply
02-11-2018, 01:20 PM
Post: #2
RE: SemanticString
Many of our data structures are represented as PlainMessage messages. I suggest we support that by adding a format ID:

2: PlainMessage

RR zma.
Find all posts by this user
Quote this message in a reply
02-11-2018, 02:52 PM
Post: #3
RE: SemanticString
(02-11-2018 01:20 PM)lingu Wrote:  Many of our data structures are represented as PlainMessage messages. I suggest we support that by adding a format ID:

2: PlainMessage

RR zma.

I guess "varda" contains the encoded PlainMessage? If so, it sounds good to me.
Visit this user's website Find all posts by this user
Quote this message in a reply
02-11-2018, 11:44 PM
Post: #4
RE: SemanticString
We'd like to also make it possible to construct a composite SemanticString which contains multiple SemanticStrings in it. Such recursion is usually necessary when we handle sophisticated data. An example is the messages between a client and a server, which may contain multiple fields including error messages. But it may not be able to predict which contents/segments a message indeed contains. For example, if there is no error, there may not be an error message string.

I suggest we add a composite type:

9: Composite: the semantic string contains multiple substrings which are semantic strings in themselves.

RR xinjie
Find all posts by this user
Quote this message in a reply
02-12-2018, 10:32 AM
Post: #5
RE: SemanticString
(02-11-2018 11:44 PM)lingu Wrote:  We'd like to also make it possible to construct a composite SemanticString which contains multiple SemanticStrings in it. Such recursion is usually necessary when we handle sophisticated data. An example is the messages between a client and a server, which may contain multiple fields including error messages. But it may not be able to predict which contents/segments a message indeed contains. For example, if there is no error, there may not be an error message string.

I suggest we add a composite type:

9: Composite: the semantic string contains multiple substrings which are semantic strings in themselves.

RR xinjie

Good to me.
Find all posts by this user
Quote this message in a reply
02-12-2018, 04:39 PM
Post: #6
RE: SemanticString
SemanticString and CompositeSemanticString abstract the behavior of SemanticString. CompositeSemanticString extends SemanticString so that I expect polymorphism would work. But I am not sure because I dont know much about java.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: