Re: [Neo4j] Unique constraint and transaction over REST

2011-12-03 Thread dnagir
Thanks Matt.

Yeah. I think the transaction API is in making. Would be great addition.

The server-side plugin will definitely work, but I personally prefer to use one 
way of doing things. At least until I will start speaking neo4j natively :)

Cheers,
Dmytrii
http://www.ApproachE.com


On 04/12/2011, at 6:35 PM, mhluongo [via Neo4j Community Discussions] wrote:

> I've run into this problem, and resorted to using the Gremlin/Groovy over 
> REST (via the server-included plugin). 
> 
> There really isn't a way to transactionally express a conditional (or 
> get-or-create) like that over the vanilla REST API, though I'm sure it's in 
> the works. 
> 
> -- 
> Matt Luongo 
> Co-Founder, Scholr.ly 
> 
> 
> 
> On Thu, Dec 1, 2011 at 5:45 PM, dnagir <[hidden email]> wrote: 
> 
> > Hi, 
> > 
> > I wonder what's the best way to do something similar to unique constraints 
> > in RDBMS. 
> > 
> > For example, user registration requires that the user's email to be unique. 
> > 
> > Working over in Ruby over REST API, how do you achieve this? 
> > 
> > I assume I need an auto-index on email property of User nodes. Then query 
> > it 
> > to check the property. 
> > 
> > But how can I make it transactional? So that I am sure that between 
> > querying 
> > and inserting the node, no similar has been inserted. 
> > 
> > The transactional part better applies to reservation instead of user 
> > creation. But you get the point. 
> > 
> > Cheers. 
> > 
> > -- 
> > View this message in context: 
> > http://neo4j-community-discussions.438527.n3.nabble.com/Unique-constraint-and-transaction-over-REST-tp3553148p3553148.html
> > Sent from the Neo4j Community Discussions mailing list archive at 
> > Nabble.com. 
> > ___ 
> > Neo4j mailing list 
> > [hidden email] 
> > https://lists.neo4j.org/mailman/listinfo/user
> >
> ___ 
> Neo4j mailing list 
> [hidden email] 
> https://lists.neo4j.org/mailman/listinfo/user
> 
> 
> If you reply to this email, your message will be added to the discussion 
> below:
> http://neo4j-community-discussions.438527.n3.nabble.com/Unique-constraint-and-transaction-over-REST-tp3553148p3558628.html
> To unsubscribe from Unique constraint and transaction over REST, click here.
> NAML



--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Unique-constraint-and-transaction-over-REST-tp3553148p3558630.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] Named matched with depth gives error

2011-12-01 Thread dnagir
Thank Michael,

I didn't realise there's snapshot version available from the download page.

I prefer downloading the whole package instead of one particular thing, as Jim 
suggested.

But glad to know there's such an option.

Cheers.

On 02/12/2011, at 5:20 PM, Michael Hunger [via Neo4j Community Discussions] 
wrote:

> download the 1.6 SNAPSHOT from neo4j.org/downloads 
> 
> mobile mail please excuse brevity and typos 
> 
> Am 02.12.2011 um 01:27 schrieb dnagir <[hidden email]>: 
> 
> >> I fixed this 
> >> yesterday<https://github.com/neo4j/community/commit/37c2867871c7d953c2021177d0b72cd8ba825be0>.
> >>  
> > 
> > Thanks a lot for that. 
> > How can I get the build that includes the fix? (Sorry for the question, but 
> > just starting with noe4j). 
> > 
> >> Sorry you ran into it... 
> > NP. 
> > 
> > Cheers. 
> > 
> > -- 
> > View this message in context: 
> > http://neo4j-community-discussions.438527.n3.nabble.com/Named-matched-with-depth-gives-error-tp3548195p3553337.html
> > Sent from the Neo4j Community Discussions mailing list archive at 
> > Nabble.com. 
> > ___ 
> > Neo4j mailing list 
> > [hidden email] 
> > https://lists.neo4j.org/mailman/listinfo/user
> ___ 
> Neo4j mailing list 
> [hidden email] 
> https://lists.neo4j.org/mailman/listinfo/user
> 
> 
> If you reply to this email, your message will be added to the discussion 
> below:
> http://neo4j-community-discussions.438527.n3.nabble.com/Named-matched-with-depth-gives-error-tp3548195p3553894.html
> To unsubscribe from Named matched with depth gives error, click here.
> NAML



--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Named-matched-with-depth-gives-error-tp3548195p3553941.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] Named matched with depth gives error

2011-12-01 Thread dnagir
> I fixed this 
> yesterday.
>  

Thanks a lot for that.
How can I get the build that includes the fix? (Sorry for the question, but 
just starting with noe4j).

> Sorry you ran into it... 
NP.

Cheers.

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Named-matched-with-depth-gives-error-tp3548195p3553337.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] Unique constraint and transaction over REST

2011-12-01 Thread dnagir
Hi,

