Re: [Neo4j] Neo4j-Scala Wrapper 0.1.0 released

2011-11-17 Thread Michael Hunger
There is also Adriano's Scala Cypher DSL:
https://github.com/adrianoalmeida7/cypher-typesafe-scala

Michael

Am 17.11.2011 um 22:00 schrieb Andres Taylor:

> On Thu, Nov 17, 2011 at 9:55 PM, Peter Neubauer <
> peter.neuba...@neotechnology.com> wrote:
> 
>> Actually,
>> it might be an idea to look at this kind of DSL for Cypher, much along
>> the (Scala) lines of Rickards Java-DSL,
>> 
>> http://rickardoberg.wordpress.com/2011/11/14/creating-a-dsl-for-cypher-graph-queries/
>> instead of trying to mimic literal Cypher Strings.
>> 
> 
> Personally, I like Scala DSLs.
> 
> IMVHO - Java DSLs look like they do because Java doesn't allow anything
> else, not because they are the best way to express a DSL. To forgo the very
> expressive possibilities that Scala opens up makes little sense to me. And,
> if you like the Cypher-DSL, you can already use it from Scala.
> 
> But that's just me...
> 
> 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] Neo4j HA and Spring Data Graph 1.1

2011-11-17 Thread Michael Hunger
Hi Karthik,

You have to do the normal Neo4j HA setup 
(http://docs.neo4j.org/chunked/snapshot/ha.html).

* add the additional dependencies to your project org.neo4j:neo4j-ha:1.5
* running 3 coordinators (either download neo4j-enterprise and use 
start-coordinator or start the zookeeper instances programmatically)
* configure Spring Data Neo4j to use the HighlyAvailableGraphDatabase and 
provide the necessary config















If you have any further questions, please ask

Cheers

Michael

Am 17.11.2011 um 21:45 schrieb kv8:

> We have an Spring Data Graph implementation that is currently working great
> with the embedded neo4j database. We want to try out the HA setup and my
> understanding is you can run HA in embedded mode. 
> 
> Assuming you have the HA configuration setup, would configuring the
> graphDatabaseService bean to use the HighlyAvailableGraphDatabase is all you
> need to do ?  I will keep you guys posted with my progress. 
> 
> Thanks much,
> Karthik
> 
> 
> 
> --
> View this message in context: 
> http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-HA-and-Spring-Data-Graph-1-1-tp3517015p3517015.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] How do I use parameters in Cypher queries using regular expressions?

2011-11-17 Thread Andres Taylor
I've tried to reproduce this directly in Cypher, and through SDN, but I
haven't been able to. I will spend some more time on this tomorrow. If it's
possible for you to create a minimal test that reproduces the problem, it
would very helpful.

Andrés

On Thu, Nov 17, 2011 at 8:45 PM, Tero Paananen wrote:

> >> @Query(value = "start n = node(1) match (n)-[:KNOWS]->(c) where c.a =~
> >> /.*?{foo}.*?/ return c", type = QueryType.Cypher)
> >> Page getConnectedNodes(@Param("foo") String foo, Pageable
> pageable);
> >>
> >
> > The regular expression can either be provided through a parameter, or
> > inlined in the query. You are trying to do a mix of both, and that is not
> > supported in Cypher.  You have to create the full regular expression, and
> > then pass that on to your query.
> >
> > You query would have to look like this:
> > start n = node(1)
> > match (n)-[:KNOWS]->(c)
> > where c.a =~ {foo}
> > return c
> >
> > Does that make sense?
>
> It does.
>
> However, still something not quite right about this.
>
> Here's my query:
>
> @Query(value = "start user = node({nodeId}) match (user)-[:KNOWS]->(c)
> where c.firstName =~ {keyword} return c", type = QueryType.Cypher)
> Page searchUsers(@Param("nodeId") Long nodeId, @Param("keyword")
> String keyword, Pageable pageable);
>
> Calls to this query result in an exeption:
>
> org.neo4j.cypher.ParameterNotFoundException: Expected a parameter named
> keyword
> at
> org.neo4j.cypher.commands.ParameterValue$$anonfun$apply$2.apply(Value.scala:136)
> at
> org.neo4j.cypher.commands.ParameterValue$$anonfun$apply$2.apply(Value.scala:136)
> at scala.collection.MapLike$class.getOrElse(MapLike.scala:122)
> at scala.collection.immutable.Map$Map3.getOrElse(Map.scala:143)
> at org.neo4j.cypher.commands.ParameterValue.apply(Value.scala:136)
> at org.neo4j.cypher.commands.ParameterValue.apply(Value.scala:135)
> at org.neo4j.cypher.commands.RegularExpression.isMatch(Clause.scala:101)
> at
> org.neo4j.cypher.pipes.matching.PatternMatcher$$anonfun$isMatchSoFar$1.apply(PatternMatcher.scala:143)
> at
> org.neo4j.cypher.pipes.matching.PatternMatcher$$anonfun$isMatchSoFar$1.apply(PatternMatcher.scala:143)
>
> I've stepped inside the Neo4J code in the debugger, and I know the keyword
> param
> is populated with the right type of value ("/.*?foo.*?/") before the
> query gets executed.
>
> If I change the query to:
>
>
> @Query(value = "start user = node({nodeId}) match (user)-[:KNOWS]->(c)
> where c.firstName = {keyword} return c", type = QueryType.Cypher)
> Page searchUsers(@Param("nodeId") Long nodeId, @Param("keyword")
> String keyword, Pageable pageable);
>
> And execute it with the same keyword param value, the query gets executed
> just
> fine.
>
> Any ideas?
>
> -TPP
> ___
> 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] Record not in use problem and solution

2011-11-17 Thread Mattias Persson
Deleting a node doesn't remove it from its indexes because there's no hard
link between a node and its indexes so it would be a costly operation. It
merely hides it from IndexHits and puts it up for deletion later
(read-repair). Are you getting the exception in another thread and/or is
that node included in some other IndexHits? If that's the case then it
might be a race condition.

2011/11/17 Axel Morgner 

>
> > It cannot be only that. By the looks of it some part of your code uses
> > Node#hasProperty after Node#delete, which is illegal and that's what's
> > causing it.
> Yes, that's right. The exception is expected behaviour. But why the
> node's still in the index?
>
> I think it's just a timing problem in our code. It's happening only
> under race conditions when creating and deleting nodes with multiple
> threads. Maybe it's because after node.delete() the deleting thread
> doesn't immediately remove it from the index while another thread
> accesses the node via index lookup, and of course fails to use the node
> as it has already the notInUse flag persisted. Seems that the node is
> then kind of locked. I don't know ...
>
> It's a bit weird that it's so easy to bring the database into an
> inconsistant state with a node still being in the index, but our fix is
> working for us so far, and I understood what we did wrong.
>
> Sorry that I don't have more time to sort it out. But if you really
> think that it's worth to have a deeper look into it, I could setup a
> small webapp using the libraries we're using here (it's all available at
> Github [1]).
>
> [1]
>
> https://github.com/structr/structr/blob/develop/structr/structr-core/src/main/java/org/structr/rest/constraint/ResourceConstraint.java
>
>
> Greetings
>
> Axel
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



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


Re: [Neo4j] Neo4j-Scala Wrapper 0.1.0 released

2011-11-17 Thread Andres Taylor
On Thu, Nov 17, 2011 at 9:55 PM, Peter Neubauer <
peter.neuba...@neotechnology.com> wrote:

> Actually,
> it might be an idea to look at this kind of DSL for Cypher, much along
> the (Scala) lines of Rickards Java-DSL,
>
> http://rickardoberg.wordpress.com/2011/11/14/creating-a-dsl-for-cypher-graph-queries/
> instead of trying to mimic literal Cypher Strings.
>

Personally, I like Scala DSLs.

IMVHO - Java DSLs look like they do because Java doesn't allow anything
else, not because they are the best way to express a DSL. To forgo the very
expressive possibilities that Scala opens up makes little sense to me. And,
if you like the Cypher-DSL, you can already use it from Scala.

But that's just me...

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


Re: [Neo4j] Neo4j-Scala Wrapper 0.1.0 released

2011-11-17 Thread Peter Neubauer
Actually,
it might be an idea to look at this kind of DSL for Cypher, much along
the (Scala) lines of Rickards Java-DSL,
http://rickardoberg.wordpress.com/2011/11/14/creating-a-dsl-for-cypher-graph-queries/
instead of trying to mimic literal Cypher Strings.

WDYT?

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

http://www.neo4j.org              - NOSQL for the Enterprise.
http://startupbootcamp.org/    - Öresund - Innovation happens HERE.



On Thu, Nov 17, 2011 at 4:04 PM, Marko Rodriguez  wrote:
> Hey,
>
> It might be a little too soon to bring it up, but early December, we are 
> releasing Gremlin Scala in Gremlin 1.4 which will allow you to import Gremlin 
> into your Scala project (e.g. Neo4j-Scala Wrapper) and evaluate Gremlin 
> queries natively.
>
>        https://github.com/tinkerpop/gremlin/tree/master/gremlin-scala
>
> For example, in Gremlin Scala:
>
>        g.v(1).out("knows").out("created").filter{v:Vertex => 
> v("name").equals("marko")}
>
> This way Scala developers can use Gremlin-style traversing natively in their 
> Scala code.
>
> See ya,
> Marko.
>
> http://markorodriguez.com
>
> On Nov 17, 2011, at 5:21 AM, Christopher Schmidt wrote:
>
>> Peter, I think its not possible because "[" and "]" are reserved for Scalas
>> type declarations.
>> The String (fe. "KNOWS") is implicitly converted
>> into DynamicRelationshipType.withName("KNOWS").
>>
>> What would be possible to get something like this (which is actually just a
>> change of method names):
>>
>> start - "KNOWS" -> end
>>
>> Regarding the Cypher language:
>> Its an interpreted language, so it is possible to define a completely free
>> syntax. In case of Scala, all we are doing has to be fit into the language
>> syntax, although it looks like a freely designed DSL. Cypher has some
>> similarities to SQL as a special query language. And to be honest, I think
>> using it programmatically will cause the same symtoms as SQL with respect
>> to runtime errors, type safety, abstraction etc.
>>
>> Nevertheless, it would be interesting to create a nearly Cypher compilable
>> DSL, which includes type safety and transparent DAO or Case Class mapping.
>> Something like:
>>
>> case class User(name:String)
>> val nodes = createNode(User("name1")) :: createNode(User("name2"))
>> :: createNode(User("name3")) :: Nil
>> . . .
>> for (f <- START nodes MATCH user-"friend"->follower WHERE follower.name =~
>> /S.*/ RETURN follower)
>>   println("User Follower: " + f.name)
>>
>>
>> This would be basically the same idea JPA tries with its criteria api. But
>> that will be hard work :-)
>>
>> Christopher
>>
>> On Wednesday, November 16, 2011, Peter Neubauer wrote:
>>
>>> Chstopher,
>>> this looks really cool! I notice the similarity to the cypher syntax
>>> in the ASCII art part of the notation. Do you think there is a chance
>>> to make it even more similar to that so you could actually write
>>>
>>> start -[:KNOWS]-> intermediary - [KNOWS] -> end
>>>
>>> instead of
>>>
>>> start --> "KNOWS" --> intermediary --> "KNOWS" --> end ? Would be
>>> quite cool to be closely in line with
>>> http://docs.neo4j.org/chunked/snapshot/cypher-query-lang.html, maybe
>>> we could even use this for a modifying cypher in the future ...
>>>
>>> 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
>>>
>>> http://www.neo4j.org              - NOSQL for the Enterprise.
>>> http://startupbootcamp.org/    - Öresund - Innovation happens HERE.
>>>
>>>
>>>
>>> On Wed, Nov 16, 2011 at 6:36 AM, Christopher Schmidt
>>>  wrote:
 Hi all,

 I released version 0.1.0 of the Neo4j Scala Wrapper neo4j-scala (base is
 neo4j-scala by jawher).
 Main features are

 - simple Traits for the wrapper itself, GraphDatabaseService provider,
 index provider and batch insertion
 - transaction wrapping:

 withTx {...}

 - natural usage of relations:

 start --> "KNOWS" --> intermediary --> "KNOWS" --> end

 - setting and getting properties:

 node("foo") = "bar"
 node[String]("foo") match {
   case Some(x) => println(x)
   case None => println("aww")
 }

 - easy CaseClass to/from Node/Relation properties marshaling

 withTx {
 implicit neo =>
   // create new Node with Case Class Test
   val node1 = createNode(Test("Something", 1, 2, 3.3, 10, true))

   // or using Option[T] (returning Some[T] if possible)
   val nodeOption: Option[Test] = node.toCC[Test]

   // create new relation with Case Class Test
   node1 --> "foo" --> node2 < Test("other", 0, 1, 1.3, 1, false)
 }

 - transparent batch processing (simply replace 2 traits 

[Neo4j] Neo4j HA and Spring Data Graph 1.1

2011-11-17 Thread kv8
We have an Spring Data Graph implementation that is currently working great
with the embedded neo4j database. We want to try out the HA setup and my
understanding is you can run HA in embedded mode. 

Assuming you have the HA configuration setup, would configuring the
graphDatabaseService bean to use the HighlyAvailableGraphDatabase is all you
need to do ?  I will keep you guys posted with my progress. 

Thanks much,
Karthik



--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-HA-and-Spring-Data-Graph-1-1-tp3517015p3517015.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] Using the WrappingNeoServerBootstrapper with sbt

