Re: [Neo4j] Odd Result Comparing Nodes...

2011-10-24 Thread Rick Bullotta
Thanks! I had forgotten that. 

On Oct 24, 2011, at 7:39 PM, "Michael Hunger" 
 wrote:

> No because they might be two different objects (node-proxies pointing to 
> node-manager) in memory.
> 
> But node1.equals(node2) evaluates to true.
> 
> Michael
> 
> Am 24.10.2011 um 15:22 schrieb Rick Bullotta:
> 
>> I guess I never tried/noticed this before, but if two Node objects refer to 
>> the same node (getId() == the same), shouldn't the following evaluate as 
>> true?
>> 
>> Node node1;
>> Node node2;
>> 
>> somehow they get set...
>> 
>> If(node1 == node2) {
>> }
>> ___
>> 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] Spring Data Graph 2.0.0 and Cypher queries using Repositories

2011-10-24 Thread Michael Hunger
Thanks for the feedback.

{param} should use in all caess.

I create a test for you issue and report back to you.

Cheers

Michael

Am 24.10.2011 um 14:41 schrieb Tero Paananen:

> I just upgraded to Spring Data Graph for Neo4J 2.0.0.M1 and it  
> looks like certain things changed for the worse for my needs.
> 
> Just looking for clarification of whether these changes are
> permanent or to be addressed before final release.
> 
> I'm using Cypher queries defined in Repository classes, e.g.:
> 
> @Repository
> public interface CustomRepository extends GraphRepository {
>   @Query(value = "start u = node:user(name = '%foo') match 
> (u)-[:KNOWS*1..%depth]->() return u", type = QueryType.Cypher)
>   Iterable getConnections(@Param("foo") String foo, @Param("depth") 
> Integer depth);
> }
> 
> This used to work just fine in 1.1.0.RELEASE.
> 
> In 2.0.0.M01 %foo should be {foo} and %depth produces a syntax
> error regardless of whether I specify it with %depth or {depth}.
> Same with skip and limit instructions:
> 
> .. return u skip %skip limit %limit  
> 
> used to work just fine, however
> 
> .. return u skip {skip} limit {limit}
> 
> no longer works.
> 
> I know I could probably replicate this behavior using the
> Neo4JTemplate functionality, but I'm not sure that's actually
> a better way of doing that, considering how convenient it is
> to create queries with the @Query annotation.
> 
> Your thoughts? And what would be my best options for alternatives
> at this point?
> 
> Thanks!
> 
> -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] Odd Result Comparing Nodes...

2011-10-24 Thread Michael Hunger
No because they might be two different objects (node-proxies pointing to 
node-manager) in memory.

But node1.equals(node2) evaluates to true.

Michael

Am 24.10.2011 um 15:22 schrieb Rick Bullotta:

> I guess I never tried/noticed this before, but if two Node objects refer to 
> the same node (getId() == the same), shouldn't the following evaluate as true?
> 
> Node node1;
> Node node2;
> 
> somehow they get set...
> 
> If(node1 == node2) {
> }
> ___
> 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] Default Analyzer in Index Framework

2011-10-24 Thread Rick Bullotta
When not using fulltext indexing, what Lucene Analyzer class does Neo4J use?  
It seems that non-fulltext index searches are case sensitive - we'd like to 
change that behavior.

Thanks for any help/guidance/examples!

Rick

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


[Neo4j] Odd Result Comparing Nodes...

2011-10-24 Thread Rick Bullotta
I guess I never tried/noticed this before, but if two Node objects refer to the 
same node (getId() == the same), shouldn't the following evaluate as true?

Node node1;
Node node2;

somehow they get set...

If(node1 == node2) {
}
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Spring Data Graph 2.0.0 and Cypher queries using Repositories

2011-10-24 Thread Tero Paananen
I just upgraded to Spring Data Graph for Neo4J 2.0.0.M1 and it  
looks like certain things changed for the worse for my needs.

Just looking for clarification of whether these changes are
permanent or to be addressed before final release.

I'm using Cypher queries defined in Repository classes, e.g.:

@Repository
public interface CustomRepository extends GraphRepository {
   @Query(value = "start u = node:user(name = '%foo') match 
(u)-[:KNOWS*1..%depth]->() return u", type = QueryType.Cypher)
   Iterable getConnections(@Param("foo") String foo, @Param("depth") 
Integer depth);
}

This used to work just fine in 1.1.0.RELEASE.

In 2.0.0.M01 %foo should be {foo} and %depth produces a syntax
error regardless of whether I specify it with %depth or {depth}.
Same with skip and limit instructions:

.. return u skip %skip limit %limit  

used to work just fine, however

.. return u skip {skip} limit {limit}

no longer works.

I know I could probably replicate this behavior using the
Neo4JTemplate functionality, but I'm not sure that's actually
a better way of doing that, considering how convenient it is
to create queries with the @Query annotation.

Your thoughts? And what would be my best options for alternatives
at this point?

Thanks!

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


[Neo4j] Neo4jRestNet Cypher Plugin

2011-10-24 Thread KanTube
I have push a code update that implements the Cypher plugin

https://github.com/SepiaGroup/Neo4jRestNet

The interface supports all of the START, MATCH, WHERE and RETURN clauses
(except the Type function on the Where clause – coming soon.) Blow are some
examples.  The last two examples show an alternate syntax that can be used
with any clause.  I have not implemented the Order by, Skip, Limit or
Funcitons yet.  

Romiko/Tatham if you can review the syntax and make suggestions I will try
to implement them, otherwise you should be able to incorporate this into
your code with minimal modifications.   Also you may want to look at how I
parse the Expression tree.  I have not had time to review the update you
just posted for paging queries but that sounds very interesting.   

// Basic Cypher query
CypherQuery c1 = new CypherQuery();

c1.Start(s => s.Node("A", 0));
c1.Return( r => r.Node("A"));

DataTable tbl = Cypher.Post(c1);

// c1.ToString() = "START A=node(0) RETURN A"


// Cypher with Match clause
CypherQuery c2 = new CypherQuery();

c2.Start(s => s.Node("A", 0));
c2.Match(m => m.Node("A").To("r", "Likes").Node("B"));
c2.Return(r => r.Node("A").Relationship("r").Node("B"));

tbl = Cypher.Post(c2);

// c2.ToString() = "START A=node(0) MATCH (A) -[r:Likes]-> (B)  RETURN A, r,
B"


// Cypher with multi start and return optional property
CypherQuery c3 = new CypherQuery();
c3.Start(s => s.Node("A", 0, 1));
c3.Match(m => m.Node("A").Any("r", "Likes").Node("C"));
c3.Return(r => r.Node("C").Node("C").Property("Name?"));

tbl = Cypher.Post(c3);

// c3.ToString() = "START A=node(0,1) MATCH (A) -[r:Likes]- (C)  RETURN C,
C.Name?"

// Multi Start
CypherQuery c4 = new CypherQuery();
c4.Start(s => s.Node("A", 0).Node("B",1));
c4.Return(r => r.Node("A").Node("B"));

tbl = Cypher.Post(c4);

// C4.ToString() = "START A=node(0), B=node(1) RETURN A, B"

// Cypher with Where clause
CypherQuery c5 = new CypherQuery();
c5.Start(s => s.Node("A", 0, 1));
c5.Where(w => w.Node("A").Property("Age?") < 30 &&
w.Node("A").Property("Name?") == "Tobias" || !(w.Node("A").Property("Name?")
== "Tobias"));
c5.Return(r => r.Node("A"));

tbl = Cypher.Post(c5.ToString());

// C5.ToString() = "START A=node(0,1) WHERE A.Age? < 30 and A.Name? =
'Tobias' or not(A.Name? = 'Tobias') RETURN A"

// Alt syntax
CypherQuery c6 = new CypherQuery();
c6.Start(s =>   {
s.Node("A", 0);
s.Node("B", 1);
return s;
});

c6.Return(r =>  {
r.Node("A");
r.Node("B");
return r;
});

tbl = Cypher.Post(c6);

// c6.ToString = "START A=node(0), B=node(1) RETURN A, B"

// Alt syntax
CypherQuery c7 = new CypherQuery();
c7.Start(s => s.Node("A", 0));
c7.Start(s => s.Node("B", 1));

c7.Return(r => r.Node("A"));
c7.Return(r => r.Node("B"));

tbl = Cypher.Post(c7);
// c7.ToString = "START A=node(0), B=node(1) RETURN A, B"



--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4jRestNet-Cypher-Plugin-tp3449054p3449054.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] [SOLVED] Traversing graph after adding node