I wonder what's the best way to do something similar to unique constraints
in RDBMS.

For example, user registration requires that the user's email to be unique.

Working over in Ruby over REST API, how do you achieve this?

I assume I need an auto-index on email property of User nodes. Then query it
to check the property.

But how can I make it transactional? So that I am sure that between querying
and inserting the node, no similar has been inserted.

The transactional part better applies to reservation instead of user
creation. But you get the point.

Cheers.

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Unique-constraint-and-transaction-over-REST-tp3553148p3553148.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] Which Ruby REST client for neo4j?

2011-11-30 Thread dnagir
Basically subject says it all.
More detailed question is at SO:
http://stackoverflow.com/questions/8335136/which-ruby-client-for-neo4j-rest-api

So basically there are 3 main options:

neograhy - just plain REST API. Nothing to do with models etc.
neology - is just a wrapper over neography and isn't a full featured
ActiveModel.
architect4r - conforms to ActiveModel, but provides only one way to query
data (Gypher language), also no indexes support.


Which of them and why would you (not) use?

Cheers.

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Which-Ruby-REST-client-for-neo4j-tp3550245p3550245.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] Named matched with depth gives error

2011-11-30 Thread dnagir
Hi,

I am trying this query:

*START u=node(5963) MATCH p = (u)<-[r:selling*1..99]-() WHERE
r.development=7867 RETURN p*

But it gives the error: Error: *NoSuchElementException - key not found: r*

When I remove the depth specification (*1..99) from the MATCH, it works as
expected.

What's a deal with it?

Thanks,
Dmytrii.

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Named-matched-with-depth-gives-error-tp3548195p3548195.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] How to return the start nodes of all the paths with Cypher

2011-11-30 Thread dnagir


On 30/11/2011, at 9:46 PM, Andres Taylor [via Neo4j Community Discussions] 
wrote:

> Well, this query would also return 'b' in the example you shared above.

You're right. Too late here already. Can't think clearly.

> I think we need something that says "follow this path until you can't follow 
> it any more". If you're working with a B-tree, you should be able to say 
> "given this sub-root, give me all leafs".

I don't need all leaves. It's a bit the other way around. I need the root of 
the tree.


> Something like: 
> 
> START c = node(17) 
> MATCH x<-[*END]-c 
> RETURN x 
> I really don't like this syntax, but I think the information belongs in 
> there somewhere... 

I actually don't mind this syntax. It's looks like the right place and clearly 
shows the intent.



--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/How-to-return-the-start-nodes-of-all-the-paths-with-Cypher-tp3547480p3547928.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] RETURN DISTINCT with ORDER BY

2011-11-30 Thread dnagir
Thanks. This does work indeed.

Much like in SQL :)



On 30/11/2011, at 6:37 PM, readic [via Neo4j Community Discussions] wrote:

> try this: 
> start d=node(17) match d-[*0..99]->x return distinct x,x.name order by x.name 
> 
> If you reply to this email, your message will be added to the discussion 
> below:
> http://neo4j-community-discussions.438527.n3.nabble.com/RETURN-DISTINCT-with-ORDER-BY-tp3547366p3547551.html
> To unsubscribe from RETURN DISTINCT with ORDER BY, click here.
> NAML



--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/RETURN-DISTINCT-with-ORDER-BY-tp3547366p3547899.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] How to return the start nodes of all the paths with Cypher

2011-11-30 Thread dnagir
I would probably like to write something among these lines (it's not valid
query of course):


START s=node(10)
MATCH p = s<-[:whatever]-t
RETURN t, LENGTH(p) as len
HAVING len >= MAX( LENGTH(p) )

Seems like clause similar to SQL HAVING is missing.

It doesn't "exactly" reflect what I want but just thought from top of my
head.

So currently I have to use other query language if I want to do this. Right?

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/How-to-return-the-start-nodes-of-all-the-paths-with-Cypher-tp3547480p3547877.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] How to return the start nodes of all the paths with Cypher

2011-11-29 Thread dnagir
Hi,

How can I find all the nodes that "start a path"

So that I start at node "c" and paths
"a->b->c", 
"d->c", 
"d->b->c", 
"e->f->c"
I want to retrieve nodes "a", "d" and "e".



--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/How-to-return-the-start-nodes-of-all-the-paths-with-Cypher-tp3547480p3547480.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] RETURN DISTINCT with ORDER BY

2011-11-29 Thread dnagir
Hi,

I wonder how can I use both distinct and order by in the queries.

These 2 work as expected:

start d=node(17) match d-[*0..99]->x return x order by x.name

start d=node(17) match d-[*0..99]->x return distinct x


But the query with both DISTINCT and ORDER BY doesn't return anything:

start d=node(17) match d-[*0..99]->x return distinct x order by x.name

What am I missing here?

Using v 1.5.M02

Thanks.

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/RETURN-DISTINCT-with-ORDER-BY-tp3547366p3547366.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