2011-11-17 Thread Peter Neubauer
Great,
thanks a lot George! Will include it in the setup section in the
manual, 
http://docs.neo4j.org/chunked/snapshot/server-embedded.html#_getting_the_libraries

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

http://www.neo4j.org              - NOSQL for the Enterprise.
http://startupbootcamp.org/    - Öresund - Innovation happens HERE.



On Thu, Nov 17, 2011 at 3:12 PM, g-eorge  wrote:
> Sure, no problem.
>
> Here you go: https://gist.github.com/1373211
>
>
>
> On 17 Nov 2011, at 12:41, Peter Neubauer [via Neo4j Community Discussions] 
> wrote:
>
>> Great,
>> Thanks for sharing it! Would love to see this in some public place to be
>> able to refer to it. Gut it on Github somewhere?
>> On Nov 17, 2011 1:35 PM, "g-eorge" <[hidden email]> wrote:
>>
>> > I added the following to my .sbt file and everything appears to work fine
>> > so
>> > far..
>> >
>> > libraryDependencies ++= Seq(
>> >   "org.neo4j.app" % "neo4j-server" % "1.5",
>> >   "org.neo4j.app" % "neo4j-server" % "1.5" classifier "static-web"
>> >      from
>> > "
>> > http://m2.neo4j.org/releases/org/neo4j/app/neo4j-server/1.5/neo4j-server-1.5-static-web.jar
>> > ",
>> >   "com.sun.jersey" % "jersey-core" % "1.9"
>> > )
>> >
>> >
>> > resolvers ++= Seq(
>> >  "tinkerprop" at "http://tinkerpop.com/maven2";
>> > )
>> >
>> > --
>> > View this message in context:
>> > http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Using-the-WrappingNeoServerBootstrapper-with-sbt-tp3477583p3515594.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/Neo4j-Using-the-WrappingNeoServerBootstrapper-with-sbt-tp3477583p3515604.html
>> To unsubscribe from [Neo4j] Using the WrappingNeoServerBootstrapper with 
>> sbt, click here.
>> NAML
>
>
>
> --
> View this message in context: 
> http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Using-the-WrappingNeoServerBootstrapper-with-sbt-tp3477583p3515883.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] How do I use parameters in Cypher queries using regular expressions?

2011-11-17 Thread Tero Paananen
>> @Query(value = "start n = node(1) match (n)-[:KNOWS]->(c) where c.a =~
>> /.*?{foo}.*?/ return c", type = QueryType.Cypher)
>> Page getConnectedNodes(@Param("foo") String foo, Pageable pageable);
>>
>
> The regular expression can either be provided through a parameter, or
> inlined in the query. You are trying to do a mix of both, and that is not
> supported in Cypher.  You have to create the full regular expression, and
> then pass that on to your query.
>
> You query would have to look like this:
> start n = node(1)
> match (n)-[:KNOWS]->(c)
> where c.a =~ {foo}
> return c
>
> Does that make sense?

It does.

However, still something not quite right about this.

Here's my query:

@Query(value = "start user = node({nodeId}) match (user)-[:KNOWS]->(c)
where c.firstName =~ {keyword} return c", type = QueryType.Cypher)
Page searchUsers(@Param("nodeId") Long nodeId, @Param("keyword")
String keyword, Pageable pageable);

Calls to this query result in an exeption:

org.neo4j.cypher.ParameterNotFoundException: Expected a parameter named keyword
at 
org.neo4j.cypher.commands.ParameterValue$$anonfun$apply$2.apply(Value.scala:136)
at 
org.neo4j.cypher.commands.ParameterValue$$anonfun$apply$2.apply(Value.scala:136)
at scala.collection.MapLike$class.getOrElse(MapLike.scala:122)
at scala.collection.immutable.Map$Map3.getOrElse(Map.scala:143)
at org.neo4j.cypher.commands.ParameterValue.apply(Value.scala:136)
at org.neo4j.cypher.commands.ParameterValue.apply(Value.scala:135)
at org.neo4j.cypher.commands.RegularExpression.isMatch(Clause.scala:101)
at 
org.neo4j.cypher.pipes.matching.PatternMatcher$$anonfun$isMatchSoFar$1.apply(PatternMatcher.scala:143)
at 
org.neo4j.cypher.pipes.matching.PatternMatcher$$anonfun$isMatchSoFar$1.apply(PatternMatcher.scala:143)

I've stepped inside the Neo4J code in the debugger, and I know the keyword param
is populated with the right type of value ("/.*?foo.*?/") before the
query gets executed.

If I change the query to:


@Query(value = "start user = node({nodeId}) match (user)-[:KNOWS]->(c)
where c.firstName = {keyword} return c", type = QueryType.Cypher)
Page searchUsers(@Param("nodeId") Long nodeId, @Param("keyword")
String keyword, Pageable pageable);

And execute it with the same keyword param value, the query gets executed just
fine.

Any ideas?

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


Re: [Neo4j] The cypher project in neo4j-community has errors in eclipse

2011-11-17 Thread Eric Liang
On 11/18/2011 02:34 AM, Peter Neubauer wrote:
>
> How about some time during tomorrow CET working hours?
>
Fine, see you then. Thanks in advance for your time.

Eric

-- 
-BEGIN GEEK CODE BLOCK-
Version: 3.1
GCM/CS/E/MU/P d+(-) s: a- C++ UL$ P+>++ L++ E++ W++ N+ o+>++ K+++ w !O
M-(+) V-- PS+ PE+ Y+ PGP++ t? 5? X? R+>* tv@ b DI-- D G++ e++>+++@ h*
r !y+
--END GEEK CODE BLOCK--

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


Re: [Neo4j] How do I use parameters in Cypher queries using regular expressions?

2011-11-17 Thread Andres Taylor
On Thu, Nov 17, 2011 at 6:14 PM, Tero Paananen wrote:

> @Query(value = "start n = node(1) match (n)-[:KNOWS]->(c) where c.a =~
> /.*?{foo}.*?/ return c", type = QueryType.Cypher)
> Page getConnectedNodes(@Param("foo") String foo, Pageable pageable);
>

The regular expression can either be provided through a parameter, or
inlined in the query. You are trying to do a mix of both, and that is not
supported in Cypher.  You have to create the full regular expression, and
then pass that on to your query.

You query would have to look like this:
start n = node(1)
match (n)-[:KNOWS]->(c)
where c.a =~ {foo}
return c

Does that make sense?

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


Re: [Neo4j] Gremlin plugin and script engine question

2011-11-17 Thread Alfredas Chmieliauskas
Got it. Thanks!

Rick >> -1

A


On Thu, Nov 17, 2011 at 6:36 PM, Marko Rodriguez  wrote:
>> What exactly does iterate() do?
>
> A Gremlin expression yields a Pipeline and
>        Pipeline implements Iterator
>
> Thus, a Gremlin expression doesn't return the results of a traversal, only a 
> lazy iterator for .next()'ing results. For people doing a traversal to yield 
> a sideEffect (e.g. aggregate, groupCount, etc.), iterate() is there to 
> "while(hasNext()) { next() }" for you to "fill up" your side effect data 
> structure.
>
> Finally, the Gremlin REPL automagically iterates and System.out.printlns() 
> any objects in an Iterator it gets so thats why the behavior in the Gremlin 
> REPL looks like a Gremlin expression returns results.
>
> Hope that is clear,
> Marko.
>
> http://markorodriguez.com
>
>> A
>>
>> On Thu, Nov 17, 2011 at 4:07 PM, Marko Rodriguez  
>> wrote:
>>> Hey Alfredas,
>>>
>>> Be sure to iterate your pipeline
>>>
>>>        x = []; g.v(1).out("from").out("to").aggregate(x).loop(3){it.loops < 
>>> 4}.iterate(); x
>>>
>>> * NOTE: You can also do:
>>>        g.v(1).out("from").out("to").aggregate(x).loop(3){it.loops < 4} >>-1
>>>   but the >> convention is no longer with us in Gremlin 1.4-SNAPSHOT.
>>>
>>> HTH,
>>> Marko.
>>>
>>> http://markorodriguez.com
>>>
>>> On Nov 17, 2011, at 7:21 AM, Alfredas Chmieliauskas wrote:
>>>
 Dear all,
 This concerns gremlin plugin and the script engine.
 Maybe there's an explanation for this behavior:
 1) gremlin> x = [];
 g.v(1).out("from").out("to").aggregate(x).loop(3){it.loops < 4};
     gremlin> x;

 ==> v[7]
 ==> v[3]
 ==> v[5]

 2) gremlin> x = [];
 g.v(1).out("from").out("to").aggregate(x).loop(3){it.loops < 4}; x;
 returns nothing...

 Thanks,

 Alfredas
 ___
 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
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] The cypher project in neo4j-community has errors in eclipse

2011-11-17 Thread Peter Neubauer
How about some time during tomorrow CET working hours?
On Nov 17, 2011 2:29 PM, "Eric Liang"  wrote:

> On 11/17/2011 08:44 PM, Peter Neubauer wrote:
> > Eric,
> > Maybe we can connect over Skype and get it working? I am somewhat of a
> > fixing things expert :-)
> OK. I can share the screen but talk much since my colleagues are still
> working. :D
>
> Anyway, is your skype peter.neubauer and what time is convenient for you?
>
> Eric
> > On Nov 17, 2011 11:26 AM, "Eric Liang"  wrote:
> >
> >> On 11/17/2011 02:46 PM, Anders Nawroth wrote:
> >>> Hi!
> >>>
>   From the discussion ( http://neo4j.org/forums/#nabble-td3217906 ),
>  Anders Nawroth said neo4j-cypher works with Eclipse Indigo, so I
>  installed a fresh latest version of Eclipse, but still not work.
> >>> It worked when I wrote the instructions in the readme file. I've seen
> >>> that there's now a problem, but haven't been able to fix it.
> >> Thanks Anders.
> >>
> >> Well, that's not good news. By the way, is that problem the same as
> >> posted in my previous mail?
> >>
> >> Eric
> >>
> >> --
> >> -BEGIN GEEK CODE BLOCK-
> >> Version: 3.1
> >> GCM/CS/E/MU/P d+(-) s: a- C++ UL$ P+>++ L++ E++ W++ N+ o+>++ K+++ w !O
> >> M-(+) V-- PS+ PE+ Y+ PGP++ t? 5? X? R+>* tv@ b DI-- D G++ e++>+++@
> h*
> >> r !y+
> >> --END GEEK CODE BLOCK--
> >>
> >> ___
> >> 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
>
>
> --
> -BEGIN GEEK CODE BLOCK-
> Version: 3.1
> GCM/CS/E/MU/P d+(-) s: a- C++ UL$ P+>++ L++ E++ W++ N+ o+>++ K+++ w !O
> M-(+) V-- PS+ PE+ Y+ PGP++ t? 5? X? R+>* tv@ b DI-- D G++ e++>+++@ h*
> r !y+
> --END GEEK CODE BLOCK--
>
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Record not in use problem and solution

2011-11-17 Thread Axel Morgner

> It cannot be only that. By the looks of it some part of your code uses
> Node#hasProperty after Node#delete, which is illegal and that's what's
> causing it.
Yes, that's right. The exception is expected behaviour. But why the 
node's still in the index?

I think it's just a timing problem in our code. It's happening only 
under race conditions when creating and deleting nodes with multiple 
threads. Maybe it's because after node.delete() the deleting thread 
doesn't immediately remove it from the index while another thread 
accesses the node via index lookup, and of course fails to use the node 
as it has already the notInUse flag persisted. Seems that the node is 
then kind of locked. I don't know ...

It's a bit weird that it's so easy to bring the database into an 
inconsistant state with a node still being in the index, but our fix is 
working for us so far, and I understood what we did wrong.

Sorry that I don't have more time to sort it out. But if you really 
think that it's worth to have a deeper look into it, I could setup a 
small webapp using the libraries we're using here (it's all available at 
Github [1]).