2011-10-24 Thread Peter Neubauer
Hi there,
so the problem is solved for you? If you have more questions, maybe
you can post a GIST so I can have a look?

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 Mon, Oct 24, 2011 at 9:12 AM, Rubicon  wrote:
> Realized, that I've to give the hole path to the node I'm looking fore...
> have:
> [refNode]USER--->[user]HAS_OCCUPATION>[occupation]
> For some reason the traverser
>        Traverser usersTraverser = firstNode.traverse(Order.BREADTH_FIRST,
>                StopEvaluator.END_OF_GRAPH,
> ReturnableEvaluator.ALL_BUT_START_NODE,
>                RelTypes.HAS_OCCUPATION, Direction.OUTGOING);
> wouldn't find the [occupation] node. Adding additional parameters to the
> traverser (RelTypes.USER, Direction.OUTGOING), and implementing the
> ReturnableEvaluator to return
> currentPosition.lastRelationshipTraversed().isType(RelTypes.HAS_OCCUPATION)
> have done the job.
> Don't have to commit the transaction also.
>
> --
> View this message in context: 
> http://neo4j-community-discussions.438527.n3.nabble.com/Traversing-graph-after-adding-node-tp3448023p3448255.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] Neo4jRestNet Update

2011-10-24 Thread Peter Neubauer
Tatham,
yes, serialization is an issue in that the JSON needs to be built
before sending over the request. What you could do is to trim the
query down by not pulling out the nodes, but just the properties you
need (including node IDs) which will dramatically change the amount of
data transferred, see e.g.

http://docs.neo4j.org/chunked/snapshot/cypher-plugin.html#rest-api-send-queries-with-parameters

or

http://docs.neo4j.org/chunked/snapshot/gremlin-plugin.html#rest-api-group-count

Would that work?

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 Mon, Oct 24, 2011 at 7:35 AM, Tatham Oddie  wrote:
> More info:
>
> That's all transparent ... consumers of our client just enumerate the result 
> like normal and see no difference. Under the covers, this gets split up into 
> pages of 100 nodes loaded on-demand.
>
> Added it because we wanted to pull out 38k nodes from a query and the REST 
> plugin was exploding the Java heap space trying to append the string. :) (Um, 
> streaming anyone? ;))
>
>
> -- Tatham
>
>
> -Original Message-
> From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
> Behalf Of Romiko Derbynew
> Sent: Monday, 24 October 2011 10:46 PM
> To: Neo4j user discussions
> Subject: Re: [Neo4j] Neo4jRestNet Update
>
> Tatham has also added support for paging queries, so queries returning more 
> than 100 results are retrieved via an enumerator per 100 results, this 
> optimises the heap usage as well, by leveraging the groovy Take and Drop 
> functions.
>
> Cheers.
>
> -Original Message-
> From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
> Behalf Of Tatham Oddie
> Sent: Friday, 21 October 2011 4:37 PM
> To: Neo4j user discussions
> Subject: Re: [Neo4j] Neo4jRestNet Update
>
> Hi Kan,
>
> FYI - we added parametized Gremlin queries in our implementation and have 
> seen a nice memory heap improvement on the Java side as a result.
>
> That is ... instead of:
>
> g.v(123).outE[[label:'FOO']]
>
> we send:
>
> {
>  query: 'g.v(p0).outE[[label:p1]]',
>  params: {
>    p0: 123,
>    p1: 'FOO'
>  }
> }
>
> This allows the query to be cached by neo4j and then just called with 
> different parameters later.
>
>
> -- Tatham
>
>
> -Original Message-
> From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
> Behalf Of KanTube
> Sent: Thursday, 20 October 2011 9:36 AM
> To: user@lists.neo4j.org
> Subject: [Neo4j] Neo4jRestNet Update
>
> fwiw...
>
> I updated my .Net wrapper
> https://github.com/SepiaGroup/Neo4jRestNet/
>
> you can now use LINQ on the flilter and sort commands for example
>
> Node MyNode = Node.GetNode(123);
> GremlinScript script = new GremlinScript(MyNode)
>        .Out("Like")
>        .Filter(it => it.GetProperty("MyProp").ToLowerCase() == "TestValue" ||
> it.GetProperty("AnotherProp").Contains("SomeValue"))
>
> IEnumerable ReturnNodes = Gremlin.Post(script);
>
>
> You can also return a DataTable
>
> GremlinScript script = new GremlinScript();
> script.NewTable("t")
>        .NodeIndexLookup(new Dictionary() { { "FirstName" , 
> "Jack"
> }, { "LastName", "Shaw" } })
>        .Filter(it => it.GetProperty("UID") == "jshaw")
>        .As("UserNode")
>        .OutE("Like")
>        .As("LikeRel")
>        .InV()
>        .As("FriendNode")
>        .Table("t", "UserNode", "LikeRel", "FriendNode")
>        .Append("{{it}}{{it.getProperty('{0}')}}{{it.getProperty('{1}')}} >> 
> -1; t","Date", "FirstName");
>
> DataTable tbl = Gremlin.GetTable(script);
>
>
> The above table example will submit the following Gremlin script to Neo4j:
>
> t = new Table();
> g.V[['FirstName':'Jack','LastName':'Shaw']]
>        .filter{it.getProperty('UID') == 'jshaw'}
>        .as('UserNode')
>        .outE('Likes')
>        .as('LikeRel')
>        .inV()
>        .as('FriendNode')
>        .table(t,
> ['UserNode','LikeRel','FriendNode']){it}{it.getProperty('Date')}{it.getProperty('FirstName')}
>>> -1; t");
>
> And the returned table will have column names of "UserNode", "LikeRel", 
> "FriendNode" with typed values of Node, DateTime, string (assuming the 
> properties are stored with the correct types)
>
>
>
>
> --
> View this message in context: 
> http://neo4j-community-discussions.438527.n3.nabble.com/Neo4jRestNet-Update-tp3436032p3436032.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] [SOLVED] Traversing graph after adding node

2011-10-24 Thread Rubicon
Realized, that I've to give the hole path to the node I'm looking fore...
have:
[refNode]USER--->[user]HAS_OCCUPATION>[occupation]
For some reason the traverser
Traverser usersTraverser = firstNode.traverse(Order.BREADTH_FIRST,
StopEvaluator.END_OF_GRAPH,
ReturnableEvaluator.ALL_BUT_START_NODE,
RelTypes.HAS_OCCUPATION, Direction.OUTGOING);
wouldn't find the [occupation] node. Adding additional parameters to the
traverser (RelTypes.USER, Direction.OUTGOING), and implementing the
ReturnableEvaluator to return
currentPosition.lastRelationshipTraversed().isType(RelTypes.HAS_OCCUPATION)
have done the job.
Don't have to commit the transaction also.

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Traversing-graph-after-adding-node-tp3448023p3448255.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] Iterable handling in unmanaged server extension

