Skip to content
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
api
bin
core
css
docs
kbs
kbs_trig
lib
ontos
pending
public
src
srcdocs
test
uploads
vendor
vhosts
views
COPYING
CREDITS
Gruntfile.coffee
README.md
bitbucket-pipelines.yml
bower.json
index.coffee
index.js
libnoo_ng.md
package.json
production_config_db.nq
production_config_db.trig
results.txt
server.coffee
server.js
test_db.nq
test_db.trig

README.md

Nooron: Globally Scalable Collective Cognition

Contents

Issues

Until how to deal with old issues from the master repo on BitBucket has been resolved we ask users to create any new issues at: https://bitbucket.org/nooron/nooron/issues

See this issue about the issues

Requirements

Nooron is served by NodeJS and being developed in an NVM environment using node v8.9.4

Nooron requires NodeJS > 4.0 for access to ES6 features, specifically Proxy

The scripts devInspect and watchInspect require NodeJS > 6.3 for node --inspect support.

how to prepare for development or production

npm install
bower install

how to run development (so it watches for changed files)

npm run dev
# then surf to http://localhost:9998/
#  The server should restart automatically when needed files change.
#  Adjust the list of watched files in Gruntfile.coffee
#  under grunt.initConfig: watch: express: files:

# How to control the amout of logging output
LOG_LEVEL=EMERGENCY npm run dev # 0
LOG_LEVEL=ALERT     npm run dev # 1
LOG_LEVEL=CRITICAL  npm run dev # 2
LOG_LEVEL=ERROR     npm run dev # 3
LOG_LEVEL=WARNING   npm run dev # 4 default
LOG_LEVEL=NOTICE    npm run dev # 5
LOG_LEVEL=INFO      npm run dev # 6
LOG_LEVEL=DEBUG     npm run dev # 7

how to develop FractalPanel

http://localhost:9998/dev/fractalpanel_sandbox.html is a playground for playing with the FractalPanel technology.

http://localhost:9998/tests/fractalpanel.html reloads on every code change and beeps when tests fail. This is good to keep loaded in a tab if you're working with FractalPanel at all. Add your own tests to src/fractalpanel_test.coffee

how to develop HuViz

# use enviroment variables to tell the server where to find the libraries under development
HUVIZ_PATH=path/to/your/dev/version/of/huviz npm run dev
# for example if the huviz directory is beside the libnoo directory...
HUVIZ_PATH=../huviz npm run dev

It might be necessary to keep a tab open where you can manually force the reloading of http://localhost:9998/huviz/huviz.js after you've made a change (and it has rebuilt automatically because you're running the huviz "npm run dev" command in a terminal somewhere). Then do force a full page reload (CMD-SHIFT-R on macOS) to reload the http://localhost:9998/__/whatever url you're doing your testing in.

how to develop email-login

# use enviroment variables to tell the server where to find the libraries under development
EMAILLOGIN_PATH=path/to/your/dev/version/of/email-login npm run dev
# for example if the email-login directory is beside the libnoo directory...
EMAILLOGIN_PATH=../email-login npm run dev

how to develop blossom

# use enviroment variables to tell the server where to find the libraries under development
BLOSSOM_PATH=path/to/your/dev/version/of/PeterKey/blossom/src npm run dev
# for example if the diversus-flower directory is beside the nooron directory...
BLOSSOM_PATH=../blossom/src npm run dev

how to experiment with LAN-local mobile browsers

# use the NOORON_HOSTNAME environment variable to serve from a routed hostname or IP address
NOORON_HOSTNAME=192.168.1.17 npm run dev # use your actual IP here
# at this point you should be able to surf to the Nooron instance at http://192.168.1.17

how to run the server

(for production only)

npm start

how to run tests

# run the tests once with:
npm test
# or equivalently
npm run test

running tests with different LOG_LEVELS

LOG_LEVEL=WARNING npm test
LOG_LEVEL=NOTICE npm test
LOG_LEVEL=INFO npm test
LOG_LEVEL=DEBUG npm test