[1] 
https://github.com/structr/structr/blob/develop/structr/structr-core/src/main/java/org/structr/rest/constraint/ResourceConstraint.java


Greetings

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


Re: [Neo4j] Gremlin plugin and script engine question

2011-11-17 Thread Marko Rodriguez
> What exactly does iterate() do?

A Gremlin expression yields a Pipeline and
Pipeline implements Iterator

Thus, a Gremlin expression doesn't return the results of a traversal, only a 
lazy iterator for .next()'ing results. For people doing a traversal to yield a 
sideEffect (e.g. aggregate, groupCount, etc.), iterate() is there to 
"while(hasNext()) { next() }" for you to "fill up" your side effect data 
structure.

Finally, the Gremlin REPL automagically iterates and System.out.printlns() any 
objects in an Iterator it gets so thats why the behavior in the Gremlin REPL 
looks like a Gremlin expression returns results.

Hope that is clear,
Marko.

http://markorodriguez.com

> A
> 
> On Thu, Nov 17, 2011 at 4:07 PM, Marko Rodriguez  wrote:
>> Hey Alfredas,
>> 
>> Be sure to iterate your pipeline
>> 
>>x = []; g.v(1).out("from").out("to").aggregate(x).loop(3){it.loops < 
>> 4}.iterate(); x
>> 
>> * NOTE: You can also do:
>>g.v(1).out("from").out("to").aggregate(x).loop(3){it.loops < 4} >>-1
>>   but the >> convention is no longer with us in Gremlin 1.4-SNAPSHOT.
>> 
>> HTH,
>> Marko.
>> 
>> http://markorodriguez.com
>> 
>> On Nov 17, 2011, at 7:21 AM, Alfredas Chmieliauskas wrote:
>> 
>>> Dear all,
>>> This concerns gremlin plugin and the script engine.
>>> Maybe there's an explanation for this behavior:
>>> 1) gremlin> x = [];
>>> g.v(1).out("from").out("to").aggregate(x).loop(3){it.loops < 4};
>>> gremlin> x;
>>> 
>>> ==> v[7]
>>> ==> v[3]
>>> ==> v[5]
>>> 
>>> 2) gremlin> x = [];
>>> g.v(1).out("from").out("to").aggregate(x).loop(3){it.loops < 4}; x;
>>> returns nothing...
>>> 
>>> Thanks,
>>> 
>>> Alfredas
>>> ___
>>> 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] Gremlin plugin and script engine question

2011-11-17 Thread Rick Bullotta
It iterates.

Sorry, couldn't resist.  ;-)

-Original Message-
From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
Behalf Of Alfredas Chmieliauskas
Sent: Thursday, November 17, 2011 12:31 PM
To: Neo4j user discussions
Subject: Re: [Neo4j] Gremlin plugin and script engine question

Thanks!

What exactly does iterate() do?

A

On Thu, Nov 17, 2011 at 4:07 PM, Marko Rodriguez  wrote:
> Hey Alfredas,
>
> Be sure to iterate your pipeline
>
>        x = []; g.v(1).out("from").out("to").aggregate(x).loop(3){it.loops < 
> 4}.iterate(); x
>
> * NOTE: You can also do:
>        g.v(1).out("from").out("to").aggregate(x).loop(3){it.loops < 4} >>-1
>   but the >> convention is no longer with us in Gremlin 1.4-SNAPSHOT.
>
> HTH,
> Marko.
>
> http://markorodriguez.com
>
> On Nov 17, 2011, at 7:21 AM, Alfredas Chmieliauskas wrote:
>
>> Dear all,
>> This concerns gremlin plugin and the script engine.
>> Maybe there's an explanation for this behavior:
>> 1) gremlin> x = [];
>> g.v(1).out("from").out("to").aggregate(x).loop(3){it.loops < 4};
>>     gremlin> x;
>>
>> ==> v[7]
>> ==> v[3]
>> ==> v[5]
>>
>> 2) gremlin> x = [];
>> g.v(1).out("from").out("to").aggregate(x).loop(3){it.loops < 4}; x;
>> returns nothing...
>>
>> Thanks,
>>
>> Alfredas
>> ___
>> 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] Gremlin plugin and script engine question

2011-11-17 Thread Alfredas Chmieliauskas
Thanks!

What exactly does iterate() do?

A

On Thu, Nov 17, 2011 at 4:07 PM, Marko Rodriguez  wrote:
> Hey Alfredas,
>
> Be sure to iterate your pipeline
>
>        x = []; g.v(1).out("from").out("to").aggregate(x).loop(3){it.loops < 
> 4}.iterate(); x
>
> * NOTE: You can also do:
>        g.v(1).out("from").out("to").aggregate(x).loop(3){it.loops < 4} >>-1
>   but the >> convention is no longer with us in Gremlin 1.4-SNAPSHOT.
>
> HTH,
> Marko.
>
> http://markorodriguez.com
>
> On Nov 17, 2011, at 7:21 AM, Alfredas Chmieliauskas wrote:
>
>> Dear all,
>> This concerns gremlin plugin and the script engine.
>> Maybe there's an explanation for this behavior:
>> 1) gremlin> x = [];
>> g.v(1).out("from").out("to").aggregate(x).loop(3){it.loops < 4};
>>     gremlin> x;
>>
>> ==> v[7]
>> ==> v[3]
>> ==> v[5]
>>
>> 2) gremlin> x = [];
>> g.v(1).out("from").out("to").aggregate(x).loop(3){it.loops < 4}; x;
>> returns nothing...
>>
>> Thanks,
>>
>> Alfredas
>> ___
>> 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] How do I use parameters in Cypher queries using regular expressions?

2011-11-17 Thread Tero Paananen
Another regular expression related issue in Cypher. 1.5 GA.

I'm using repositories extensively in my application. I'm extending the
queries defined by the repository interfaces with my own using the @Query
annotation.

It seems as if using parametrized regular expressions in these queries
isn't working as I'd expect them to.

Here's an example:

@Query(value = "start n = node(1) match (n)-[:KNOWS]->(c) where c.a =~
/.*?{foo}.*?/ return c", type = QueryType.Cypher)
Page getConnectedNodes(@Param("foo") String foo, Pageable pageable);


It looks like the stuff inside {} is parsed as part of the regular expression.

I tried it with %foo as well.

Looks like parameters inside regular expressions aren't being replaced
at all.

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


[Neo4j] Bug (or feature?) in using regular expressions in Cypher where clauses

2011-11-17 Thread Tero Paananen
This is using 1.5 GA.

I think I found a bug (or unsupported feature) in how regular
expressions used in where clauses work in Cypher queries.

It doesn't look like having multiple regular expression conditions
in a where clause back to back works too well.

Here's an example that works:

start n = node(1) match (n)-[:KNOWS]->(k) where k.a =~ /foo.*/ return k

Returns all connected nodes where property a starts with "foo".


Here's an example that doesn't work:

start n = node(1) match (n)-[:KNOWS]->(k) where k.a =~ /foo.*/ or k.b
=~ /foo.*/ return k

This will always return an empty result. So will if I change or to and.


Here's an example that does work:

start n = node(1) match (n)-[:KNOWS]->(k) where k.a =~ /foo.*/ or k.a
= "foo" or k.b =~ /foo.*/ return k

The introduction of a non-regular expression condition makes the
query work as intended.


This one does not work:

start n = node(1) match (n)-[:KNOWS]->(k) where k.a =~ /foo.*/ or k.b
=~ /foo.*/ or k.a = "foo" return k

Looks like a bug to me, and seems to be caused by where clauses
with more than one regular expression conditions next to each other.

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


Re: [Neo4j] Gremlin plugin and script engine question

2011-11-17 Thread Marko Rodriguez
Hey Alfredas,

Be sure to iterate your pipeline

x = []; g.v(1).out("from").out("to").aggregate(x).loop(3){it.loops < 
4}.iterate(); x

* NOTE: You can also do:
g.v(1).out("from").out("to").aggregate(x).loop(3){it.loops < 4} >>-1
   but the >> convention is no longer with us in Gremlin 1.4-SNAPSHOT.

HTH,
Marko.

http://markorodriguez.com

On Nov 17, 2011, at 7:21 AM, Alfredas Chmieliauskas wrote:

> Dear all,
> This concerns gremlin plugin and the script engine.
> Maybe there's an explanation for this behavior:
> 1) gremlin> x = [];
> g.v(1).out("from").out("to").aggregate(x).loop(3){it.loops < 4};
> gremlin> x;
> 
> ==> v[7]
> ==> v[3]
> ==> v[5]
> 
> 2) gremlin> x = [];
> g.v(1).out("from").out("to").aggregate(x).loop(3){it.loops < 4}; x;
> returns nothing...
> 
> Thanks,
> 
> Alfredas
> ___
> 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] Neo4j-Scala Wrapper 0.1.0 released

2011-11-17 Thread Marko Rodriguez
Hey,

