Re: [Neo] Indexing Relationships?

2010-05-20 Thread Mattias Persson
kind of
>> indexing on relationships would greatly enhance Neo4j's usability in the
>> network analysis community, and perhaps begin to push researchers to explore
>> the properties of more complex graphs that Neo4j is capable of representing.
>>
>> Thanks very much,
>> Alex D'Amour
>>
>> On Sat, May 15, 2010 at 2:49 PM, Niels Hoogeveen
>> wrote:
>>
>>>
>>> I use relationships to encode paths in the graph based on the meta model.
>>> For example:
>>> Class(Article) --> Relationship(Author) --> Class(User) -->
>>> Property(Username)
>>> Right now I encode this using an md5 encoding of the above path, add a
>>> property to the first entity in the path, using the md5 encoding as the
>>> key
>>> (the value is irrelevant), relationships (with a DynamicRelationshipType
>>> with a name equal to the md5 key) are used to link the various items in
>>> the
>>> path.
>>> Finding the path requires a traversal from the first Class node in the
>>> path, following the given relationships. This traversal can potentially be
>>> expensive when a class takes many instances (all have a relationship to
>>> the
>>> class).
>>> When relationships were indexed, the path could be encoded by giving each
>>> relationship making up the path a property encoding the path, then use the
>>> index to retrieve all relationships making up the path and lay those
>>> relationships head to toe to construct the path. No longer would a
>>> traversal
>>> be necessary and the cost of the operation only depends on the number of
>>> elements in the path, and not to the number of relationships one of the
>>> elements in the path can potentially have.
>>> Niels
>>>
>>>  From: tobias.ivars...@neotechnology.com
>>> > Date: Sat, 15 May 2010 13:32:36 +0200
>>> > To: user@lists.neo4j.org
>>> > Subject: Re: [Neo] Indexing Relationships?
>>> >
>>> > There is no indexing component for Relationships and there has never
>>> > been
>>> > one.
>>> > The interesting question that you should have asked is: _will_ there
>>> > ever
>>> be
>>> > one.
>>> >
>>> > The answer to that question is: maybe, it has been prototyped as part of
>>> a
>>> > simplification of the entire indexing API.
>>> >
>>> > The interesting thing to me would be to get a concrete use case for
>>> > this.
>>> > I've heard requests for being able to index relationships a number of
>>> times,
>>> > but never a concrete use case for being able to do so. It's always been
>>> > vague hand waving like in this case "we have data that is heavily
>>> centered
>>> > on the relationships rather than nodes", WHAT is that data? WHY does it
>>> need
>>> > to be centered around the relationships? If you say that you have use
>>> cases
>>> > like these I believe that you do, I have no reason to believe that you
>>> are
>>> > lying, why would you. But I want to understand those use cases, and I
>>> want
>>> > to understand them in a setting where having support for indexing
>>> > relationships adds value to the business.
>>> >
>>> > I would like it if we were able to index Relationships as part of the
>>> core
>>> > API by version 1.2, and having an actual use case for when it would
>>> improve
>>> > the implementation of an actual domain would certainly help speed up the
>>> > process, perhaps we could even sneak it into version 1.1.
>>> >
>>> > Cheers,
>>> > Tobias
>>> >
>>> > On Fri, May 14, 2010 at 5:05 PM, Alex D'Amour >> >wrote:
>>> >
>>> > > Hi all,
>>> > >
>>> > > I am working on an application that stores large network data from
>>> multiple
>>> > > domains in Neo4j databases. The object is to allow users to upload
>>> network
>>> > > datasets and then expose them to researchers over the web, allowing
>>> > > researchers to subset the data and eventually download their own
>>> subgraph
>>> > > of
>>> > > the original dataset.
>>> > >
>>> > > Many of the operations that we intend to support are covered by the
>>> Lucene
>>> > > an

Re: [Neo] Indexing Relationships?

2010-05-20 Thread Mattias Persson
I encode this using an md5 encoding of the above path, add a
>> property to the first entity in the path, using the md5 encoding as the
>> key
>> (the value is irrelevant), relationships (with a DynamicRelationshipType
>> with a name equal to the md5 key) are used to link the various items in
>> the
>> path.
>> Finding the path requires a traversal from the first Class node in the
>> path, following the given relationships. This traversal can potentially be
>> expensive when a class takes many instances (all have a relationship to
>> the
>> class).
>> When relationships were indexed, the path could be encoded by giving each
>> relationship making up the path a property encoding the path, then use the
>> index to retrieve all relationships making up the path and lay those
>> relationships head to toe to construct the path. No longer would a
>> traversal
>> be necessary and the cost of the operation only depends on the number of
>> elements in the path, and not to the number of relationships one of the
>> elements in the path can potentially have.
>> Niels
>>
>>  From: tobias.ivars...@neotechnology.com
>> > Date: Sat, 15 May 2010 13:32:36 +0200
>> > To: user@lists.neo4j.org
>> > Subject: Re: [Neo] Indexing Relationships?
>> >
>> > There is no indexing component for Relationships and there has never
>> > been
>> > one.
>> > The interesting question that you should have asked is: _will_ there
>> > ever
>> be
>> > one.
>> >
>> > The answer to that question is: maybe, it has been prototyped as part of
>> a
>> > simplification of the entire indexing API.
>> >
>> > The interesting thing to me would be to get a concrete use case for
>> > this.
>> > I've heard requests for being able to index relationships a number of
>> times,
>> > but never a concrete use case for being able to do so. It's always been
>> > vague hand waving like in this case "we have data that is heavily
>> centered
>> > on the relationships rather than nodes", WHAT is that data? WHY does it
>> need
>> > to be centered around the relationships? If you say that you have use
>> cases
>> > like these I believe that you do, I have no reason to believe that you
>> are
>> > lying, why would you. But I want to understand those use cases, and I
>> want
>> > to understand them in a setting where having support for indexing
>> > relationships adds value to the business.
>> >
>> > I would like it if we were able to index Relationships as part of the
>> core
>> > API by version 1.2, and having an actual use case for when it would
>> improve
>> > the implementation of an actual domain would certainly help speed up the
>> > process, perhaps we could even sneak it into version 1.1.
>> >
>> > Cheers,
>> > Tobias
>> >
>> > On Fri, May 14, 2010 at 5:05 PM, Alex D'Amour > >wrote:
>> >
>> > > Hi all,
>> > >
>> > > I am working on an application that stores large network data from
>> multiple
>> > > domains in Neo4j databases. The object is to allow users to upload
>> network
>> > > datasets and then expose them to researchers over the web, allowing
>> > > researchers to subset the data and eventually download their own
>> subgraph
>> > > of
>> > > the original dataset.
>> > >
>> > > Many of the operations that we intend to support are covered by the
>> Lucene
>> > > and Traversal frameworks. However, we'd also like to perform
>> relationship
>> > > lookups in the same way that we perform node lookups since many
>> networks
>> > > have data that are heavily centered on the Relationships rather than
>> nodes.
>> > > Is there or has there ever been an indexing component for
>> > > Relationships
>> in
>> > > Neo4j? If not, how difficult would it be to port the
>> > > LuceneIndexService
>> to
>> > > index relationships as well as nodes (i.e. how much of the code is
>> specific
>> > > to Nodes rather than PropertyContainers)?
>> > >
>> > > I realize that this probably isn't the ideal way to interact with the
>> graph
>> > > and that better domain modeling would probably solve this if the
>> framework
>> > > didn't have to be generic. But in this case we'd like to s