LOG_LEVEL=WARNING npm run watchTest
LOG_LEVEL=NOTICE npm run watchTest
LOG_LEVEL=INFO npm run watchTest
LOG_LEVEL=DEBUG npm run watchTest

running just some tests

npm run watchTest -- --grep="runs functions"

running tests with different reporters

npm run watchTest -- --reporter=spec
# reporters: dot|min|progress|spec|tap
# See all the reporters at https://mochajs.org/#reporters

running tests with screenshots

SCREENSHOTS=1 npm test # SCREENSHOTS envvar triggers selenium screenshots in test/screenshots/

before committing

Run the following command to update results.txt with the latest canonical test output. This command also shows a diff on results.txt so we might notice changes.

bin/canonical_test_run.sh

Why do this? So that results.txt can be maintained as a log of what test output is looking like. When instituted they were not all passing, so this is a way to track their progress. Notice that here at the outset anyway results.txt looks slightly different every run in one line only.

-  text: 'Please click:\n  http://localhost:31415/email-login/verify/mailto:smurp@smurp.com/nrn:B_3_4YvMz2_3RSRBr/' }
+  text: 'Please click:\n  http://localhost:31415/email-login/verify/mailto:smurp@smurp.com/nrn:B_3_4YvNF3_fzKbj/' }

If that is the only line where there is a diff then we don't need to bother checking results.txt back into the repo. If there are more changes let's check it in with git commit results.txt -m 'latest results.txt'

how to buid the source docs

npm run buildSrcDocs

how to debug the server

First start a watcher to keep code built.

grunt watchbuild

Then start the server with the --inspect flag, restarting upon rebuild or data changes:

 npm run inspect:server
 # This should start up a 'Developer Tools' window for you pointed at the running server.

 # Now any `debugger` lines in server-side code will be respected and you can
 # interactively add your own breakpoints etc.
 # If the window doesn't come up automatically (something is probably broken or your Chrome is < v60)
 # then visit

 chrome://inspect
 # and click on "Open dedicated DevTools for Node"

Coding Standards

The project follows https://github.com/polarmobile/coffeescript-style-guide with the following exceptions.

Calling Functions

When calling functions parenthesis are not optional. In general we try to follow Python aesthetics in this regard to avoid ambiguity and magic.

# GOOD
baz(12)

# SO BAD
baz 12
# whose idea was this?

# GOOD
foo(4).bar(8)