It might be a little too soon to bring it up, but early December, we are 
releasing Gremlin Scala in Gremlin 1.4 which will allow you to import Gremlin 
into your Scala project (e.g. Neo4j-Scala Wrapper) and evaluate Gremlin queries 
natively. 

https://github.com/tinkerpop/gremlin/tree/master/gremlin-scala

For example, in Gremlin Scala:

g.v(1).out("knows").out("created").filter{v:Vertex => 
v("name").equals("marko")}

This way Scala developers can use Gremlin-style traversing natively in their 
Scala code.

See ya,
Marko.

http://markorodriguez.com

On Nov 17, 2011, at 5:21 AM, Christopher Schmidt wrote:

> Peter, I think its not possible because "[" and "]" are reserved for Scalas
> type declarations.
> The String (fe. "KNOWS") is implicitly converted
> into DynamicRelationshipType.withName("KNOWS").
> 
> What would be possible to get something like this (which is actually just a
> change of method names):
> 
> start - "KNOWS" -> end
> 
> Regarding the Cypher language:
> Its an interpreted language, so it is possible to define a completely free
> syntax. In case of Scala, all we are doing has to be fit into the language
> syntax, although it looks like a freely designed DSL. Cypher has some
> similarities to SQL as a special query language. And to be honest, I think
> using it programmatically will cause the same symtoms as SQL with respect
> to runtime errors, type safety, abstraction etc.
> 
> Nevertheless, it would be interesting to create a nearly Cypher compilable
> DSL, which includes type safety and transparent DAO or Case Class mapping.
> Something like:
> 
> case class User(name:String)
> val nodes = createNode(User("name1")) :: createNode(User("name2"))
> :: createNode(User("name3")) :: Nil
> . . .
> for (f <- START nodes MATCH user-"friend"->follower WHERE follower.name =~
> /S.*/ RETURN follower)
>   println("User Follower: " + f.name)
> 
> 
> This would be basically the same idea JPA tries with its criteria api. But
> that will be hard work :-)
> 
> Christopher
> 
> On Wednesday, November 16, 2011, Peter Neubauer wrote:
> 
>> Chstopher,
>> this looks really cool! I notice the similarity to the cypher syntax
>> in the ASCII art part of the notation. Do you think there is a chance
>> to make it even more similar to that so you could actually write
>> 
>> start -[:KNOWS]-> intermediary - [KNOWS] -> end
>> 
>> instead of
>> 
>> start --> "KNOWS" --> intermediary --> "KNOWS" --> end ? Would be
>> quite cool to be closely in line with
>> http://docs.neo4j.org/chunked/snapshot/cypher-query-lang.html, maybe
>> we could even use this for a modifying cypher in the future ...
>> 
>> 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
>> 
>> http://www.neo4j.org  - NOSQL for the Enterprise.
>> http://startupbootcamp.org/- Öresund - Innovation happens HERE.
>> 
>> 
>> 
>> On Wed, Nov 16, 2011 at 6:36 AM, Christopher Schmidt
>>  wrote:
>>> Hi all,
>>> 
>>> I released version 0.1.0 of the Neo4j Scala Wrapper neo4j-scala (base is
>>> neo4j-scala by jawher).
>>> Main features are
>>> 
>>> - simple Traits for the wrapper itself, GraphDatabaseService provider,
>>> index provider and batch insertion
>>> - transaction wrapping:
>>> 
>>> withTx {...}
>>> 
>>> - natural usage of relations:
>>> 
>>> start --> "KNOWS" --> intermediary --> "KNOWS" --> end
>>> 
>>> - setting and getting properties:
>>> 
>>> node("foo") = "bar"
>>> node[String]("foo") match {
>>>   case Some(x) => println(x)
>>>   case None => println("aww")
>>> }
>>> 
>>> - easy CaseClass to/from Node/Relation properties marshaling
>>> 
>>> withTx {
>>> implicit neo =>
>>>   // create new Node with Case Class Test
>>>   val node1 = createNode(Test("Something", 1, 2, 3.3, 10, true))
>>> 
>>>   // or using Option[T] (returning Some[T] if possible)
>>>   val nodeOption: Option[Test] = node.toCC[Test]
>>> 
>>>   // create new relation with Case Class Test
>>>   node1 --> "foo" --> node2 < Test("other", 0, 1, 1.3, 1, false)
>>> }
>>> 
>>> - transparent batch processing (simply replace 2 traits to use the same
>>> code for batch- and non batch processing)
>>> 
>>> For now I am using a simple Github "Maven repository".
>>> Neo4j-scala should be usable with the following POM settings:
>>>   
>>> 
>>>   fakod-releases
>>>   https://raw.github.com/FaKod/fakod-mvn-repo/master/releases
>>> 
>>> 
>>>   
>>> 
>>>   
>>> 
>>>   org.neo4j
>>>   neo4j-scala
>>>   0.1.0
>>> 
>>>   
>>> 
>>> The Sources are hosted on Github:
>>> 
>>> https://github.com/FaKod/neo4j-scala/tree/0.1.0
>>> 
>>> 
>>> A simple Matrix example GIST is here:
>>> 
>>> https://gist.github.com/1331556
>>> 
>>> 
>>> Enjoy...
>>> 
>>> 
>>> PS: Maybe you are using Neo4j Server via Jersey? So sjersey-client may be
>>> interesting for you as well: see @
>>> Git

[Neo4j] Gremlin plugin and script engine question

2011-11-17 Thread Alfredas Chmieliauskas
Dear all,
This concerns gremlin plugin and the script engine.
Maybe there's an explanation for this behavior:
1) gremlin> x = [];
g.v(1).out("from").out("to").aggregate(x).loop(3){it.loops < 4};
    gremlin> x;

==> v[7]
==> v[3]
==> v[5]

2) gremlin> x = [];
g.v(1).out("from").out("to").aggregate(x).loop(3){it.loops < 4}; x;
returns nothing...

Thanks,

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


Re: [Neo4j] Newbie question on server topology

2011-11-17 Thread Vinicius Carvalho
Thanks for the great reply Michael, the "RESTDataService" is
SpringRestGraphDatabase  , sorry, I was away from docs, and was the best
approximation of the real name I had :P

Thanks a lot for clarification. I guess I'm just assuming REST will not be
enough before even trying, it may not be an overhead at all vs a binary
protocol like jRMP.

Regards

On Thu, Nov 17, 2011 at 2:04 PM, Michael Hunger <
michael.hun...@neotechnology.com> wrote:

> If you're using spring you can also look into Spring Data Neo4j (
> http://spring.neo4j.org)
>
> (see the docs here:
> http://static.springsource.org/spring-data/data-graph/snapshot-site/reference/html/#reference:neo4j-server
> )
>
> and its use of the SpringRestGraphDatabase and/or the java-rest-binding (
> https://github.com/neo4j/java-rest-binding).
>
> You could also add a domain level server-extension to the neo4j server
> that talks a application specific protocol (instead of the generic REST
> protocol).
>
> The best way is to do a PoC for your use-case(s) and measure the ease of
> use + performance for your domain model + data.
>
> Haven't seen the "RESTDataService" you referenced, do you have any docs on
> that?
>
> Cheers
>
> Michael
>
> Am 17.11.2011 um 14:34 schrieb Vinicius Carvalho:
>
> > Hi there! I've being playing around with neo4j for a few weeks now. I'm
> > using embedded graph db, and the data lives inside my developer machine.
> > But now I need to turn things into a more production like stage.
> >
> > Coming from a traditional SQL world where we have our clusters of DB
> > running in some servers and all AppServers accessing remotely via jdbc
> > connections. I'm wondering what is the best approach with neo4j?
> >
> > Is REST the way to go when we have a separation from AppServers and the
> > node servers? I've seen some ppl saying that one could use HA and have
> DBs
> > collocated on each machine and have the HA capabilities to sync the
> > storage, but I'd like to avoid this approach at all, we don't want to
> have
> > graphdb servers and appservers on the same machine (not my call this
> > decision unfortunately)
> >
> > It seems to me that Spring has some nice RESTDataService that wraps the
> > REST API, so I'm considering going that way.
> >
> > Just wondering what would be a recommend strategy for this.
> >
> > Regards
> > ___
> > 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] Using the WrappingNeoServerBootstrapper with sbt

2011-11-17 Thread g-eorge
Sure, no problem.

Here you go: https://gist.github.com/1373211



On 17 Nov 2011, at 12:41, Peter Neubauer [via Neo4j Community Discussions] 
wrote:

> Great, 
> Thanks for sharing it! Would love to see this in some public place to be 
> able to refer to it. Gut it on Github somewhere? 
> On Nov 17, 2011 1:35 PM, "g-eorge" <[hidden email]> wrote: 
> 
> > I added the following to my .sbt file and everything appears to work fine 
> > so 
> > far.. 
> > 
> > libraryDependencies ++= Seq( 
> >   "org.neo4j.app" % "neo4j-server" % "1.5", 
> >   "org.neo4j.app" % "neo4j-server" % "1.5" classifier "static-web" 
> >  from 
> > " 
> > http://m2.neo4j.org/releases/org/neo4j/app/neo4j-server/1.5/neo4j-server-1.5-static-web.jar
> > ", 
> >   "com.sun.jersey" % "jersey-core" % "1.9" 
> > ) 
> > 
> > 
> > resolvers ++= Seq( 
> >  "tinkerprop" at "http://tinkerpop.com/maven2"; 
> > ) 
> > 
> > -- 
> > View this message in context: 
> > http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Using-the-WrappingNeoServerBootstrapper-with-sbt-tp3477583p3515594.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/Neo4j-Using-the-WrappingNeoServerBootstrapper-with-sbt-tp3477583p3515604.html
> To unsubscribe from [Neo4j] Using the WrappingNeoServerBootstrapper with sbt, 
> click here.
> NAML



--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Using-the-WrappingNeoServerBootstrapper-with-sbt-tp3477583p3515883.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] Newbie question on server topology

