Re: [Neo4j] feature request for the GUI

2010-07-20 Thread Rob Challen
Sticking with the original thread topic of requirements for neoclipse.
I find that if I accidentally open a view of a graph with more than
about 500 nodes to layout then the whole lot takes a very long time to
come back. Is there a way to either speed it up, or let the user
interrupt the process if there are a lot of nodes to draw. I usually
do it by accident by increasing the traversal depth too much or
enabling the wrong relationshiptype.

All the best,
Rob.

On Tue, Jul 20, 2010 at 1:23 PM, Martin Skurla buja...@gmail.com wrote:
 Peter,


 about editing support = this is true. I firstly focused on core
 abilities like importing and exporting including filtering abilities.
 The fact is that another student is working on Data Laboratory, so the
 place where it will be possible to change data. We are also thinking
 about setting values and this must be solved, but we have to recognize
 how Neo4j behaves, because the actual values are not stored in memory,
 but are delegating at demand so you just cannot set the value
 directly, because it is node/relationship id in fact. There is very
 simple delegating mechanism behind that.

 about performance = this is the thing which will be solved at the
 end. In fact last week I rewrite the importing and exporting, because
 results does not return unconnected nodes. I test it with graph about
 3000 nodes and 8000 edges and it works quite performant. On the other
 side export after the rewrite is brutal slow, I will have to figure
 out why. Performance optimizations will be done at the end, because
 there will be maybe some features that will cause to rewrite some core
 parts as previous week. If you tried the filtering abilities too, this
 can also cause the performance problem, because previous week it was
 just doing the parsing for every node which is now cachced.

 about surf nodes = sorry I don't get the point. Surf nodes are all
 nodes except leafs? If you would like to do that, this is currently
 not possible, but can be simply added as option to API and GUI. Same
 with start node, currently there is no way how to express the fact we
 would like to include it or not. I just forget about the option. And
 this will be added as checkbox in gui and in API too.

 In the case of any other questions, advices, requests, just write...

 //Martin Skurla


 2010/7/20 Peter Neubauer peter.neuba...@neotechnology.com:
 Martin,

 On Tue, Jul 20, 2010 at 1:06 PM, Martin Skurla  I am a GSoC (Google
 Summer of Code) student working on adding support
 for Neo4j in Gephi. I appreciate you to look at Gephi as a very nice
 visualization tool. This week I will also finish the article
 summarizing what have I done and what is needed to do. In fact Gephi
 has much more visualization abilities that Neoclipse. I will also
 write some quiz/questionnaire about some possible features which may
 be implemented but I am not sure if they will be useful for Neo4j
 users. So if you can reply to the article, or fill in the
 quiz/questionnaire it will be very helpful for me.

 Great Martin. I tried out your branch last week - worked partly for a
 small graph. Good work! It seems there is some editing support still
 missing, but I will be happy to test and provide more if you can
 provide more background on how to use Neo4j and Gephi in a good way.


 In fact the project now supports importing Neo4j database and
 exporting, importing with many options how to filter the imput. All
 the traversal work is done in trunk version of Neo4j, so the new
 traversal is used.


 Great. Would be awesome if you could maybe provide a short video
 tutorial on useing Neo4j in Gephi, and post your weekly progress to
 this list?

 Also, hav you tried to open big graphs with Gephi? I recently tried to
 open the Neo4j db generated by the test of
 http://github.com/neo4j/neo4j-spatial (run mvn clean test), but
 things slowed down to a trickle. Not sure if what the limit is for
 Gephi, and how to open/surf nodes with a depth-1 environment in scope
 in Gephi ...

 Cheers,

 /peter
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] Traverser customization

2010-01-25 Thread Rob Challen
Can you close the tree with a has-end relationship from every leaf to
an end-of-thread node, then traverse back up the first n nodes in the
tree from the end-of-thread node?

Complicates your insertion code a bit.

Rob.

On 25/01/2010, Robert Hritz rhr...@gmail.com wrote:
 Hi,

 I am currently playing around with neo4j for one of my pet projects and it
 certainly looks like a interesting technology. I have a few questions
 regarding traversers though.

 Let's say I'm building a threaded discussion forum. Any node can be root of
 a tree of 'reaction' relations with other nodes. Now usually, I would want
 to display the reactions tree depth-first, with descending creation time
 (newest reactions first), and of course paged. For the depth-first part, we
 have the DepthFirstTraverser, which is fine. Descending creation time
 (of the node or relation, doesn't really matter) can be approximated by the
 'natural ordering' mentioned in AbstractTraverser.addEndNodesToList(), we
 only have to reverse the order in which nodes are added to the positions
 list - I didn't try this yet but shouldn't be a big issue. Of course I could
 get all the relevant nodes and do the sorting later in the application
 instead of having to modify the AbstractTraverser but this looks to be
 far more effective. Now to paging: using StopEvaluator and
 ReturnableEvaluator, I can get the first N nodes, next N nodes etc.. But if
 the root node has 100k direct descendants in this relationship and I only
 want first X of them by the aforementioned ordering, the ReturnableEvaluator
 will still be called for all 100k traversal positions, which is not
 effective at all, because I already know that I do not want the last 100k-X,
 where X is not more than 100.

 I do understand that StopEvaluator and ReturnableEvaluator are fine for many
 cases like results filtering, but in the case I would need something
 like a HardStopEvaluator, which will stop the traverser from adding new
 positions and/or calling the evaluators after a node.

 Of course, I can modify the current traverser to fit my needs, but maybe I
 am missing something or there is a better, faster, more
 effective way to accomplish this task. Thank you very much for any input.

 Cheers,

 Robert Hritz
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user


-- 
Sent from my mobile device
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo] Maven repository indexing

