With version Neo4j 2.3 we introduced the ability to run custom "slide-shows" in the Neo4j Browser, similar to the existing :play movie graph
.
The idea behind these guides is, that you can provide a guided tour to a data set or use-case. Your users can interactively read through the slide-show, execute statements to import or query the data or look at pictures, videos or other media for detailed explanations.
We use these guides ourselves in many areas:
-
Online and classroom training
-
Meetups and presentations
-
Exploration of interesting datasets, like TrumpWorld
:play http://guides.neo4j.com/trumpworld
-
Rendering GraphGists as Guides
Others have used them too, here a few examples:
-
The Panama Papers Download comes with a comprehensive guide
-
Daniel Himmelsteins Protein Networks (Hetnet)
-
Will Lyons Game of Thrones Graph:
:play http://guides.neo4j.com/got
Those guides are simple HTML pages with a section per slide.
Your users can interactively read through the slide-show, execute statements from <pre/>
areas to import or query the data or look at pictures, videos or other media for detailed explanations.
Of course you can use other HTML elements like tables, bullets, links etc.
There are some special classes that trigger actions within Neo4j Browser, e.g. for :play
or :help
commands.
Since Neo4j 3.1 it is also possible to provide form-fields whose input is automatically included in the query text.
The guides can be hosted anywhere, for security reasons you have to whitelist any domain besides http://guides.neo4j.com
in your $NEO4J_HOME/conf/neo4j.conf
.
# comma separated list of base-urls, or * for everything browser.remote_content_hostname_whitelist=http://example.com/guides
Your server has to support proper CORS headers for both GET and OPTIONS requests, so unfortunately GitHub pages and Dropbox folders don’t work, but s3 works well enough (or a custom Python or Java webserver).
Warning
|
For security reasons Javascript and Angular tags are stripped from the HTML, even from whitelisted sources. |
Warning
|
If your Neo4j instance is access over a 'https://' URL, only guides hosted on 'https://' URLs will render. Currently, as of 14-Mar-2017, guides.neo4j.com does not support 'https'. |
The HTML format is described in detail here, but don’t despair, you don’t have to create the HTML manually, although you can fine tune the generated HTML from the next step afterwards.
To make it easier to create Browser Guides we created a simple tooling repository that uses AsciiDoc as source format and a HTML template with the slide structure.
AsciiDoc is used in many places, e.g. for O’Reilly books, many Documentation Manuals (ours too), our [GraphGists] but also Readme’s and Wiki’s on GitHub. It was developed for technical documentation, and is more powerful than Markdown. You can find a basic syntax overview here.
We use the AsciiDoctor toolchain and a variant of their erb-HTML5 templates.
Our process is very easy, we just get or create a simple AsciiDoc file, for deep details on the AsciiDoc syntax, please see the AsciiDoctor User Manual
Clone and enter this repository and start editing your first guide.
git clone https://github.com/neo4j-contrib/neo4j-guides cd neo4j-guides edit adoc/test.adoc
= A Test Guide == First Slide: Media image::https://s3.amazonaws.com/dev.assets.neo4j.com/wp-content/uploads/neo4j_logo-325x150.png[width=200,float=right] This is just a test guide. But it comes with a picture and a video: ++++ <iframe width="560" height="315" src="https://www.youtube.com/embed/V7f2tGsNSck?showinfo=0&controls=2&autohide=1" frameborder="0" allowfullscreen></iframe> ++++ == Second Slide: Statements === Creating Data The area below becomes a clickable statement. [source,cypher] ---- CREATE (db:Database {name:"Neo4j"}) RETURN db ---- === Querying Data :name: pass:a['<span value-key="name">Neo4j</span>'] We use a form field here: ++++ <input style="display:inline;width:30%;" value-for="name" class="form-control" value="Neo4j" size="40"> ++++ [source,cypher,subs=attributes] ---- MATCH (db:Database {name:{name}}) RETURN db ---- == Third Slide: Links * http://neo4j.com/developer/cypher[Learn more about Cypher] * pass:a[<a help-topic='key'>Help Keys</a>] * pass:a[<a play-topic='http://guides.neo4j.com/'>Another Guide</a>] image::http://example.com/guides/img/logo.png[width=100,link="http://example.com"]
And then run it through the run.sh
script to convert it to the HTML slides.
./run.sh adoc/test.adoc html/test.html # optional arguments, leveloffset to change the heading level up or down, base-url and additional attributes ./run.sh path/to/test.adoc path/to/test.html [+1] http://example.com/guides/test # then upload the file to your target server, e.g. s3cmd put -P html/test.html s3://guides.neo4j.com/test
-
idea
-
built in guides
-
capabilities
-
format
-
hosting
-
whitelist
-
auto-play command
-
url-param cmd=play&args=
Explaining the HTML Format https://github.com/neo4j-contrib/neo4j-guides/blob/master/docs/html-guides.adoc
Guide Generator ADOC→ Guides https://github.com/neo4j-contrib/neo4j-guides
ABK’s guides with Jade: https://github.com/neo4j-contrib/guides
:play http://guides.neo4j.com/grid-template.html :play http://guides.neo4j.com/guide-library.html :play http://guides.neo4j.com/how-to-guide.html :play http://guides.neo4j.com/index.html :play http://guides.neo4j.com/interactive-template.html :play http://guides.neo4j.com/northwind-graph-dev.html :play http://guides.neo4j.com/slide-template.html :play http://guides.neo4j.com/start.html :play http://guides.neo4j.com/browser.html
Create a google doc with asciidoc content for collaborative editing Make it publicly readable (with link) Use the "Download as Plain Text URL"
name=${1-network} url='https://docs.google.com/a/neotechnology.com/document/export?format=txt&id=1HY3AX6dvd8UtJhp5XAsyFsQ0oyC6Z0pbwJvkyr4WHtM&token=AC4w5Vjb20_Xmpe6awpuDyYGC5UO5egnEA%3A1488965039896' curl -sL "$url" -o adoc/$name.adoc ./run.sh adoc/$name.adoc html/$name.html s3cmd put -P html/$name.html s3://guides.neo4j.com/$name
Guides for Classroom Training: https://github.com/neo4j-contrib/training/ Neo4j Fundamentals :play http://guides.neo4j.com/fundamentals/ Intro: Relational to Graph: :play http://guides.neo4j.com/intro/ Advanced Cypher :play http://guides.neo4j.com/advanced_cypher/ Recommendation Training: :play http://guides.neo4j.com/reco :play http://guides.neo4j.com/reco/file Modeling Flights: :play http://guides.neo4j.com/modeling_airports
Online Training Cypher Guide: https://github.com/neo-technology/training-slides/tree/master/online/cypher/60-Minute-Cypher :play http://guides.neo4j.com/cypher
APOC Guides: https://github.com/neo4j-contrib/neo4j-apoc-procedures/blob/3.1/docs/guides.adoc :play guides.neo4j.com/apoc/
Loading Data with Apoc :play http://guides.neo4j.com/apocload/
:play http://guides.neo4j.com/sandbox/blank-sandbox :play http://guides.neo4j.com/sandbox/legis-graph :play http://guides.neo4j.com/sandbox/recommendations :play http://guides.neo4j.com/sandbox/retail-recommendations :play http://guides.neo4j.com/sandbox/trumpworld :play http://guides.neo4j.com/sandbox/us-elections-2016
Twitter Election Graph :play http://guides.neo4j.com/twitterElection/
Finding Insights in Campaign Finance Data With Graphs :play http://guides.neo4j.com/nicar2017
https://github.com/johnymontana/neo4j-datasets/tree/master/us-fec-elections-2016 IRE Fundamentals of graph databases + US Congress + FEC :play http://guides.neo4j.com/ire2016/
POLE database :play http://guides.neo4j.com/field/pole.html
RDF vs LPG: The data models :play http://guides.neo4j.com/rdf-graphs/ RDF vs LPG: The data models :play http://guides.neo4j.com/rdf/rdf-to-neo-worked.html
browser.remote_content_hostname_whitelist=http://cloudfront-files-1.publicintegrity.org :play http://cloudfront-files-1.publicintegrity.org/offshoreleaks/neo4j/guide/index.html
GraphGist Portal Guide for any GraphGist "Run this gist in the Neo4j console" :play http://portal.graphgist.org/graph_gists/trumpworld-graph/graph_guide browser.remote_content_hostname_whitelist=http://portal.graphgist.org
Select GraphGists: :play http://guides.neo4j.com/graphgists/
https://twitter.com/graphcommons/status/815999498245853185 Also you’ve probably seen it, Graph Commons supports the Neo4j browser, you can simply type this below in the Neo4j browser (notice the /neo4j at the end): :play https://graphcommons.com/graphs/1a93e8fa-e3ce-4ec7-ba16-814b867d1bcb/neo4j