2011-11-17 Thread Michael Hunger
If you're using spring you can also look into Spring Data Neo4j 
(http://spring.neo4j.org) 

(see the docs here: 
http://static.springsource.org/spring-data/data-graph/snapshot-site/reference/html/#reference:neo4j-server)

and its use of the SpringRestGraphDatabase and/or the java-rest-binding 
(https://github.com/neo4j/java-rest-binding).

You could also add a domain level server-extension to the neo4j server that 
talks a application specific protocol (instead of the generic REST protocol).

The best way is to do a PoC for your use-case(s) and measure the ease of use + 
performance for your domain model + data.

Haven't seen the "RESTDataService" you referenced, do you have any docs on that?

Cheers

Michael

Am 17.11.2011 um 14:34 schrieb Vinicius Carvalho:

> Hi there! I've being playing around with neo4j for a few weeks now. I'm
> using embedded graph db, and the data lives inside my developer machine.
> But now I need to turn things into a more production like stage.
> 
> Coming from a traditional SQL world where we have our clusters of DB
> running in some servers and all AppServers accessing remotely via jdbc
> connections. I'm wondering what is the best approach with neo4j?
> 
> Is REST the way to go when we have a separation from AppServers and the
> node servers? I've seen some ppl saying that one could use HA and have DBs
> collocated on each machine and have the HA capabilities to sync the
> storage, but I'd like to avoid this approach at all, we don't want to have
> graphdb servers and appservers on the same machine (not my call this
> decision unfortunately)
> 
> It seems to me that Spring has some nice RESTDataService that wraps the
> REST API, so I'm considering going that way.
> 
> Just wondering what would be a recommend strategy for this.
> 
> Regards
> ___
> 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] Sampling a Neo4j instance?

2011-11-17 Thread Mattias Persson
I don't think lucene supports that. You could instead make sure that
everything you index is also indexed in some kind of "all" field, which
would duplicate your index, but make this possible.

Den 17 november 2011 11:00 skrev Anders Lindström :

>
> Thanks Michael for this creative idea.
>
> But is it possible to query for _all_ objects in a Lucene index? As I
> understand it, I need at least the name of an index key field, e.g.
> 'title', right? What I would like to do is basically query for * (without
> knowing _anything_ but the index name, i.e. not even names of index keys)
> and then have the results randomly sorted.
>
> Also, when and on what collection is the actual sorting performed? It
> seems to me an approach like this would sort all entries in the IndexHits
> first, and then we can start going through them. For a large index, this
> doesn't scale as sorting is O(nlog n). On the StackOverflow link it says
> "This doesn't consume any I/O when shuffling the results.", but I cannot
> understand how this is. What if the resulting IndexHits does not fit into
> memory, then we need to go to disk for shuffling too?
>
>
> Lastly, thanks CG. I've implemented your suggestion and it seems to be
> working fine!
>
> > From: michael.hun...@neotechnology.com
> > Date: Thu, 10 Nov 2011 11:14:32 +0100
> > To: user@lists.neo4j.org
> > Subject: Re: [Neo4j] Sampling a Neo4j instance?
> >
> > Probably using an index for your nodes (could be an auto-index).
> >
> > And then using an random shuffling of the results? You can pass in a
> lucene query object or query string to index.query(queryOrQueryObject).
> >
> > Sth like this
> http://stackoverflow.com/questions/7201638/lucene-2-9-2-how-to-show-results-in-random-order
> >
> > perhaps there is also some string based lucene query/sort syntax for it.
> >
> > Michael
> >
> > Am 10.11.2011 um 11:01 schrieb Chris Gioran:
> >
> > > Answers inline.
> > >
> > > 2011/11/9 Anders Lindström :
> > >>
> > >> Thanks to the both of you. I am very grateful that you took your time
> to put this into code -- how's that for community!
> > >> I presume this way of getting 'highId' is constant in time? It looks
> rather messy though -- is it really the most straightforward way to do it?
> > >
> > > This is the safest way to do it, that takes into consideration crashes
> > > and HA cluster membership.
> > >
> > > Another way to do it is
> > >
> > > long highId = db.getConfig().getIdGeneratorFactory().get( IdType.NODE
> > > ).getHighId();
> > >
> > > which can return the same value with the first, if some conditions are
> > > met. It is shorter and cast-free but i'd still use the first way.
> > >
> > > getHighId() is a constant time operation for both ways described - it
> > > is just a field access, with an additional long comparison for the
> > > first case.
> > >
> > >> I am thinking about how efficient this will be. As I understand it,
> the "sampling misses" come from deleted nodes that once was there. But if I
> remember correctly, Neo4j tries to reuse these unused node indices when new
> nodes are added. But is an unused node index _guaranteed_ to be used given
> that there is one, or could inserting another node result in increasing
> 'highId' even though some indices below it are not used?
> > >
> > > During the lifetime of a Neo4j instance there is no id reuse for Nodes
> > > and Relationships - deleted ids are saved however and will be reused
> > > the next time Neo4j starts. This means that if during run A you
> > > deleted nodes 3 and 5, the first two nodes returned by createNode() on
> > > the next run will have ids 3 and 5 - so highId will not change.
> > > Additionally, during run A, after deleting nodes 3 and 5, no new nodes
> > > would have the id 3 or 5. A crash (or improper shutdown) of the
> > > database will break this however, since the ids-to-recycle will
> > > probably not make it to disk.
> > >
> > > So, in short, it is guaranteed that ids *won't* be reused in the same
> > > run but not guaranteed to be reused between runs.
> > >
> > >> My conclusion is that the "sampling misses" will increase with index
> usage sparseness and that we will have a high rate of "sampling misses"
> when we had many deletes and few insertions recently. Would you agree?
> > >
> > > Yes, that is true, especially given the cost of the "wasted" I/O and
> > > of handling the exception. However, this cost can go down
> > > significantly if you keep a hash set for the ids of nodes you have
> > > deleted and check that before asking for the node by id, instead of
> > > catching an exception. Persisting that between runs would move you
> > > away from encapsulated Neo4j constructs and would also be more
> > > efficient.
> > >
> > >> Thanks again.
> > >> Regards,Anders
> > >>
> > >>> Date: Wed, 9 Nov 2011 19:30:36 +0200
> > >>> From: chris.gio...@neotechnology.com
> > >>> To: user@lists.neo4j.org
> > >>> Subject: Re: [Neo4j] Sampling a Neo4j instance?
> > >>>
> > >>> Hi,
> > >>>
> > >>> Backin

Re: [Neo4j] Record not in use problem and solution

2011-11-17 Thread Mattias Persson
2011/11/17 Axel Morgner 

> We remove nodes from the index with index.remove(node). The index is
> initialized at startup with
>

It cannot be only that. By the looks of it some part of your code uses
Node#hasProperty after Node#delete, which is illegal and that's what's
causing it. Can you provide a more covering stacktrace or perhaps other
information/code ?

>
> Index index = graphDb.index().forNodes("fulltextAllNodes",
> MapUtil.stringMap("provider", "lucene", "type", "fulltext"));
>
> Removing the node from the index before executing node.delete() avoids
> the exception.
>
> Isolating the testcase is difficult, and I don't have the time right
> now. But I can send you a database archive containing a zombie node if
> you like.
>
>
> Am 17.11.2011 10:35, schrieb Mattias Persson:
> > "Removing from index": is that done by looking at properties and removing
> > them from the index for every property. If that's the case then this is
> > expected since the node has been deleted just before.
> >
> > 2011/11/17 Peter Neubauer
> >
> >> Axel,
> >> Can you isolate this into a test, and maybe send the messages.log off
> list
> >> for us to look at?
> >> On Nov 17, 2011 12:09 AM, "Axel Morgner"  wrote:
> >>
> >>> Sorry to say, but I can reproduce the behaviour with 1.5, too.
> >>>
> >>> Without deleting the node from the index manually, I get still this
> >>> org.neo4j.kernel.impl.nioneo.store.InvalidRecordException:
> >>>
> >>> 17.11.2011 00:01:48 org.structr.core.node.TransactionCommand execute
> >>> WARNUNG: Transaction failure
> >>> org.neo4j.kernel.impl.nioneo.store.InvalidRecordException: Record[46]
> >>> not in use
> >>>  at
> >>>
> >>
> org.neo4j.kernel.impl.nioneo.store.NodeStore.getRecord(NodeStore.java:215)
> >>>  at
> >>>
> org.neo4j.kernel.impl.nioneo.store.NodeStore.getRecord(NodeStore.java:96)
> >>>  at
> >>>
> >>>
> >>
> org.neo4j.kernel.impl.nioneo.xa.WriteTransaction.nodeDelete(WriteTransaction.java:683)
> >>>  at
> >>>
> >>>
> >>
> org.neo4j.kernel.impl.persistence.PersistenceManager.nodeDelete(PersistenceManager.java:136)
> >>>  at
> >>> org.neo4j.kernel.impl.core.NodeManager.deleteNode(NodeManager.java:847)
> >>>  at org.neo4j.kernel.impl.core.NodeImpl.delete(NodeImpl.java:266)
> >>>  at org.neo4j.kernel.impl.core.NodeProxy.delete(NodeProxy.java:57)
> >>>  at
> >> org.structr.core.entity.AbstractNode.delete(AbstractNode.java:1358)
> >>>  at
> >>>
> >>>
> >>
> org.structr.rest.constraint.ResourceConstraint$2.execute(ResourceConstraint.java:153)
> >>>  at
> >>>
> >>>
> >>
> org.structr.core.node.TransactionCommand.execute(TransactionCommand.java:61)
> >>>  at
> >>>
> >>>
> >>
> org.structr.rest.constraint.ResourceConstraint.doDelete(ResourceConstraint.java:129)
> >>>  at
> >>>
> >>
> org.structr.rest.servlet.JsonRestServlet.doDelete(JsonRestServlet.java:188)
> >>>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
> >>>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
> >>>  at
> >>>
> >>>
> >>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
> >>>  at
> >>>
> >>>
> >>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> >>>  at
> >>>
> >>>
> >>
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
> >>>  at
> >>>
> >>>
> >>
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
> >>>  at
> >>>
> >>>
> >>
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
> >>>  at
> >>>
> >>>
> >>
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
> >>>  at
> >>>
> >>>
> >>
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
> >>>  at
> >>>
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
> >>>  at
> >>>
> >>>
> >>
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
> >>>  at
> >>>
> >>
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:403)
> >>>  at
> >>>
> >>
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:301)
> >>>  at
> >>>
> >>>
> >>
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:162)
> >>>  at
> >>>
> >>>
> >>
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:140)
> >>>  at
> >>>
> >>>
> >>
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
> >>>  at
> >>>
> >>>
> >>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> >>>  at
> >>>
> >>>
> >>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> >>>  at java.lang.Thread.run(Thread.java:679)
> >>>
> >>> Interestingly, all node properties (besides id) are empty.
> >>>
> >>> 

Re: [Neo4j] Using the WrappingNeoServerBootstrapper with sbt

2011-11-17 Thread Markus Joschko
After I finally figured out that one of my main problems was with the
version of jersey used (I upgraded to 1.10),
I copied over the static web dependency to the lib folder and it worked as well.

But your approach is much nicer. Will give it a try.



On Thu, Nov 17, 2011 at 1:40 PM, Peter Neubauer
 wrote:
> Great,
> Thanks for sharing it! Would love to see this in some public place to be
> able to refer to it. Gut it on Github somewhere?
> On Nov 17, 2011 1:35 PM, "g-eorge"  wrote:
>
>> I added the following to my .sbt file and everything appears to work fine
>> so
>> far..
>>
>> libraryDependencies ++= Seq(
>>   "org.neo4j.app" % "neo4j-server" % "1.5",
>>   "org.neo4j.app" % "neo4j-server" % "1.5" classifier "static-web"
>>      from
>> "
>> http://m2.neo4j.org/releases/org/neo4j/app/neo4j-server/1.5/neo4j-server-1.5-static-web.jar
>> ",
>>   "com.sun.jersey" % "jersey-core" % "1.9"
>> )
>>
>>
>> resolvers ++= Seq(
>>  "tinkerprop" at "http://tinkerpop.com/maven2";
>> )
>>
>> --
>> View this message in context:
>> http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Using-the-WrappingNeoServerBootstrapper-with-sbt-tp3477583p3515594.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
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Neo4j-Scala Wrapper 0.1.0 released

2011-11-17 Thread Andres Taylor
On Thu, Nov 17, 2011 at 1:21 PM, Christopher Schmidt <
fakod...@googlemail.com> wrote:

> Cypher has some
> similarities to SQL as a special query language. And to be honest, I think
> using it programmatically will cause the same symtoms as SQL with respect
> to runtime errors, type safety, abstraction etc.
>

I understand your worries about runtime errors and type safety. I'd love to
know what you mean by "abstraction etc". Do you have any concrete examples
in mind?

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


Re: [Neo4j] Neo4j Spatial build / run problems

2011-11-17 Thread danielb
Sure, here are the files, first after the checkout directly and then after I
add the missing entry (maybe you can correct this on the repository?).