2010-01-22 Thread Rob Challen
Would it be possible to index the neo repository with nexus?

Rob.
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] Glassfish v3 and others application servers

2010-01-11 Thread Rob Challen
I have an old framework for serving neo graphs as web pages which I
was deploying using tomcat. It allows you to describe a template for
rendering a neo node and some options around mapping nodes to url. It
is part of the snosled project on sourceforge which has not been
progressing at the moment :-(. I'll dig out the link and point you to
the tests when I am online..

Rob.

On 11/01/2010, Laurent Laborde kerdez...@gmail.com wrote:
 Friendly greetings !

 I'm currently experimenting with Groovy and Grails (Groovy on Rails, heh!).
 I'm also planning to build a web interface to play with my neo4j database.
 (not in grails, as it use hibernate and ORM, which seems to be totally
 incompatible (and counter-intuitive) with neo4j and any graphdb).

 I know Jetty (very cool!!!), tomcat (Mmm ...)
 i wanted to experiment with glassfish v3, as it integrate a *lot* of
 feature, including JavaDB (Sun's Apache Derby) and... Groovy/Grails
 \o/

 unzip, ./bin/as-admin start-dopain, http://localhost:4848/ , pick my
 jaw of the floor !
 I haven't explored all the admin page yet, but that's some impressive
 stuff ! o_O

 I'll be pleased to read feedback about various java application server,

 and solution to display neo4 graph in a webpage (javascript, java applet,
 ... ?)

 Thank you, see you soon ! :)

 --
 Laurent ker2x Laborde
 Sysadmin  DBA at http://www.over-blog.com/
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user


-- 
Sent from my mobile device
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] XML data import strategy?

2009-12-01 Thread Rob Challen
I had to do something like this a while back, for some work I did
representing a UML model represented in XMI. I did, as suggested here,
import the XML tree into neo4j and then worked on producing sequential
domain abstractions of the XML representation, using a set of graph
transformers, until I got to something that represented the content of the
UML model. I was trying to retain the linkage between all the views so had
to keep the various layers in the graph.

From the XML import point of view I used a DOM walk and hasParent and a
hasPrevious relationships to allow for the representation of the
serialisation. If you are going to round trip the XML representation you
need to have a strategy for handling text nodes gracefully. I had to
introduce a special property that allowed a type representation of the XML
node being represented. I also had a property on a neo4j graph node which
held the name of the xml element. To avoid naming conflicts I had to
introduce a system of namespacing neo4j property names, and in fact
namespace representation in general was a bit of an issue.

Based on my experience of doing it this was I have a couple of observations.
One is that to do the abstraction you end up wanting to implement the DOM
specification on top of your graph representation so you can access neo4j
nodes with salient features directly, particularly local path based querying
within the graph was something I had to develop a graph path query for. The
other is that I found in most situations there was a set of XML I really
wanted to remain collapsed within the graph and represented just as a text
attribute in a graph node (e.g. html content in xml structure). So the
ability to selectively collapse and expand nodes was useful. I was looking
at DocumentTraversers and NodeFilters in the DOM 2 spec and thought they
might have been the best way to do this.

I don;t really understand it but something I came across later in my travels
was w3c's GRDDL which appears to be a spec for binding XML transforms to
create RDF. There seem to be other more generic ways also of doing the XML
to RDF conversion - these could be loaded into a dense triple store in
Neo4j. Maybe that is one simple approach which avoids re-implementing
namespace support.

Craig mentions relationships by identity, there are also relationships by
xpath to contend with. I did lookup by identity using an indexservice in the
graph as a postprocessing step but it is more or less the same approach. I
didn;t implement xpath references. I'm happy to dig out the code if anyone
wants a look but be warned its a bit of a mess.

Rob.