Re: [Neo] Indexing Relationships?

2010-05-16 Thread Alex D'Amour
First of all, I'd like to thank everybody who chimed in on this thread with
their own use cases. To answer Tobias' original question, I have two
examples of use cases that we want to support.

In the first example, we'd like to represent the coauthorship network of
inventors who hold patents registered in the United States, so each node is
an author and each relationship is a coauthorship of a patent. We are
particularly interested in how changes in authors' location or employment
connect otherwise disjoint sets of coauthors (e.g. somebody moves from HP to
Canon and provides a potential source of collaboration between engineers at
these firms). Because a node's employer or location state changes with time,
we choose to store this information in the relationships instead of the
nodes. Often we are interested in collaborations that took place in a
certain region during a certain timespan -- in this case, it makes sense to
query the relationships.

In another example, we have data on conflicts between countries that we
would like to represent as a network. Each node is a country and each
relationship indicates that two countries had a conflict at a particular
time. We have time data stored in the relationships, and we would like to
query for conflicts that occurred during a particular timeframe.

In general, we want to provide data hosting for social scientists who have
dyadic relational data. We'd like for them to be able to upload a graphml
file that encodes their property graph, and then allow other researchers to
query that graph for particular nodes and edges and download that subgraph.
In particular, we would like the kind of each edge and node querying support
found in network analysis packages like igraph.

I realize that in most cases the relationship-querying problem can be solved
with better domain modeling. In an extreme case we could make the graph
bipartite and simply have each relationship be intercepted by a node that
holds the properties that we would like to query. Of course, in many cases
it's be possible to consolidate these relationship nodes or the properties
they contain into nodes that represent other entities (a patent, a year, a
place) and reduce the number of relationships in the graph. However, this is
hard to generalize and in certain cases makes the storage engine much less
efficient (2 times the edges, plus a new node for each edge in the worst
case). Still, in requesting this feature, I should mention that we have also
prototyped ways to make this relationship consolidation more general, but
that it seems less straightforward than extending the indexing engine to
include relationships.

It is possible that this very "flat" graph representation isn't a priority
for the Neo4j team and that our use of the database is an abuse of the
system, but this is the type of structure that network researchers have the
most interest in, and Neo4j is by far the best database available to store
it. And while network analysis techniques will eventually adapt to more
advanced representations, they currently rely on the much flatter structure
of one type of node and one type of relationship. Allowing this kind of
indexing on relationships would greatly enhance Neo4j's usability in the
network analysis community, and perhaps begin to push researchers to explore
the properties of more complex graphs that Neo4j is capable of representing.

Thanks very much,
Alex D'Amour

On Sat, May 15, 2010 at 2:49 PM, Niels Hoogeveen
wrote:

>
> I use relationships to encode paths in the graph based on the meta model.
> For example:
> Class(Article) --> Relationship(Author) --> Class(User) -->
> Property(Username)
> Right now I encode this using an md5 encoding of the above path, add a
> property to the first entity in the path, using the md5 encoding as the key
> (the value is irrelevant), relationships (with a DynamicRelationshipType
> with a name equal to the md5 key) are used to link the various items in the
> path.
> Finding the path requires a traversal from the first Class node in the
> path, following the given relationships. This traversal can potentially be
> expensive when a class takes many instances (all have a relationship to the
> class).
> When relationships were indexed, the path could be encoded by giving each
> relationship making up the path a property encoding the path, then use the
> index to retrieve all relationships making up the path and lay those
> relationships head to toe to construct the path. No longer would a traversal
> be necessary and the cost of the operation only depends on the number of
> elements in the path, and not to the number of relationships one of the
> elements in the path can potentially have.
> Niels
>
>  From: tobias.ivars...@neotechnology.com
> > Date: Sat, 15 May 2010 13:32:36 +0200
> > To: user@lists.ne

Re: [Neo] Indexing Relationships?

2010-05-15 Thread Niels Hoogeveen

I use relationships to encode paths in the graph based on the meta model.
For example:
Class(Article) --> Relationship(Author) --> Class(User) --> Property(Username)
Right now I encode this using an md5 encoding of the above path, add a property 
to the first entity in the path, using the md5 encoding as the key (the value 
is irrelevant), relationships (with a DynamicRelationshipType with a name equal 
to the md5 key) are used to link the various items in the path.
Finding the path requires a traversal from the first Class node in the path, 
following the given relationships. This traversal can potentially be expensive 
when a class takes many instances (all have a relationship to the class). 
When relationships were indexed, the path could be encoded by giving each 
relationship making up the path a property encoding the path, then use the 
index to retrieve all relationships making up the path and lay those 
relationships head to toe to construct the path. No longer would a traversal be 
necessary and the cost of the operation only depends on the number of elements 
in the path, and not to the number of relationships one of the elements in the 
path can potentially have.
Niels

 From: tobias.ivars...@neotechnology.com