http://dl.dropbox.com/u/18693700/git.txt
http://dl.dropbox.com/u/18693700/meta-inf_fixed.txt




--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Spatial-build-run-problems-tp3515519p3515786.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] Newbie question on server topology

2011-11-17 Thread Vinicius Carvalho
Hi there! I've being playing around with neo4j for a few weeks now. I'm
using embedded graph db, and the data lives inside my developer machine.
But now I need to turn things into a more production like stage.

Coming from a traditional SQL world where we have our clusters of DB
running in some servers and all AppServers accessing remotely via jdbc
connections. I'm wondering what is the best approach with neo4j?

Is REST the way to go when we have a separation from AppServers and the
node servers? I've seen some ppl saying that one could use HA and have DBs
collocated on each machine and have the HA capabilities to sync the
storage, but I'd like to avoid this approach at all, we don't want to have
graphdb servers and appservers on the same machine (not my call this
decision unfortunately)

It seems to me that Spring has some nice RESTDataService that wraps the
REST API, so I'm considering going that way.

Just wondering what would be a recommend strategy for this.

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


Re: [Neo4j] The cypher project in neo4j-community has errors in eclipse

2011-11-17 Thread Eric Liang
On 11/17/2011 08:44 PM, Peter Neubauer wrote:
> Eric,
> Maybe we can connect over Skype and get it working? I am somewhat of a
> fixing things expert :-)
OK. I can share the screen but talk much since my colleagues are still
working. :D

Anyway, is your skype peter.neubauer and what time is convenient for you?

Eric
> On Nov 17, 2011 11:26 AM, "Eric Liang"  wrote:
>
>> On 11/17/2011 02:46 PM, Anders Nawroth wrote:
>>> Hi!
>>>
  From the discussion ( http://neo4j.org/forums/#nabble-td3217906 ),
 Anders Nawroth said neo4j-cypher works with Eclipse Indigo, so I
 installed a fresh latest version of Eclipse, but still not work.
>>> It worked when I wrote the instructions in the readme file. I've seen
>>> that there's now a problem, but haven't been able to fix it.
>> Thanks Anders.
>>
>> Well, that's not good news. By the way, is that problem the same as
>> posted in my previous mail?
>>
>> Eric
>>
>> --
>> -BEGIN GEEK CODE BLOCK-
>> Version: 3.1
>> GCM/CS/E/MU/P d+(-) s: a- C++ UL$ P+>++ L++ E++ W++ N+ o+>++ K+++ w !O
>> M-(+) V-- PS+ PE+ Y+ PGP++ t? 5? X? R+>* tv@ b DI-- D G++ e++>+++@ h*
>> r !y+
>> --END GEEK CODE BLOCK--
>>
>> ___
>> 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


-- 
-BEGIN GEEK CODE BLOCK-
Version: 3.1
GCM/CS/E/MU/P d+(-) s: a- C++ UL$ P+>++ L++ E++ W++ N+ o+>++ K+++ w !O
M-(+) V-- PS+ PE+ Y+ PGP++ t? 5? X? R+>* tv@ b DI-- D G++ e++>+++@ h*
r !y+
--END GEEK CODE BLOCK--

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


Re: [Neo4j] The cypher project in neo4j-community has errors in eclipse

2011-11-17 Thread Peter Neubauer
Eric,
Maybe we can connect over Skype and get it working? I am somewhat of a
fixing things expert :-)
On Nov 17, 2011 11:26 AM, "Eric Liang"  wrote:

> On 11/17/2011 02:46 PM, Anders Nawroth wrote:
> > Hi!
> >
> >>  From the discussion ( http://neo4j.org/forums/#nabble-td3217906 ),
> >> Anders Nawroth said neo4j-cypher works with Eclipse Indigo, so I
> >> installed a fresh latest version of Eclipse, but still not work.
> > It worked when I wrote the instructions in the readme file. I've seen
> > that there's now a problem, but haven't been able to fix it.
> Thanks Anders.
>
> Well, that's not good news. By the way, is that problem the same as
> posted in my previous mail?
>
> Eric
>
> --
> -BEGIN GEEK CODE BLOCK-
> Version: 3.1
> GCM/CS/E/MU/P d+(-) s: a- C++ UL$ P+>++ L++ E++ W++ N+ o+>++ K+++ w !O
> M-(+) V-- PS+ PE+ Y+ PGP++ t? 5? X? R+>* tv@ b DI-- D G++ e++>+++@ h*
> r !y+
> --END GEEK CODE BLOCK--
>
> ___
> 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] Using the WrappingNeoServerBootstrapper with sbt

2011-11-17 Thread Peter Neubauer
Great,
Thanks for sharing it! Would love to see this in some public place to be
able to refer to it. Gut it on Github somewhere?
On Nov 17, 2011 1:35 PM, "g-eorge"  wrote:

> I added the following to my .sbt file and everything appears to work fine
> so
> far..
>
> libraryDependencies ++= Seq(
>   "org.neo4j.app" % "neo4j-server" % "1.5",
>   "org.neo4j.app" % "neo4j-server" % "1.5" classifier "static-web"
>  from
> "
> http://m2.neo4j.org/releases/org/neo4j/app/neo4j-server/1.5/neo4j-server-1.5-static-web.jar
> ",
>   "com.sun.jersey" % "jersey-core" % "1.9"
> )
>
>
> resolvers ++= Seq(
>  "tinkerprop" at "http://tinkerpop.com/maven2";
> )
>
> --
> View this message in context:
> http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Using-the-WrappingNeoServerBootstrapper-with-sbt-tp3477583p3515594.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] Neo4j Spatial build / run problems

2011-11-17 Thread Peter Neubauer
Daniel,
Could you send over the full console output of a

mvn clean install -DskipTests

?
On Nov 17, 2011 12:55 PM, "danielb"  wrote:

> Hi I have some problems with the new build of Neo4j Spatial. First if I
> checkout and try to build the following error occurs "[ERROR]
>
> spatial\src\main\java\org\neo4j\gis\spatial\indexprovider\SpatialIndexProvider.java:[38,0]
> error: Internal error: java.io.FileNotFoundException:
> META-INF/services/org.neo4j.kernel.KernelExtension". This is the current
> state after checkout.
>
> In the next step I have done the checkout in Netbeans and added the missing
> META-INF entry. Also there is currently only a "TestKernelExtension" class
> and not "KernelExtension". After that I could build the project and tried
> to
> run the OSMImporter.main inside Netbeans. I can't pass Parameters from
> project->properties->run->arguments, I guess it has something to do with
> the
> Maven project (I am a .NET / VS developer, I do it by trial and error atm).
>
> Finally I tried to load the project by console with parameter passing: "mvn
> exec:java -Dexec.mainClass="org.neo4j.gis.spatial.osm.OSMImporter.main"
> -Dexec.classpathScope=runtime -Dexec.args=""C:/Program
> Files/neo4j-community-1.5/data/graph.db"
> "C:/Users/UserName/Dropbox/WBIS/osm/berlin.osm"".  I had to copy the
> pom.xml
> (in netbeans project folder) to C:/users/username first to prevent an error
> from loading this file. After this I am stuck here:
>
> [WARNING]
> [WARNING] Some problems were encountered while building the effective model
> for org.neo4j:neo4j-spatial:jar:0.7-SNAPSHOT
> [WARNING] 'reporting.plugins.plugin.version' for
> org.apache.maven.plugins:maven-surefire-plugin is missing. @ line 532,
> column 15
> [WARNING]
> [WARNING] It is highly recommended to fix these problems because they
> threaten the stability of your build.
> [WARNING]
> [WARNING] For this reason, future Maven versions might no longer support
> building such malformed projects.
> [WARNING]
> [WARNING] The POM for cuke4duke:cuke4duke-maven-plugin:jar:0.4.4 is
> missing,
> no dependency information available
> [WARNING] Failed to retrieve plugin descriptor for
> cuke4duke:cuke4duke-maven-plugin:0.4.4: Plugin
> cuke4duke:cuke4duke-maven-plugin:0.4.4 or one of its
>  dependencies could not be resolved: Failed to read artifact descriptor for
> cuke4duke:cuke4duke-maven-plugin:jar:0.4.4
> [WARNING] The POM for cuke4duke:cuke4duke-maven-plugin:jar:0.4.4 is
> missing,
> no dependency information available
> [WARNING] Failed to retrieve plugin descriptor for
> cuke4duke:cuke4duke-maven-plugin:0.4.4: Plugin
> cuke4duke:cuke4duke-maven-plugin:0.4.4 or one of its
>  dependencies could not be resolved: Failed to read artifact descriptor for
> cuke4duke:cuke4duke-maven-plugin:jar:0.4.4
> [WARNING] The POM for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 is
> missing, no dependency information available
> [WARNING] Failed to retrieve plugin descriptor for
> org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin
> org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of i
> ts dependencies could not be resolved: Failed to read artifact descriptor
> for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0
> Downloading:
> http://repo1.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml
> Downloading:
> http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-metadata.xml
> Downloaded:
> http://repo1.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml (19 KB
> at
> 18.5 KB/sec)
> Downloaded:
> http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-metadata.xml
> (11 KB at 8.0 KB/sec)
> [INFO]
> 
> [INFO] BUILD FAILURE
> [INFO]
> 
> [INFO] Total time: 2.417s
> [INFO] Finished at: Thu Nov 17 12:44:42 CET 2011
> [INFO] Final Memory: 13M/309M
> [INFO]
> 
> [ERROR] No plugin found for prefix 'Files/neo4j-community-1.5/data/graph.db
> C' in the current project and in the plugin groups
> [org.apache.maven.plugins, org.codehaus.mojo] available from the
> repositories [local (C:\Users\UserName\.m2\repository), central
> (http://repo1.maven.org/maven2)] -> [
> Help 1]
>
> I would appreciate every help. Can I get it to work in Netbeans with
> parameter passing?
>
> --
> View this message in context:
> http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Spatial-build-run-problems-tp3515519p3515519.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] Using the WrappingNeoServerBootstrapper with sbt

2011-11-17 Thread g-eorge
I added the following to my .sbt file and everything appears to work fine so
far..

libraryDependencies ++= Seq(
   "org.neo4j.app" % "neo4j-server" % "1.5",
   "org.neo4j.app" % "neo4j-server" % "1.5" classifier "static-web" 
  from
"http://m2.neo4j.org/releases/org/neo4j/app/neo4j-server/1.5/neo4j-server-1.5-static-web.jar";,
   "com.sun.jersey" % "jersey-core" % "1.9"
)


resolvers ++= Seq(
  "tinkerprop" at "http://tinkerpop.com/maven2";
)

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Using-the-WrappingNeoServerBootstrapper-with-sbt-tp3477583p3515594.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] Neo4j-Scala Wrapper 0.1.0 released

2011-11-17 Thread Christopher Schmidt
Peter, I think its not possible because "[" and "]" are reserved for Scalas
type declarations.
The String (fe. "KNOWS") is implicitly converted
into DynamicRelationshipType.withName("KNOWS").

What would be possible to get something like this (which is actually just a
change of method names):

start - "KNOWS" -> end

Regarding the Cypher language:
Its an interpreted language, so it is possible to define a completely free
syntax. In case of Scala, all we are doing has to be fit into the language
syntax, although it looks like a freely designed DSL. Cypher has some
similarities to SQL as a special query language. And to be honest, I think
using it programmatically will cause the same symtoms as SQL with respect
to runtime errors, type safety, abstraction etc.

