Re: [Neo] Bindings to use Neo4J with Qi4j

2008-05-22 Thread Peter Neubauer
Hi there,

On Thu, May 22, 2008 at 8:03 AM, Tobias Ivarsson
<[EMAIL PROTECTED]> wrote:
> Greetings Qi4j and Neo4J friends!
>
> Last night (Swedish time) I published bindings for using Neo4J as an
> EntityStore in Qi4j.
Cool!

I ran the test, pointed Neoclipse at the resulting nodespace and came
up with this image:
http://wiki.neo4j.org/content/Image:Qi4j_neo4j_store.png (I included
it as examples for neoclipse, too). Interesting to see the shape of
the nodespace and the indexes ...

/peter
-- 
GTalk: neubauer.peter
Skype peter.neubauer
ICQ 18762544
GTalk neubauer.peter
Phone +46704 106975
LinkedIn http://www.linkedin.com/in/neubauer

http://www.neo4j.org - New Energy for Data - the Graph Database.
http://www.ops4j.org - New Energy for OSS Communities - Open
Participation Software.
http://www.qi4j.org - New Energy for Java - Domain Driven Development.
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo] Re: [Commits] r1597 - laboratory/users/patrik/neoalgo/trunk/src/main/java/org/neo4j/algo/graphGeneration

2008-05-22 Thread Peter Neubauer
Hi Patrik,
there is a lot of commits in your lab, maybe it would be cool to have
a small intro on what you are doing and what the status of the algos
are?

/peter