> Date: Sat, 15 May 2010 13:32:36 +0200
> To: user@lists.neo4j.org
> Subject: Re: [Neo] Indexing Relationships?
> 
> There is no indexing component for Relationships and there has never been
> one.
> The interesting question that you should have asked is: _will_ there ever be
> one.
> 
> The answer to that question is: maybe, it has been prototyped as part of a
> simplification of the entire indexing API.
> 
> The interesting thing to me would be to get a concrete use case for this.
> I've heard requests for being able to index relationships a number of times,
> but never a concrete use case for being able to do so. It's always been
> vague hand waving like in this case "we have data that is heavily centered
> on the relationships rather than nodes", WHAT is that data? WHY does it need
> to be centered around the relationships? If you say that you have use cases
> like these I believe that you do, I have no reason to believe that you are
> lying, why would you. But I want to understand those use cases, and I want
> to understand them in a setting where having support for indexing
> relationships adds value to the business.
> 
> I would like it if we were able to index Relationships as part of the core
> API by version 1.2, and having an actual use case for when it would improve
> the implementation of an actual domain would certainly help speed up the
> process, perhaps we could even sneak it into version 1.1.
> 
> Cheers,
> Tobias
> 
> On Fri, May 14, 2010 at 5:05 PM, Alex D'Amour wrote:
> 
> > Hi all,
> >
> > I am working on an application that stores large network data from multiple
> > domains in Neo4j databases. The object is to allow users to upload network
> > datasets and then expose them to researchers over the web, allowing
> > researchers to subset the data and eventually download their own subgraph
> > of
> > the original dataset.
> >
> > Many of the operations that we intend to support are covered by the Lucene
> > and Traversal frameworks. However, we'd also like to perform relationship
> > lookups in the same way that we perform node lookups since many networks
> > have data that are heavily centered on the Relationships rather than nodes.
> > Is there or has there ever been an indexing component for Relationships in
> > Neo4j? If not, how difficult would it be to port the LuceneIndexService to
> > index relationships as well as nodes (i.e. how much of the code is specific
> > to Nodes rather than PropertyContainers)?
> >
> > I realize that this probably isn't the ideal way to interact with the graph
> > and that better domain modeling would probably solve this if the framework
> > didn't have to be generic. But in this case we'd like to support this type
> > of interaction with simple graph structures with only one type of node and
> > only one type of relationship since they are the structures that social
> > network researchers are the most interested in.
> >
> > Thanks,
> > Alex
> > ___
> > Neo mailing list
> > User@lists.neo4j.org
> > https://lists.neo4j.org/mailman/listinfo/user
> >
> 
> 
> 
> -- 
> Tobias Ivarsson 
> Hacker, Neo Technology
> www.neotechnology.com
> Cellphone: +46 706 534857
> ___
> Neo mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
  
_
New Windows 7: Find the right PC for you. Learn more.
http://windows.microsoft.com/shop
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] Indexing Relationships?

2010-05-15 Thread Kim Soldal


I also find interest in this functionality, and would like to contribute a 
possible use case.
We have just wrapped up a project using Neo4j to describe a Transportation 
Network Graph (http://code.google.com/p/gotogate/). In this graph each node is 
a stop for some transport, while there is one realation between two nodes for 
each transportation that travels between these. The interesting part would be 
that if this graph were to be translated to a map overlay for a single route to 
be presented to the user by requrest for example, we would now have to traverse 
the entire graph until we find a relation with a name that matches the 
requested transport name. This would be less than optimal in a large 
transportation network such as for an entire country. Obviously the indexing 
for such a graph would be costly to include all relations, but I agree with 
Alex D'Amour that the functionality is useful. Traversing this graph to find 
one specific transportation line would be way more costly. I would like to see 
this functionality as optional on the index service, since it would slow down 
implementations that do not need relation indexing.
 
Cheers
Kim

> From: tobias.ivars...@neotechnology.com
> Date: Sat, 15 May 2010 13:32:36 +0200
> To: user@lists.neo4j.org
> Subject: Re: [Neo] Indexing Relationships?
> 
> There is no indexing component for Relationships and there has never been
> one.
> The interesting question that you should have asked is: _will_ there ever be
> one.
> 
> The answer to that question is: maybe, it has been prototyped as part of a
> simplification of the entire indexing API.
> 
> The interesting thing to me would be to get a concrete use case for this.
> I've heard requests for being able to index relationships a number of times,
> but never a concrete use case for being able to do so. It's always been
> vague hand waving like in this case "we have data that is heavily centered
> on the relationships rather than nodes", WHAT is that data? WHY does it need
> to be centered around the relationships? If you say that you have use cases
> like these I believe that you do, I have no reason to believe that you are
> lying, why would you. But I want to understand those use cases, and I want
> to understand them in a setting where having support for indexing
> relationships adds value to the business.
> 
> I would like it if we were able to index Relationships as part of the core
> API by version 1.2, and having an actual use case for when it would improve
> the implementation of an actual domain would certainly help speed up the
> process, perhaps we could even sneak it into version 1.1.
> 
> Cheers,
> Tobias
> 
> On Fri, May 14, 2010 at 5:05 PM, Alex D'Amour wrote:
> 
> > Hi all,
> >
> > I am working on an application that stores large network data from multiple
> > domains in Neo4j databases. The object is to allow users to upload network
> > datasets and then expose them to researchers over the web, allowing
> > researchers to subset the data and eventually download their own subgraph
> > of
> > the original dataset.
> >
> > Many of the operations that we intend to support are covered by the Lucene
> > and Traversal frameworks. However, we'd also like to perform relationship
> > lookups in the same way that we perform node lookups since many networks
> > have data that are heavily centered on the Relationships rather than nodes.
> > Is there or has there ever been an indexing component for Relationships in
> > Neo4j? If not, how difficult would it be to port the LuceneIndexService to
> > index relationships as well as nodes (i.e. how much of the code is specific
> > to Nodes rather than PropertyContainers)?
> >
> > I realize that this probably isn't the ideal way to interact with the graph
> > and that better domain modeling would probably solve this if the framework
> > didn't have to be generic. But in this case we'd like to support this type
> > of interaction with simple graph structures with only one type of node and
> > only one type of relationship since they are the structures that social
> > network researchers are the most interested in.
> >
> > Thanks,
> > Alex
> > ___
> > Neo mailing list
> > User@lists.neo4j.org
> > https://lists.neo4j.org/mailman/listinfo/user
> >
> 
> 
> 
> -- 
> Tobias Ivarsson 
> Hacker, Neo Technology
> www.neotechnology.com
> Cellphone: +46 706 534857
> ___
> Neo mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
  
_
Windows 7: Se direkte-TV fra den bærbare PCen. Finn ut mer.
http://windows.microsoft.com/windows-7
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] Indexing Relationships?

2010-05-15 Thread Patrick Durusau
Tobias,