On Tue, Dec 1, 2009 at 6:37 PM, Craig Taverner cr...@amanzi.com wrote:

 I can elaborate on my view of option one, parsing directly into neo4j with
 no in-memory representation (other than neo4j caches).

 Firstly I avoid the use of the word DOM here because that seems to imply
 the
 use of an in-memory representation of the XML, which is unnecessary if the
 graph structure is going to match the original XML.

 I would use a SAX parser, which with the default configuration would build
 a
 tree structure in Neo4j exactly matching the XML. Each tag would be a node,
 all attributes become properties and all sub-tags become nodes related to
 the encapsulating node with a 'CHILD' relationship. Then, as Peter says,
 the
 graph database can be manipulated later.

 However, it should not be too hard to create an extension framework
 allowing
 specific customization of the parser to achieve a few deviations from the
 1-1 mapping of XML to graph:

   - Filters for ignoring XML structure
   - Mappers for converting attributes to child nodes, or contained tags to
   properties
   - Rules for cross linking nodes, so the structure is no longer a tree but
   a closed graph.

 This last one is especially important for domain data that XML does not
 support nicely. For example, consider the case of a dataset describing
 blogs. There might be a tree structure of authors like:
 authorsauthorblog... In addition there might be a separate tree of
 categories or tags: tagstag id=32politics/tag/tags. In XML the
 cross linking is achieved though sub-tags to the blog, as in tag-ref
 id=32/. Our default SAX parser would simply create a node linked to the
 blog with the id as an attribute. It has no idea that a better approach is
 to make a relationship back to the original tag in the tags tree.

 We can add that structure later, but I think it best to add it during the
 parse (as long as tags are defined before blogs). To make this work, we do
 need an in memory hash of the tag ids, but that is not a big cost compared
 to the total XML data size, so we still get the low memory, and high
 performance advantages of this approach.

 On Tue, Dec 1, 2009 at 6:13 PM, Peter Neubauer 
 peter.neuba...@neotechnology.com wrote:

   Hi folks,
  I have come over the problem of importing data form XML files a lot
  lately. There are 2 approaches that emerged after 

Re: [Neo] Graph visualization on the web

2009-10-14 Thread Rob Challen
Treebolic looks like an easy option to implement and the graphical rendering
is all client side. It will render graphs as well as trees but needs a focus
node, and can be used in an interactive way.

http://treebolic.sourceforge.net/

A server side rendering to svg using graphviz combined with zgrviewer could
also be good. This is much more flexible for doing different graph layouts
so would work better for visualising whole networks, but all the rendering
would have to be done up front.

http://zvtm.sourceforge.net/zgrviewer/news.html

Rob.

On Wed, Oct 14, 2009 at 9:29 AM, Peter Neubauer neubauer.pe...@gmail.comwrote:

 Hi there,
 another project doing nice visuals based on the Flare toolkit is
 Sasha's PeopleMap,

 http://github.com/sashaagafonoff/peoplemap/blob/master/MASTER/screenshot_13_October_2009.png

 /peter

 GTalk:  neubauer.peter
 Skype   peter.neubauer
 Phone   +46 704 106975
 LinkedIn   http://www.linkedin.com/in/neubauer
 Twitter  http://twitter.com/peterneubauer

 http://www.neo4j.org- Relationships count.
 http://www.oredev.se   - The best thing since the wall came
 down.
 http://www.linkedprocess.org   - Distributed computing on LinkedData scale



 On Wed, Oct 14, 2009 at 10:26 AM, DakshinaMurthy Bhamidi
 bmdakshinamur...@gmail.com wrote:
  You could use Javascript Infoviz toolkit http://thejit.org/.
  It accepts data in json format.
 
  On Wed, Oct 14, 2009 at 1:51 PM, orla.spill...@sunlife.com wrote:
 
  I used an open source Flex based tool called RaViz:
  http://code.google.com/p/birdeye/wiki/RaVis
 
  Its part of the BirdEye Library: http://code.google.com/p/birdeye/
 
  Its mainly built to accept graph data in XML format but some
 modifications
  have been made to allow objects/collections be used as source data and
 this
  is easily built on.
 
  Regards,
  Orla
 
 
  |
  | From:  |
  |
 
 
  
 --|
   |Jonas Andersson jonas.anders...@jayway.se
|
 
 
  
 --|
  |
  | To:|
  |
 
 
  
 --|
   |Neo user discussions user@lists.neo4j.org
|
 
 
  
 --|
  |
  | Date:  |
  |
 
 
  
 --|
   |14/10/2009 09:11
   |
 
 
  
 --|
  |
  | Subject:   |
  |
 
 
  
 --|
   |[Neo] Graph visualization on the web
   |
 
 
  
 --|
 
 
 
 
 
  Hello
 
  I'm wondering if anyone know of a good open source solution for
  displaying graph content, preferably on the web? When developing
  Neoclipse, did you find any other tools than GEF/Zest that might be
  usable? Is GEF/Zest only usable from within eclipse?
 
  Best regards
 
  Jonas Andersson
  ___
  Neo mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user
 
 
 
 
 
 ---
  This e-mail message (including attachments, if any) is intended for the
 use
  of the individual or entity to which it is addressed and may contain
  information that is privileged, proprietary , confidential and exempt
 from
  disclosure.  If you are not the intended recipient, you are notified
 that
  any dissemination, distribution or copying of this communication is
  strictly prohibited.  If you have received this communication in error,
  please notify the sender and erase this e-mail message immediately.
 
 ---
 
  ___
  Neo mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user
 
 
 
 
  --
  Thanks and Regards,
  

