[Neo4j] Neo4jClient - Query optmised

2011-12-07 Thread Romiko Derbynew
Finally thanks to Peter and Marko, the .Net Neo4jClient code has been optimised 
to use short hand version of in('') and out('').
ChangeSet is http://hg.readify.net/neo4jclient/changeset/91ef447a9053
___
NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
and consider posting at https://groups.google.com/forum/#!forum/neo4j

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


Re: [Neo4j] println and Table Projections

2011-12-07 Thread Romiko Derbynew
Hi,

Thanks for the tips, will see if I can change the client to use the new format. 
Indeed, let me try isolate the problems with more simpler queries. I have built 
a test case below, forgive me if I made it to complex.

Friend => HasPet => Pet => HasCareTaker => CareTaker
Friend => HasPet => Pet => HasCareTaker => CareTaker
Friend

Test Case Script Setup
props = [:];rootNode= g.addVertex(props);props["Name"] = "John";friendNode1 = 
g.addVertex(props);myRelation = g.addEdge(rootNode, friendNode1, 
'AllFriends');props["Name"] = "Jack";friendNode2 = 
g.addVertex(props);myRelation = g.addEdge(rootNode, friendNode2, 
'AllFriends');props["Name"] = "Jill";friendNode3 = 
g.addVertex(props);myRelation = g.addEdge(rootNode, friendNode3, 
'AllFriends');props["Name"] = "ScoobieDoo";petNode1 = 
g.addVertex(props);myRelation = g.addEdge(friendNode1, 
petNode1,'HasPet');props["Name"] = "Garfield";petNode2 = 
g.addVertex(props);myRelation = g.addEdge(friendNode2, 
petNode2,'HasPet');props["Name"] = "Bob";careTakerNode1 = 
g.addVertex(props);myRelation = g.addEdge(petNode1, 
careTakerNode1,'HasCareTaker');props["Name"] = "Harry";careTakerNode2 = 
g.addVertex(props);myRelation = g.addEdge(petNode2, 
careTakerNode2,'HasCareTaker')

Query - Works, but does not have Jill in the table.
rootNode.out('AllFriends').as('Friend').ifThenElse{it.out('HasPet').hasNext()}{it.out('HasPet')}{it}.as('Pet').out('HasCareTaker').as('CareTaker').table(new
 Table()){it['Name']}{it['Name']}{it['Name']}.cap

Output
[[Friend:Jack, Pet:Garfield, CareTaker:Harry], [Friend:John, Pet:ScoobieDoo, 
CareTaker:Bob]]

Attempted Query - Does not work - trying to get Jill (Notice I am trying to use 
println)
rootNode.out('AllFriends').as('Friend').ifThenElse{it.out('HasPet').hasNext()}{it.out('HasPet')}{println
 "${it} Unknown"}.as('Pet').out('HasCareTaker').as('CareTaker').table(new 
Table()){it['Name']}{it['Name']}{it['Name']}.cap

Desired Output
[[Friend:Jack, Pet:Garfield, CareTaker:Harry], [Friend:John, Pet:ScoobieDoo, 
CareTaker:Bob], [Friend:Jill, Pet:unknown, CareTaker:unknown]]]

If I can get this working, it means we can have allot more performance from 
queries without doing separate queries if we have a powerful table projection 
model, since I rely on the REST API, I feel the table projections is going to 
be our core method of joining results in one call, so the idea of left/right 
joins etc.

-Original Message-
From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
Behalf Of Marko Rodriguez
Sent: Wednesday, 7 December 2011 7:07 PM
To: Neo4j user discussions
Cc: ne...@googlegroups.com
Subject: Re: [Neo4j] println and Table Projections

Hi,

Peter brings up a good point. Its hard for us to parse complex queries and see 
where Exceptions are happening. If you can isolate the problem via a simpler 
traversal, that would be best for us -- and our little baby brains.

Also, note the following syntax optimizations for your traversal:
1. outE[[label:'HOSTS']].inV ---> out('HOSTS')
2. Similarly, inE[[label:'X']].outV -> in('X')

Using out() and in() is much more efficient (faster) and more concise. Unless 
you plan to reason on the properties of an edge, then there is no reason to use 
outE.inV style syntax as out will do the full vertex-to-vertex jump for you.

HTH,
Marko.

http://markorodriguez.com

On Dec 7, 2011, at 1:00 AM, Peter Neubauer wrote:

> Mmh,
> I was thinking on how to return the contents of the output stream, I 
> am not quite sure how to return that. What woudl be a good format for 
> you?
> 
> Also could you reduce this into a small testcase that I can work on?
> 
> Cheers,
> 
> /peter neubauer
> 
> GTalk:  neubauer.peter
> Skype   peter.neubauer
> Phone   +46 704 106975
> LinkedIn   http://www.linkedin.com/in/neubauer
> Twitter  http://twitter.com/peterneubauer
> 
> brew install neo4j && neo4j start
> heroku addons:add neo4j
> 
> 
> 
> On Wed, Dec 7, 2011 at 8:10 AM, Romiko Derbynew 
>  wrote:
>> Hi,
>> 
>> I have this statement.
>> g.v('0').outE[[label:'HOSTS']].inV.filter{ 
>> it['Key'].equalsIgnoreCase('romikoagency') 
>> }.inE[[label:'USER_BELONGS_TO']].outV.filter{ 
>> it['Username'].equalsIgnoreCase('romiko.derbynew') 
>> }.ifThenElse{it.outE[[label:'USER_LINKED_TO_CENTRE']].inV.hasNext()}{
>> it.outE[[label:'USER_LINKED_TO_CENTRE']].inV.Name}{println ${it} 
>> "Unknown"}.as('Centre')
>> 
>> I then take this query and do a table projection, however I get the 
>> following error.
>> println java.lang.String cannot be cast to 
>> com.tinkerpop.blueprints.pgm.Vertex
>> 
>> Is there a better way to do this then? I want to reduce our calls to the DB 
>> for performance and finding it a bit tough wrapping everything into one  
>> query. Currently the above query is split into two different queries.
>> 
>> Much appreciated.
>> ___
>> Neo4j mailing list
>> User@lists.neo4j.org
>> https://lists.neo4j.org/mailman/listinfo/user
> 

