nLSD graphs
Basic line format:
(node number) : (node type) : (node data)
Start counting from 0.
|
type |
data |
|
STR |
string data, turn newlines into "\n" and slashes into "\\" |
|
INT |
integer, infinitely long possible |
|
FLOAT |
float, whatever |
|
LIST |
comma seperated list of nodes that are elements of the list |
|
DICT |
comma seperated list of nodes, k,v,k,v,k,v,... |
|
REF |
(URL (optional: space node#/flagid (optional-repeat space index)) - where to tie into another nLSD graph |
|
|
optional: node# or flag ID for identifying start point w/in graph at URL |
|
|
optional: indexes are either LIST indexes or DICT key-names |
|
XML-RPC |
URL - will turn into an XML-RPC server proxy object |
|
FLAG |
(string name) + (a space) + node number |
make & communicate lisp-ish / scheme-ish micro-language
whatever
data = nLSD.Graph( data=[1,2,3] ) data = nLSD.Graph( uri="http://speakeasy.org/~lion/data/" ) data = nLSD.Graph( data=["hello", ", ", "world!", nLSD.Ref( "http://speakeasy.org/~lion/data/" ) )
You can also point a Ref at a particular node of the target graph, by identifying it by number.
Nitpicking details:
You can use node-types that others might not quite understand- they should just put a "I-don't-know-how-to-understand-this" node in place.
FLAG: Particular flags should appear only once. They are used to pinpoint particular locations within the graph. The node number of the Flag itself (not what it demarcs) should NEVER be referenced. Flag IDs cannot be numbers. (Otherwise, you couldn't tell the difference between a flag, and a number of a node.)
"START" - there's a special flag named "START" (all caps.) Tells where to "start" from, in the absense of directions. If graph doesn't have one, start at node 0. If graph doesn't have a "START" flag, and doesn't have a node 0, then it has no start position.
DICT: if you have a list for a key, render it as an immutable key.
Don't be stupid. Don't make a dictionary keys out of a START node, or any other funny stuff.
Document encoding: iso-8859-1? What? You tell me. What does everyone else use? I don't know, I just work here.
Future Possibilities:
Make a FLAG node? This would replace the START node. It would allow you to name particular nodes for easy external binding. If a REF had a string for a second argument, the string would point to the FLAG name. Default: "START".