Nevertheless, it would be interesting to create a nearly Cypher compilable
DSL, which includes type safety and transparent DAO or Case Class mapping.
Something like:

case class User(name:String)
val nodes = createNode(User("name1")) :: createNode(User("name2"))
:: createNode(User("name3")) :: Nil
. . .
for (f <- START nodes MATCH user-"friend"->follower WHERE follower.name =~
/S.*/ RETURN follower)
   println("User Follower: " + f.name)


This would be basically the same idea JPA tries with its criteria api. But
that will be hard work :-)

Christopher

On Wednesday, November 16, 2011, Peter Neubauer wrote:

> Chstopher,
> this looks really cool! I notice the similarity to the cypher syntax
> in the ASCII art part of the notation. Do you think there is a chance
> to make it even more similar to that so you could actually write
>
> start -[:KNOWS]-> intermediary - [KNOWS] -> end
>
> instead of
>
> start --> "KNOWS" --> intermediary --> "KNOWS" --> end ? Would be
> quite cool to be closely in line with
> http://docs.neo4j.org/chunked/snapshot/cypher-query-lang.html, maybe
> we could even use this for a modifying cypher in the future ...
>
> 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
>
> http://www.neo4j.org  - NOSQL for the Enterprise.
> http://startupbootcamp.org/- Öresund - Innovation happens HERE.
>
>
>
> On Wed, Nov 16, 2011 at 6:36 AM, Christopher Schmidt
>  wrote:
> > Hi all,
> >
> > I released version 0.1.0 of the Neo4j Scala Wrapper neo4j-scala (base is
> > neo4j-scala by jawher).
> > Main features are
> >
> > - simple Traits for the wrapper itself, GraphDatabaseService provider,
> > index provider and batch insertion
> > - transaction wrapping:
> >
> > withTx {...}
> >
> > - natural usage of relations:
> >
> > start --> "KNOWS" --> intermediary --> "KNOWS" --> end
> >
> > - setting and getting properties:
> >
> > node("foo") = "bar"
> > node[String]("foo") match {
> >case Some(x) => println(x)
> >case None => println("aww")
> > }
> >
> > - easy CaseClass to/from Node/Relation properties marshaling
> >
> > withTx {
> >  implicit neo =>
> >// create new Node with Case Class Test
> >val node1 = createNode(Test("Something", 1, 2, 3.3, 10, true))
> >
> >// or using Option[T] (returning Some[T] if possible)
> >val nodeOption: Option[Test] = node.toCC[Test]
> >
> >// create new relation with Case Class Test
> >node1 --> "foo" --> node2 < Test("other", 0, 1, 1.3, 1, false)
> > }
> >
> > - transparent batch processing (simply replace 2 traits to use the same
> > code for batch- and non batch processing)
> >
> > For now I am using a simple Github "Maven repository".
> > Neo4j-scala should be usable with the following POM settings:
> >
> >  
> >fakod-releases
> >https://raw.github.com/FaKod/fakod-mvn-repo/master/releases
> > 
> >  
> >
> >
> >
> >  
> >org.neo4j
> >neo4j-scala
> >0.1.0
> >  
> >
> >
> > The Sources are hosted on Github:
> >
> > https://github.com/FaKod/neo4j-scala/tree/0.1.0
> >
> >
> > A simple Matrix example GIST is here:
> >
> > https://gist.github.com/1331556
> >
> >
> > Enjoy...
> >
> >
> > PS: Maybe you are using Neo4j Server via Jersey? So sjersey-client may be
> > interesting for you as well: see @
> > Github and
> > this example .
> >
> > --
> > Christopher
> > twitter: @fakod
> > blog: http://blog.fakod.eu
> >
> >
> >
> > --
> > Christopher
> > twitter: @fakod
> > blog: http://blog.fakod.eu
> > ___
> > 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
>


-- 
Christopher
twitter: @fakod
blog: http://blog.fakod.eu
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/

Re: [Neo4j] Record not in use problem and solution

2011-11-17 Thread Axel Morgner

> Does this problem occur with automatic node indexing?
>
We're not using auto indexing, so I can't say.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Neo4j Spatial build / run problems

2011-11-17 Thread danielb
Hi I have some problems with the new build of Neo4j Spatial. First if I
checkout and try to build the following error occurs "[ERROR]
spatial\src\main\java\org\neo4j\gis\spatial\indexprovider\SpatialIndexProvider.java:[38,0]
error: Internal error: java.io.FileNotFoundException:
META-INF/services/org.neo4j.kernel.KernelExtension". This is the current
state after checkout.

In the next step I have done the checkout in Netbeans and added the missing
META-INF entry. Also there is currently only a "TestKernelExtension" class
and not "KernelExtension". After that I could build the project and tried to
run the OSMImporter.main inside Netbeans. I can't pass Parameters from
project->properties->run->arguments, I guess it has something to do with the
Maven project (I am a .NET / VS developer, I do it by trial and error atm).

Finally I tried to load the project by console with parameter passing: "mvn
exec:java -Dexec.mainClass="org.neo4j.gis.spatial.osm.OSMImporter.main"
-Dexec.classpathScope=runtime -Dexec.args=""C:/Program
Files/neo4j-community-1.5/data/graph.db"
"C:/Users/UserName/Dropbox/WBIS/osm/berlin.osm"".  I had to copy the pom.xml
(in netbeans project folder) to C:/users/username first to prevent an error
from loading this file. After this I am stuck here:

[WARNING]
[WARNING] Some problems were encountered while building the effective model
for org.neo4j:neo4j-spatial:jar:0.7-SNAPSHOT
[WARNING] 'reporting.plugins.plugin.version' for
org.apache.maven.plugins:maven-surefire-plugin is missing. @ line 532,
column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they
threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support
building such malformed projects.
[WARNING]
[WARNING] The POM for cuke4duke:cuke4duke-maven-plugin:jar:0.4.4 is missing,
no dependency information available
[WARNING] Failed to retrieve plugin descriptor for
cuke4duke:cuke4duke-maven-plugin:0.4.4: Plugin
cuke4duke:cuke4duke-maven-plugin:0.4.4 or one of its
 dependencies could not be resolved: Failed to read artifact descriptor for
cuke4duke:cuke4duke-maven-plugin:jar:0.4.4
[WARNING] The POM for cuke4duke:cuke4duke-maven-plugin:jar:0.4.4 is missing,
no dependency information available
[WARNING] Failed to retrieve plugin descriptor for
cuke4duke:cuke4duke-maven-plugin:0.4.4: Plugin
cuke4duke:cuke4duke-maven-plugin:0.4.4 or one of its
 dependencies could not be resolved: Failed to read artifact descriptor for
cuke4duke:cuke4duke-maven-plugin:jar:0.4.4
[WARNING] The POM for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 is
missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for
org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin
org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of i
ts dependencies could not be resolved: Failed to read artifact descriptor
for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0
Downloading:
http://repo1.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Downloaded:
http://repo1.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml (19 KB at
18.5 KB/sec)
Downloaded:
http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-metadata.xml
(11 KB at 8.0 KB/sec)
[INFO]

[INFO] BUILD FAILURE
[INFO]

[INFO] Total time: 2.417s
[INFO] Finished at: Thu Nov 17 12:44:42 CET 2011
[INFO] Final Memory: 13M/309M
[INFO]

[ERROR] No plugin found for prefix 'Files/neo4j-community-1.5/data/graph.db
C' in the current project and in the plugin groups
[org.apache.maven.plugins, org.codehaus.mojo] available from the
repositories [local (C:\Users\UserName\.m2\repository), central
(http://repo1.maven.org/maven2)] -> [
Help 1]

I would appreciate every help. Can I get it to work in Netbeans with
parameter passing?

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Spatial-build-run-problems-tp3515519p3515519.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] Record not in use problem and solution

2011-11-17 Thread Krzysztof Raczyński
Does this problem occur with automatic node indexing?
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Help Needed: Creating a Neo4j Cheat Sheet / Reference Card

2011-11-17 Thread Michael Hunger
Dear Graphistas,

today we would like to ask for your contribution in our efforts to create an 
introductional reference card for Neo4j.

We would like to publish it as a 6 page DZone Ref-Card but also include the 
content in our distribution / website.

We feel many people are overwhelmed when it comes to get started with Neo4j and 
also many mailing list/Stack Overflow questions
could be answered by pointing to that refcard.

We started collecting topics and content in a google document but think that 
the perspective of the community is much more useful than the one of the 
Neo4j core devteam because of its broader perspective.

Please come over here: 
https://docs.google.com/document/d/1TAPFgz4s5BxXmEJfOB0I4rIPu11syyCJmSCFJ_EXiaw/edit

and add/edit/comment what you think is important for someone coming to neo4j or 
using neo4j for the first months.

Thanks so much

Michael

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


Re: [Neo4j] Record not in use problem and solution

2011-11-17 Thread Axel Morgner
We remove nodes from the index with index.remove(node). The index is 
initialized at startup with

Index index = graphDb.index().forNodes("fulltextAllNodes", 
MapUtil.stringMap("provider", "lucene", "type", "fulltext"));

Removing the node from the index before executing node.delete() avoids 
the exception.

Isolating the testcase is difficult, and I don't have the time right 
now. But I can send you a database archive containing a zombie node if 
you like.


Am 17.11.2011 10:35, schrieb Mattias Persson:
> "Removing from index": is that done by looking at properties and removing
> them from the index for every property. If that's the case then this is
> expected since the node has been deleted just before.
>
> 2011/11/17 Peter Neubauer
>
>> Axel,
>> Can you isolate this into a test, and maybe send the messages.log off list
>> for us to look at?
>> On Nov 17, 2011 12:09 AM, "Axel Morgner"  wrote:
>>
>>> Sorry to say, but I can reproduce the behaviour with 1.5, too.
>>>
>>> Without deleting the node from the index manually, I get still this
>>> org.neo4j.kernel.impl.nioneo.store.InvalidRecordException:
>>>
>>> 17.11.2011 00:01:48 org.structr.core.node.TransactionCommand execute
>>> WARNUNG: Transaction failure
>>> org.neo4j.kernel.impl.nioneo.store.InvalidRecordException: Record[46]
>>> not in use
>>>  at
>>>
>> org.neo4j.kernel.impl.nioneo.store.NodeStore.getRecord(NodeStore.java:215)
>>>  at
>>> org.neo4j.kernel.impl.nioneo.store.NodeStore.getRecord(NodeStore.java:96)
>>>  at
>>>
>>>
>> org.neo4j.kernel.impl.nioneo.xa.WriteTransaction.nodeDelete(WriteTransaction.java:683)
>>>  at
>>>
>>>
>> org.neo4j.kernel.impl.persistence.PersistenceManager.nodeDelete(PersistenceManager.java:136)
>>>  at
>>> org.neo4j.kernel.impl.core.NodeManager.deleteNode(NodeManager.java:847)
>>>  at org.neo4j.kernel.impl.core.NodeImpl.delete(NodeImpl.java:266)
>>>  at org.neo4j.kernel.impl.core.NodeProxy.delete(NodeProxy.java:57)
>>>  at
>> org.structr.core.entity.AbstractNode.delete(AbstractNode.java:1358)
>>>  at
>>>
>>>
>> org.structr.rest.constraint.ResourceConstraint$2.execute(ResourceConstraint.java:153)
>>>  at
>>>
>>>
>> org.structr.core.node.TransactionCommand.execute(TransactionCommand.java:61)
>>>  at
>>>
>>>
>> org.structr.rest.constraint.ResourceConstraint.doDelete(ResourceConstraint.java:129)
>>>  at
>>>
>> org.structr.rest.servlet.JsonRestServlet.doDelete(JsonRestServlet.java:188)
>>>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
>>>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>>>  at
>>>
>>>
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
>>>  at
>>>
>>>
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>>>  at
>>>
>>>
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
>>>  at
>>>
>>>
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
>>>  at
>>>
>>>
>> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
>>>  at
>>>
>>>
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
>>>  at
>>>
>>>
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
>>>  at
>>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
>>>  at
>>>
>>>
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
>>>  at
>>>
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:403)
>>>  at
>>>
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:301)
>>>  at
>>>
>>>
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:162)
>>>  at
>>>
>>>
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:140)
>>>  at
>>>
>>>
>> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
>>>  at
>>>
>>>
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
>>>  at
>>>
>>>
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>>>  at java.lang.Thread.run(Thread.java:679)
>>>
>>> Interestingly, all node properties (besides id) are empty.
>>>
>>> Greetings
>>>
>>> Axel
>>>
 Sorry, I meant we had this with 1.4.2, but nevertheless I will
 double-check 1.5 now ..


 Am 16.11.2011 22:28, schrieb Peter Neubauer:
> Axel,
> please do, as we have found and squashed a number of potential
> problems in QA for 1.5 after 1.4.1
>
> 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
>
>

Re: [Neo4j] The cypher project in neo4j-community has errors in eclipse

2011-11-17 Thread Eric Liang
On 11/17/2011 02:46 PM, Anders Nawroth wrote:
> Hi!
>
>>  From the discussion ( http://neo4j.org/forums/#nabble-td3217906 ),
>> Anders Nawroth said neo4j-cypher works with Eclipse Indigo, so I
>> installed a fresh latest version of Eclipse, but still not work.
> It worked when I wrote the instructions in the readme file. I've seen 
> that there's now a problem, but haven't been able to fix it.
Thanks Anders.

Well, that's not good news. By the way, is that problem the same as
posted in my previous mail?

Eric

-- 
-BEGIN GEEK CODE BLOCK-
Version: 3.1
GCM/CS/E/MU/P d+(-) s: a- C++ UL$ P+>++ L++ E++ W++ N+ o+>++ K+++ w !O
M-(+) V-- PS+ PE+ Y+ PGP++ t? 5? X? R+>* tv@ b DI-- D G++ e++>+++@ h*
r !y+
--END GEEK CODE BLOCK--

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


Re: [Neo4j] Sampling a Neo4j instance?

2011-11-17 Thread Anders Lindström

Thanks Michael for this creative idea.

But is it possible to query for _all_ objects in a Lucene index? As I 
understand it, I need at least the name of an index key field, e.g. 'title', 
right? What I would like to do is basically query for * (without knowing 
_anything_ but the index name, i.e. not even names of index keys) and then have 
the results randomly sorted.

Also, when and on what collection is the actual sorting performed? It seems to 
me an approach like this would sort all entries in the IndexHits first, and 
then we can start going through them. For a large index, this doesn't scale as 
sorting is O(nlog n). On the StackOverflow link it says "This doesn't consume 
any I/O when shuffling the results.", but I cannot understand how this is. What 
if the resulting IndexHits does not fit into memory, then we need to go to disk 
for shuffling too?


Lastly, thanks CG. I've implemented your suggestion and it seems to be working 
fine!

> From: michael.hun...@neotechnology.com
> Date: Thu, 10 Nov 2011 11:14:32 +0100
> To: user@lists.neo4j.org
> Subject: Re: [Neo4j] Sampling a Neo4j instance?
> 
> Probably using an index for your nodes (could be an auto-index).
> 
> And then using an random shuffling of the results? You can pass in a lucene 
> query object or query string to index.query(queryOrQueryObject).
> 
> Sth like this 
> http://stackoverflow.com/questions/7201638/lucene-2-9-2-how-to-show-results-in-random-order
> 
> perhaps there is also some string based lucene query/sort syntax for it.
> 
> Michael
> 
> Am 10.11.2011 um 11:01 schrieb Chris Gioran:
> 
> > Answers inline.
> > 
> > 2011/11/9 Anders Lindström :
> >> 
> >> Thanks to the both of you. I am very grateful that you took your time to 
> >> put this into code -- how's that for community!
> >> I presume this way of getting 'highId' is constant in time? It looks 
> >> rather messy though -- is it really the most straightforward way to do it?
> > 
> > This is the safest way to do it, that takes into consideration crashes
> > and HA cluster membership.
> > 
> > Another way to do it is
> > 
> > long highId = db.getConfig().getIdGeneratorFactory().get( IdType.NODE
> > ).getHighId();
> > 
> > which can return the same value with the first, if some conditions are
> > met. It is shorter and cast-free but i'd still use the first way.
> > 
> > getHighId() is a constant time operation for both ways described - it
> > is just a field access, with an additional long comparison for the
> > first case.
> > 
> >> I am thinking about how efficient this will be. As I understand it, the 
> >> "sampling misses" come from deleted nodes that once was there. But if I 
> >> remember correctly, Neo4j tries to reuse these unused node indices when 
> >> new nodes are added. But is an unused node index _guaranteed_ to be used 
> >> given that there is one, or could inserting another node result in 
> >> increasing 'highId' even though some indices below it are not used?
> > 
> > During the lifetime of a Neo4j instance there is no id reuse for Nodes
> > and Relationships - deleted ids are saved however and will be reused
> > the next time Neo4j starts. This means that if during run A you
> > deleted nodes 3 and 5, the first two nodes returned by createNode() on
> > the next run will have ids 3 and 5 - so highId will not change.
> > Additionally, during run A, after deleting nodes 3 and 5, no new nodes
> > would have the id 3 or 5. A crash (or improper shutdown) of the
> > database will break this however, since the ids-to-recycle will
> > probably not make it to disk.
> > 
> > So, in short, it is guaranteed that ids *won't* be reused in the same
> > run but not guaranteed to be reused between runs.
> > 
> >> My conclusion is that the "sampling misses" will increase with index usage 
> >> sparseness and that we will have a high rate of "sampling misses" when we 
> >> had many deletes and few insertions recently. Would you agree?
> > 
> > Yes, that is true, especially given the cost of the "wasted" I/O and
> > of handling the exception. However, this cost can go down
> > significantly if you keep a hash set for the ids of nodes you have
> > deleted and check that before asking for the node by id, instead of
> > catching an exception. Persisting that between runs would move you
> > away from encapsulated Neo4j constructs and would also be more
> > efficient.
> > 
> >> Thanks again.
> >> Regards,Anders
> >> 
> >>> Date: Wed, 9 Nov 2011 19:30:36 +0200
> >>> From: chris.gio...@neotechnology.com
> >>> To: user@lists.neo4j.org
> >>> Subject: Re: [Neo4j] Sampling a Neo4j instance?
> >>> 
> >>> Hi,
> >>> 
> >>> Backing Jim's algorithm with some code:
> >>> 
> >>> public static void main( String[] args )
> >>> {
> >>> long SAMPLE_SIZE = 1;
> >>> EmbeddedGraphDatabase db = new EmbeddedGraphDatabase(
> >>> "path/to/db/" );
> >>> // Determine the highest possible id for the node store
> >>> long highId = ( (NeoStoreX

Re: [Neo4j] Record not in use problem and solution

2011-11-17 Thread Mattias Persson
"Removing from index": is that done by looking at properties and removing
them from the index for every property. If that's the case then this is
expected since the node has been deleted just before.

2011/11/17 Peter Neubauer 

> Axel,
> Can you isolate this into a test, and maybe send the messages.log off list
> for us to look at?
> On Nov 17, 2011 12:09 AM, "Axel Morgner"  wrote:
>
> > Sorry to say, but I can reproduce the behaviour with 1.5, too.
> >
> > Without deleting the node from the index manually, I get still this
> > org.neo4j.kernel.impl.nioneo.store.InvalidRecordException:
> >
> > 17.11.2011 00:01:48 org.structr.core.node.TransactionCommand execute
> > WARNUNG: Transaction failure
> > org.neo4j.kernel.impl.nioneo.store.InvalidRecordException: Record[46]
> > not in use
> > at
> >
> org.neo4j.kernel.impl.nioneo.store.NodeStore.getRecord(NodeStore.java:215)
> > at
> > org.neo4j.kernel.impl.nioneo.store.NodeStore.getRecord(NodeStore.java:96)
> > at
> >
> >
> org.neo4j.kernel.impl.nioneo.xa.WriteTransaction.nodeDelete(WriteTransaction.java:683)
> > at
> >
> >
> org.neo4j.kernel.impl.persistence.PersistenceManager.nodeDelete(PersistenceManager.java:136)
> > at
> > org.neo4j.kernel.impl.core.NodeManager.deleteNode(NodeManager.java:847)
> > at org.neo4j.kernel.impl.core.NodeImpl.delete(NodeImpl.java:266)
> > at org.neo4j.kernel.impl.core.NodeProxy.delete(NodeProxy.java:57)
> > at
> org.structr.core.entity.AbstractNode.delete(AbstractNode.java:1358)
> > at
> >
> >
> org.structr.rest.constraint.ResourceConstraint$2.execute(ResourceConstraint.java:153)
> > at
> >
> >
> org.structr.core.node.TransactionCommand.execute(TransactionCommand.java:61)
> > at
> >
> >
> org.structr.rest.constraint.ResourceConstraint.doDelete(ResourceConstraint.java:129)
> > at
> >
> org.structr.rest.servlet.JsonRestServlet.doDelete(JsonRestServlet.java:188)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
> > at
> >
> >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
> > at
> >
> >
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> > at
> >
> >
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
> > at
> >
> >
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
> > at
> >
> >
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
> > at
> >
> >
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
> > at
> >
> >
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
> > at
> > org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
> > at
> >
> >
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
> > at
> >
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:403)
> > at
> >
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:301)
> > at
> >
> >
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:162)
> > at
> >
> >
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:140)
> > at
> >
> >
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
> > at
> >
> >
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> > at
> >
> >
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> > at java.lang.Thread.run(Thread.java:679)
> >
> > Interestingly, all node properties (besides id) are empty.
> >
> > Greetings
> >
> > Axel
> >
> > > Sorry, I meant we had this with 1.4.2, but nevertheless I will
> > > double-check 1.5 now ..
> > >
> > >
> > > Am 16.11.2011 22:28, schrieb Peter Neubauer:
> > >> Axel,
> > >> please do, as we have found and squashed a number of potential
> > >> problems in QA for 1.5 after 1.4.1
> > >>
> > >> 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
> > >>
> > >> http://www.neo4j.org  - NOSQL for the Enterprise.
> > >> http://startupbootcamp.org/- Öresund - Innovation happens HERE.
> > >>
> > >>
> > >>
> > >> On Wed, Nov 16, 2011 at 10:27 PM, Axel Morgner
> > wrote:
> > >>> Using neo4j 1.4.1 we had some exceptions like
> > >>>
> > >>> 15.11.2011 18:16:11 org.structr.core.entity.AbstractNode setProperty
> > >>> WARNUNG: Exception in setProperty
> > >>> org.neo4j.kernel.impl.nioneo.store.InvalidRecordException: Record[22]
> > >>> not in use
> > >>> at
> > >>>
> >
> org.neo4j.kernel.impl.nioneo.st