2011-10-24 Thread Michael Hunger
It's all jersey there.

Michael

Am 24.10.2011 um 05:07 schrieb Brendan cheng:

> 
> Hi,
> is the Neo4j specific annotations for managed server plugin still available 
> for unmanaged extension?Or do I have to use all Jersey annotations instead?
> Regards,
> Brendan
> 
> 
>> From: peter.neuba...@neotechnology.com
>> Date: Sun, 23 Oct 2011 04:46:02 +
>> To: user@lists.neo4j.org
>> Subject: Re: [Neo4j] Iterable handling in unmanaged server extension
>> 
>> Brendan,
>> the docs for the API are at
>> http://docs.neo4j.org/chunked/snapshot/rest-api.html, let us know if
>> this is good info for you.
>> 
>> Regarding the filtering, Jim, do you have any thoughts on this? It
>> seems that this looks a lot like the security rules that are in the
>> server, see 
>> http://docs.neo4j.org/chunked/snapshot/security-server.html#_server_authorization_rules
>> . In there, you can intercept access to the REST API faine-grained. If
>> you got access to the database instance, you could even look up nodes
>> and act according to the content, as you mentioned.
>> 
>> Would having access to a database instance from within a security rule
>> be a solution to your usecase?
>> 
>> Otherwise, yes, writing your own REST API is of course possible with
>> the unmanaged extensions. Let me know if I can help you with that.
>> 
>> 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 Sun, Oct 23, 2011 at 2:19 AM, Brendan cheng  wrote:
>>> I'm trying to write my own restful api so that for each request a check of 
>>> password with usernode is needed and response will depends who the user is 
>>> and which method the user request.  Because your restful api only return 
>>> node relationship and path and their iterable, certain info inside the 
>>> property will not be able to be hidden for user, it seems there is only the 
>>> unmanaged way can achieve it. right? so I will have managed something 
>>> similar to your api.  Your restful api is quite complicated to me to 
>>> follow. any doc of it?
>>> 
>>> brendan
>>> 
>>> -Original Message-
>>> 
>>> From: Peter Neubauer
>>> Sent: 23 Oct 2011 01:09:45 GMT
>>> To: Neo4j user discussions
>>> Subject: Re: [Neo4j] Iterable handling in unmanaged server extension
>>> 
>>> Brendan,
>>> are these iterables of Nodes, Relationships or Properties? If so, you
>>> should not need to do unmanaged extension but just write your server
>>> plugin, http://docs.neo4j.org/chunked/snapshot/server-plugins.html
>>> 
>>> Otherwise, what kind of return are you looking for (maybe pseudo code)?
>>> 
>>> 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 Sat, Oct 22, 2011 at 11:19 AM, Brendan cheng  wrote:
 
 Hi,
 I'm trying to produce Iterable results from unmanaged server extension and 
 not sure how to achieve it.In your code, this should already be done so. 
 �Could you show me where the code is which I tried to find but failed?
 Thanks in advance,
 Brendan
 ___
 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

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