# SO PROFOUNDLY BAD
foo(.bar 8
(foo 4).bar 8
# I am agog!

Setting up VHosts

Nooron has a directory called vhosts/ which ought to contain directories named after the FQDNs which Nooron serves. For instance vhosts/diversus.nooron.com is a symlink to https://github.com/DIVERSUSandTIM/diversusprotoassets which contains configuration, template and asset resources used by Nooron to host the site http://diversus.nooron.com

The public directory

Each VHost's public/ directory is mapped onto the served path https://THE.VHOST.FQDN/vhost so, for example a VHost's public/YOUR/PATH/HERE.png file will appear at https://THE.VHOST.FQDN/vhost/YOUR/PATH/HERE.png

The tmpl directory

Each VHost's tmpl/ directory will be searched for templates before Nooron's own views/ directory.

Currenlty the Diversus tmpl/ directory is also served for ALL VHosts at https://THE.VHOST.FQDN/tmpl until templates start being searched for as described above.

VHost clientArgs

Currently, these are all defined in setUpVHostOrRedir() in server.coffee and are accessible on all visualizations at @rootPanel.clientArgs.vhost_name (for example).

vhost_name = "nooron.com"
The FQDN of the virtual host eg `nooron.com`, `diversus.nooron.com` or `spangler.gig.gl`
close_login_panel = false
Causes the login_panel to not show.
suppress_fracpanel_buttons_by_default = false
Turns off the FractalPanel controls globally on a site.
speedOverFeatures = false
Suppresses the loading of some javascript dependencies for vhosts which do not need them.
default_formurla = "subjects(g=nrn:meta_kb)"
Specify the FormURLa which will run by default for the site

Developing a VHost

In the development environment one runs npm run dev as usual but to experience the vhost you must surf to a localhost version of the vhost. For instance, to develop the diversus.nooron.com vhost the developer surfs to the url http://diversus.nooron.com.localhost:9998/

For the name diversus.nooron.com.localhost to properly resolve, you must modify your /etc/hosts file by adding a name like YOUR.VHOST.FQDN.localhost for 127.0.0.1 for each vhost you would like to develop.

# /etc/hosts
127.0.0.1       localhost
127.0.0.1       nooron.com.localhost # if you would like to develop or experience nooron.com locally
127.0.0.1       diversus.nooron.com.localhost # if you would like to develop diversus

This should work on any unix-like machine.

Evolution of the Dev Environment

I'm regretting the big Gruntfile and all it's tricky deps. Turns out it is merely adding complexity. Let us follow the fine guidance offered by the following docs on how to move toward a lean npm-based configuration.

Another ambition is to move away from coffeescript in favour of plain old ES6. Some of the steps to accomplish that ought to be coordinated with the move away from Grunt.

The Visualizations

   # Ponderate
   allegations(g=nrn:hours_sample) # columns: subject, predicate, object, graph, id is label
   subjects(g=nrn:hours_sample) # subjects are row, predicates are columns
   evaluations(g=nrn:hours_sample) # lowest level of detail
   timesheet(g=nrn:hours_sample) # WIP does not work yet

   # LeafletJS
   map(points="52.4893,13.3595,green,bowie was here;52.48905,13.36061,red,u-Kleistpark is here")
   map(g:nrn:70sCarsGeo) # display data from graph=nrn:70sCarsGeo

   # HuViz
   graph(g=nrn:foaf20140114) # WIP awkward settings and controls panes; scripts status???

   # Blockly
   makeDiscriminator() # WIP parsing not working, cannot be used as visualation of existing Discriminator
   makeDiscriminator(showAST=1,showCode=1) # turn on debugging aids for the Discrimnator AST and source

   # Vega visualations
   area(g=nrn:70sCars)
   bar(g=nrn:70sCars)
   bubble(g=nrn:70sCars,size=Miles_per_Gallon,x=Displacement,y=Horsepower)
   line(g=nrn:70sCars)
   scatter(g=nrn:70sCars,x=Displacement,y=Horsepower,size=Miles_per_Gallon)

   # builtins
   above(...,...) # layout visualizations top to bottom eg. above(map(),print(killroy was above me))
   beside(...,...) # layout visualizations left to right eg. beside(map(),print(killroy was to the left))
   formurlaSrc()
   formurlaAST()
   print("whatever is in here gets printed")
   showDiv(the_Name_Of_A_DIV) # displays a div from the containing HTML environment

   # EXAMPLE LAYOUTS
   beside(above(print(TL),print(BL)),print(MID),above(print(TR),print(BR))) # BL is bugged right now
   # +----+-----+----+
   # | TL |     | TR |
   # +----+ MID +----+
   # | BL |     | BR |
   # +----+-----+----+

   beside(above(makeDiscriminator(),bubble(g=nrn:70sCars,size=Miles_per_Gallon,x=Displacement,y=Horsepower)),map(points="52.490375,13.3602;52.4893,13.3595;52.48905,13.36061"),graph(g=nrn:foaf20140114))
   # +----------+---------+---------+
   # | discr()  |         |         |
   # +----------+  map()  | graph() |
   # | bubble() |         |         |
   # +----+-----+---------+---------+
   #
   # at the moment the placement of bubble() is bugged

Gallery

descriminator, map and foaf graph

References

WikiShootMe

https://tools.wmflabs.org/wikishootme/#lat=52.48842498820842&lng=13.360818028450014&zoom=17

Valuable photo archive offered in a map context.

GeoHack

https://tools.wmflabs.org/geohack/geohack.php?pagename=M-Bahn&params=52.510980556_N_13.37176111_E_type:landmark_region:DE-BE&title=Kemperplatz

Selenium

https://intoli.com/blog/running-selenium-with-headless-chrome/ https://gist.github.com/ziadoz/3e8ab7e944d02fe872c3454d17af31a5

License

Copyright (C) 2010 Shawn F. Murphy

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

You can’t perform that action at this time.