Re: [Neo4j] Feedback after evaluation

2011-12-09 Thread espeed
On Thursday, December 8, 2011 2:48:59 AM UTC-6, Dmytrii Nagirniak wrote:

Unfortunately I couldn't see a lot of value in the REST API either.
The core operations that are taken for granted with native bindings
(traversals using poor Ruby constructs) would require to execute HTTP
request (that's what SELECT N+1 in SQL world is).
Or otherwise I would have to wrap all the logic in the traversal queries. It
would significantly overcomplicate the system with HTTP handling logic.


Hi Dmytrii -

Neo4j Server has a built-in Gremlin scripting engine that enables REST
clients to execute transactions in a single HTTP request.

Gremlin is a domain-specific language for graphs written in Groovy. If you
were using a relational database, you would use its domain-specific
language, which is SQL. Same idea.

For the last few weeks, I have been working on Bulbs 0.3, which is a Python
REST client for Neo4j Server, and it has a library of Gremlin templates in a
YAML file. 

The Python methods do named variable substitution on the Gremlin templates
and then execute them via the Neo4j Server Gremlin extension. 

Here's an example:

gremlin.yaml
https://gist.github.com/1450859

element.py 
https://gist.github.com/1450871

You can see the create_indexed_vertex Gremlin script has JSON args. Python
lists and dicts are converted to JSON, and then on the server side, the
Gremlin script converts them into Groovy maps and lists. 

Marko is working on adding the JSONSlurper library import to Gremlin so you
won't have to do the import each time
(https://github.com/tinkerpop/gremlin/issues/259).


 So I decided to write another REST library
 (http:://github.com/dnagir/morpheus), 
 but then gave up realising that you just cannot have a proper abstraction
 over HTTP.
 (I'll probably kill off that repo).

Groovy is pretty simple. Consider reviving Morpheus and using Gremlin for
scripting -- you'll get all the power of native Ruby and Neo4j without the
Java.

When Bulbs 0.3 is released, I'll post the full gremlin.yaml, and you should
be able to use it in Ruby without any mods since it's just YAML.

- James

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

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


Re: [Neo4j] Feedback after evaluation

2011-12-09 Thread espeed

Michael Hunger wrote
 
 you should use native gremlin params where they can be used. otherwise
 you'll blow the scriptengine in the plugin and loose lots of performance
 

Hi Michael -

What do you mean exactly? After the JSON param converts to a map, everything
is a native Groovy param.

- James

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

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


Re: [Neo4j] Feedback after evaluation

2011-12-09 Thread espeed

Michael Hunger wrote
 
 I understood you were just templating the params in there (string
 replacement) which would result in different groovy strings for every set
 of different parameters. Is this correct?
 

The string replacement is done on the client side. When the script is
presented to the extension, it looks like a normal Gremlin script.

For example, the update_indexed_vertex YAML script has three params: nodeId,
properties, indexName. But all the string replacement is done by the client.

By the time the Gremlin extension gets it, the nodeId is an integer, which
is used to look up the node object:

node = g.getRawGraph().getNodeById(5)

The properties are a JSON string, which are immediately converted to a
Groovy map so they can be iterated upon:

MapString, Object properties = slurper.parseText('{age:35,name:James
Thornton}')

The indexName is a string, which is used to look up the actual index:

index = manager.forNodes('people')

Here is what the Gremlin extension actually sees:
https://gist.github.com/1452942

Do see an issue with that?

- James



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

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


Re: [Neo4j] Feedback after evaluation

2011-12-09 Thread espeed

Michael Hunger wrote
 
 The gremlin plugin (as does the cypher plugin) take an map (a json map) as
 params, each of which which you then can refer to everywhere in the
 gremlin script (key == variable name, value == value). So no need for
 JSONSlurper.
 

Ahh, that's different than Rexster's Gremlin extension
(https://github.com/tinkerpop/rexster/wiki/Gremlin-Extension). That makes
things easy.


Michael Hunger wrote
 
 The real problem here lies in the fact that each of your statements (with
 different parameters) will cause the groovy-scripting engine to generate a
 new groovy class, which will in turn
 * cause PermGen OutOfMemory errors as those can't be garbage collected as
 long as the script engine is around
 * will take about factor 100-1000 longer to execute (parsing, class
 generation, loading and such).
 
 For the first issue we have a work-around in the plugin which recreates
 the script-engine every 500 requests (should probably be configurable) but
 this is less than optimal. The second problem will hit you all the time.
 

What do you recommend for the second problem?  And are you saying it will be
100-1000 longer than a normal Groovy or 100-1000 longer than Java? 

Last week when I emailed you, you were looking into a way to store a custom,
server-side Gremlin library. Would that help? 

- James



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

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


Re: [Neo4j] Feedback after evaluation

2011-12-09 Thread espeed
Michael -

If I understand you correctly, then this modified Gremlin script and request
format should solve problem 2:

Gremlin Script:
https://gist.github.com/1453964

Script Engine REST Request that uses params:
https://gist.github.com/1453966

- James

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

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


Re: [Neo4j] Feedback after evaluation

2011-12-09 Thread espeed
Michael -

What if each Gremlin script was scoped inside a Groovy function? 

Example: https://gist.github.com/1454298

Would that help keep things clean?

- James

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

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


Re: [Neo4j] Best practice for User Authentication and Authorization

2011-09-15 Thread espeed

Brendan cheng-2 wrote:
 
 What design pattern do you recommend for user authentication and
 authorization in neo4j graph? I'm searching a simple and flexible way to
 restrict the access to certain part of graph which is dynamically depends
 on the user and role...etc.How to avoid excessive traversing?
 Any idea is appreciated!
 

Use whatever authentication mechanism you want, such as Facebook auth,
Twitter auth, or a home-grown authentication system. 

Store users as nodes, and you can do node-level authorization using a little
metadata and bitwise arithmetic. For example, see... 

How to Build Role-Based Access Control in SQL, by Baron Schwartz (author
of High Performance MySQL) 
Part 1:
http://www.xaprb.com/blog/2006/08/16/how-to-build-role-based-access-control-in-sql/
Part 2:
http://www.xaprb.com/blog/2006/08/18/role-based-access-control-in-sql-part-2/

This is for an SQL-based row-level authorization system, but it could be
adapted to a graph-based node-level system.

- James 

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Best-practice-for-User-Authentication-and-Authorization-tp3338055p3338333.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] neo4j+playframework

2011-09-15 Thread espeed

deviantCode wrote:
 
 wrapping the models into java classes is a bit challenging for me cos i
 cant
 get my head around how the persistence layer will handle that. After the
 post i did a search for a mapper and found jo4neo, and im currently tryn
 to
 use that. Having challenges with how tho make the model persist.
 
 I would be very grateful again if you could give me a small sample model
 implementation for neo such that the controller can persist it.
 

Hi -

Bulbs (http://bulbflow.com) is a Python library that wraps models into
Python classes. I wrote it for Rexster
(https://github.com/tinkerpop/rexster/wiki/), which is another Neo4j REST
server, but the principles are the same.

You can view the source code here:
  
   https://github.com/espeed/bulbs/tree/master/bulbs

Here are the module layers from lowest to highest: 

   rest.py, element.py, index.py graph.py, model.py 

There are a few other modules, but those are the main ones you need to look
at to understand the structure. 

HTH.

- James



--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-neo4j-playframework-tp3338580p3340431.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] Querying a full text index

2011-09-12 Thread espeed
Hi Yaniv -

Something to keep in mind...

It's now easy to use an external full-text index such as Solr,
ElasticSearch, or IndexTank
(http://indextank.com/) for full-text search and then use Neo4j for
rankings.

For example, you could do the full-text query using Solr and have it
return a list of element IDs. Then if you want to use Gremlin for
ranking, you could pass in the list of element IDs to Gremlin as the
starting point of the query, and do a local rank type algorithm
(http://markorodriguez.com/2011/03/30/global-vs-local-graph-ranking/).

To make this work, a few days ago Marko updated Gremlin so you can pass in
multiple element IDs like this:

  g.v(1,2,3,4,5,6,7,8)

See https://groups.google.com/d/topic/gremlin-users/JjOopbFDHMw/discussion

- James

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Querying-a-full-text-index-tp3316241p3330648.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] Returning arbitrary data from gremlin

2011-09-11 Thread espeed
Hi Xavier -

If you would, provide a more detailed description of what the query is
trying to do.

You might look at the Gremlin aggregate, scatter, and gather methods, and I
thought there was a collect() method, but I don't see it in the docs --
Marko, isn't/wasn't that method?).

Here are some docs that might be useful:

Gremlin: Depth First vs. Breadth First
   https://github.com/tinkerpop/gremlin/wiki/Depth-First-vs.-Breadth-First

[Gremlin] The Generalize AsPipe model - back(), loop(), and table()
   https://groups.google.com/d/topic/gremlin-users/5ujhy2bMKMI/discussion

Have Gremlin Talk to Redis in Real Time while It's Walking the Graph
   https://groups.google.com/d/topic/gremlin-users/xhqP-0wIg5s/discussion

And to make things cleaner, you can also create user-define steps:
  https://github.com/tinkerpop/gremlin/wiki/User-Defined-Steps.

For example, here's a user-defined step that builds a tree:
https://gist.github.com/1197179

- James





--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Returning-arbitrary-data-from-gremlin-tp3327047p3327144.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Neo4j Write Performance

2011-09-11 Thread espeed
I added a ticket for this here...

https://github.com/neo4j/community/issues/18

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Write-Performance-tp3323638p3327618.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 Write Performance

2011-09-09 Thread espeed
Hi Guys -

I have been working on loading WordNet (http://wordnet.princeton.edu/) into
Neo4j, and have been using it as an opportunity to tune write performance on
Linux for a Web application I am developing. 

My initial idea was to load WordNet RDF
(http://semanticweb.cs.vu.nl/lod/wn30/) through the Blueprints SailGraph
interface, but then I decided to use NLTK (http://www.nltk.org) and load it
directly from Bulbs into Rexster.

Stephen recently added batch transactions to Rexster
(https://github.com/tinkerpop/rexster-kibbles/tree/master/batch-kibble), but
right now I am not using them because I want to see what type of write
performance you can get in non-batch mode.

The Neo4j performance guides were helpful:

* http://wiki.neo4j.org/content/Performance_Guide
* http://wiki.neo4j.org/content/Linux_Performance_Guide
* http://wiki.neo4j.org/content/Configuration_Settings

As are Peter and Tobias' recommendations to put Neo4j transactions in manual
mode
(https://groups.google.com/d/msg/gremlin-users/vl4IZO7O8H4/20Yc4rUObNcJ) so
you don't have to flush to disk for each write.  

However, manual/batch modes are not practical for writes in a Web
application. It would be cool if there was a tunable parameter where you
could set Neo4j to flush to disk at some interval instead of after every
create/update statement. 

Obviously you would have an issue if the server crashed before it was
written to disk, but this could be mitigated through HA redundancy, and
because it's a tunable parameter, you could dial it up or down depending on
your requirements. 

MongoDB does something similar, and it is reported that a single server can
do 20-30,000 writes per second
(http://www.dbms2.com/2011/04/04/the-mongodb-story/).

Here some of the things Mongo does to make writes fast:

* A memory-mapped data model.
* Deferred writes — a write might take a couple of seconds to actually
persist.
* Optimism — you don’t have to wait for an acknowledgement if you write
something to the database.
* “Upsert in place” – update in place without checking whether you’re doing
a write or insert.

What would it take for Neo4j to approach these levels?

Neo4j does memory-mapped IO:

 
http://wiki.neo4j.org/content/Configuration_Settings#Memory_mapped_I.2FO_settings

There have been talks about adding optimistic locking:

  http://neo4j.org/forums/#nabble-td2891798

And Peter has said that deferred writes are on the drawing board
(http://lists.neo4j.org/pipermail/user/2011-May/008792.html):


Peter Neubauer wrote:
 
 However, we are looking into Neo4j normal mode speedups by having a mode
 that drops the JTA dependencies and thus can relax on the logfile flushing
 requirements for each transaction, by that being able to use the
 underlying
 OS for ordered (deferred) writing, adjustable on a case-by-case level
 (e.g.
 batch inserting big data). This will give Neo4j insertions in this mode
 comparable performance with the batchinserter, while keeping all other
 semantics and layers in place. I hope this can make it into 1.4, and it
 will
 speed up the RDF insertion considerably!
 

Is support for optimistic locking and deferred writes planned for an
upcoming release?

Thanks.

- James

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Write-Performance-tp3323638p3323638.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] Gremlin pipes broken in 1.5

2011-09-09 Thread espeed

Xavier Shay wrote:
 
 I have just upgraded to neo4j 1.5 (brew install neo4j --HEAD) and am
 getting
 the following exception whenever I try to use a pipe:
 curl -H Accept:application/json -X POST -d
 '{script:g.v(1)._().both;}'
 

Hi Xavier -

Gremlin and Pipes has been undergoing a massive refactoring lately. What
happens when you omit the _()?

g.v(1).both()

- James

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Gremlin-pipes-broken-in-1-5-tp3323873p3323895.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] Aggregate queries

2011-09-08 Thread espeed

Marko Rodriguez-2 wrote:
 

 For all nodes in a particular index, how many other nodes are they 
 connected to at depth X? 
 
 Here is how I would do it -- groupCount is not needed.
 
   g.idx(index_name)[[key:value]].both.loop(1){it.loops  depth}.count()
 
 

Thanks Marko. A couple questions...

Won't this count dupes more than once? 

Xavier's requirements of how many other nodes are they connected sounds
like you should only count uniques, and that's why I am checking the size of
groupCount map instead of using count(). Instead of a map you could use a
Set with aggregate(), but I wasn't sure if they'd have the aggregate-loop
fix yet. 

Also Xavier said, For all nodes in a particular index. I took that to mean
all nodes in an index, not all nodes for a particular value in an index,
hence the wildcard query:

index_nodes = g.idx(index_name).get(index_key,Neo4jTokens.QUERY_HEADER +
*)
 
However, I am not sure/can't remember if you can do a wildcard query without
at least one leading character.

- James





--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Aggregate-queries-tp3317720p3319768.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 Write Test Compile Error

2011-09-08 Thread espeed
Hi Guys -

I'm trying to compile and run the write test
(https://svn.neo4j.org/laboratory/users/johan/write-test) from
http://wiki.neo4j.org/content/Linux_Performance_Guide, and I'm getting this
error:

   https://gist.github.com/1205327

Is there a newer version of this?

Thanks.

- James

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Write-Test-Compile-Error-tp3321729p3321729.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Neo4j Write Test Compile Error

2011-09-08 Thread espeed

Bryce Ewing wrote:
 
 You can get this working by replacing the parent pom reference in the
 pom.xml file with:
   parent
 groupIdorg.neo4j.build/groupId
 artifactIdparent-central/artifactId
 version25/version
   /parent
 Instead of the current:
   parent
 groupIdorg.neo4j/groupId
 artifactIdparent-pom/artifactId
 version6/version
   /parent
 
 It still wont work quite as is though.  The build will fail on a license
 check, so do compile like:
 mvn -Dlicense.failIfMissing=false compile
 

Sure enough. Thanks Bryce!


--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Write-Test-Compile-Error-tp3321729p3321821.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] Aggregate queries

2011-09-07 Thread espeed

Xavier Shay wrote:
 
 For all nodes in a particular index, how many other nodes are they
 connected to at depth X?
 

Marko will be able to improve upon this, but try something like this (this
is untested)...

m = [:]
depth = 10
index_name = vertices
index_key = name
index_nodes = g.idx(index_name).get(index_key,Neo4jTokens.QUERY_HEADER +
*).
index_nodes._().both.groupCount(m).loop(2){it.loops  depth}
m.size()

- James


--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Aggregate-queries-tp3317720p3317876.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] Loading WordNet 3.0 RDF into Neo4j?

2011-08-28 Thread espeed

Peter Neubauer wrote:
 
 I would try the blueprints rdf importer. look at my github home
 (peterneubauer) for a project to import rdf from dbpedia which should
 work for any rdf.
 

Thanks Peter!

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Loading-WordNet-3-0-RDF-into-Neo4j-tp3289356p3290448.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] Loading WordNet 3.0 RDF into Neo4j?

2011-08-27 Thread espeed
Has anyone here loaded WordNet 3.0 (http://wordnet.princeton.edu/) into Neo4j
or have pointers for doing so?

WordNet 2.0 is in RDF form (http://www.w3.org/2006/03/wn/wn20/) as well as
3.0 (http://semanticweb.cs.vu.nl/lod/wn30/).

What's the best way to load/convert RDF data into Neo4j?

Thanks!

- James

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Loading-WordNet-3-0-RDF-into-Neo4j-tp3289356p3289356.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] Create Custom Gremlin Steps in Any JVM Language

2011-08-22 Thread espeed
During my experimentation in creating Gremlin user-defined steps
(https://github.com/tinkerpop/gremlin/wiki/User-Defined-Steps), I had a
thought -- what if you could create a Gremlin step using any JVM language?

Well as it turns out, you can. 

I created a library that provides an example for how to write custom,
user-defined Gremlin steps in Jython. 

The library is called mogwai, and it's on Github
(https://github.com/espeed/mogwai).

You should be able to adapt it for any JVM language. 

Here's the example code:

Jython module:
https://github.com/espeed/mogwai/blob/master/mogwai/steps/jython/Gizmo.py

Java Interface:
https://github.com/espeed/mogwai/blob/master/mogwai/interfaces/GizmoType.java

Java Factory you can reuse for each Jython module:
https://github.com/espeed/mogwai/blob/master/mogwai/factories/JythonFactory.java

Groovy script that create the Gremlin steps:
https://github.com/espeed/mogwai/blob/master/examples/gizmo.groovy

Instructions on how to make this work:
https://github.com/espeed/mogwai/blob/master/README


And here's the corresponding thread in the Gremlin Users group
(https://groups.google.com/d/topic/gremlin-users/wVTrJR1OMzQ/discussion).

- James

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Create-Custom-Gremlin-Steps-in-Any-JVM-Language-tp3275424p3275424.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] Are Unique Indices in the Works?

2011-08-06 Thread espeed

Michael Hunger wrote:
 
 What one could do at a lower level is to create operations like
 db.obtainUniqueNode(Map properties,String...idProperties);
 node.obtainUniqueRelationship(dir, type, props, String...idProperties);
 node.obtainUniqueRelationship(dir, type, targetNode, props,
 String...idProperties);
 
 which handle the lock, index lookup and property-update in one go.
 
 That operation can be exposed on the REST layer.
 

Hi Michael -

Yes, ultimately you would have a create or update REST endpoint that would
do something like that. 

BTW I re-read my previous post and realized I may have jumped from
discussing the unique index to the create or update endpoint in a
confusing way so let me clarify:

On Rexster and/or Neo4j Server, there would be a create or update endpoint
that does a silent update if the node already exists. The question then
would be is how do you enforce the unique property on operations that don't
use the endpoint and  how do you (potentially) allow for versioning of the
node.

- James



--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Are-Unique-Indices-in-the-Works-tp3229971p3231501.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] Are Unique Indices in the Works?

2011-08-06 Thread espeed

Michael Hunger wrote:
 
 Probably we have to add this unique property behavior to the auto-indexing
 framework.
 
 Right now we have no means to mark properties as unique.
 
 So whenever you take a different node and set one of its unique
 properties to a value already contained in an unique index it should fail
 on commit, this is the point where the auto-indexing would come into play.
 
 There should probably also be a different index type (besides the exact
 and fulltext types that handles unique values and for instance fails at
 duplicate key insertion.
 
 We would have to provide the low-level methods for the obtain* operations
 which you could use in the embedded graphdb mode. All other operations
 should be protected either by auto-indexing storing the values in the
 unique index.
 

Hi Michael -

Yeah, that's sounds right, Then you could use the unique index methods to do
things like build a create or update endpoint or a create or update
batch endpoint that would allow you to efficiently load a user's social
graph. 

I added a ticket here...

http://neo4jdb.lighthouseapp.com/projects/77609-neo4j-community/tickets/12-add-unique-property-behavior-to-the-auto-indexing-framework

Thanks.

- James



--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Are-Unique-Indices-in-the-Works-tp3229971p3232258.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] Are Unique Indices in the Works?

2011-08-05 Thread espeed
Hi -

The issue of unique indices came up several times earlier this summer:

http://neo4j.org/forums/#nabble-td3047393
http://neo4j.org/forums/#nabble-td3148364
http://lists.neo4j.org/pipermail/user/2011-June/009809.html

And Mattias created a support ticket:

http://help.neo4j.org/discussions/questions/8-re-neo4j-unique-constaint-on-index

Has anything become of this?

Being able to do a create or update on unique properties would be very
useful when working with social graph data from Facebook and Twitter.

For example, when creating a social app that uses the Facebook graph or the
Twitter authentication APIs, it's common to create nodes for all the
Facebook friends and Twitter followers so the FB user ID and Twitter
username are stored as properties for each Person node.

If two users have the same friend or follower, the node is already going to
exist on insert. Rather than query for the existence of each node, it would
be better to just update the node if one already exists with that Facebook
ID.

Likewise, being able to mark an edge as unique and update it rather than
create a dupe if an edge already exists with the same inV, label, and outV
(or a unique property) -- for example, you wouldn't want to recreate the
edge on the create or insert if the node already exists.

Thoughts?

- James


--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Are-Unique-Indices-in-the-Works-tp3229971p3229971.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] Hwo to work with indexes in gremlin?

2011-07-19 Thread espeed
The Gremlin Wiki (https://github.com/tinkerpop/gremlin/wiki) is where you can
find the Gremlin documentation. 

Specifically look at the Gremlin Methods
(https://github.com/tinkerpop/gremlin/wiki/Gremlin-Methods) and Gremlin
Steps (https://github.com/tinkerpop/gremlin/wiki/Gremlin-Steps) cheat
sheets.

- James

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Hwo-to-work-with-indexes-in-gremlin-tp3180514p3182171.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] Bulbflow: a Python framework for Neo4j

2011-07-16 Thread espeed
Hey guys -

I just released Bulbflow, a new Python framework for graph databases. 

It supports Neo4j and Gremlin through Rexster, and it's online at
http://bulbflow.com .

Enjoy!

- James

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Bulbflow-a-Python-framework-for-Neo4j-tp3175275p3175275.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] Bulbflow: a Python framework for Neo4j

2011-07-16 Thread espeed
Hi Javier -

Thanks! Yeah, Bulbflow (Bulbs) is what I was talking in when we were
commenting in Hacker News a few weeks ago
(http://news.ycombinator.com/item?id=2684816). I have used your API for the
Neo4j REST server, but I didn't know you were working on one for Rexster too
-- we should exchange notes :)

- James 

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Bulbflow-a-Python-framework-for-Neo4j-tp3175275p3176095.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] Traversals versus Indexing

2011-06-12 Thread espeed
It depends on the traversal you are running.

--
View this message in context: 
http://neo4j-user-list.438527.n3.nabble.com/Neo4j-Traversals-versus-Indexing-tp3057515p3057538.html
Sent from the Neo4J User List mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] How Do You Configure neo4j Not to Reuse IDs?

2011-04-28 Thread espeed
How do you configure neo4j not to reuse IDs?

Thanks.

- James

--
View this message in context: 
http://neo4j-user-list.438527.n3.nabble.com/How-Do-You-Configure-neo4j-Not-to-Reuse-IDs-tp2874501p2874501.html
Sent from the Neo4J User List mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] How Do You Configure neo4j Not to Reuse IDs?

2011-04-28 Thread espeed
I found the mentions of a patch from about a year ago...

http://lists.neo4j.org/pipermail/user/2010-June/003964.html

Has something like this with a configuration param made it into the main
branch?

Thanks.

- James

--
View this message in context: 
http://neo4j-user-list.438527.n3.nabble.com/How-Do-You-Configure-neo4j-Not-to-Reuse-IDs-tp2874501p2874642.html
Sent from the Neo4J User List mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user