On 5/15/2010 7:32 AM, Tobias Ivarsson wrote:
> There is no indexing component for Relationships and there has never been
> one.
> The interesting question that you should have asked is: _will_ there ever be
> one.
>
> The answer to that question is: maybe, it has been prototyped as part of a
> simplification of the entire indexing API.
>
> The interesting thing to me would be to get a concrete use case for this.
> I've heard requests for being able to index relationships a number of times,
> but never a concrete use case for being able to do so. It's always been
> vague hand waving like in this case "we have data that is heavily centered
> on the relationships rather than nodes", WHAT is that data? WHY does it need
> to be centered around the relationships? If you say that you have use cases
> like these I believe that you do, I have no reason to believe that you are
> lying, why would you. But I want to understand those use cases, and I want
> to understand them in a setting where having support for indexing
> relationships adds value to the business.
>
>
I have never tried to formulate a specific use case for indexing 
relationships but your question prompted me to do some searching on the 
issue.

Devanand Rajoo Radindran - KeyConcept: Exploiting Hierarchical 
Relationships for Conceptually Indexed Data (thesis, 
http://www.ittc.ku.edu/research/thesis/documents/devanand__ravindran_thesis.pdf)
 
Exploits the hierarchical relationships for pruning and retrieval.

Xiao Renguo, et. al. - An Indexing Structure for Aggregation 
Relationships in OODB 
(http://www.springerlink.com/content/5mj5k9mgdntjvdxp/) Features of 
aggregation relationships discussed. (I am not logged so all I can see 
is the abstract.)

Hsinchun Chen, et. al. Semantic Indexing and searching using a Hopfield 
net. (http://ai.arizona.edu/intranet/papers/SemanitcIndexing.pdf) 
Generated *10,000,000 relationships.*

The point being that words/terms occur in *relationship* to each other, 
authors, documents, domains, etc.

Without context (read relationships) express or implied, there is no 
semantic.

The ability to explore relationships, which are the basis for any 
semantic, would be enhanced by the ability to index relationships. Yes?

Hope you are having a great weekend!

Patrick


-- 
Patrick Durusau
patr...@durusau.net
Chair, V1 - US TAG to JTC 1/SC 34
Convener, JTC 1/SC 34/WG 3 (Topic Maps)
Editor, OpenDocument Format TC (OASIS), Project Editor ISO/IEC 26300
Co-Editor, ISO/IEC 13250-1, 13250-5 (Topic Maps)

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


Re: [Neo] Indexing Relationships?

2010-05-15 Thread Tobias Ivarsson
There is no indexing component for Relationships and there has never been
one.
The interesting question that you should have asked is: _will_ there ever be
one.

The answer to that question is: maybe, it has been prototyped as part of a
simplification of the entire indexing API.

The interesting thing to me would be to get a concrete use case for this.
I've heard requests for being able to index relationships a number of times,
but never a concrete use case for being able to do so. It's always been
vague hand waving like in this case "we have data that is heavily centered
on the relationships rather than nodes", WHAT is that data? WHY does it need
to be centered around the relationships? If you say that you have use cases
like these I believe that you do, I have no reason to believe that you are
lying, why would you. But I want to understand those use cases, and I want
to understand them in a setting where having support for indexing
relationships adds value to the business.

I would like it if we were able to index Relationships as part of the core
API by version 1.2, and having an actual use case for when it would improve
the implementation of an actual domain would certainly help speed up the
process, perhaps we could even sneak it into version 1.1.

Cheers,
Tobias

On Fri, May 14, 2010 at 5:05 PM, Alex D'Amour wrote:

> Hi all,
>
> I am working on an application that stores large network data from multiple
> domains in Neo4j databases. The object is to allow users to upload network
> datasets and then expose them to researchers over the web, allowing
> researchers to subset the data and eventually download their own subgraph
> of
> the original dataset.
>
> Many of the operations that we intend to support are covered by the Lucene
> and Traversal frameworks. However, we'd also like to perform relationship
> lookups in the same way that we perform node lookups since many networks
> have data that are heavily centered on the Relationships rather than nodes.
> Is there or has there ever been an indexing component for Relationships in
> Neo4j? If not, how difficult would it be to port the LuceneIndexService to
> index relationships as well as nodes (i.e. how much of the code is specific
> to Nodes rather than PropertyContainers)?
>
> I realize that this probably isn't the ideal way to interact with the graph
> and that better domain modeling would probably solve this if the framework
> didn't have to be generic. But in this case we'd like to support this type
> of interaction with simple graph structures with only one type of node and
> only one type of relationship since they are the structures that social
> network researchers are the most interested in.
>
> Thanks,
> Alex
> ___
> Neo mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Tobias Ivarsson 
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] Indexing Relationships?

2010-05-14 Thread Alex D'Amour
Hi all,

I am working on an application that stores large network data from multiple
domains in Neo4j databases. The object is to allow users to upload network
datasets and then expose them to researchers over the web, allowing
researchers to subset the data and eventually download their own subgraph of
the original dataset.

Many of the operations that we intend to support are covered by the Lucene
and Traversal frameworks. However, we'd also like to perform relationship
lookups in the same way that we perform node lookups since many networks
have data that are heavily centered on the Relationships rather than nodes.
Is there or has there ever been an indexing component for Relationships in
Neo4j? If not, how difficult would it be to port the LuceneIndexService to
index relationships as well as nodes (i.e. how much of the code is specific
to Nodes rather than PropertyContainers)?

I realize that this probably isn't the ideal way to interact with the graph
and that better domain modeling would probably solve this if the framework
didn't have to be generic. But in this case we'd like to support this type
of interaction with simple graph structures with only one type of node and
only one type of relationship since they are the structures that social
network researchers are the most interested in.

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


Re: [Neo] indexing relationships

2009-07-10 Thread Symeon (Akis) Papadopoulos

>> My problem is the following:
>> I have a bi-partite graph consisting of two kinds of entities (say Users
>> and Images). A User object can be related to Images by means of
>> USER_IMAGE relationships.
>> Following the design guidelines, I have mapped this scheme to Neo4j in
>> the following way:
>> ROOT
>>-> USERS -> RootUser
>>-> USER -> User1
>>-> USER -> User2
>>
>>-> IMAGES -> RootImage
>>-> IMAGE -> Image1
>>-> IMAGE -> Image2
>>  
>> UserX -> USER_IMAGE -> ImageY
>>
>> After I create my original graph in one go (by reading from a text file)
>> I want to add some additional relationships to it, namely IMAGE_IMAGE
>> relations which are calculated in the following way:
>> Such a relation (IMAGE_IMAGE) is created between two Image nodes as long
>> as there is at least one User object which is related to both of these
>> Image objects (by means of a USER_IMAGE relationship). That would be
>> fine, but I also want to have a property attached to such a Relationship
>> which quantifies the frequency of this relationship (i.e. the number of
>> User objects that are related to both of these Images). The naive
>> approach that I adopted to achieve this, was the following:
>>  1. Iterate through all users.
>>  2. For each user, get a list of all images to which this user is
>> related. Create a relationship between each possible pair. If such a
>> relationship already exists, then update its "frequency" property.
>> As you may imagine, step 2 is in dire need of the relationship indexing
>> scheme we were discussing. I couldn't think of a more efficient way to
>> achieve the same result.
>>
>> 
>
> Do you ever traverse the IMAGE_IMAGE relationship after they have been
> created or are they just there to quantify the frequency between given
> two different images? If not you could store that information on a
> separate node that is indexed with the two image URIs.
>
> If you need to traverse the IMAGE_IMAGE draw two of those
> relationships to the indexed node. For example:
>
> (IMAGE_A)---IMAGE_IMAGEv
>   (Node that has
> frequency count and indexed property with "IMAGE_A_IMAGE_B")
> (IMAGE_B)---IMAGE_IMAGE^
>   
While this is a good idea to reuse the existing neo4j infrastructure for 
tackling the aforementioned problem, I am a bit hesitant in adopting it 
since it would bloat the size of a graph (number of nodes) by an order 
of magnitude (since each image object typically has ~10 IMAGE_IMAGE 
relations). Of course, neo4j can handle very large graphs, but I would 
prefer not to push it too much ;-) .
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] indexing relationships