Re: [Neo4j] I need help with this cypher query

2011-12-07 Thread Michael Hunger
Hey André,

you already almost did it, just copying your parts together

start shop=node(123), me=node(321)
match shop-[:sell]->item<-[:like]-user,item<-[r1?:like]-me
where r1 is null
return item

the missing part was the optional relationship for r1, which allows it to be 
null and you check for those results, where no relationship between me and item 
exists.

HTH

Michael

Am 07.12.2011 um 23:28 schrieb andremetzen:

> I'm trying to create a cypher query. 
> 
> I have a shop=node(123) and me=node(321) start nodes. 
> 
> I want all items that shop-[:sell]->item<-[:like]-user but does not exist
> any r1 me-[r1:like]->item. 
> 
> It's that possible with cypher?
> 
> --
> View this message in context: 
> http://neo4j-community-discussions.438527.n3.nabble.com/I-need-help-with-this-cypher-query-tp3568845p3568845.html
> Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
> ___
> NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
> and consider posting at https://groups.google.com/forum/#!forum/neo4j
> 
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user

___
NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
and consider posting at https://groups.google.com/forum/#!forum/neo4j

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


[Neo4j] I need help with this cypher query

2011-12-07 Thread andremetzen
I'm trying to create a cypher query. 

I have a shop=node(123) and me=node(321) start nodes. 

I want all items that shop-[:sell]->item<-[:like]-user but does not exist
any r1 me-[r1:like]->item. 

It's that possible with cypher?

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/I-need-help-with-this-cypher-query-tp3568845p3568845.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
and consider posting at https://groups.google.com/forum/#!forum/neo4j

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


[Neo4j] Switching mailinglist during the weekend to Google Groups

2011-12-07 Thread Peter Neubauer
Hi all,
it turns out the Google Apps for you Domain Groups are not showing up
in the central Google Index. That means we will switch this weekend to
https://groups.google.com/forum/#!forum/neo4j instead.

Currently, every mail to this list is forwarded to the new Google
Group, and this will stay so. However, you all will get a notice that
you are added to the new list sometime this week, and we are setting
up an autoresponse saying

NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please
register and consider posting at
https://groups.google.com/forum/#!forum/neo4j

This list will be open for another week or so, so we can make sure
everything is flowing smoothly, but then it will be put in readonly
mode.

Sorry for the inconvenience everyone!


Cheers,

/peter neubauer

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

brew install neo4j && neo4j start
heroku addons:add neo4j
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Cypher <3 Trees

2011-12-07 Thread Michael Hunger
E.g. a timeline tree with root -> centuries -> years ->  months -> days -> hours

I want to traverse the tree with cypher in the order of the entries, e.g. to 
extract data in a ordered fashion.

Am 07.12.2011 um 17:05 schrieb Andres Taylor:

> On Wed, Dec 7, 2011 at 4:25 PM, Michael Hunger <
> michael.hun...@neotechnology.com> wrote:
> 
>> I would love to see consideration of branch ordering.
>> 
> 
> What do you mean? An example would be helpful.
> 
> 
>> Predicate support for trees like we now have for paths.
>> 
> 
> Didn't think in these terms. I like it. Do you have any concrete predicates
> in mind?
> 
Filter trees by conditions that all/some/no nodes/rels (or all leaves or 
non-leaves) have to fulfill.

> 
>> And returning trees and subgraphs as cypher results.
>> 
>> Can we generalize this discussion to connected subgraphs or is this too
>> early ?
>> 
> 
> I'd love to fork this into a different thread and hear more about your
> thinking here. Would you do the honors?
> 
> Andrés
> ___
> 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: [Neo4j] Cypher <3 Trees

2011-12-07 Thread D. Frej
ok, I agree I was too short on this one.

What Peter suggested was to start somewhere in a tree (stem) and get the 
leafs based on a condition (x.importance > 30). For me, this is similiar 
to hierarchies, which are often build with the help nested sets in RDBMS.

Anyways: forget about my comment. The important point is my +1 to 
Peter's functionality wish





Am 07.12.2011 16:53, schrieb Andres Taylor:
> On Wed, Dec 7, 2011 at 4:47 PM, D. Frej  wrote:
>
>> +1 as this also goes into the direction of nested sets
>>
> I don't get it. Maybe I have my nomenclature all wrong, but
> thisis what I think of
> when I hear nested sets. What am I missing?
>
> Andrés
> ___
> 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: [Neo4j] Cypher <3 Trees

2011-12-07 Thread Andres Taylor
On Wed, Dec 7, 2011 at 4:25 PM, Michael Hunger <
michael.hun...@neotechnology.com> wrote:

> I would love to see consideration of branch ordering.
>

What do you mean? An example would be helpful.


> Predicate support for trees like we now have for paths.
>

Didn't think in these terms. I like it. Do you have any concrete predicates
in mind?


> And returning trees and subgraphs as cypher results.
>
> Can we generalize this discussion to connected subgraphs or is this too
> early ?
>