Re: [Neo] Graph visualization on the web

2009-10-14 Thread Rob Challen
I think also that the treebolic applet can also input GraphML and maybe
Graphviz dot too, Can't remember the details -  but I think you would loose
the ability to lazily load braches.

On Wed, Oct 14, 2009 at 11:44 AM, Tobias Ivarsson 
tobias.ivars...@neotechnology.com wrote:

 On Wed, Oct 14, 2009 at 10:39 AM, Rob Challen rjchal...@gmail.com wrote:

 
  A server side rendering to svg using graphviz combined with zgrviewer
 could
  also be good. This is much more flexible for doing different graph
 layouts
  so would work better for visualising whole networks, but all the
 rendering
  would have to be done up front.
 
  http://zvtm.sourceforge.net/zgrviewer/news.html
 

 I've written a small lib for rendering Neo4j graphs to graphviz format:
 svn co https://svn.neo4j.org/laboratory/components/neo-graphviz/

 It's just proof of concept, a bit old, and not fully documented, but it
 works, it has been used for a few papers.

 --
 Tobias Ivarsson tobias.ivars...@neotechnology.com
 Hacker, Neo Technology
 www.neotechnology.com
 Cellphone: +46 706 534857
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] Graph visualization on the web

2009-10-14 Thread Rob Challen
Out of scope of the original topic but I just also was directed to cytoscape
from the bioinformatics world which also looks interesting.
http://www.cytoscape.org/index.php


On Wed, Oct 14, 2009 at 1:03 PM, Morten Wang warnc...@online.no wrote:

 * Olivier Rossel
  in java, i use jung or prefuse.
  but it is swing based.
  so pretty difficult to port on web apps.

 I'm using JUNG too.  Most of their examples are applets, so if that's
 within scope it's a possible solution.  When looking for toolkits I also
 looked at Prefuse and Piccolo2D, but couldn't find an easy way to
 do/visualize parallel edges in those, which JUNG supports.



 Cheers,
 Morten

 --
 ...a liquid which was almost, but not quite, entirely unlike tea.
  My opinions are not necessarily those of my provider,
  not necessarily mine, and probably not necessary.
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] Lucene Full text bathinserter

2009-09-07 Thread Rob Challen
Thanks, That's pretty good service :-). I'll try and have a go this
afternoon / tomorrow.

On an aside... I know there was discussion about this before, but I'm trying
to do an implementation of SNOMED CT (a largish medical terminology) in Neo.
SNOMED has a unique index on all concepts and descriptions (which I have
mapped to neo nodes) and relationships (which I have mapped to neo
relationships).

Theoretically it could be useful to directly access a relationship by its
SNOMED ID which would be best done through a unique index - it seems that
the indexing interface is specifically directed at nodes, and accessing a
neo4j relationship in this way would be difficult, is this right?. Given
that this index is pretty much a static lookup table of SNOMED IDS to node /
relationship ids I will probably roll my own very basic
SnomedCtIdIndexService for this, but just wanted to make sure I was not
missing something.

Rob.

On Mon, Sep 7, 2009 at 12:12 PM, Mattias Persson
matt...@neotechnology.comwrote:

 Hi Bob,

 I just committed a LuceneFulltextIndexBatchInserter which does just
 that. You'll probably be the first to try it out though, except some
 unit tests :)

 2009/9/5 Rob Challen rjchal...@gmail.com:
  Hi there,
 
  Is there any way to use a full text lucene index service with the
  BatchInserter, or with the EmbeddedReadOnlyNeo service?
 
  Thanks,
 
  Rob.
  ___
  Neo mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user
 



 --
 Mattias Persson, [matt...@neotechnology.com]
 Neo Technology, www.neotechnology.com
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo] Lucene Full text bathinserter

2009-09-05 Thread Rob Challen
Hi there,

Is there any way to use a full text lucene index service with the
BatchInserter, or with the EmbeddedReadOnlyNeo service?

Thanks,

Rob.
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] New features in trunk

2009-09-03 Thread Rob Challen
I moved over to the b10 snapshot and everything seems fine so far. Recovery
time was near instantaneous on a graph with no changes on it, but that had
been shut down with a transaction open, which previously would have take 5
minutes to rebuild.

I tried to use an EmbeddedReadOnlyNeo service within a servlet container, I
updated to index-utils 0.8-SNAPSHOT and figured out that I had to use a
LuceneReadOnlyIndexService, and it all works, replacing my immediate need
for the RMI  RemoteNeo. Neo was never the performance bottleneck in my app
so difficult to assess any difference at the moment, but it certainly
simplifies my code.

Cheers,

Rob.