2009-07-09 Thread Johan Svensson
On Tue, Jul 7, 2009 at 5:15 PM, Symeon (Akis)
Papadopoulos wrote:
> Johan Svensson wrote:
>
>> What we keep forgetting is that the graph already is the index. A well
>> designed graph will often check if a specific relationship exist
>> between two nodes just as fast as asking an already existing global
>> index. This is because (often) in real world scenarios at least one of
>> the two nodes will have few relationships.
>>
> Probably I'm missing something since I'm newbie in Neo4j, but I couldn't
> find some method that would directly return me the number of
> relationships for a node. Therefore, when I have two nodes and want to
> check whether a relationship exists between them, I cannot know in
> advance which of the two has the lower degree.
>

True, but sometimes the domain has information about it, such as: "An
organization node has more relationships connected than a person node
(so it is better to always start traversing from the person node)".
You can also keep relationship count as a property on a node.

>>
>> Symeon, maybe you could describe the problems you were having?
>> Hopefully it is possible to change something (either in the code or
>> the layout of the graph) to achieve better performance during the
>> update process.
>>
> My problem is the following:
> I have a bi-partite graph consisting of two kinds of entities (say Users
> and Images). A User object can be related to Images by means of
> USER_IMAGE relationships.
> Following the design guidelines, I have mapped this scheme to Neo4j in
> the following way:
> ROOT
>    -> USERS -> RootUser
>                                    -> USER -> User1
>                                    -> USER -> User2
>    
>    -> IMAGES -> RootImage
>                                    -> IMAGE -> Image1
>                                    -> IMAGE -> Image2
>      
>                                             UserX -> USER_IMAGE -> ImageY
>
> After I create my original graph in one go (by reading from a text file)
> I want to add some additional relationships to it, namely IMAGE_IMAGE
> relations which are calculated in the following way:
> Such a relation (IMAGE_IMAGE) is created between two Image nodes as long
> as there is at least one User object which is related to both of these
> Image objects (by means of a USER_IMAGE relationship). That would be
> fine, but I also want to have a property attached to such a Relationship
> which quantifies the frequency of this relationship (i.e. the number of
> User objects that are related to both of these Images). The naive
> approach that I adopted to achieve this, was the following:
>  1. Iterate through all users.
>  2. For each user, get a list of all images to which this user is
> related. Create a relationship between each possible pair. If such a
> relationship already exists, then update its "frequency" property.
> As you may imagine, step 2 is in dire need of the relationship indexing
> scheme we were discussing. I couldn't think of a more efficient way to
> achieve the same result.
>

Do you ever traverse the IMAGE_IMAGE relationship after they have been
created or are they just there to quantify the frequency between given
two different images? If not you could store that information on a
separate node that is indexed with the two image URIs.

If you need to traverse the IMAGE_IMAGE draw two of those
relationships to the indexed node. For example:

(IMAGE_A)---IMAGE_IMAGEv
  (Node that has
frequency count and indexed property with "IMAGE_A_IMAGE_B")
(IMAGE_B)---IMAGE_IMAGE^

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


Re: [Neo] indexing relationships

2009-07-07 Thread Symeon (Akis) Papadopoulos
Johan Svensson wrote:
> Hello,
>
> We have discussed this and given it some thought before. I think
> having a global index on (node1,node2,relationship) will not work
> well. Just managing that index will slow down relationship create and
> delete a lot.
>   
I agree. That's why, as Tobias noted in a previous email, such an 
indexing scheme would be an additional facility for those application 
scenarios where it is really needed.


> What we keep forgetting is that the graph already is the index. A well
> designed graph will often check if a specific relationship exist
> between two nodes just as fast as asking an already existing global
> index. This is because (often) in real world scenarios at least one of
> the two nodes will have few relationships.
>   
Probably I'm missing something since I'm newbie in Neo4j, but I couldn't 
find some method that would directly return me the number of 
relationships for a node. Therefore, when I have two nodes and want to 
check whether a relationship exists between them, I cannot know in 
advance which of the two has the lower degree.

> Doing lookup for first relationship of any given node today executes
> (roughly) in constant time. Then traversing the relationships will be
> a linear search and that is fast enough as long as there aren't too
> many relationships (it is not like we do a "table scan" on all the
> relationships that exist, we just work with the relationships around
> one of the nodes so in one sense you could say there already exist an
> index on "node,relationships").
>
> Symeon, maybe you could describe the problems you were having?
> Hopefully it is possible to change something (either in the code or
> the layout of the graph) to achieve better performance during the
> update process.
>   
My problem is the following:
I have a bi-partite graph consisting of two kinds of entities (say Users 
and Images). A User object can be related to Images by means of 
USER_IMAGE relationships.
Following the design guidelines, I have mapped this scheme to Neo4j in 
the following way:
ROOT
-> USERS -> RootUser
-> USER -> User1
-> USER -> User2

-> IMAGES -> RootImage
-> IMAGE -> Image1
-> IMAGE -> Image2
  
 UserX -> USER_IMAGE -> ImageY

