<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<font face="Helvetica, Arial, sans-serif">So, we've been talking
about it for quite a while.<br>
We really need this, we should start working on it actively to
make a proof of concepts.<br>
I know many of us (included myself) are developing their own API
for their nodeDB.<br>
<br>
Let's agree discuss about this common interchange mecchanism.<br>
<br>
I'll start with some thoughts that follow.<br>
<br>
Every community surely has at least NODES in their DB, so I'll
start with that.<br>
<br>
This is a draft of how my JSON list (and I underline that a list
view is different from a detail view, a list view is for example <b>/api/v1/nodes/</b>
while a detail view would be /api/v1/nodes/<slug>/ output
actually looks like:<br>
</font>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<br class="Apple-interchange-newline">
<span style="color: rgb(0, 0, 0); font-family: monospace;
font-style: normal; font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: normal; orphans: 2;
text-align: -webkit-auto; text-indent: 0px; text-transform: none;
white-space: pre; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;
font-size: medium; display: inline !important; float: none; ">{</span>
<ul class="obj collapsible" style="list-style-type: none;
padding-top: 0px; padding-right: 0px; padding-bottom: 0px;
padding-left: 0px; margin-top: 0px; margin-right: 0px;
margin-bottom: 0px; margin-left: 2em; color: rgb(0, 0, 0);
font-family: monospace; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-align: -webkit-auto; text-indent: 0px;
text-transform: none; white-space: pre; widows: 2; word-spacing:
0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width:
0px; font-size: medium; ">
<li style="position: relative; ">
<div class="hoverable" style="-webkit-transition-property:
background-color; -webkit-transition-duration: 0.2s;
-webkit-transition-timing-function: ease-out;
-webkit-transition-delay: 0s; display: inline-block;
padding-top: 1px; padding-bottom: 1px; padding-left: 2px;
padding-right: 2px; border-top-left-radius: 2px;
border-top-right-radius: 2px; border-bottom-right-radius: 2px;
border-bottom-left-radius: 2px; "><span class="property"
style="font-weight: bold; ">meta</span>: {
<ul class="obj collapsible" style="list-style-type: none;
padding-top: 0px; padding-right: 0px; padding-bottom: 0px;
padding-left: 0px; margin-top: 0px; margin-right: 0px;
margin-bottom: 0px; margin-left: 2em; ">
<li style="position: relative; ">
<div class="hoverable" style="-webkit-transition-property:
background-color; -webkit-transition-duration: 0.2s;
-webkit-transition-timing-function: ease-out;
-webkit-transition-delay: 0s; display: inline-block;
padding-top: 1px; padding-bottom: 1px; padding-left:
2px; padding-right: 2px; border-top-left-radius: 2px;
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
border-bottom-left-radius: 2px; "><span class="property"
style="font-weight: bold; ">limit</span>: <span
class="type-number" style="color: blue; ">1000</span>,</div>
</li>
<li style="position: relative; ">
<div class="hoverable" style="-webkit-transition-property:
background-color; -webkit-transition-duration: 0.2s;
-webkit-transition-timing-function: ease-out;
-webkit-transition-delay: 0s; display: inline-block;
padding-top: 1px; padding-bottom: 1px; padding-left:
2px; padding-right: 2px; border-top-left-radius: 2px;
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
border-bottom-left-radius: 2px; "><span class="property"
style="font-weight: bold; ">next</span>: <span
class="type-null" style="color: gray; ">null</span>,</div>
</li>
<li style="position: relative; ">
<div class="hoverable" style="-webkit-transition-property:
background-color; -webkit-transition-duration: 0.2s;
-webkit-transition-timing-function: ease-out;
-webkit-transition-delay: 0s; display: inline-block;
padding-top: 1px; padding-bottom: 1px; padding-left:
2px; padding-right: 2px; border-top-left-radius: 2px;
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
border-bottom-left-radius: 2px; "><span class="property"
style="font-weight: bold; ">offset</span>: <span
class="type-number" style="color: blue; ">0</span>,</div>
</li>
<li style="position: relative; ">
<div class="hoverable" style="-webkit-transition-property:
background-color; -webkit-transition-duration: 0.2s;
-webkit-transition-timing-function: ease-out;
-webkit-transition-delay: 0s; display: inline-block;
padding-top: 1px; padding-bottom: 1px; padding-left:
2px; padding-right: 2px; border-top-left-radius: 2px;
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
border-bottom-left-radius: 2px; "><span class="property"
style="font-weight: bold; ">previous</span>: <span
class="type-null" style="color: gray; ">null</span>,</div>
</li>
<li style="position: relative; ">
<div class="hoverable" style="-webkit-transition-property:
background-color; -webkit-transition-duration: 0.2s;
-webkit-transition-timing-function: ease-out;
-webkit-transition-delay: 0s; display: inline-block;
padding-top: 1px; padding-bottom: 1px; padding-left:
2px; padding-right: 2px; border-top-left-radius: 2px;
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
border-bottom-left-radius: 2px; "><span class="property"
style="font-weight: bold; ">total_count</span>: 1<span
class="type-number" style="color: blue; "></span></div>
</li>
</ul>
},</div>
</li>
<li style="position: relative; ">
<div class="hoverable" style="-webkit-transition-property:
background-color; -webkit-transition-duration: 0.2s;
-webkit-transition-timing-function: ease-out;
-webkit-transition-delay: 0s; display: inline-block;
padding-top: 1px; padding-bottom: 1px; padding-left: 2px;
padding-right: 2px; border-top-left-radius: 2px;
border-top-right-radius: 2px; border-bottom-right-radius: 2px;
border-bottom-left-radius: 2px; "><span class="property"
style="font-weight: bold; ">objects</span>: [
<ul class="array collapsible" style="list-style-type: none;
padding-top: 0px; padding-right: 0px; padding-bottom: 0px;
padding-left: 0px; margin-top: 0px; margin-right: 0px;
margin-bottom: 0px; margin-left: 2em; ">
<li style="position: relative; ">
<div class="hoverable" style="-webkit-transition-property:
background-color; -webkit-transition-duration: 0.2s;
-webkit-transition-timing-function: ease-out;
-webkit-transition-delay: 0s; display: inline-block;
padding-top: 1px; padding-bottom: 1px; padding-left:
2px; padding-right: 2px; border-top-left-radius: 2px;
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
border-bottom-left-radius: 2px; ">{</div>
</li>
<li style="position: relative; ">
<div class="hoverable" style="-webkit-transition-property:
background-color; -webkit-transition-duration: 0.2s;
-webkit-transition-timing-function: ease-out;
-webkit-transition-delay: 0s; display: inline-block;
padding-top: 1px; padding-bottom: 1px; padding-left:
2px; padding-right: 2px; border-top-left-radius: 2px;
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
border-bottom-left-radius: 2px; ">
<ul class="obj collapsible" style="list-style-type:
none; padding-top: 0px; padding-right: 0px;
padding-bottom: 0px; padding-left: 0px; margin-top:
0px; margin-right: 0px; margin-bottom: 0px;
margin-left: 2em; ">
<li style="position: relative; "><span
class="property" style="font-weight: bold; ">id</span>:
<span class="type-number" style="color: blue; ">1</span>,</li>
<li style="position: relative; "><span
class="property" style="font-weight: bold; ">status</span>:
<span class="type-number" style="color: blue; ">3</span>,
<span class="property" style="font-weight: bold; ">name</span>:
<span class="type-string" style="color: green; ">"Fusolab
Rome"</span>,
</li>
<li style="position: relative; ">
<div class="hoverable"
style="-webkit-transition-property:
background-color; -webkit-transition-duration:
0.2s; -webkit-transition-timing-function:
ease-out; -webkit-transition-delay: 0s; display:
inline-block; padding-top: 1px; padding-bottom:
1px; padding-left: 2px; padding-right: 2px;
border-top-left-radius: 2px;
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
border-bottom-left-radius: 2px; "><span
class="property" style="font-weight: bold; ">slug</span>:
<span class="type-string" style="color: green; ">"fusolab"</span>,</div>
</li>
<li style="position: relative; ">
<div class="hoverable"
style="-webkit-transition-property:
background-color; -webkit-transition-duration:
0.2s; -webkit-transition-timing-function:
ease-out; -webkit-transition-delay: 0s; display:
inline-block; padding-top: 1px; padding-bottom:
1px; padding-left: 2px; padding-right: 2px;
border-top-left-radius: 2px;
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
border-bottom-left-radius: 2px; "><span
class="property" style="font-weight: bold; ">description</span>:
<span class="type-string" style="color: green; ">"Fusolab"</span>,</div>
</li>
<li style="position: relative; ">
<div class="hoverable"
style="-webkit-transition-property:
background-color; -webkit-transition-duration:
0.2s; -webkit-transition-timing-function:
ease-out; -webkit-transition-delay: 0s; display:
inline-block; padding-top: 1px; padding-bottom:
1px; padding-left: 2px; padding-right: 2px;
border-top-left-radius: 2px;
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
border-bottom-left-radius: 2px; "><span
class="property" style="font-weight: bold; ">lat</span>:
<span class="type-number" style="color: blue; ">41.8720419277</span>,</div>
</li>
<li style="position: relative; ">
<div class="hoverable"
style="-webkit-transition-property:
background-color; -webkit-transition-duration:
0.2s; -webkit-transition-timing-function:
ease-out; -webkit-transition-delay: 0s; display:
inline-block; padding-top: 1px; padding-bottom:
1px; padding-left: 2px; padding-right: 2px;
border-top-left-radius: 2px;
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
border-bottom-left-radius: 2px; "><span
class="property" style="font-weight: bold; ">lng</span>:
<span class="type-number" style="color: blue; ">12.5822391919</span>,</div>
</li>
<li style="position: relative; "><span
class="property" style="font-weight: bold; ">elev</span>:
<span class="type-number" style="color: blue; ">80,</span>
<div class="hoverable"
style="-webkit-transition-property:
background-color; -webkit-transition-duration:
0.2s; -webkit-transition-timing-function:
ease-out; -webkit-transition-delay: 0s; display:
inline-block; padding-top: 1px; padding-bottom:
1px; padding-left: 2px; padding-right: 2px;
border-top-left-radius: 2px;
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
border-bottom-left-radius: 2px; "><span
class="property" style="font-weight: bold; "></span></div>
</li>
<li style="position: relative; "><span
class="property" style="font-weight: bold; ">is_hotspot</span>:
<span class="type-boolean" style="color: rgb(178,
34, 34); ">true</span></li>
</ul>
},
</div>
</li>
</ul>
</div>
</li>
</ul>
<span style="color: rgb(0, 0, 0); font-family: monospace;
font-style: normal; font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: normal; orphans: 2;
text-align: -webkit-auto; text-indent: 0px; text-transform: none;
white-space: pre; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;
font-size: medium; display: inline !important; float: none; ">}</span><br>
<font face="Helvetica, Arial, sans-serif"><br>
<b>objects and is_hotspot</b><br>
Pheraphs "objects" should be "nodes" (in this case) and is_hotspot
just "hotspot". What does hotspot actually means? It means if the
node has some kind of easy 0 conf access to the network (included
internet connection), I mean for example an ubiquiti picostation
with 2.4 with open access. We consider that a useful info here.<br>
<br>
<b>status</b><br>
Status could be a string, even though a number would make us save
some bandwidth if we would agree to map numbers to stati, that
could be done easily in any language.<br>
<br>
<b>description</b><br>
Description might be left out for the list view and be kept only
for the detail view to save even more bandwidth.<br>
<br>
<b>slug</b><br>
Pheraphs not evey node db is going to use a slug but I guess we
should make it possible to use it and fallback to the ID if not
present.<br>
<br>
<b>meta</b><br>
that is provided out-of-the-box with django-tastypie. It's useful
in case someone needs to paginate or do some other filtering
operations.<br>
Don't know if it's useful for the interchange mecchanism but that
makes me wonder, what do you do when you have thousands of nodes?<br>
<br>
<b>splitting the nodes</b><br>
</font><font face="Helvetica, Arial, sans-serif">Is not a good idea
to send a huge JSON file to mobile clients.</font> The info should
be split somehow. I was thinking of splitting data depending on
zones / groups (nodewatcher calls them projects, CNML calls them
zones).<br>
clients can download data from the zones they're in, so you if you
load the map of vienna you'll download only the vienna JSON file
initially and other nearer zones/groups/projects will be loaded in
the background as you move around. It should really work in a
similar way like google maps does.<br>
I think I talked about this with Ralf from Funkfeuer.<br>
<br>
Come on, share your thoughts! I guess if we don't start now we'll
never do it ;-P<br>
<br>
<div class="moz-signature"><br>
<b>Federico Capoano</b><br>
Web Designer & Web Developer<br>
Portfolio/Blog: <a href="http://nemesisdesign.net">nemesisdesign.net</a><br>
Twitter: <a href="http://twitter.com/nemesisdesign/">@nemesisdesign</a><br>
PGP Key ID: 308BD46E</div>
</body>
</html>