Comparison of serialization or graph representation formats

137 views
Skip to first unread message

Joseph Boyle

unread,
Apr 25, 2013, 5:24:33 PM4/25/13
to drummond@respectnetwork.net Reed, Markus Sabadello, xd...@googlegroups.com
This is to help understand formats discussed in today's XDI2 call so we can proceed further with design of formats. Corrections encouraged.



Existing description: display format
Suggested description: display format statement serialization
Current documentation: https://wiki.oasis-open.org/xdi/XdiAbnf  (we have been conflating it with the graph rather than documenting it as a serialization)
Low level data format: proprietary

Graph serialization approach: as list of statements (triples) containing full paths
Subject/context format: Composed as bare string; always required
Predicate format: Composed as bare string separated by /
Object format: Composed as as bare string or as JSON value

Repetition elimination: none, always use full addresses
Idempotence: Sequence of operations where result in graph can be overwritten by a following statement
Minimal example: 10 bytes
=s/=p/=o<LF>



Existing description: (original) JSON serialization
Suggested description: JSON S/P or S+P statement serialization      (pronounced just as SP)
Current documentation: https://wiki.oasis-open.org/xdi/JSONSerializationRules  (will move to its own page)
Low level data format: JSON

Graph serialization approach: as list statements (triples) containing full paths
Subject/context format: Composed as JSON string along with predicate
Predicate format: Composed as JSON string along with subject
Object format: Composed as JSON string

Repetition elimination: Can omit S/P if both exactly the same
Idempotence: Sequence of operations where result in graph can be overwritten by a following statement
Minimal example: 16 bytes
{"=s/=p":["=o"]}



Existing description: parse tree serialization
Suggested description: JSON parsed statement serialization
Current documentation: https://wiki.oasis-open.org/xdi/JSONSerializationRules/Discussion 2013-04-06 entry  (will move to its own page)
Low level data format: JSON

Graph serialization approach: as list of statements (triples) containing full paths
Subject/context format: Decomposed as JSON key per context symbol and JSON string value per corresponding identifier
Predicate format: Decomposed as JSON key per context symbol and JSON string value per corresponding identifier
Object format: Decomposed as JSON key per context symbol and JSON string value per corresponding identifier

Repetition elimination: None currently
Idempotence: Sequence of operations where result in graph can be overwritten by a following statement
Minimal example: 35 bytes
[[[{"=":"s"},{"=":"p"},{"=":"o"}]]]



Existing description: graph tree serialization
Suggested description: JSON context tree serialization
Current documentation: https://wiki.oasis-open.org/xdi/GraphTreeSerialization  (will move to its own page)
Low level data format: JSON

Graph serialization approach: Nodes and contextual arcs serialized as JSON tree structure. Relational and literal arcs as keys on subject node.
Subject/context format: Decomposed as JSON key per arc, key string contains both context symbol corresponding identifier
Predicate format: Composed as single JSON string
Object format: Composed as single JSON strong except if object is an inner graph; then inner graph's subject is decomposed.

Repetition elimination: All shared prefixes among all subjects are merged as part of tree; but no such merging for predicate and object. No separate definitions needed for contexts.
Idempotence: Represents state, not a sequence of operations
Minimal example: 26 bytes
{"=s":{"/":{"=p":["=o"]}}} 



Existing description: XDI2 JSON format to represent XDI graph in Zephyr datastore:
Low level data format: JSON

Graph serialization approach: List of nodes each containing list of outgoing arcs and incoming arcs (please correct and improve)
Subject/context format: composed as single JSON string, but encoded as URL
Predicate format: single JSON string?
Object format: single JSON string?

Idempotence: Represents state, not a sequence of operations
Minimal example: add here

Reply all
Reply to author
Forward
0 new messages