After I create my original graph in one go (by reading from a text file) 
I want to add some additional relationships to it, namely IMAGE_IMAGE 
relations which are calculated in the following way:
Such a relation (IMAGE_IMAGE) is created between two Image nodes as long 
as there is at least one User object which is related to both of these 
Image objects (by means of a USER_IMAGE relationship). That would be 
fine, but I also want to have a property attached to such a Relationship 
which quantifies the frequency of this relationship (i.e. the number of 
User objects that are related to both of these Images). The naive 
approach that I adopted to achieve this, was the following:
 1. Iterate through all users.
 2. For each user, get a list of all images to which this user is 
related. Create a relationship between each possible pair. If such a 
relationship already exists, then update its "frequency" property.
As you may imagine, step 2 is in dire need of the relationship indexing 
scheme we were discussing. I couldn't think of a more efficient way to 
achieve the same result.

I created a quick-and-dirty implementation of the RelationshipIndex 
interface proposed by Tobias based on B-Trees (I used the JDBM library 
for this). Things improved a lot with this, but I feel that there is 
much room for improvement...

Best regards,
Symeon (Akis)


> Regards,
> Johan
>
> On Tue, Jul 7, 2009 at 10:48 AM, Tobias
> Ivarsson wrote:
>   
>> On Tue, Jul 7, 2009 at 10:12 AM, Symeon (Akis) Papadopoulos
>> wrote:
>>
>> 
>>> Perhaps the lookup method should have an additional argument specifying
>>> whether the relationship is directed or not.
>>>   
>> Good point, but I think it's better to add a specific method for that kind
>> of lookup:
>>
>> interface RelationshipIndex {
>>void index(Relationship relationship);
>>Relationship directionalLookup(RelationshipType type, Node start, Node
>> end);
>>Relationship undirectionalLookup(RelationshipType type, Node n1, Node
>> n2);
>>void remove(Relationship relationship);
>> }
>>
>> This is probably a nice convenience method even if the implementation would
>> just be:
>>
>> Relationship undirectionalLookup(RelationshipType type, Node n1, Node n2) {
>>Relationship result = this.directionalLookup(type, n1, n2);
>>if (result == null) {
>>result = this.directionalLookup(type, n2, n1);
>>}
>>return result;
>> }
>>
>> 
> ___
> Neo mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/

Re: [Neo] indexing relationships

2009-07-07 Thread Johan Svensson
Hello,

We have discussed this and given it some thought before. I think
having a global index on (node1,node2,relationship) will not work
well. Just managing that index will slow down relationship create and
delete a lot.

What we keep forgetting is that the graph already is the index. A well
designed graph will often check if a specific relationship exist
between two nodes just as fast as asking an already existing global
index. This is because (often) in real world scenarios at least one of
the two nodes will have few relationships.

Doing lookup for first relationship of any given node today executes
(roughly) in constant time. Then traversing the relationships will be
a linear search and that is fast enough as long as there aren't too
many relationships (it is not like we do a "table scan" on all the
relationships that exist, we just work with the relationships around
one of the nodes so in one sense you could say there already exist an
index on "node,relationships").

Symeon, maybe you could describe the problems you were having?
Hopefully it is possible to change something (either in the code or
the layout of the graph) to achieve better performance during the
update process.

Regards,
Johan

On Tue, Jul 7, 2009 at 10:48 AM, Tobias
Ivarsson wrote:
> On Tue, Jul 7, 2009 at 10:12 AM, Symeon (Akis) Papadopoulos
> wrote:
>
>> Perhaps the lookup method should have an additional argument specifying
>> whether the relationship is directed or not.
>
>
> Good point, but I think it's better to add a specific method for that kind
> of lookup:
>
> interface RelationshipIndex {
>    void index(Relationship relationship);
>    Relationship directionalLookup(RelationshipType type, Node start, Node
> end);
>    Relationship undirectionalLookup(RelationshipType type, Node n1, Node
> n2);
>    void remove(Relationship relationship);
> }
>
> This is probably a nice convenience method even if the implementation would
> just be:
>
> Relationship undirectionalLookup(RelationshipType type, Node n1, Node n2) {
>    Relationship result = this.directionalLookup(type, n1, n2);
>    if (result == null) {
>        result = this.directionalLookup(type, n2, n1);
>    }
>    return result;
> }
>
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] indexing relationships

2009-07-07 Thread Tobias Ivarsson
On Tue, Jul 7, 2009 at 10:12 AM, Symeon (Akis) Papadopoulos
wrote:

> Perhaps the lookup method should have an additional argument specifying
> whether the relationship is directed or not.


Good point, but I think it's better to add a specific method for that kind
of lookup:

interface RelationshipIndex {
void index(Relationship relationship);
Relationship directionalLookup(RelationshipType type, Node start, Node
end);
Relationship undirectionalLookup(RelationshipType type, Node n1, Node
n2);
void remove(Relationship relationship);
}

This is probably a nice convenience method even if the implementation would
just be:

Relationship undirectionalLookup(RelationshipType type, Node n1, Node n2) {
Relationship result = this.directionalLookup(type, n1, n2);
if (result == null) {
result = this.directionalLookup(type, n2, n1);
}
return result;
}

Depending on the actual index implementation, this implementation of
undirectionalLookup could actually be the best performing implementation.
But that's enough getting ahead of ourselves, having it in the interface is
a good idea. Now all that is left is for this to get high enough in the
priority queue and for someone to have enough time for this to get
implemented...


>
> My major problem (stemming from some preliminary tests I've done) is
> performance and scalability. I've implemented a simple indexing scheme,
> where an edge between two nodes with string indices n1_idx and n2_idx is
> indexed simply by the concatenation between them (the underlying index
> structure was a B-tree). When I attempted to index all edges of a
> moderately sized graph (~120k nodes, ~2M edges) the indexing process
> took quite a lot (several hours) which I consider as unacceptable. Any
> suggestions for improving on the efficiency and scalability of such an
> index are more than welcome.
>

Sorry, I don't have a silver bullet solution for this. Anyone else? (see for
example Mattias email that arrived while I was typing this)

Johan: Is there perhaps a batch index creator?
Akis: This (if available) would help you if most of your data is created up
front.

I remember being particularly irritated by this problem during my CS
education:
"given n in N and m in N, and finding out if (n,m) in E is an O(1) operation
you said? - No way that is true for a large graph."

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


Re: [Neo] indexing relationships