I'd love to fork this into a different thread and hear more about your
thinking here. Would you do the honors?

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


Re: [Neo4j] Cypher <3 Trees

2011-12-07 Thread Andres Taylor
On Wed, Dec 7, 2011 at 4:14 PM, Peter Neubauer <
peter.neuba...@neotechnology.com> wrote:

> Mmh,
> I would like to see that I can specify the "stem" of the tree as a
> path and then get leaf nodes out from that


Yeah, the cook book exposed this weakness clearly...


> , something like
>
> START root = node(0)
> MATCH stem=root->(dir?*), stem-[:LEAF]->leaf
> WHERE all(x in nodes(stem)
> WHERE x.importance > 30)
> RETURN leaf, stem
>

My idea was to do something similar to shortestPath:

START root=node(0)
MATCH leafPath = getAllLeafPaths( root-[:LEAF*]->leafNode )
RETURN leafNode

What do you think about this syntax?

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


Re: [Neo4j] Cypher <3 Trees

2011-12-07 Thread Andres Taylor
On Wed, Dec 7, 2011 at 4:47 PM, D. Frej  wrote:

> +1 as this also goes into the direction of nested sets
>

I don't get it. Maybe I have my nomenclature all wrong, but
thisis what I think of
when I hear nested sets. What am I missing?

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


Re: [Neo4j] Cypher <3 Trees

2011-12-07 Thread D. Frej
+1 as this also goes into the direction of nested sets



Am 07.12.2011 16:14, schrieb Peter Neubauer:
> Mmh,
> I would like to see that I can specify the "stem" of the tree as a
> path and then get leaf nodes out from that, something like
>
> START root = node(0)
> MATCH stem=root->(dir?*), stem-[:LEAF]->leaf
> WHERE all(x in nodes(stem)
> WHERE x.importance>  30)
> RETURN leaf, stem
>
> Does that make sense?
>
> Cheers,
>
> /peter neubauer
>
> GTalk:  neubauer.peter
> Skype   peter.neubauer
> Phone   +46 704 106975
> LinkedIn   http://www.linkedin.com/in/neubauer
> Twitter  http://twitter.com/peterneubauer
>
> brew install neo4j&&  neo4j start
> heroku addons:add neo4j
>
>
>
> On Wed, Dec 7, 2011 at 2:53 PM, Andres Taylor
>   wrote:
>> A subset of the graphs are trees, and they have a few problems that are
>> specific for them. I'm right now planning what needs to be added to Cypher
>> to make it play nice with your tree structures.
>>
>> I'd love to know if you have hierarchical data, and what queries you do and
>> would like to do. Doesn't matter if you use Cypher or not.
>>
>> Thanks!
>>
>> Andrés
>> ___
>> 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: [Neo4j] With rest,how to get the root URI

2011-12-07 Thread Peter Neubauer
Ahh yes,
Good call!

/peter

Sent from my phone, please excuse typos and autocorrection.
On Dec 7, 2011 4:40 PM, "maxdemarzi"  wrote:

> http://docs.neo4j.org/chunked/milestone/rest-api-service-root.html
>
> The Reference Node:
>
> {
>  "relationship_index" : "http://localhost:7474/db/data/index/relationship
> ",
>  "node" : "http://localhost:7474/db/data/node";,
>  "relationship_types" : "http://localhost:7474/db/data/relationship/types
> ",
>  "neo4j_version" : "1.6.M01",
>  "batch" : "http://localhost:7474/db/data/batch";,
>  "extensions_info" : "http://localhost:7474/db/data/ext";,
>  "node_index" : "http://localhost:7474/db/data/index/node";,
>  "reference_node" : "http://localhost:7474/db/data/node/107";,
>  "extensions" : {
>  }
> }
>
> Which reminds me that I need to update neograpy since I simply assume the
> root is node 0, but it seems that isn't always the case.
>
> --
> View this message in context:
> http://neo4j-community-discussions.438527.n3.nabble.com/With-rest-how-to-get-the-root-URI-tp3566691p3567770.html
> Sent from the Neo4j Community Discussions mailing list archive at
> Nabble.com.
> ___
> 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: [Neo4j] With rest,how to get the root URI

2011-12-07 Thread maxdemarzi
http://docs.neo4j.org/chunked/milestone/rest-api-service-root.html

The Reference Node:

{
  "relationship_index" : "http://localhost:7474/db/data/index/relationship";,
  "node" : "http://localhost:7474/db/data/node";,
  "relationship_types" : "http://localhost:7474/db/data/relationship/types";,
  "neo4j_version" : "1.6.M01",
  "batch" : "http://localhost:7474/db/data/batch";,
  "extensions_info" : "http://localhost:7474/db/data/ext";,
  "node_index" : "http://localhost:7474/db/data/index/node";,
  "reference_node" : "http://localhost:7474/db/data/node/107";,
  "extensions" : {
  }
}

Which reminds me that I need to update neograpy since I simply assume the
root is node 0, but it seems that isn't always the case.

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/With-rest-how-to-get-the-root-URI-tp3566691p3567770.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Cypher <3 Trees

2011-12-07 Thread Michael Hunger
I would love to see consideration of branch ordering.

Predicate support for trees like we now have for paths.

And returning trees and subgraphs as cypher results.

Can we generalize this discussion to connected subgraphs or is this too early ?

Michael

Am 07.12.2011 um 16:14 schrieb Peter Neubauer:

> Mmh,
> I would like to see that I can specify the "stem" of the tree as a
> path and then get leaf nodes out from that, something like
> 
> START root = node(0)
> MATCH stem=root->(dir?*), stem-[:LEAF]->leaf
> WHERE all(x in nodes(stem)
> WHERE x.importance > 30)
> RETURN leaf, stem
> 
> Does that make sense?
> 
> Cheers,
> 
> /peter neubauer
> 
> GTalk:  neubauer.peter
> Skype   peter.neubauer
> Phone   +46 704 106975
> LinkedIn   http://www.linkedin.com/in/neubauer
> Twitter  http://twitter.com/peterneubauer
> 
> brew install neo4j && neo4j start
> heroku addons:add neo4j
> 
> 
> 
> On Wed, Dec 7, 2011 at 2:53 PM, Andres Taylor
>  wrote:
>> A subset of the graphs are trees, and they have a few problems that are
>> specific for them. I'm right now planning what needs to be added to Cypher
>> to make it play nice with your tree structures.
>> 
>> I'd love to know if you have hierarchical data, and what queries you do and
>> would like to do. Doesn't matter if you use Cypher or not.
>> 
>> Thanks!
>> 
>> Andrés
>> ___
>> 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: [Neo4j] Cypher <3 Trees

2011-12-07 Thread Peter Neubauer
Mmh,
I would like to see that I can specify the "stem" of the tree as a
path and then get leaf nodes out from that, something like

START root = node(0)
MATCH stem=root->(dir?*), stem-[:LEAF]->leaf
WHERE all(x in nodes(stem)
WHERE x.importance > 30)
RETURN leaf, stem

Does that make sense?

Cheers,

/peter neubauer

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

brew install neo4j && neo4j start
heroku addons:add neo4j



On Wed, Dec 7, 2011 at 2:53 PM, Andres Taylor
 wrote:
> A subset of the graphs are trees, and they have a few problems that are
> specific for them. I'm right now planning what needs to be added to Cypher
> to make it play nice with your tree structures.
>
> I'd love to know if you have hierarchical data, and what queries you do and
> would like to do. Doesn't matter if you use Cypher or not.
>
> Thanks!
>
> Andrés
> ___
> 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: [Neo4j] Feedback requested: Major "wish list" item for Neo4J

2011-12-07 Thread Craig Taverner
I definitely second this suggestion. We have recently being working on a
binary store for dense data we would like to access as if they were
properties of nodes. Right now we have properties that are references to
files on disk, and then handle the binary ourselves, but this does not
benefit from any transactional advantages. Rick's suggestion of a plugable
store would suite us very well, because I presume Neo4j would specify the
interface/api to use to implement such a store in a way that could be
handled atomically within transactions, and then we could satisfy that with
our own store.

On Wed, Dec 7, 2011 at 3:43 PM, Rick Bullotta
wrote:

> One area where I would love to see the Neo4J team focus some energy is in
> the efficient storage and retrieval of blob/large text properties.  Similar
> to the indexing strategy in Neo4J, it would be nice if this was pluggable
> (and it could depend on some other data store more optimized for blob/clob
> properties).
>
> The keys for this to be successful are:
>
> - Transacted
> - Does not store these properties "in memory" except when accessed (and
> then, perhaps offer a getPropertyAsStream method and a
> setPropertyFromStream method for optimal performance)
> - Transparent - should just "work"
>
> Nice to haves, but not at all required in the first iteration:
>
> - Pluggable (store in Neo4J native, filesystem, EC2 simple storage, etc.)
>
> Addition of these capabilities would move Neo4J into a dramatically
> expanded realm of potential applications, some of which are quite mind
> blowing, both in the social realm and in the enterprise realm.
>
> Feedback welcomed!
> ___
> 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: [Neo4j] Modeling subrelationships in Neo4j

2011-12-07 Thread Niels Hoogeveen

I think my explanation was not clear as it should be. 
I wasn't suggesting to replace the relationships with a node, but to shadow the 
relationshiptypes with a node.
Let's say we have two relationshiptypes, KNOWS and FRIEND, where we want to 
state that friends form a subset of the people a person knows. Additionally we 
have a relationshiptype SUBRELATIONSHIP indicating that a relationshiptype is a 
subtype of another relationshiptype.
For the two relationshiptypes KNOWS and FRIEND, create nodes and store the name 
of the relationshiptype in a property on that node. These two nodes must 
somehow be indexed, which you can either do with Lucene, though in my own 
application I have chosen to create a namespace node attached to the reference 
node, and create a relationship from that namespace node to the 
relationshiptype node. This allows for a quick lookup of the relationshiptype 
nodes. 
Additionally a relationhip of type SUBRELATIONSHIP should be created from the 
FRIEND node to the KNOWS node. 
Now methods for the retrieval of relationships should be written, so you don't 
fetch just the relationships with a given relationshiptype, but traverse all 
subrelationshiptype too and fetch all relationships on a node with those 
subrelationships. 
Example:
pete --> FRIEND --> jakepete --> FRIEND --> ellenpete --> KNOWS --> patty
Suppose we want to fetch all the people pete knows.
We traverse the hierarchy of relationshiptypes under KNOWS, and get an Iterable 
with the two relationshiptype nodes associated with KNOWS and FRIEND. Then we 
iterate over these relationhiptype nodes fetching the relationship on the 
pete-node with the corresponding relationshiptype, thereby returning an 
Iterable with the nodes associated with jake, ellen and patty.
For faster lookups, I have decided to use the id of the relationshiptype node 
as the name of the relationships used, but this is not a requirement for this 
solution.
Niels