On Wed, Sep 2, 2009 at 2:16 PM, Johan Svensson jo...@neotechnology.comwrote:

 Hello,

 Now that the 1.0-b9 release has been out for a while we have had some
 time to work on some important new features that we want to be part of
 the final 1.0 release. The 1.0-b10-SNAPSHOT (trunk) now includes:

 o New algorithm to rebuild id generators during recovery after a
 crash. Cuts recovery time on large stores to a fraction of the time it
 used to take.
 o Read-only mode. You can now startup multiple read-only NeoServices
 to the same store (using EmbbededReadOnlyNeo) and have a single writer
 to that store.
 o Improved depth first traversal speed on nodes with many
 relationships by loading relationships on demand. This will also
 reduce the stress on GC when traversing over a node with many
 relationships since much fewer objects will be created.

 If you have some suitable project please help us test and try out
 these new features.

 Regards,
 -Johan

 --
 Johan Svensson [jo...@neotechnology.com]
 Chief Technology Officer, Neo Technology
 www.neotechnology.com
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] New features in trunk

2009-09-02 Thread Rob Challen
The same is true of using it in Tomcat. I'll try and port my use of
RemoteNeo to an EmbeddedReadOnlyNeo.

It'd be useful for me to have the option to make Neoclipse use
EmbeddedReadOnlyNeo for debugging a graph during development. Is there
anyone else who vote for that?

Cheers,

Rob.

On Wed, Sep 2, 2009 at 3:08 PM, Tobias Ivarsson 
tobias.ivars...@neotechnology.com wrote:

 On Wed, Sep 2, 2009 at 3:16 PM, Johan Svensson jo...@neotechnology.com
 wrote:
 
  o Read-only mode. You can now startup multiple read-only NeoServices
  to the same store (using EmbbededReadOnlyNeo) and have a single writer
  to that store.
 

 Cool, I could use this to build a Hybrid MultiProcessNeo that uses
 EmbeddedReadOnlyNeo for reads and RemoteNeo for writes. This will enable
 Neo4j.py (with CPython in particular) to operate from multiple processes,
 the common setup for web servers using mod_python or mod_wsgi.
 --
 Tobias Ivarsson tobias.ivars...@neotechnology.com
 Hacker, Neo Technology
 www.neotechnology.com
 Cellphone: +46 706 534857
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] Batchinserter methods

2009-07-30 Thread Rob Challen
Thanks for looking into it. I found another logical error in the code
segment and had to rework it anyway - I am not sure I will be able to
reproduce the situation to test the fix.

On Thu, Jul 30, 2009 at 9:06 PM, Johan Svensson jo...@neotechnology.comwrote:

 Hi Rob,

 Your problem was caused by a bug in the batch inserter. I just
 committed a fix for it so a new b9-SNAPSHOT should be available soon.

 -Johan

 On Tue, Jul 28, 2009 at 11:25 AM, Rob Challenrjchal...@gmail.com wrote:
  I'm using the batchinserter to build a graph. I'm not sure if what I am
  seeing here is something I am doing wrong or something in the
 batchinserter.
  For one task I need to check whether a relationship already exists to a
  target node and perform a test on the target node, before deciding
 whether
  to build a new blank node or not. I'm getting the following exception:
 
  Exception in thread main java.lang.IllegalArgumentException: id=697209
  at
 
 org.neo4j.impl.batchinsert.BatchInserterImpl.getRelationshipRecord(BatchInserterImpl.java:508)
  at
 
 org.neo4j.impl.batchinsert.BatchInserterImpl.getRelationships(BatchInserterImpl.java:267)
  at
 
 uk.co.pointofcare.echobase.snosled.neoimpl.NeoSctNodeBuilder.build(NeoSctNodeBuilder.java:330)
  at
 
 uk.co.pointofcare.echobase.snosled.neoimpl.NeoLoadRunner.loadFile(NeoLoadRunner.java:129)
  at
 
 uk.co.pointofcare.echobase.snosled.neoimpl.NeoLoadRunner.sequenceLoading(NeoLoadRunner.java:107)
  at
 
 uk.co.pointofcare.echobase.snosled.neoimpl.NeoLoadRunner.batchload(NeoLoadRunner.java:63)
  at
 
 uk.co.pointofcare.echobase.snosled.neoimpl.NeoLoadRunner.main(NeoLoadRunner.java:41)
 
  From the following code segment:
 
  long subject = current working node id - looked up against an index
  if (roleGroup == 0) {
  neoId = batchInsert.createRelationship(subject, object, rt,
  neoMap.getMap());
  } else {
  // insert blank node to represent role groups. First of all find out
 whether
  blank node has already been
  // created.
  long roleGroupNode = 0L;
 
  // look for current relationship with HAS_ROLE_GROUP relationship type
  for (SimpleRelationship sr: batchInsert.getRelationships(subject)) {
  //stack trace here
  if (sr.getType().equals(SctRelationshipType.HAS_ROLE_GROUP)) {
 
  //look for end node with specific RELATIONSHP_GROUP property equal to
  roleGroup
  int tmp = (Integer)
 
 batchInsert.getNodeProperties(sr.getEndNode()).get(SctPropertyName.RELATIONSHIP_GROUP.key());
  if (tmp == roleGroup) {
  roleGroupNode = sr.getEndNode(); //reference to current blank node
  }
  }
  }
  //If no existing blank node found then create a new one
  if (roleGroupNode == 0) {
  HashMapString,Object tmp = new HashMapString,Object();
  roleGroupNode = batchInsert.createNode(tmp); //reference to new blank
 node
  tmp.put(SctPropertyName.RELATIONSHIP_GROUP.key(), roleGroup);
  batchInsert.createRelationship(roleGroupNode, object,
  SctRelationshipType.HAS_ROLE_GROUP, tmp);
  }
  //create the relationship
  neoId = batchInsert.createRelationship(subject, roleGroupNode, rt,
  neoMap.getMap());
  }
 
  Am I misusing the batchinserter here? or is there another issue?
 
  Rob.
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] neo-meta properties