2009-07-07 Thread Mattias Persson
2009/7/7 Symeon (Akis) Papadopoulos :
>
>> Was that what you meant?
>>
>> My interpretation of Symeons request was an index from
>> (RelationshipType,Node,Node) to Relationship, which in my opinion would be
>> much more useful than a simple index from (String,primitive) to
>> Relationship, which is how the node indexes work.
>>
> That was exactly what I meant.
>
>
>> The use for such an index would be for places where you have many
>> relationships from a node and quickly wish to determine if there is a
>> relationship from that node to a given node.
>>
> Actually, my original thought was to index all relationships of a graph,
> but selective indexing based on node degree sounds like a smart way to
> save disk space and index update time.
>
>> The benefit of having this be part of index-util (as opposed to internally
>> in neo-core) is obvious. Keeping an index like this updated is expensive.
>> You as an application developer know where in your graph you need it and
>> thus where you are prepared to pay the extra overhead for insertion (an
>> overhead that pays back on lookup). If we instead were to add something like
>> this to neo-core we would add that overhead to all relationship creations,
>> and that would be very undesirable.
>>
> That is obviously understandable.
>>
>> To further clarify the distinction between an index like this and the
>> currently existing indexes, here is a quick definition of the interface for
>> it:
>>
>> interface RelationshipIndex {
>>     void index(Relationship relationship);
>>     Relationship lookup(RelationshipType type, Node start, Node end);
>>     void remove(Relationship relationship);
>> }
>>
> Perhaps the lookup method should have an additional argument specifying
> whether the relationship is directed or not.
>
>
> My major problem (stemming from some preliminary tests I've done) is
> performance and scalability. I've implemented a simple indexing scheme,
> where an edge between two nodes with string indices n1_idx and n2_idx is
> indexed simply by the concatenation between them (the underlying index
> structure was a B-tree). When I attempted to index all edges of a
> moderately sized graph (~120k nodes, ~2M edges) the indexing process
> took quite a lot (several hours) which I consider as unacceptable. Any
> suggestions for improving on the efficiency and scalability of such an
> index are more than welcome.

Grouping more operations in one transaction will increase indexing
speed and also if we were to write such a RelationshipIndex in lucene
it would be much faster, at least if tx grouping is high.

>
> Best regards,
> Akis
>
>> Cheers,
>> Tobias
>>
>> On Mon, Jul 6, 2009 at 7:27 PM, Peter Neubauer 
>> wrote:
>>
>>
>>> Hi Symeon,
>>> so, what you are saying is that you would like to have the possibility
>>> to set indexes on relationships and their properties just like on the
>>> nodes as in http://components.neo4j.org/index-util/ ?
>>>
>>> I guess that would be easy to do, or you could do it yourself by
>>> looking at the index-util package, but I guess being able to treat
>>> Relationships as first-class indexing citizens is a good idea ... any
>>> others that have opinions on that?
>>>
>>> /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     - New Energy for Data - The Graph Database.
>>> http://www.ops4j.org     - New Energy for OSS Communities - Open
>>> Participation Software.
>>> http://www.oredev.org   - Where Good Geeks Grok.
>>>
>>>
>>>
>>> On Mon, Jul 6, 2009 at 10:38 AM, Symeon (Akis)
>>> Papadopoulos wrote:
>>>
 Hi,

 I have been experimenting with incremental building of large graphs and
 I realized that the graph update process would be much faster if there
 was a possibility to index relationships between pairs of nodes in order
 to have the possibility for quick lookups. Currently, each time I want
 to create or update a relationship between two nodes (say n1 and n2), I
 first need to iterate through all relationships (of the particular type)
 of n1 and check whether the other node is n2. Is there any effort within
 neo4j.util.index to provide such functionality or should I try to
 develop something on my own?

 Best regards,
 Symeon (Akis)
 ___
 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 mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Mattias Persson, [matt...@neotechnology.com]
Neo Technology, www.neotechnology.com
_

Re: [Neo] indexing relationships

2009-07-07 Thread Symeon (Akis) Papadopoulos

> Was that what you meant?
>
> My interpretation of Symeons request was an index from
> (RelationshipType,Node,Node) to Relationship, which in my opinion would be
> much more useful than a simple index from (String,primitive) to
> Relationship, which is how the node indexes work.
>   
That was exactly what I meant.


> The use for such an index would be for places where you have many
> relationships from a node and quickly wish to determine if there is a
> relationship from that node to a given node.
>   
Actually, my original thought was to index all relationships of a graph, 
but selective indexing based on node degree sounds like a smart way to 
save disk space and index update time.

> The benefit of having this be part of index-util (as opposed to internally
> in neo-core) is obvious. Keeping an index like this updated is expensive.
> You as an application developer know where in your graph you need it and
> thus where you are prepared to pay the extra overhead for insertion (an
> overhead that pays back on lookup). If we instead were to add something like
> this to neo-core we would add that overhead to all relationship creations,
> and that would be very undesirable.
>   
That is obviously understandable.
>
> To further clarify the distinction between an index like this and the
> currently existing indexes, here is a quick definition of the interface for
> it:
>
> interface RelationshipIndex {
> void index(Relationship relationship);
> Relationship lookup(RelationshipType type, Node start, Node end);
> void remove(Relationship relationship);
> }
>   
Perhaps the lookup method should have an additional argument specifying 
whether the relationship is directed or not.


My major problem (stemming from some preliminary tests I've done) is 
performance and scalability. I've implemented a simple indexing scheme, 
where an edge between two nodes with string indices n1_idx and n2_idx is 
indexed simply by the concatenation between them (the underlying index 
structure was a B-tree). When I attempted to index all edges of a 
moderately sized graph (~120k nodes, ~2M edges) the indexing process 
took quite a lot (several hours) which I consider as unacceptable. Any 
suggestions for improving on the efficiency and scalability of such an 
index are more than welcome.

Best regards,
Akis

> Cheers,
> Tobias
>
> On Mon, Jul 6, 2009 at 7:27 PM, Peter Neubauer 
> wrote:
>
>   
>> Hi Symeon,
>> so, what you are saying is that you would like to have the possibility
>> to set indexes on relationships and their properties just like on the
>> nodes as in http://components.neo4j.org/index-util/ ?
>>
>> I guess that would be easy to do, or you could do it yourself by
>> looking at the index-util package, but I guess being able to treat
>> Relationships as first-class indexing citizens is a good idea ... any
>> others that have opinions on that?
>>
>> /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 - New Energy for Data - The Graph Database.
>> http://www.ops4j.org - New Energy for OSS Communities - Open
>> Participation Software.
>> http://www.oredev.org   - Where Good Geeks Grok.
>>
>>
>>
>> On Mon, Jul 6, 2009 at 10:38 AM, Symeon (Akis)
>> Papadopoulos wrote:
>> 
>>> Hi,
>>>
>>> I have been experimenting with incremental building of large graphs and
>>> I realized that the graph update process would be much faster if there
>>> was a possibility to index relationships between pairs of nodes in order
>>> to have the possibility for quick lookups. Currently, each time I want
>>> to create or update a relationship between two nodes (say n1 and n2), I
>>> first need to iterate through all relationships (of the particular type)
>>> of n1 and check whether the other node is n2. Is there any effort within
>>> neo4j.util.index to provide such functionality or should I try to
>>> develop something on my own?
>>>
>>> Best regards,
>>> Symeon (Akis)
>>> ___
>>> 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 mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] indexing relationships

2009-07-07 Thread Tobias Ivarsson
Was that what you meant?

My interpretation of Symeons request was an index from
(RelationshipType,Node,Node) to Relationship, which in my opinion would be
much more useful than a simple index from (String,primitive) to
Relationship, which is how the node indexes work.

The use for such an index would be for places where you have many
relationships from a node and quickly wish to determine if there is a
relationship from that node to a given node.

The benefit of having this be part of index-util (as opposed to internally
in neo-core) is obvious. Keeping an index like this updated is expensive.
You as an application developer know where in your graph you need it and
thus where you are prepared to pay the extra overhead for insertion (an
overhead that pays back on lookup). If we instead were to add something like
this to neo-core we would add that overhead to all relationship creations,
and that would be very undesirable.


To further clarify the distinction between an index like this and the
currently existing indexes, here is a quick definition of the interface for
it:

interface RelationshipIndex {
void index(Relationship relationship);
Relationship lookup(RelationshipType type, Node start, Node end);
void remove(Relationship relationship);
}

Cheers,
Tobias

On Mon, Jul 6, 2009 at 7:27 PM, Peter Neubauer wrote:

> Hi Symeon,
> so, what you are saying is that you would like to have the possibility
> to set indexes on relationships and their properties just like on the
> nodes as in http://components.neo4j.org/index-util/ ?
>
> I guess that would be easy to do, or you could do it yourself by
> looking at the index-util package, but I guess being able to treat
> Relationships as first-class indexing citizens is a good idea ... any
> others that have opinions on that?
>
> /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 - New Energy for Data - The Graph Database.
> http://www.ops4j.org - New Energy for OSS Communities - Open
> Participation Software.
> http://www.oredev.org   - Where Good Geeks Grok.
>
>
>
> On Mon, Jul 6, 2009 at 10:38 AM, Symeon (Akis)
> Papadopoulos wrote:
> > Hi,
> >
> > I have been experimenting with incremental building of large graphs and
> > I realized that the graph update process would be much faster if there
> > was a possibility to index relationships between pairs of nodes in order
> > to have the possibility for quick lookups. Currently, each time I want
> > to create or update a relationship between two nodes (say n1 and n2), I
> > first need to iterate through all relationships (of the particular type)
> > of n1 and check whether the other node is n2. Is there any effort within
> > neo4j.util.index to provide such functionality or should I try to
> > develop something on my own?
> >
> > Best regards,
> > Symeon (Akis)
> > ___
> > 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
>



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


Re: [Neo] indexing relationships

2009-07-06 Thread Peter Neubauer
Hi Symeon,
so, what you are saying is that you would like to have the possibility
to set indexes on relationships and their properties just like on the
nodes as in http://components.neo4j.org/index-util/ ?

I guess that would be easy to do, or you could do it yourself by
looking at the index-util package, but I guess being able to treat
Relationships as first-class indexing citizens is a good idea ... any
others that have opinions on that?

/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 - New Energy for Data - The Graph Database.
http://www.ops4j.org - New Energy for OSS Communities - Open
Participation Software.
http://www.oredev.org   - Where Good Geeks Grok.



On Mon, Jul 6, 2009 at 10:38 AM, Symeon (Akis)
Papadopoulos wrote:
> Hi,
>
> I have been experimenting with incremental building of large graphs and
> I realized that the graph update process would be much faster if there
> was a possibility to index relationships between pairs of nodes in order
> to have the possibility for quick lookups. Currently, each time I want
> to create or update a relationship between two nodes (say n1 and n2), I
> first need to iterate through all relationships (of the particular type)
> of n1 and check whether the other node is n2. Is there any effort within
> neo4j.util.index to provide such functionality or should I try to
> develop something on my own?
>
> Best regards,
> Symeon (Akis)
> ___
> 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] indexing relationships