> Date: Wed, 7 Dec 2011 18:16:15 +0530
> From: sourajit.ba...@gmail.com
> To: user@lists.neo4j.org
> Subject: Re: [Neo4j] Modeling subrelationships in Neo4j
> 
> To Niels' approach,
> Wouldn't it be a very dense graph ? For e.g. there will be several people
> inter-connected by KNOWS; if we model KNOWS as a node, there would be lots
> of edges originating from it.
> 
> 
> On Wed, Dec 7, 2011 at 5:16 PM, Alistair Jones <
> alistair.jo...@neotechnology.com> wrote:
> 
> > Qualifying the relationships with an additional property (or properties)
> > sounds like a sensible approach.
> >
> > The simplest thing to do would be to have a boolean property to distinguish
> > the two types, so they would both have relationship type "KNOWS", and also
> > a boolean property "well".  You could use this in a cypher query like this:
> >
> > start Alistair = node(1) match Alistair -[r:KNOWS]-> friend where r.well =
> > true return friend.name
> >
> > Alternatively, as Rick suggests, if you wanted a sliding scale of knowing,
> > you could have a numerical property, and then do more sophisticated
> > traversals.  This is analogous to a weighted graph that you might use for
> > route planning, where each of the relationships is weighted with a property
> > "distance" or "time".  In cypher:
> >
> > start Alistair = node(1) match Alistair -[r:KNOWS]-> friend where
> > r.how_well > 50 return friend.name
> >
> > This property-based approach is less sophisticated than Niels' true
> > relationship-type-hierarchy approach, but I guess it depends on your domain
> > what will be most appropriate.  I think using properties is probably
> > simpler to implement if it meets your needs.
> >
> > -Alistair
> >
> > On 6 December 2011 14:14, Rick Otten  wrote:
> >
> > > Can you do this with properties on the relationship?
> > >
> > > In your example a "KNOWS" relationship could have a "how well" property,
> > > with values 1 to 100.
> > >
> > > You could define "KNOWS_BETTER" as  [ 50 < how well < 80 ].
> > > "KNOWS_BEST" as [ 80 <= how well <= 100 ].
> > >
> > > I'm not sure what the difference between a "sub relationship" and a
> > > "relationship qualified with properties" really is.
> > >
> > >
> > > -Original Message-
> > > From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org]
> > > On Behalf Of Sourajit Basak
> > > Sent: Tuesday, December 06, 2011 6:09 AM
> > > To: user@lists.neo4j.org
> > > Subject: [Neo4j] Modeling subrelationships in Neo4j
> > >
> > > Is it possible to create subrelationships in neo4j ? For e.g. a
> > > relationship called KNOWS_BETTER as a subrelationship of KNOWS.
> > >
> > > Do I need to explicitly connect the nodes using both relationships for
> > the
> > > traversal to work ? Lets say, I create this
> > >
> > > neo4j --> KNOWS_BETTER --> graphDB, does this entails the following ?
> > > neo4j --> KNOWS --> graphDB.
> > >
> > > Such a scenario can be modeled in OWL Ontology, wondering if neo4j has
> > any
> > > capabilities.
> > >
> > > Note: Under the hood, most OWL Ontology i

[Neo4j] Cypher <3 Trees

2011-12-07 Thread Andres Taylor
A subset of the graphs are trees, and they have a few problems that are
specific for them. I'm right now planning what needs to be added to Cypher
to make it play nice with your tree structures.

I'd love to know if you have hierarchical data, and what queries you do and
would like to do. Doesn't matter if you use Cypher or not.

Thanks!

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


[Neo4j] Feedback requested: Major "wish list" item for Neo4J

2011-12-07 Thread Rick Bullotta
One area where I would love to see the Neo4J team focus some energy is in the 
efficient storage and retrieval of blob/large text properties.  Similar to the 
indexing strategy in Neo4J, it would be nice if this was pluggable (and it 
could depend on some other data store more optimized for blob/clob properties).

The keys for this to be successful are:

- Transacted
- Does not store these properties "in memory" except when accessed (and then, 
perhaps offer a getPropertyAsStream method and a setPropertyFromStream method 
for optimal performance)
- Transparent - should just "work"

Nice to haves, but not at all required in the first iteration:

- Pluggable (store in Neo4J native, filesystem, EC2 simple storage, etc.)

Addition of these capabilities would move Neo4J into a dramatically expanded 
realm of potential applications, some of which are quite mind blowing, both in 
the social realm and in the enterprise realm.

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


Re: [Neo4j] Neo4j for a CMS backend

2011-12-07 Thread Rick Bullotta
FWIW, we use Neo4J also as our "dependency graph" in ThingWorx.  We can 
determine deep, two-way dependencies quite easily, so that when any object in 
ThingWorx is modified, we can intelligently do "hot" updates to affected 
entities without having to stop and restart the entire server.  It would have 
been all but impossible to map in a traditional data store.


From: user-boun...@lists.neo4j.org [user-boun...@lists.neo4j.org] On Behalf Of 
Peter Neubauer [peter.neuba...@neotechnology.com]
Sent: Wednesday, December 07, 2011 4:15 AM
To: ne...@googlegroups.com
Cc: user@lists.neo4j.org
Subject: Re: [Neo4j] Neo4j for a CMS backend

Haha,
sorry, my bad. I meant CMDB actually :) Thanks for pointing that out Axel!

Cheers,

/peter neubauer

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

brew install neo4j && neo4j start
heroku addons:add neo4j



