I am considering Neo4j; I have watched a video entitled, "Getting started with Neo4j." I have a basic (low level) understanding of relationships and nodes. I want to have nodes that represent pages on a normal web server. I want to be able to store lets say a journal page and then create a relationship called "inside" to other nodes (its children).I must be able to query down the nodes to a particular item. For example we have a journal and a travel node. Travel is inside journal. Routing to travel/journal must obtain the journal node and all of its data. I understand I will probably have to split at the slashes, but what would a syntax look like for this.I am using nodejs, there are some restful plugins for Neo4j; how will this affect my ability to use all of Neo4j's?I am hoping that Neo4j is right for this. I hate creating a parent/sibbling relationship in a relational database. Querying is terrible and reliability of queries is bad.Thanks.Joshua.--
--
--
Axel Morgner · ax...@morgner.de · @amorgner
c/o Morgner UG · Hanauer Landstr. 291a · 60314 Frankfurt ·
Germany
phone: +49 151 40522060 · skype: axel.morgner
http://structr.org
http://www.meetup.com/graphdb-frankfurt
https://splink.de
<div class="no-tabs content">
<h2 id="common.title" class="append no-label"></h2>
<div class="author-date">
<span id="common.author:out"> <a id="base.user_name"
href="/user/"
class="attr(href,base.user_name,append) replace-inner no-label"></a>
</span> <span id="root.created" class="append no-label"> / </span>
</div>
<div id="common.text" class="no-label replace-inner"
style="margin-top: 1em;"></div>
<div class="topic-list">
<ul id="base.has_topic:out">
<li><a id="base.topic_term" href="/topics/"
class="attr(href,base.topic_term,append) replace-inner no-label"></a>
</li>
</ul>
</div>
<div id="comments" class="embed"></div>
</div>
The code above is valid HTML and can be created with any HTML editor, yet it contains enough information to dynamically create a page based on content in the attributes of the template.
The template transformation is started by putting the node associated with the blog entry into scope.
The h2 element contains an id telling the template engine to lookup a property named "title" within the namespace "common" and put that property in scope. The class attribute "append no-label" tells the engine to add the value of the property to the children of the h2 tag.
The span tag starting in the div "author-date", has an id "common.author:out", which instructs the template engine to look up a relationhip named "author" in the namespace "common" and put the iteration of the nodes found in the outgoing direction into scope,
The following a-tag, fetches the user_name of the author and puts that into scope. to place that as the text of the tag.
</example>
In short, we use the tree structure of HTML to give our templating engine traversal descriptions, so the engine can maintain positions in the graph.
Of course this is only one solution to the challenge to render data from the graph and our solution may not suit your specific need, but I wanted to share it with you anyway, so you get an idea of what can be done.
Niels
--
Travering over path relationships makes the overhead of creating/deleting paths very low, but can have a steep cost when doing lookups.
Stupid question:
Why don't you put the relation the other way round (has_parent) and start from the right side of the url?
Traversal time would not depend on number of child nodes but be linear withe the parts of the Url.
--