2009-07-06 Thread Symeon (Akis) Papadopoulos
Hi,

I have been experimenting with incremental building of large graphs and 
I realized that the graph update process would be much faster if there 
was a possibility to index relationships between pairs of nodes in order 
to have the possibility for quick lookups. Currently, each time I want 
to create or update a relationship between two nodes (say n1 and n2), I 
first need to iterate through all relationships (of the particular type) 
of n1 and check whether the other node is n2. Is there any effort within 
neo4j.util.index to provide such functionality or should I try to 
develop something on my own?

Best regards,
Symeon (Akis)
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] indexing relationships

2008-08-10 Thread Anders Nawroth
Hi!

As the relationships are a core strength of neo4j, this would be a nice 
addition to the index API.

In the current IMDB example data model the roles are modeled as 
relationships and at the moment not searchable (which they really should 
be). So I have a use case for this!

There are workarounds, but I can't see workarounds should be needed for 
this kind of operation ...

/anders

Johan Svensson skrev:
> Hi Anders,
>
> When we specified the IndexService API getRelationshipById was not
> present in the Neo core API. That has changed now so maybe we will
> extend the index API to support this.
>
> -Johan
>
> On Thu, Aug 7, 2008 at 7:44 PM, Anders Nawroth <[EMAIL PROTECTED]> wrote:
>   
>> Hi!
>>
>> Any way I can index relationships?
>>
>> Can't find this in the IndexService API.
>>
>> Would be useful, as information can be stored as relationship properties.
>>
>>
>> /anders
>> 
> ___
>   

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


Re: [Neo] indexing relationships

2008-08-07 Thread Johan Svensson
Hi Anders,

When we specified the IndexService API getRelationshipById was not
present in the Neo core API. That has changed now so maybe we will
extend the index API to support this.

-Johan

On Thu, Aug 7, 2008 at 7:44 PM, Anders Nawroth <[EMAIL PROTECTED]> wrote:
> Hi!
>
> Any way I can index relationships?
>
> Can't find this in the IndexService API.
>
> Would be useful, as information can be stored as relationship properties.
>
>
> /anders
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo] indexing relationships

2008-08-07 Thread Anders Nawroth
Hi!

Any way I can index relationships?

Can't find this in the IndexService API.

Would be useful, as information can be stored as relationship properties.


/anders

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