On Wed, Dec 7, 2011 at 9:30 AM, Axel Morgner  wrote:
> Hi Peter,
>
> seems like you confused CMDB (Configuration Management Database) with
> CMS (Content Management System)? While Neo4j is perfect for building
> both, the use cases don't have very much in common ...
>
> Greetings
>
> Axel
>
>
> Am 07.12.2011 09:26, schrieb Peter Neubauer:
>> Hi folks,
>> thought this might be interesting for some of you ...
>> http://www.dzone.com/links/r/why_im_pretty_excited_about_using_neo4j_for_a_cmd.html
>>
>> Cheers,
>>
>> /peter neubauer
>>
>> GTalk:  neubauer.peter
>> Skype   peter.neubauer
>> Phone   +46 704 106975
>> LinkedIn   http://www.linkedin.com/in/neubauer
>> Twitter  http://twitter.com/peterneubauer
>>
>> brew install neo4j&&  neo4j start
>> heroku addons:add neo4j
>> ___
>> 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
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Modeling subrelationships in Neo4j

2011-12-07 Thread Sourajit Basak
To Niels' approach,
Wouldn't it be a very dense graph ? For e.g. there will be several people
inter-connected by KNOWS; if we model KNOWS as a node, there would be lots
of edges originating from it.


On Wed, Dec 7, 2011 at 5:16 PM, Alistair Jones <
alistair.jo...@neotechnology.com> wrote:

> Qualifying the relationships with an additional property (or properties)
> sounds like a sensible approach.
>
> The simplest thing to do would be to have a boolean property to distinguish
> the two types, so they would both have relationship type "KNOWS", and also
> a boolean property "well".  You could use this in a cypher query like this:
>
> start Alistair = node(1) match Alistair -[r:KNOWS]-> friend where r.well =
> true return friend.name
>
> Alternatively, as Rick suggests, if you wanted a sliding scale of knowing,
> you could have a numerical property, and then do more sophisticated
> traversals.  This is analogous to a weighted graph that you might use for
> route planning, where each of the relationships is weighted with a property
> "distance" or "time".  In cypher:
>
> start Alistair = node(1) match Alistair -[r:KNOWS]-> friend where
> r.how_well > 50 return friend.name
>
> This property-based approach is less sophisticated than Niels' true
> relationship-type-hierarchy approach, but I guess it depends on your domain
> what will be most appropriate.  I think using properties is probably
> simpler to implement if it meets your needs.
>
> -Alistair
>
> On 6 December 2011 14:14, Rick Otten  wrote:
>
> > Can you do this with properties on the relationship?
> >
> > In your example a "KNOWS" relationship could have a "how well" property,
> > with values 1 to 100.
> >
> > You could define "KNOWS_BETTER" as  [ 50 < how well < 80 ].
> > "KNOWS_BEST" as [ 80 <= how well <= 100 ].
> >
> > I'm not sure what the difference between a "sub relationship" and a
> > "relationship qualified with properties" really is.
> >
> >
> > -Original Message-
> > From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org]
> > On Behalf Of Sourajit Basak
> > Sent: Tuesday, December 06, 2011 6:09 AM
> > To: user@lists.neo4j.org
> > Subject: [Neo4j] Modeling subrelationships in Neo4j
> >
> > Is it possible to create subrelationships in neo4j ? For e.g. a
> > relationship called KNOWS_BETTER as a subrelationship of KNOWS.
> >
> > Do I need to explicitly connect the nodes using both relationships for
> the
> > traversal to work ? Lets say, I create this
> >
> > neo4j --> KNOWS_BETTER --> graphDB, does this entails the following ?
> > neo4j --> KNOWS --> graphDB.
> >
> > Such a scenario can be modeled in OWL Ontology, wondering if neo4j has
> any
> > capabilities.
> >
> > Note: Under the hood, most OWL Ontology implementations do create these
> > *extra* inferred links internally.
> > ___
> > 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
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Modeling subrelationships in Neo4j

2011-12-07 Thread Alistair Jones
Qualifying the relationships with an additional property (or properties)
sounds like a sensible approach.

The simplest thing to do would be to have a boolean property to distinguish
the two types, so they would both have relationship type "KNOWS", and also
a boolean property "well".  You could use this in a cypher query like this:

start Alistair = node(1) match Alistair -[r:KNOWS]-> friend where r.well =
true return friend.name

Alternatively, as Rick suggests, if you wanted a sliding scale of knowing,
you could have a numerical property, and then do more sophisticated
traversals.  This is analogous to a weighted graph that you might use for
route planning, where each of the relationships is weighted with a property
"distance" or "time".  In cypher:

start Alistair = node(1) match Alistair -[r:KNOWS]-> friend where
r.how_well > 50 return friend.name

This property-based approach is less sophisticated than Niels' true
relationship-type-hierarchy approach, but I guess it depends on your domain
what will be most appropriate.  I think using properties is probably
simpler to implement if it meets your needs.

-Alistair

On 6 December 2011 14:14, Rick Otten  wrote:

> Can you do this with properties on the relationship?
>
> In your example a "KNOWS" relationship could have a "how well" property,
> with values 1 to 100.
>
> You could define "KNOWS_BETTER" as  [ 50 < how well < 80 ].
> "KNOWS_BEST" as [ 80 <= how well <= 100 ].
>
> I'm not sure what the difference between a "sub relationship" and a
> "relationship qualified with properties" really is.
>
>
> -Original Message-
> From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org]
> On Behalf Of Sourajit Basak
> Sent: Tuesday, December 06, 2011 6:09 AM
> To: user@lists.neo4j.org
> Subject: [Neo4j] Modeling subrelationships in Neo4j
>
> Is it possible to create subrelationships in neo4j ? For e.g. a
> relationship called KNOWS_BETTER as a subrelationship of KNOWS.
>
> Do I need to explicitly connect the nodes using both relationships for the
> traversal to work ? Lets say, I create this
>
> neo4j --> KNOWS_BETTER --> graphDB, does this entails the following ?
> neo4j --> KNOWS --> graphDB.
>
> Such a scenario can be modeled in OWL Ontology, wondering if neo4j has any
> capabilities.
>
> Note: Under the hood, most OWL Ontology implementations do create these
> *extra* inferred links internally.
> ___
> 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: [Neo4j] path finding using OSM ways