On Thu, May 22, 2008 at 7:17 PM,  <[EMAIL PROTECTED]> wrote:
> Author: patrik
> Date: 2008-05-22 19:17:29 +0200 (Thu, 22 May 2008)
> New Revision: 1597
>
> Log:
> Various experimental subgraph implementations
>
> Added:
>   
> laboratory/users/patrik/neoalgo/trunk/src/main/java/org/neo4j/algo/graphGeneration/SubNetwork.java
>   
> laboratory/users/patrik/neoalgo/trunk/src/main/java/org/neo4j/algo/graphGeneration/SubNetworkCopy.java
>
> Added: 
> laboratory/users/patrik/neoalgo/trunk/src/main/java/org/neo4j/algo/graphGeneration/SubNetwork.java
> ===
> --- 
> laboratory/users/patrik/neoalgo/trunk/src/main/java/org/neo4j/algo/graphGeneration/SubNetwork.java
>   (rev 0)
> +++ 
> laboratory/users/patrik/neoalgo/trunk/src/main/java/org/neo4j/algo/graphGeneration/SubNetwork.java
>   2008-05-22 17:17:29 UTC (rev 1597)
> @@ -0,0 +1,603 @@
> +package org.neo4j.algo.graphGeneration;
> +
> +import java.util.HashMap;
> +import java.util.HashSet;
> +import java.util.LinkedList;
> +import java.util.List;
> +import java.util.Map;
> +import java.util.Set;
> +import org.neo4j.api.core.Direction;
> +import org.neo4j.api.core.Node;
> +import org.neo4j.api.core.Relationship;
> +import org.neo4j.api.core.RelationshipType;
> +import org.neo4j.api.core.ReturnableEvaluator;
> +import org.neo4j.api.core.StopEvaluator;
> +import org.neo4j.api.core.TraversalPosition;
> +import org.neo4j.api.core.Traverser;
> +import org.neo4j.api.core.Traverser.Order;
> +import org.neo4j.impl.traversal.TraverserFactory;
> +
> +/**
> + * This class can be used to represent part of a network (like a subgraph),
> + * represented as a set of nodes and a set of edges. All this really does is
> + * filter the results of Node.getRelationships to only return relationships
> + * within this subnetwork, thus limiting traversals and searches to the nodes
> + * within the subnetwork. Therefore, any changes made to the subnetwork will 
> be
> + * reflected in the underlying network as well. The subgraph always starts 
> out
> + * empty, and can be emptied again with the clear() method. It can then be
> + * filled with nodes and edges through the various methods supplied. This 
> class
> + * can of course also be used to retrieve the set of all nodes and the set of
> + * all edges from a network.
> + * @author Patrik Larsson
> + */
> +public class SubNetwork
> +{
> +Set subNetworkRelationships = new HashSet();
> +Set subNetworkNodes = new HashSet();
> +TraverserFactory traverserFactory = new TraverserFactory();
> +
> +/**
> + * Adds a tree to this subnetwork by doing a breadth first search of a 
> given
> + * depth, adding all nodes found and the first edge leading to each node.
> + * @param node
> + *The starting node
> + * @param searchDepth
> + *The search depth.
> + * @param relationshipType
> + *Relation type to traverse.
> + * @param direction
> + *Direction in which to traverse relationships.
> + */
> +public void addTreeFromCentralNode( Node node, final int searchDepth,
> +RelationshipType relationshipType, Direction direction )
> +{
> +Traverser traverser = node.traverse( Order.BREADTH_FIRST,
> +new StopEvaluator()
> +{
> +public boolean isStopNode( TraversalPosition currentPos )
> +{
> +return currentPos.depth() >= searchDepth;
> +}
> +}, ReturnableEvaluator.ALL, relationshipType, direction );
> +for ( Node node2 : traverser )
> +{
> +subNetworkNodes.add( node2 );
> +subNetworkRelationships.add( traverser.currentPosition()
> +.lastRelationshipTraversed() );
> +}
> +}
> +
> +/**
> + * Makes a search of a given depth from a given node and adds all found
> + * nodes and relationships to this subnetwork.
> + * @param node
> + *The starting node
> + * @param searchDepth
> + *The search depth.
> + * @param relationshipType
> + *Relation type to traverse.
> + * @param direction
> + *Direction in which to traverse relationships.
> + * @param includeBoundaryRelationships
> + *If false, relationships between nodes where the maximum 
> depth
> + *has been reached will not be included since the search 
> depth
> + *is considered to have been exhausted at them.
> + */
> +public void addSubNetworkFromCentralNode( Node node, final int 
> searchDepth,
> +RelationshipType relationshipType, Direction direction,
> +boolean includeBoundaryRelationships )
> +{

[Neo] Re: OSGi console

2008-05-22 Thread Peter Neubauer
Btw,
added some basic docs under
http://wiki.neo4j.org/content/Neo_OSGi_Shell. If you combine this with
http://wiki.ops4j.org/confluence/display/ops4j/Pax+Jabber+Console you
actually get a nice little monitoring system with almost no effort :)

/peter

On Wed, May 21, 2008 at 11:59 AM, Peter Neubauer
<[EMAIL PROTECTED]> wrote:
> Hi all,
> I have a basic Neo OSGi command for both Knopflerfish and the Felix
> Shell Service under
> https://svn.neo4j.org/laboratory/users/peter/shell/, so if anyone is
> interested, please check it out. Basically, you just type
>
> mvn install
> mvn pax:provision
>  and should get up a Felix shell, where you e.g. can try
>
> ->neols 0
> to list the relationships of the reference node. I will try to
> document this in the wiki as I get some time over ...
>
> Cheers,
>
> /peter
> --
> GTalk: neubauer.peter
> Skype peter.neubauer
> ICQ 18762544
> GTalk neubauer.peter
> Phone +46704 106975
> LinkedIn http://www.linkedin.com/in/neubauer
>
> http://www.neo4j.org - New Energy for Data - the Graph Database.
> http://www.ops4j.org - New Energy for OSS Communities - Open
> Participation Software.
> http://www.qi4j.org - New Energy for Java - Domain Driven Development.
>



-- 
GTalk:neubauer.peter
Skypepeter.neubauer
ICQ18762544
GTalkneubauer.peter
Phone   +46704 106975
LinkedIn   http://www.linkedin.com/in/neubauer

http://www.neo4j.org - New Energy for Data - the Graph Database.
http://www.ops4j.org - New Energy for OSS Communities - Open
Participation Software.
http://www.qi4j.org- New Energy for Java - Domain Driven Development.
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user