node-hampelmann

npm install node-hampelmann
1 downloads in the last week
1 downloads in the last month

node-Hampelmann

First of all

This is an experimental program and a playground for KNURT Systeme. Feel free to play with us, but do not use it in production environments yet!

Many features described below are a combination of already implemented code, brainstorming results and future issues.

What it is

The node-Hampelmann (German for jumping jack) is a program and a framework that we bashfully also refer to as "Code Without Borders".

In our opinion a huge data collection has the ability to do even more then selling Ads or connecting people! It is able to do everything.

Make some coffee!

To be honest: We only have a computer as well. But what is it then?

The difference (or better the idea) is a code with no specific purposes on the one hand - just like a framework. On the other hand it is an application that is ready to use.

So most likely this is a restful database just like Apache CouchDB or mongodb-rest but featureless. The strong points of the software is the possibility to compare different stored documents and visualize it in a table. And that can be done by everyone just using some HTML.

Let's have a look.

Example 1: Fighting against epidemics

If people describe symptoms of their diseases, what they ate and where they got it, it might become possible to locate the source of the pathogen then.

All you need is a HTML-Form for data capturing:

[...]
<form action="/insert/disease.json" method="post">
   <fieldset>
     <legend>Your symptoms</legend>
     <p>
       <label>Symptom 1<br>
         <input type="text" name="symptoms[]">
       </label>
     </p>
     <p>
       <label>Symptom 2<br>
         <input type="text" name="symptoms[]">
       </label>
     </p>
     <p>
       <label>Symptom 3<br>
         <input type="text" name="symptoms[]">
       </label>
     </p>
   </fieldset>
   <fieldset>
     <legend>Location</legend>
     <p>
       <label>Where did you stay when your symptoms first time appear?<br>
         <input type="text" name="location">
       </label>
     </p>
   </fieldset>
   <p>
     <button type="submit">I agree with a free access of my inputs.<br
/>Submit</button>
   </p>
</form>
[...]

TODO ↘ not implemented yet

It is also possible to send a JSON-Object directly with content type text/json; charset=UTF-8.

And another HTML page with some JavaScript to get a table showing which symptoms appear at what location.

[...]
<head>
[...]
<script type="text/javascript" src="cwb/analyse.js" />
<script type="text/javascript">
   Analyse.show(document.getElementById('result'),
'/disease/symptoms/location');
</script>
</head>
<body>
   <div id="result"></div>
</body>
[...]

The example put the data into a table.

This ideas has many problems. First of all, if you have huge data, you have a huge table. So what you need is a filter (e.g. "only show maximum matches"). (not implemented yet)

Then you have synonyms like "location" can be the geographical location or the part of the body the symptoms are located.

But of course there is a possibility for private use - e.g. A doctor uses his own database.

Technical specifications

The entire application is realized over a webservice answering with JSON.

Store something into the database

Send whatever key values to it via POST. You have to specify the action insert and the doctype:

<form action="http://localhost:3000/insert/<doctype>.json" method="POST">
   <input type="text" name="<key>" />
   [...]
</form>

On sending this form you get an JSON-Answer:

TODO

List of doctypes and keys

It is very important to store same things under the same doctype. It makes not much sense to store things under many synonyms. Also it might have different meanings depending on the html form input label (TODO not stored yet!).

Here is how you get all existing doctypes:

$ curl localhost:3000/doctypes.json
["disease","road_accident","forest_decline"]

And this is how to get the existing keys of a doctype:

$ curl localhost:3000/<doctype>/keys.json

E.g:

$ curl localhost:3000/disease/keys.json
[
   {
     key: "food",
     occurrences: 31
   },
   {
     key: "location",
     occurrences: 153
   },
   {
     key: "symptoms",
     occurrences: 153
   }
]

License

Copyright (C) 2012 KNURT Systeme

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

npm loves you