2009-07-17 Thread Rob Challen
Can the neo-meta package be used within a neo-rdf / neo-rdf-sail
implementation? I would guess there would need to be the same handling
of namespaces, and depend on the underlying representation of the RDF
in neo

for example something like this as an alternative to the above:

org.neo4j.rdf.model.Resource neilPert;
drummer.getInstances().add(neilPert.nativeRepresentation());

How does all of this relate to the owl2neo component? is the owl2neo
stuff built on top of the neo-meta package?

Cheers,

Rob.


On Thu, Jul 16, 2009 at 9:17 PM, Mattias Persson
matt...@neotechnology.com wrote:

 Right, we should probably add such a method. What you can do is:

 DynamicRelationshipType.withName( plays.getName() )

 to get that relationship type (plays).

 2009/7/16 Andreas Kollegger akolleg...@tembopublic.org:
  It just occurred to me that I started a thread before the weekend to
  which I need to respond. Before I get back to that, I have a practical
  question about using neo-meta.
 
  Consider the following code snippet (a realization of the neo-meta
  introduction):
 
 MetaStructureClass artist = namespace.getMetaClass(artist, 
  true);
 MetaStructureProperty plays = namespace.getMetaProperty(plays,
  true);
 artist.getDirectProperties().add(plays);
 MetaStructureClass drummer = namespace.getMetaClass(drummer,
  true);
 artist.getDirectSubs().add(drummer);
 MetaStructureClass instrument =
  namespace.getMetaClass(instrument, true);
 MetaStructureClass drums = namespace.getMetaClass(drums, true);
 
 drummer.getDirectSupers().add( artist );
 drums.getDirectSupers().add( instrument );
 
 plays.setRange( new MetaStructureClassRange( instrument ) );
 MetaStructureRestriction playsRestriction =
 drummer.getRestriction( plays, true );
 playsRestriction.setRange( new MetaStructureClassRange( drums ) 
  );
 playsRestriction.setCardinality( 1 );
 
  Transaction tx = neo.beginTx();
  try {
 Node neilPert = neo.createNode();
 drummer.getInstances().add(neilPert);
 
 Node ludwigKit = neo.createNode();
 drums.getInstances().add(ludwigKit);
 
  }
  finally
  {
 tx.finish();
  }
 
  ...
 
  That lets me get to the point of saying that neilPert is a drummer,
  and that ludwigKit is an instance of drums. What I'm not clear about
  is how to express that neilPert plays ludwigKit.
 
  I need to establish a relationship between neilPert and lugwigKit, but
  am not sure the proper way to do that. I think I want something like:
 
 
  neilPert.createRelationshipTo(ludwigKit, plays.getRelationshipType());
 
  What's the correct way to do this?
 
 
  Thanks for any guidance,
  Andreas
 
  ___
  Neo mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user
 



 --
 Mattias Persson, [matt...@neotechnology.com]
 Neo Technology, www.neotechnology.com
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] syntactic and semantic model for XML

2009-07-13 Thread Rob Challen
I had to do a similar thing with analysing xml data from various sources,
like proprietary xmi, and xml for which there was no schema, and also (now
starting on) html documentation of the xmi, and took a low weight approach
for generating a very simple graph using only two relationships XML_CONTAINS
and XML_PREVIOUS, mapping the content of the xml files into a set of
directed mono axial graphs within neo. Once in I did the mapping in the
database based on key characteristics of the xml, creating a parallel graph
containing an abstraction of the xml data based on 'semantics', and cross
linking information from many xml sources based on a set of rules.

I'm not sure I would wholly recommend my approach :-) I ended up doing some
things in a graph that would be better in XSLT, struggling with namespaces,
trying to impose some level of order on the neo property names. You need to
be careful what sequence you load and transform the data when linking
between xml files, and you still need to have enough information about the
structure of the XML to write the abstraction rules, which are quite
verbose, compared, say, to XSLT. Nice points are though that the xml does
not have to be compliant to any schema (although it does need to be well
formed - the purpose was integrating XMI and HTML documentation of the UML
model expressed in that XMI), you only need to know enough about the
structure to get the information you are interested in out, and you can
maintain a 2 way connection between the transformed data and the source XML
(albeit in graph form), and you can continue the process to create a
hierarchy of abstract layers until you get to something meaningful from a
business perspective. You can then visualise just that business layer.