2011-12-07 Thread Craig Taverner
We do indeed have twice the node count (and twice the relationship
count). This is a necessary side effect of the fact that an OSM node
can participate in more than one way (at intersections as well as
shared edges of polygons, etc.). In addition, with shared edges the
direction can be reversed from one way to the other, so we need a
completely separate set of nodes and relationships to model one way
versus the other. We have considered a compacted version of the graph
where we only use the extra nodes and relationships when they are
needed, but the code to decide when they are needed or to convert the
subgraph to the expanded version when needed (ie. when a new joined
way is loaded) would be much more complex, and therefor susceptible to
bugs. We choose a cleaner, simpler code base over a more complex, but
more compact graph.

Now we also want to model historical changes. It appears that the use
of multiple nodes/relationships will also allow us to model this, so
it is a good thing (tm) :-)

For routing, I would create a set of relationships connecting directly
all nodes that are intersection points, and ignoring all the nodes
along the way. We can add edge weights to these new relationships for
the distance traveled, or other appropriate weighting factors (type of
road, possible speed, hinderences, etc.). This graph would be ideal
for routing calculations. The main OSM graph is not ideal for routing,
but is designed to be a true and accurate reflection of the original
OSM data and topology stored in the open street map database. With
Neo4j we can do both :-)

These routing relationships have not been added to the current OSM
model in neo4j-spatial, but would be relatively trivial to add (if we
ignore advanced concepts like turning restrictions). They could be
added by the OSMImporter code that identifies intersections, with only
a few lines of extra code (I think ;-)

On 12/6/11, danielb  wrote:
>
> craig.taverner wrote
>>
>> ...
>> - Create a way-point node for these
>> ...
>>
>
> Hi together,
>
> I wonder why to add extra nodes to the graph (if I understand Craig
> correctly)? Wouldn't you then end up in expanding twice the node count
> (way-point nodes and OSM nodes themself, because you have to query the OSM
> id (or any other identification value of the end node) in every expand and
> lat / lon if you don't have precompiled edge weights)? I would just connect
> the OSM nodes directly with new edges to form a routing subgraph.
>
> Best Regards,
> Daniel
>
>
> --
> View this message in context:
> http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-path-finding-using-OSM-ways-tp3004328p3564688.html
> Sent from the Neo4j Community Discussions mailing list archive at
> Nabble.com.
> ___
> 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: [Neo4j] Are graphs ok for lots of Event data

2011-12-07 Thread Craig Taverner
Of course the graph can be used for processing event data, and whether
that works for your case or not depends. But we have used it for this,
and I can discuss a few points.

The event stream is obviously just a linear chain and can be modeled
as such in the graph (eg. with NEXT relationships between event
nodes). However this does not bring much advantage over the original
flat file which already has implicit next (next line, assuming time
ordered). You could instead use a TimeLineIndex to manage the order,
and then you would have an advantage over disordered original data.
Durations between events can be new nodes with START and END
relationships to the individual events, and the time difference
optionally added as a property to the duration node.

One nice thing about the graph is that you can keep adding data and
structure as you go, sometimes much later. So your question about
adding server and number of items processed, etc, can be added later,
at your convenience.

When grouping events together and getting statistics, some things can
be added incrementally, like max/min/count/total. But percentile is
not so trivial. Consider the case where you want to know the
statistics for each hour of events. If you have an hour node connected
to all event nodes in that hour, you can update the
max/min/count/total values as new event data enters the database. But
percentile needs to be calculated once all events in the hour have
arrived. This can be handled at the application level.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Neo4j for a CMS backend

2011-12-07 Thread Peter Neubauer
Haha,
sorry, my bad. I meant CMDB actually :) Thanks for pointing that out Axel!

Cheers,

/peter neubauer

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

brew install neo4j && neo4j start
heroku addons:add neo4j



On Wed, Dec 7, 2011 at 9:30 AM, Axel Morgner  wrote:
> Hi Peter,
>
> seems like you confused CMDB (Configuration Management Database) with
> CMS (Content Management System)? While Neo4j is perfect for building
> both, the use cases don't have very much in common ...
>
> Greetings
>
> Axel
>
>
> Am 07.12.2011 09:26, schrieb Peter Neubauer:
>> Hi folks,
>> thought this might be interesting for some of you ...
>> http://www.dzone.com/links/r/why_im_pretty_excited_about_using_neo4j_for_a_cmd.html
>>
>> Cheers,
>>
>> /peter neubauer
>>
>> GTalk:      neubauer.peter
>> Skype       peter.neubauer
>> Phone       +46 704 106975
>> LinkedIn   http://www.linkedin.com/in/neubauer
>> Twitter      http://twitter.com/peterneubauer
>>
>> brew install neo4j&&  neo4j start
>> heroku addons:add neo4j
>> ___
>> 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


[Neo4j] Are graphs ok for lots of Event data

2011-12-07 Thread smith9
Is Neo4J a good fit for performing analysis on event data? For example if you
were recording how long events took and wanted to get percentile data for a
particular customer and product.

Would this me mapped something like:

Node: Duration
Properties: duration (eg number of seconds/milli), eventDate, descr (eg End
to End Time)

Nodes: Customer, Product