[Neo4j] Traversing graph after adding node

2011-10-24 Thread Rubicon
Hi @ all,

got a little problem here:
I'm trying to add a node to a graph like this
Node userNode = createUser(tmp);
referenceNode.createRelationshipTo(userNode, RelTypes.USER);
tx.success();
tx.finish();
tx = graphDb.beginTx();
addOccupation(userNode, tmp[3]);


The userNode should be than added to the graph. In addOccupation I'm doing
the following:
Node firstNode = getFirstNode();
Traverser usersTraverser = firstNode.traverse(Order.BREADTH_FIRST,
StopEvaluator.END_OF_GRAPH, 
ReturnableEvaluator.ALL_BUT_START_NODE,
RelTypes.HAS_OCCUPATION, Direction.OUTGOING);

if (usersTraverser.currentPosition() != null) {
for (Node occupationNode : usersTraverser) {

if(occupationNode.getProperty("occupation").equals(occupations.get(Integer.parseInt(occupation
{
user.createRelationshipTo(occupationNode, 
RelTypes.HAS_OCCUPATION);
return;
}
}
}
Node newOccupation = graphDb.createNode();
newOccupation.setProperty("type", "Occupation");
newOccupation.setProperty("occupation",
occupations.get(Integer.parseInt(occupation)));

Checking if there is already a node with certain occupation and if not, I'm
adding a new one. Otherwise a relationship is made to the found one.

The problem is that after couple turns a node with the occupation that I'm
looking for is there, but the usersTraverser.currentPosition() is always
null...

Assume, that the graph is committed every time when a new user is added, so
the newest graph can be traversed.

Where is my error? What am I doing wrong?
Thanks for your replays :)


--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Traversing-graph-after-adding-node-tp3448023p3448023.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] Batch Inserter, Node Property error

2011-10-24 Thread Christopher Schmidt
Send a pull request (https://github.com/neo4j/community/pull/73)

On Mon, Oct 24, 2011 at 6:38 AM, Christopher Schmidt <
fakod...@googlemail.com> wrote:

> Hi all,
>
> I am writing a Scala wrapper for the batch insertion interfaces. While
> doing so, I have the problem that properties are not written to DB.
> I wrote a little test case for Java, same error. The code below prints out:
>
> 2 has property keys [2, 1]
> 2 has property keys []
>
> Am I doing something wrong?
>
> Regards Christopher
>
> PS: Neo4j version 1.5-SNAPSHOT
>
>
>
> public class JavaMain {
> public static void main(String[] args) {
>
> String path = "/tmp/temp-neo-batch-test";
>
> BatchInserter inserter = new BatchInserterImpl(path);
> BatchInserterIndexProvider provider = new
> LuceneBatchInserterIndexProvider(inserter);
> String name = "users";
> BatchInserterIndex index = provider.nodeIndex(name,
> LuceneIndexImplementation.EXACT_CONFIG);
>
> GraphDatabaseService gds = inserter.getGraphDbService();
>
> Node myNode = gds.createNode();
> long id = myNode.getId();
>
> myNode.setProperty("1", "one");
> myNode.setProperty("2", "two");
>
> index.flush();
> System.out.println(myNode.getId() + " has property keys " +
> myNode.getPropertyKeys());
>
> provider.shutdown();
> inserter.shutdown();
>
> GraphDatabaseService db = new EmbeddedGraphDatabase(path);
> Node node1 = db.getNodeById(id);
> System.out.println(node1.getId() + " has property keys " +
> node1.getPropertyKeys());
> db.shutdown();
> }
> }
>
> --
> 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


Re: [Neo4j] Neo4jRestNet Update

2011-10-24 Thread Tatham Oddie
More info:

That's all transparent ... consumers of our client just enumerate the result 
like normal and see no difference. Under the covers, this gets split up into 
pages of 100 nodes loaded on-demand.

Added it because we wanted to pull out 38k nodes from a query and the REST 
plugin was exploding the Java heap space trying to append the string. :) (Um, 
streaming anyone? ;))


-- Tatham


-Original Message-
From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
Behalf Of Romiko Derbynew
Sent: Monday, 24 October 2011 10:46 PM
To: Neo4j user discussions
Subject: Re: [Neo4j] Neo4jRestNet Update

Tatham has also added support for paging queries, so queries returning more 
than 100 results are retrieved via an enumerator per 100 results, this 
optimises the heap usage as well, by leveraging the groovy Take and Drop 
functions.

Cheers.

-Original Message-
From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
Behalf Of Tatham Oddie
Sent: Friday, 21 October 2011 4:37 PM
To: Neo4j user discussions
Subject: Re: [Neo4j] Neo4jRestNet Update

Hi Kan,

FYI - we added parametized Gremlin queries in our implementation and have seen 
a nice memory heap improvement on the Java side as a result.

That is ... instead of:

g.v(123).outE[[label:'FOO']]

we send:

{
  query: 'g.v(p0).outE[[label:p1]]',
  params: {
p0: 123,
p1: 'FOO'
  }
}

This allows the query to be cached by neo4j and then just called with different 
parameters later.


-- Tatham


-Original Message-
From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
Behalf Of KanTube
Sent: Thursday, 20 October 2011 9:36 AM
To: user@lists.neo4j.org
Subject: [Neo4j] Neo4jRestNet Update

fwiw...

I updated my .Net wrapper
https://github.com/SepiaGroup/Neo4jRestNet/

you can now use LINQ on the flilter and sort commands for example

Node MyNode = Node.GetNode(123);
GremlinScript script = new GremlinScript(MyNode)
.Out("Like")
.Filter(it => it.GetProperty("MyProp").ToLowerCase() == "TestValue" ||
it.GetProperty("AnotherProp").Contains("SomeValue"))

IEnumerable ReturnNodes = Gremlin.Post(script);


You can also return a DataTable 

GremlinScript script = new GremlinScript();
script.NewTable("t")
.NodeIndexLookup(new Dictionary() { { "FirstName" , 
"Jack"
}, { "LastName", "Shaw" } })
.Filter(it => it.GetProperty("UID") == "jshaw") 
.As("UserNode")
.OutE("Like")
.As("LikeRel")
.InV()
.As("FriendNode")
.Table("t", "UserNode", "LikeRel", "FriendNode")
.Append("{{it}}{{it.getProperty('{0}')}}{{it.getProperty('{1}')}} >> 
-1; t","Date", "FirstName");

DataTable tbl = Gremlin.GetTable(script);


The above table example will submit the following Gremlin script to Neo4j:

t = new Table();
g.V[['FirstName':'Jack','LastName':'Shaw']]
.filter{it.getProperty('UID') == 'jshaw'}
.as('UserNode')
.outE('Likes')
.as('LikeRel')
.inV()
.as('FriendNode')
.table(t,
['UserNode','LikeRel','FriendNode']){it}{it.getProperty('Date')}{it.getProperty('FirstName')}
>> -1; t");

And the returned table will have column names of "UserNode", "LikeRel", 
"FriendNode" with typed values of Node, DateTime, string (assuming the 
properties are stored with the correct types)




--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4jRestNet-Update-tp3436032p3436032.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
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Neo4jRestNet Update

2011-10-24 Thread Peter Neubauer
Very nice,
thanks a lot for the update!

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 Mon, Oct 24, 2011 at 6:45 AM, Romiko Derbynew
 wrote:
> Tatham has also added support for paging queries, so queries returning more 
> than 100 results are retrieved via an enumerator per 100 results, this 
> optimises the heap usage as well, by leveraging the groovy Take and Drop 
> functions.
>
> Cheers.
>
> -Original Message-
> From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
> Behalf Of Tatham Oddie
> Sent: Friday, 21 October 2011 4:37 PM
> To: Neo4j user discussions
> Subject: Re: [Neo4j] Neo4jRestNet Update
>
> Hi Kan,
>
> FYI - we added parametized Gremlin queries in our implementation and have 
> seen a nice memory heap improvement on the Java side as a result.
>
> That is ... instead of:
>
> g.v(123).outE[[label:'FOO']]
>
> we send:
>
> {
>  query: 'g.v(p0).outE[[label:p1]]',
>  params: {
>    p0: 123,
>    p1: 'FOO'
>  }
> }
>
> This allows the query to be cached by neo4j and then just called with 
> different parameters later.
>
>
> -- Tatham
>
>
> -Original Message-
> From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
> Behalf Of KanTube
> Sent: Thursday, 20 October 2011 9:36 AM
> To: user@lists.neo4j.org
> Subject: [Neo4j] Neo4jRestNet Update
>
> fwiw...
>
> I updated my .Net wrapper
> https://github.com/SepiaGroup/Neo4jRestNet/
>
> you can now use LINQ on the flilter and sort commands for example
>
> Node MyNode = Node.GetNode(123);
> GremlinScript script = new GremlinScript(MyNode)
>        .Out("Like")
>        .Filter(it => it.GetProperty("MyProp").ToLowerCase() == "TestValue" ||
> it.GetProperty("AnotherProp").Contains("SomeValue"))
>
> IEnumerable ReturnNodes = Gremlin.Post(script);
>
>
> You can also return a DataTable
>
> GremlinScript script = new GremlinScript();
> script.NewTable("t")
>        .NodeIndexLookup(new Dictionary() { { "FirstName" , 
> "Jack"
> }, { "LastName", "Shaw" } })
>        .Filter(it => it.GetProperty("UID") == "jshaw")
>        .As("UserNode")
>        .OutE("Like")
>        .As("LikeRel")
>        .InV()
>        .As("FriendNode")
>        .Table("t", "UserNode", "LikeRel", "FriendNode")
>        .Append("{{it}}{{it.getProperty('{0}')}}{{it.getProperty('{1}')}} >> 
> -1; t","Date", "FirstName");
>
> DataTable tbl = Gremlin.GetTable(script);
>
>
> The above table example will submit the following Gremlin script to Neo4j:
>
> t = new Table();
> g.V[['FirstName':'Jack','LastName':'Shaw']]
>        .filter{it.getProperty('UID') == 'jshaw'}
>        .as('UserNode')
>        .outE('Likes')
>        .as('LikeRel')
>        .inV()
>        .as('FriendNode')
>        .table(t,
> ['UserNode','LikeRel','FriendNode']){it}{it.getProperty('Date')}{it.getProperty('FirstName')}
>>> -1; t");
>
> And the returned table will have column names of "UserNode", "LikeRel", 
> "FriendNode" with typed values of Node, DateTime, string (assuming the 
> properties are stored with the correct types)
>
>
>
>
> --
> View this message in context: 
> http://neo4j-community-discussions.438527.n3.nabble.com/Neo4jRestNet-Update-tp3436032p3436032.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
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Neo4jRestNet Update

2011-10-24 Thread Romiko Derbynew
Tatham has also added support for paging queries, so queries returning more 
than 100 results are retrieved via an enumerator per 100 results, this 
optimises the heap usage as well, by leveraging the groovy Take and Drop 
functions.

Cheers.

-Original Message-
From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
Behalf Of Tatham Oddie
Sent: Friday, 21 October 2011 4:37 PM
To: Neo4j user discussions
Subject: Re: [Neo4j] Neo4jRestNet Update

Hi Kan,

FYI - we added parametized Gremlin queries in our implementation and have seen 
a nice memory heap improvement on the Java side as a result.

That is ... instead of:

g.v(123).outE[[label:'FOO']]

we send:

{
  query: 'g.v(p0).outE[[label:p1]]',
  params: {
p0: 123,
p1: 'FOO'
  }
}

This allows the query to be cached by neo4j and then just called with different 
parameters later.


-- Tatham


-Original Message-
From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
Behalf Of KanTube
Sent: Thursday, 20 October 2011 9:36 AM
To: user@lists.neo4j.org
Subject: [Neo4j] Neo4jRestNet Update

fwiw...

I updated my .Net wrapper
https://github.com/SepiaGroup/Neo4jRestNet/

you can now use LINQ on the flilter and sort commands for example

Node MyNode = Node.GetNode(123);
GremlinScript script = new GremlinScript(MyNode)
.Out("Like")
.Filter(it => it.GetProperty("MyProp").ToLowerCase() == "TestValue" ||
it.GetProperty("AnotherProp").Contains("SomeValue"))

IEnumerable ReturnNodes = Gremlin.Post(script);


You can also return a DataTable 

GremlinScript script = new GremlinScript();
script.NewTable("t")
.NodeIndexLookup(new Dictionary() { { "FirstName" , 
"Jack"
}, { "LastName", "Shaw" } })
.Filter(it => it.GetProperty("UID") == "jshaw") 
.As("UserNode")
.OutE("Like")
.As("LikeRel")
.InV()
.As("FriendNode")
.Table("t", "UserNode", "LikeRel", "FriendNode")
.Append("{{it}}{{it.getProperty('{0}')}}{{it.getProperty('{1}')}} >> 
-1; t","Date", "FirstName");

DataTable tbl = Gremlin.GetTable(script);


The above table example will submit the following Gremlin script to Neo4j:

t = new Table();
g.V[['FirstName':'Jack','LastName':'Shaw']]
.filter{it.getProperty('UID') == 'jshaw'}
.as('UserNode')
.outE('Likes')
.as('LikeRel')
.inV()
.as('FriendNode')
.table(t,
['UserNode','LikeRel','FriendNode']){it}{it.getProperty('Date')}{it.getProperty('FirstName')}
>> -1; t");

And the returned table will have column names of "UserNode", "LikeRel", 
"FriendNode" with typed values of Node, DateTime, string (assuming the 
properties are stored with the correct types)




--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4jRestNet-Update-tp3436032p3436032.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] Iterable handling in unmanaged server extension

2011-10-24 Thread Brendan cheng

Hi,
is the Neo4j specific annotations for managed server plugin still available for 
unmanaged extension?Or do I have to use all Jersey annotations instead?
Regards,
Brendan


> From: peter.neuba...@neotechnology.com
> Date: Sun, 23 Oct 2011 04:46:02 +
> To: user@lists.neo4j.org
> Subject: Re: [Neo4j] Iterable handling in unmanaged server extension
>
> Brendan,
> the docs for the API are at
> http://docs.neo4j.org/chunked/snapshot/rest-api.html, let us know if
> this is good info for you.
>
> Regarding the filtering, Jim, do you have any thoughts on this? It
> seems that this looks a lot like the security rules that are in the
> server, see 
> http://docs.neo4j.org/chunked/snapshot/security-server.html#_server_authorization_rules
> . In there, you can intercept access to the REST API faine-grained. If
> you got access to the database instance, you could even look up nodes
> and act according to the content, as you mentioned.
>
> Would having access to a database instance from within a security rule
> be a solution to your usecase?
>
> Otherwise, yes, writing your own REST API is of course possible with
> the unmanaged extensions. Let me know if I can help you with that.
>
> 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 Sun, Oct 23, 2011 at 2:19 AM, Brendan cheng  wrote:
> > I'm trying to write my own restful api so that for each request a check of 
> > password with usernode is needed and response will depends who the user is 
> > and which method the user request.  Because your restful api only return 
> > node relationship and path and their iterable, certain info inside the 
> > property will not be able to be hidden for user, it seems there is only the 
> > unmanaged way can achieve it. right? so I will have managed something 
> > similar to your api.  Your restful api is quite complicated to me to 
> > follow. any doc of it?
> >
> > brendan
> >
> > -Original Message-
> >
> > From: Peter Neubauer
> > Sent: 23 Oct 2011 01:09:45 GMT
> > To: Neo4j user discussions
> > Subject: Re: [Neo4j] Iterable handling in unmanaged server extension
> >
> > Brendan,
> > are these iterables of Nodes, Relationships or Properties? If so, you
> > should not need to do unmanaged extension but just write your server
> > plugin, http://docs.neo4j.org/chunked/snapshot/server-plugins.html
> >
> > Otherwise, what kind of return are you looking for (maybe pseudo code)?
> >
> > 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 Sat, Oct 22, 2011 at 11:19 AM, Brendan cheng  wrote:
> >>
> >> Hi,
> >> I'm trying to produce Iterable results from unmanaged server extension and 
> >> not sure how to achieve it.In your code, this should already be done so. 
> >> �Could you show me where the code is which I tried to find but failed?
> >> Thanks in advance,
> >> Brendan
> >> ___
> >> 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