It's not great code and very task specific. But I'm in the process of
cleaning it up and aim to put it somewhere under an open source licence.

Rob.

On Sat, Jul 11, 2009 at 2:37 PM, Emil Eifrem e...@neotechnology.com wrote:

 Hi Andreas,

 Sounds like a very interesting problem and approach. As noted
 previously, this is a sorta offline weekend for me, but lemme shoot
 some questions to get this thing started.

 On Sat, Jul 11, 2009 at 05:04, Andreas
 Kolleggerakolleg...@tembopublic.org wrote:
  My thinking is
  that I could then preserve the original syntax of the XML, but
  annotate with relationships to put the data in semantic context.

 Do you need to preserve the exact String representation (incl comments
 / formatting / etc)? You probably don't need that, but if you do then
 my experience is that at the end it'll be easier to actually store two
 representations: one graph representation in the node space, and one
 string representation typically in a property on some root node for
 the document. Just a FYI.

 
  The approach I'm pursuing looks like this:
 
  A. Define meta-model per form
 1. define syntactic meta-model (org.neo4j.neometa) based on XSD
  of form instance data

 Right. The meta model is based on RDFS with a few OWL constructs for
 extra flavor, so it should be able to represent anything from XSD.

 2. add to ontology vocabulary (using OWL? RDF?) as needed

 A vocabulary to me is an instance set that narrows the base data type
 of a property. For example, the property industry may have a type of
 xsd:string, but a vocabulary of { information technology,
 automotive, defense }.

 Are we talking about the same thing? If so, where do you get the
 vocabulary?

 3. define mapping from syntactic to semantic model

 I'm not 100% clear on this step. Could you describe the semantic model
 a bit more. For example, from where do you get the semantic model
 originally? How do you define the mapping? Is the mapping a manual
 step or something you can infer?

  B. Process submitted forms
 1. transform XML into meta-model compliant nodes in the graph

 Right.

 2. traverse the nodes to add INSTANCE_OF relationships into the
  semantic model

 So, the meta model component will add INSTANCE_OF relationships into
 the meta model which originates from the XSD (step A 1). You may need
 something else, but I'll defer on this until I have more info about
 your semantic model (see above).

 Just a few quick Qs to get this started...

 Cheers,

 --
 Emil Eifrém, CEO [e...@neotechnology.com]
 Neo Technology, www.neotechnology.com
 Cell: +46 733 462 271 | US: 206 403 8808
 http://twitter.com/emileifrem
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo] precedence of evaluators

2009-07-02 Thread Rob Challen
Having lots of fun experimenting with Neo. Nice job.

Its not clear from the traverser documentation what behaviour I should
expect from a traverser if both stop evaluator and returnable evaluator
return true. Should it be returned or not? My random testing suggests that
it is and you can reuse the same logic for a StopEvaluator and a
ReturnableEvaluator if you need a single result, like this code for a
subsumption test on a tree:

private boolean inPackage(Node n, String name) {
Object[] rels = {
AbstractModelManager.Relationship.IS_COMPONENT,
Direction.OUTGOING,
AbstractModelManager.Relationship.IS_SUBPACKAGE,
Direction.OUTGOING,
};
HashtableString, String criteria = new HashtableString,
String();
criteria.put(name, name);
criteria.put(type, package);
MixedEvaluator me =
nodesWithPropertiesCaseInsensitive(criteria);
Traverser t = n.traverse(Order.BREADTH_FIRST, me, me, rels);
if (t.iterator().hasNext()) {
log.info(package found!: +name);
return true;
} else {
return false;
}
}


public MixedEvaluator nodesWithPropertiesCaseInsensitive(final
HashtableString,String tests) {
return new MixedEvaluator() {
public boolean isReturnableNode(TraversalPosition currentPos) {
boolean aggregate = true;
for (EntryString, String test: tests.entrySet()) {
try {
if
(!currentPos.currentNode().getProperty(test.getKey()).toString().equalsIgnoreCase(test.getValue().toString()))
aggregate = false;
} catch (NotFoundException e) {
aggregate = false;
}
}
return aggregate;
}
public boolean isStopNode(TraversalPosition currentPos) {
return isReturnableNode(currentPos);
}
};
}


where a MixedEvaluator is simply:

public interface MixedEvaluator extends ReturnableEvaluator, StopEvaluator {

}


Is there an abstract parent of Returnable and Stop evaluators that could be
better used here?

Cheers,

Rob.
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] precedence of evaluators