Where would metadata go - on the Duration node?
success/fail,
online/batch,
event uuid

Plus some other key value pairs of data that might not be known before the
database is setup
eg Server, Number of items processed, group, type

Queries might be
What was the 95 percentile of end to end times for online successful events
grouped by customer?
What were the max event time for each customer?

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Are-graphs-ok-for-lots-of-Event-data-tp3566813p3566813.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Neo4j for a CMS backend

2011-12-07 Thread Axel Morgner
Hi Peter,

seems like you confused CMDB (Configuration Management Database) with 
CMS (Content Management System)? While Neo4j is perfect for building 
both, the use cases don't have very much in common ...

Greetings

Axel


Am 07.12.2011 09:26, schrieb Peter Neubauer:
> Hi folks,
> thought this might be interesting for some of you ...
> http://www.dzone.com/links/r/why_im_pretty_excited_about_using_neo4j_for_a_cmd.html
>
> Cheers,
>
> /peter neubauer
>
> GTalk:  neubauer.peter
> Skype   peter.neubauer
> Phone   +46 704 106975
> LinkedIn   http://www.linkedin.com/in/neubauer
> Twitter  http://twitter.com/peterneubauer
>
> brew install neo4j&&  neo4j start
> heroku addons:add neo4j
> ___
> 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] Neo4j for a CMS backend

2011-12-07 Thread Peter Neubauer
Hi folks,
thought this might be interesting for some of you ...
http://www.dzone.com/links/r/why_im_pretty_excited_about_using_neo4j_for_a_cmd.html

Cheers,

/peter neubauer

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

brew install neo4j && neo4j start
heroku addons:add neo4j
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] println and Table Projections

2011-12-07 Thread Marko Rodriguez
Hi,

Peter brings up a good point. Its hard for us to parse complex queries and see 
where Exceptions are happening. If you can isolate the problem via a simpler 
traversal, that would be best for us -- and our little baby brains.

Also, note the following syntax optimizations for your traversal:
1. outE[[label:'HOSTS']].inV ---> out('HOSTS')
2. Similarly, inE[[label:'X']].outV -> in('X')

Using out() and in() is much more efficient (faster) and more concise. Unless 
you plan to reason on the properties of an edge, then there is no reason to use 
outE.inV style syntax as out will do the full vertex-to-vertex jump for you.

HTH,
Marko.

http://markorodriguez.com

On Dec 7, 2011, at 1:00 AM, Peter Neubauer wrote:

> Mmh,
> I was thinking on how to return the contents of the output stream, I
> am not quite sure how to return that. What woudl be a good format for
> you?
> 
> Also could you reduce this into a small testcase that I can work on?
> 
> Cheers,
> 
> /peter neubauer
> 
> GTalk:  neubauer.peter
> Skype   peter.neubauer
> Phone   +46 704 106975
> LinkedIn   http://www.linkedin.com/in/neubauer
> Twitter  http://twitter.com/peterneubauer
> 
> brew install neo4j && neo4j start
> heroku addons:add neo4j
> 
> 
> 
> On Wed, Dec 7, 2011 at 8:10 AM, Romiko Derbynew
>  wrote:
>> Hi,
>> 
>> I have this statement.
>> g.v('0').outE[[label:'HOSTS']].inV.filter{ 
>> it['Key'].equalsIgnoreCase('romikoagency') 
>> }.inE[[label:'USER_BELONGS_TO']].outV.filter{ 
>> it['Username'].equalsIgnoreCase('romiko.derbynew') 
>> }.ifThenElse{it.outE[[label:'USER_LINKED_TO_CENTRE']].inV.hasNext()}{it.outE[[label:'USER_LINKED_TO_CENTRE']].inV.Name}{println
>>  ${it} "Unknown"}.as('Centre')
>> 
>> I then take this query and do a table projection, however I get the 
>> following error.
>> println java.lang.String cannot be cast to 
>> com.tinkerpop.blueprints.pgm.Vertex
>> 
>> Is there a better way to do this then? I want to reduce our calls to the DB 
>> for performance and finding it a bit tough wrapping everything into one  
>> query. Currently the above query is split into two different queries.
>> 
>> Much appreciated.
>> ___
>> 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: [Neo4j] println and Table Projections

2011-12-07 Thread Peter Neubauer
Mmh,
I was thinking on how to return the contents of the output stream, I
am not quite sure how to return that. What woudl be a good format for
you?

Also could you reduce this into a small testcase that I can work on?

Cheers,

/peter neubauer

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

brew install neo4j && neo4j start
heroku addons:add neo4j



On Wed, Dec 7, 2011 at 8:10 AM, Romiko Derbynew
 wrote:
> Hi,
>
> I have this statement.
> g.v('0').outE[[label:'HOSTS']].inV.filter{ 
> it['Key'].equalsIgnoreCase('romikoagency') 
> }.inE[[label:'USER_BELONGS_TO']].outV.filter{ 
> it['Username'].equalsIgnoreCase('romiko.derbynew') 
> }.ifThenElse{it.outE[[label:'USER_LINKED_TO_CENTRE']].inV.hasNext()}{it.outE[[label:'USER_LINKED_TO_CENTRE']].inV.Name}{println
>  ${it} "Unknown"}.as('Centre')
>
> I then take this query and do a table projection, however I get the following 
> error.
> println java.lang.String cannot be cast to com.tinkerpop.blueprints.pgm.Vertex
>
> Is there a better way to do this then? I want to reduce our calls to the DB 
> for performance and finding it a bit tough wrapping everything into one  
> query. Currently the above query is split into two different queries.
>
> Much appreciated.
> ___
> 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