2009-07-02 Thread Rob Challen
Generally I am looking to traverse up a tree looking to see if there is a
parent with a particular property. The evaluators return that single parent
if it exists, and stop there. It is basically to return me the nearest
neighbour that has a given property. In these situations the two evaluator
types always return true at the same time. So in my most recent case I am
parsing XMI into a graph and want to answer the question is a given UML
class in a particular UML package by traversing up the containment
hierarchy.

It seems to most usually happen to me when I am using a traverser to perform
a logical test where the returned nodes are not important but the fact that
something has been found is. I guess also that in certain circumstances I
wanted to use the same logic for returnable evaluators as I had written for
stop evaluators in different contexts, so the node with property X = value
Y evaluator gets reused both as a returnable and stop evaluator depending
on what I am trying to do at the time.

Rob.

On Thu, Jul 2, 2009 at 10:26 PM, Johan Svensson jo...@neotechnology.comwrote:

 Hi Rob,

 On Thu, Jul 2, 2009 at 12:43 PM, Rob Challenrjchal...@gmail.com wrote:
  Having lots of fun experimenting with Neo. Nice job.
 

 Great to hear!

  Its not clear from the traverser documentation what behaviour I should
  expect from a traverser if both stop evaluator and returnable evaluator
  return true. Should it be returned or not? ...

 The current position should be returned. If that is not clear in the
 documentation we need to improve it.

  ... My random testing suggests that
  it is and you can reuse the same logic for a StopEvaluator and a
  ReturnableEvaluator if you need a single result, like this code for a
  subsumption test on a tree:
 

 I'm not quite sure I understand what it is you are trying to do. Could
 you elaborate a bit on the actual problem you're trying to solve? A
 common super interface for StopEvaluator and ReturanbleEvaluator does
 not exist today since we see them as two separate functions.

 Regards,
 -Johan
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] self referential statements

2009-06-24 Thread Rob Challen
Thanks Anders.

On Wed, Jun 24, 2009 at 10:19 AM, Anders Nawroth
and...@neotechnology.comwrote:

 Hi!

  This is probably working as expected but why is this constraint
 necessary?
 

 This works as expected, but I think we have to make this explicit in the
 API docs.

 I think there would be a performance hit for all graph traversals if
 relationships to the same node were permitted.


I am surprised by this. This detection of a cylic graph is a standard
feature of the traversers as far as I understand. A self referential
relationship is only an extreme case of this.


  It is sometimes meaningful to create such relationships I think - e.g.
 I'm
  trying to represent UML associations in a Neo graph. I suppose I can
 insert
  an intermediate node into every relationship that represents an
 association,
 

 Other ways to deal with this would be to add a property to the node or a
 relationship to a blank node.


For my immediate purposes I did something even more heavy weight in the end,
but have hit the same problem when I want to abstract this


  but I will have to do some special rendering to get it looking right.
 

 I think this is unavoidable.


Bum. Struggling with a rendering to HTML now.



  Any insight into how critical this constraint is?
 

 AFAIK there's no plan to change this behavior.


 /anders

 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo] self referential statements

2009-06-22 Thread Rob Challen
I just came across the following when I try and link a node to itself:

java.lang.IllegalArgumentException: Start node equals end node
at org.neo4j.impl.core.RelationshipImpl.init(RelationshipImpl.java:57)
at
org.neo4j.impl.core.NodeManager.createRelationship(NodeManager.java:280)
at org.neo4j.impl.core.NodeImpl.createRelationshipTo(NodeImpl.java:308)
at
org.neo4j.impl.core.NodeProxy.createRelationshipTo(NodeProxy.java:177)

This is probably working as expected but why is this constraint necessary?
It is sometimes meaningful to create such relationships I think - e.g. I'm
trying to represent UML associations in a Neo graph. I suppose I can insert
an intermediate node into every relationship that represents an association,
turning a

subject_node - relationship - object_node

into a

subject_node - subject_relationship - node_representation_of_relationship
node_representation_of_relationship - object_relationship - object_node

to represent the case where subject_node = object_node

but I will have to do some special rendering to get it looking right.

Any insight into how critical this constraint is?

Rob.
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo] IllegalStateException meaning

2009-05-30 Thread Rob Challen
I am getting the following exception when I call a Transaction.finish(). It
occurs during the load of a large medical terminology dataset, and prior to
this error the load progress was found to be slowing. I can;t really figure
out what the exception is telling me, or where to start looking to figure
out the cause. If anyone can give me any pointers to explain the meaning of
the error in neo4j I would be really grateful.

The .finish() is in a loop that completes without any problem up to this
point. I cannot completely rule out bad input - but finding that in a 1.5M
nodes graph would be a challenge in itself.

Exception in thread main java.lang.RuntimeException:
java.lang.IllegalStateException: Tx status is: STATUS_COMMITING
at
org.neo4j.api.core.EmbeddedNeo$TransactionImpl.finish(EmbeddedNeo.java:383)
at
uk.co.pointofcare.echobase.snosled.neoimpl.NeoLoadRunner.loadFile(NeoLoadRunner.java:122)

Sorry details so scant - not really sure where to start.

Rob.
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user