Re: [Neo4j] Feedback after evaluation

2011-12-08 Thread Max De Marzi Jr.
Is HTTP as a protocol the problem? Maybe, it does have some advantages 
though.

I think we all agree the REST API is not finished yet.  
We talked last week about Batch operations as a poor-man's replacement for 
Transactions and the concerns that brought up.

I think the REST API will get there eventually... or (since it had a short 
brush with death two months ago)  be replaced with a full Cypher language 
with data operations (INSERT, UPDATE, DELETE SQL equivalents)

In the mean time, my solution has been Polyglot Persistence using 
ActiveRecord callbacks.  

  after_create :create_node

  def create_node
if self.valid?
  self.node = $neo.create_node("identity_id" => 
self.id)["self"].split("/).last 
self.save 
  end 

  after_save :create_relationship

  def create_relationship
from = self.grantor.node
to = self.requester.node
$neo.create_relationship("vouched", from, to) 
  end 

You don't have to limit yourself to one database.  
Chances are you'll need Redis anyway, so you might as well think in terms of 
multiple storage units from the beginning. 

___
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] problem with neography and index.

2011-07-01 Thread Max De Marzi Jr.
I don't have paging in yet... I've been slacking I know.  I'll get to it soon.

On Fri, Jul 1, 2011 at 7:27 AM, Michael Hunger
 wrote:
> You have a few options here:
>
> * paging is right now only supported in the REST API for traversals the other 
> request types will get it in 1.5 (so you could use the paging functionality 
> for your traverser, don't know if Max supports that already in neography)
> * you could use either the cypher 
> (http://docs.neo4j.org/chunked/snapshot/cypher-plugin.html) or the gremlin 
> plugin (http://docs.neo4j.org/chunked/snapshot/gremlin-plugin.html)  to write 
> a request against their "execute_script" api which then does the index lookup 
> + limit
>
> * you can write your own server plugin doing that 
> http://docs.neo4j.org/chunked/snapshot/server-plugins.html
>
> Cheers
>
> Michael
>
> Am 01.07.2011 um 14:04 schrieb Laurent Laborde:
>
>> the ruby crash when i request all the page with parsed = false
>> using directly the REST interface with CURL : the result is a huge
>> json with ~10.000 nodes
>>
>> is there a way to limit the result size, like a SQL "SELECT * from
>> node where parsed == 'true' limit 100;" ?
>> i tried using a traverser instead of requesting the index :
>>
>> node_to_parse = @neo.traverse(ob_root_node, "nodes", { "relationships"
>> => [{"type"=> "link", "direction" => "out" }], "prune evaluator" =>
>> {"language" => "javascript", "body" =>
>> "position.endNode().getProperty('parsed') == 'false';"}, "return
>> filter" => {"language" => "builtin",  "name" => "all but start
>> node"}})
>>
>>
>> /home/ker2x/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/net/protocol.rb:140:in
>> `rescue in rbuf_fill': Timeout::Error (Timeout::Error)
>>       from 
>> /home/ker2x/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/net/protocol.rb:134:in
>> `rbuf_fill'
>>       from 
>> /home/ker2x/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/net/protocol.rb:116:in
>> `readuntil'
>>       from 
>> /home/ker2x/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/net/protocol.rb:126:in
>> `readline'
>>       from 
>> /home/ker2x/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/net/http.rb:2219:in
>> `read_status_line'
>>       from 
>> /home/ker2x/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/net/http.rb:2208:in
>> `read_new'
>>       from 
>> /home/ker2x/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/net/http.rb:1191:in
>> `transport_request'
>>       from 
>> /home/ker2x/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/net/http.rb:1177:in
>> `request'
>>       from 
>> /home/ker2x/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/net/http.rb:1170:in
>> `block in request'
>>       from 
>> /home/ker2x/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/net/http.rb:627:in
>> `start'
>>       from 
>> /home/ker2x/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/net/http.rb:1168:in
>> `request'
>>       from 
>> /home/ker2x/.rvm/gems/ruby-1.9.2-p180/gems/httparty-0.7.8/lib/httparty/request.rb:69:in
>> `perform'
>>       from 
>> /home/ker2x/.rvm/gems/ruby-1.9.2-p180/gems/httparty-0.7.8/lib/httparty.rb:390:in
>> `perform_request'
>>       from 
>> /home/ker2x/.rvm/gems/ruby-1.9.2-p180/gems/httparty-0.7.8/lib/httparty.rb:358:in
>> `post'
>>       from 
>> /home/ker2x/.rvm/gems/ruby-1.9.2-p180/gems/httparty-0.7.8/lib/httparty.rb:426:in
>> `post'
>>       from 
>> /home/ker2x/.rvm/gems/ruby-1.9.2-p180/gems/neography-0.0.13/lib/neography/rest.rb:363:in
>> `post'
>>       from 
>> /home/ker2x/.rvm/gems/ruby-1.9.2-p180/gems/neography-0.0.13/lib/neography/rest.rb:317:in
>> `traverse'
>>       from nokogiri-test.rb:26:in `'
>>
>>
>> --
>> Keru
>>
>> On Fri, Jul 1, 2011 at 1:15 PM, Michael Hunger
>>  wrote:
>>> Can you call the index REST request manually and see what it returns?
>>>
>>> see here 
>>> http://components.neo4j.org/neo4j-server/snapshot/rest.html#Index_search_-_Exact_keyvalue_lookup
>>>
>>> curl -H Accept:application/json 
>>> http://localhost:7474/db/data/index/node/my_nodes/the_key/the_value%20with%20space
>>>
>>> see here: 
>>> http://stackoverflow.com/questions/547127/in-ruby-how-do-i-replace-the-question-mark-character-in-a-string
>>>
>>> require "addressable/uri"
>>> Addressable::URI.encode_component("http://test.com?test/test%test",Addressable::URI::CharacterClasses::PATH)
>>>
>>> Cheers
>>>
>>> Michael
>>>
>>>
>>> Am 01.07.2011 um 11:23 schrieb Laurent Laborde:
>>>
 After a few run (and more and more and more page to crawl) it seems
 that the result returned by the index is too big :

 /home/ker2x/.rvm/gems/ruby-1.9.2-p180/gems/crack-0.1.8/lib/crack/json.rb:54:
 stack level too deep (SystemStackError)

 Any idea ? workaround ?

 thank you

 --
 Ker2x

 On Fri, Jul 1, 2011 at 10:44 AM, Laurent Laborde  
 wrote:
> I  used Base64.encode64 instead ! it still didn't worked.
> So i used Base64.encode64 and get_node_index instead of
> find_node_index and it worked \o/
>
> --
> Ker2x
>
> On Fri, Jul 1, 2011 at 10:25 AM, Laurent Laborde  
> wrot

Re: [Neo4j] A (probably simple) problem on Neo4j

2011-06-27 Thread Max De Marzi Jr.
Something like:

 @neo.traverse(node1,"paths", {"order" => "breadth first",
  "uniqueness" => "relationship path",
  "relationships" => {"type"=>
"knows", "direction" => "out"},
  "return filter" => {
"language" => "javascript",
"body" => "position.length() <= 3
   &&
position.endNode().getId() == #{node2.id}
   &&
position.lastRelationship().getProperty(\"rating\") > -1;"}


On Mon, Jun 27, 2011 at 7:18 AM, Rugal  wrote:
> Hi, I'm starting to use Neo4j with the ruby neography library. Everything it's
> working, I'm correctly managing nodes, relations and indexes (it would be
> great something less manual, in order to have a faster boot/setup/learning
> curve). But now I'm having a little problem on doing one thing:
>
> I've nodes connected between them, and the relations can have a rating
> property, which is a numeric value (positive, negative or zero). I'd like to
> get all the simple paths up to the third level depth from a node to another,
> but considering also the rating property, in this way: a path is valid if the
> rating is greater than or equal to 0, but it should consider it if the
> property is set on the last relation, also if it's negative.
>
> Very simple example
>
> A -(-5)-> B
> B --> C
> A --> D
> D --> C
>
> Then from A to C the valid paths resulting would be only A --> D --> C
>
> A --> B
> B -(-5)-> C
> A --> D
> D --> C
>
> This one the result paths would be:
> A --> D --> C
> A --> B --> C
> Because the negative rating is on the last relationship, not in the middle, so
> the path should be present
>
>
> For now I get all the paths using
> get_paths(from_node, to_node, { "type"=> "knows", "direction" => "out" },
> depth=3, algorithm="allSimplePaths")
>
> How can I make it consider that conditions too? Should I use a traversal? Do
> you have hint on how write that conditions?
>
> Thank you
>
>
>
>  --
>  Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e SMTP 
> autenticato? GRATIS solo con Email.it http://www.email.it/f
>
>  Sponsor:
>  All'hotel Roland Riccione Euro 48 in pensione completa con bevande ai pasti 
> e 2 biglietti per i parchi divertimento della zona
>  Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=11574&d=27-6
> ___
> 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] Design question: Del.icio.us

2011-06-09 Thread Max De Marzi Jr.
Not quite.  What I am saying is that it is best to define the
questions you want to answer before picking a solution and building a
model.

Look at Josef scenarios, a tagging table with fields
[user_id][tag_id][bookmark_id][created_at] gives you tag activity
streams and is not complex at all.

I found a hybrid solution worked best for me.  90% of my questions
were answered with a table and the other 10% with a simple graph
model.
Be pragmatic and don't limit yourself to having to choose.


On Thu, Jun 9, 2011 at 1:49 PM, Aseem Kishore  wrote:
> Max, just to be clear, are you basically saying that this problem is best
> solved by a relational db instead of a graph db?
>
> Thanks,
> Aseem
>
> On Wed, Jun 8, 2011 at 11:21 PM, Max De Marzi Jr. wrote:
>
>> Aseem,
>>
>> Which users tagged what? SELECT DISTINCT user_id FROM USER_TAGS WHERE
>> bookmark_id = x
>> Which bookmarks did a user tag? SELECT DISTINCT bookmark_id FROM
>> USER_TAGS WHERE user_id = x
>> Which bookmarks were tagged with x? SELECT DISTINCT bookmark_id FROM
>> USER_TAGS WHERE tag_id = x
>>
>> What question are you trying to answer that you can't get from a
>> relational table?
>>
>> I think it's better to make your model depending on the questions you
>> are trying to answer.
>>
>> I have a similar model (users tagging users) and I needed to answer:
>> Which users have been tagged by me or my network 6 degrees out?
>> What is the tagged distance a user is away from another user?
>>
>> Turns out, all I needed was User nodes with Tagged links.  User ->
>> tagged -> User -> tagged -> User
>> Everything else I get from the relational db.
>>
>> When I start to care about which users have been tagged for by me or
>> my network 6 degrees out for this KEYWORD, then I'll create a more
>> complex model:
>> User -> UserKeyword -> tagged -> UserKeyword -> User
>>    Keyword  ---/                        Keyword  ---/
>>
>> Regards,
>> Max
>>
>> On Thu, Jun 9, 2011 at 12:33 AM, Aseem Kishore 
>> wrote:
>> > Also forgot to add: now if you want to show all links (globally) for a
>> given
>> > tag, how do you do that? Are you indexing each tag-link (as a key-value
>> > pair) every time a tag is added? Removing from the index every time a tag
>> is
>> > deleted?
>> >
>> > Thanks,
>> >
>> > Aseem
>> >
>> > On Wed, Jun 8, 2011 at 10:31 PM, Aseem Kishore > >wrote:
>> >
>> >> I forgot to state this, but a key requirement of tags of course is that
>> you
>> >> can apply multiple of them to the same link.
>> >>
>> >> Would you still go that route then?
>> >>
>> >> If you want to delete a link from your bookmarks, it's a matter then of
>> >> deleting each tag edge?
>> >>
>> >> Aseem
>> >>
>> >>
>> >> On Wed, Jun 8, 2011 at 10:28 PM, Siddhartha Kasivajhula <
>> >> countvajh...@gmail.com> wrote:
>> >>
>> >>> Couldn't you use edges for "tags" instead of nodes?
>> >>>
>> >>> user1 --tag--> link1
>> >>> user2 --tag--> link1
>> >>> user1 --tag--> link2
>> >>>
>> >>>
>> >>> On Wed, Jun 8, 2011 at 10:23 PM, Aseem Kishore <
>> aseem.kish...@gmail.com
>> >>> >wrote:
>> >>>
>> >>> > Hi guys,
>> >>> >
>> >>> > We're thinking about implementing tags in our system, and we're
>> >>> pondering a
>> >>> > few ideas for how we'd go about it, and none of them seem perfect.
>> I'd
>> >>> like
>> >>> > to ask you guys: how would you design an analogous case: Del.icio.us
>> ?
>> >>> >
>> >>> > At the core, *users bookmark links*, so it makes sense to have
>> "users"
>> >>> and
>> >>> > "links" as types of nodes, and "bookmark" as the type of edge that
>> >>> connects
>> >>> > them. Now, you can see all the links a given user has bookmarked, and
>> >>> all
>> >>> > the users that have bookmarked a given link.
>> >>> >
>> >>> > Now users can also *tag* links, of course, but the most interesting
>> >>> > requirement is that, when I'm looking 

Re: [Neo4j] Design question: Del.icio.us

2011-06-08 Thread Max De Marzi Jr.
Aseem,

Which users tagged what? SELECT DISTINCT user_id FROM USER_TAGS WHERE
bookmark_id = x
Which bookmarks did a user tag? SELECT DISTINCT bookmark_id FROM
USER_TAGS WHERE user_id = x
Which bookmarks were tagged with x? SELECT DISTINCT bookmark_id FROM
USER_TAGS WHERE tag_id = x

What question are you trying to answer that you can't get from a
relational table?

I think it's better to make your model depending on the questions you
are trying to answer.

I have a similar model (users tagging users) and I needed to answer:
Which users have been tagged by me or my network 6 degrees out?
What is the tagged distance a user is away from another user?

Turns out, all I needed was User nodes with Tagged links.  User ->
tagged -> User -> tagged -> User
Everything else I get from the relational db.

When I start to care about which users have been tagged for by me or
my network 6 degrees out for this KEYWORD, then I'll create a more
complex model:
User -> UserKeyword -> tagged -> UserKeyword -> User
Keyword  ---/Keyword  ---/

Regards,
Max

On Thu, Jun 9, 2011 at 12:33 AM, Aseem Kishore  wrote:
> Also forgot to add: now if you want to show all links (globally) for a given
> tag, how do you do that? Are you indexing each tag-link (as a key-value
> pair) every time a tag is added? Removing from the index every time a tag is
> deleted?
>
> Thanks,
>
> Aseem
>
> On Wed, Jun 8, 2011 at 10:31 PM, Aseem Kishore wrote:
>
>> I forgot to state this, but a key requirement of tags of course is that you
>> can apply multiple of them to the same link.
>>
>> Would you still go that route then?
>>
>> If you want to delete a link from your bookmarks, it's a matter then of
>> deleting each tag edge?
>>
>> Aseem
>>
>>
>> On Wed, Jun 8, 2011 at 10:28 PM, Siddhartha Kasivajhula <
>> countvajh...@gmail.com> wrote:
>>
>>> Couldn't you use edges for "tags" instead of nodes?
>>>
>>> user1 --tag--> link1
>>> user2 --tag--> link1
>>> user1 --tag--> link2
>>>
>>>
>>> On Wed, Jun 8, 2011 at 10:23 PM, Aseem Kishore >> >wrote:
>>>
>>> > Hi guys,
>>> >
>>> > We're thinking about implementing tags in our system, and we're
>>> pondering a
>>> > few ideas for how we'd go about it, and none of them seem perfect. I'd
>>> like
>>> > to ask you guys: how would you design an analogous case: Del.icio.us?
>>> >
>>> > At the core, *users bookmark links*, so it makes sense to have "users"
>>> and
>>> > "links" as types of nodes, and "bookmark" as the type of edge that
>>> connects
>>> > them. Now, you can see all the links a given user has bookmarked, and
>>> all
>>> > the users that have bookmarked a given link.
>>> >
>>> > Now users can also *tag* links, of course, but the most interesting
>>> > requirement is that, when I'm looking at *my links*, I only want to see
>>> *my
>>> > tags*. Thus, tags can't be tied just to links; they have to be tied to
>>> > users
>>> > too. But most importantly, you have to maintain *which* user and *which*
>>> > link *each* tag is for.
>>> >
>>> > Thus, it seems most intuitive to us if we could have "tags" be nodes
>>> > that *point
>>> > to the "bookmark" edges*. Unfortunately, that's a hypergraph, which
>>> Neo4j
>>> > doesn't support.
>>> >
>>> > We could use intermediate nodes for bookmarks maybe, but that sort of
>>> sucks
>>> > to lose the intuitiveness of the graph and introduce redundant edges,
>>> more
>>> > complexity which makes consistency harder, etc.
>>> >
>>> > We have some other ideas, but I'm curious if any of you guys have
>>> thought
>>> > about this already or have done it, or if you guys have thoughts. Thanks
>>> in
>>> > advance!
>>> >
>>> > Aseem
>>> > ___
>>> > 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] silverlight client for neo4j, advice needed

2011-05-19 Thread Max De Marzi Jr.
Use Traverse 
http://components.neo4j.org/neo4j-server/milestone/rest.html#Traverse
with Fullpath as the return type.

See https://github.com/maxdemarzi/neovigator/blob/master/neovigator.rb
for an example.

def neighbours
{"order" => "depth first",
 "uniqueness"=> "none",
 "return filter" => {"language" => "builtin", "name" => "all but
start node"},
 "depth" => 1}
  end

connections = @neo.traverse(node, "fullpath", neighbours)



On Thu, May 19, 2011 at 6:03 PM, Anton Kulaga  wrote:
> Hi all,
>
> I have recently started learning Neo4j (I use it through REST interface in
> my silverlight applications). Now I am developing a silverlight admin panel
> for graph editing with spring graph layout algorithmes. In order to
> visualize a part of a graph I need to get all nodes somehow related to the
> selected node alongside with all their relations. The problem is that I
> don't know beforehand what relations will be there and I need to get BOTH
> nodes and relations in the result. Could anybody advice me how to achieve
> the result in minimum rest requests (because I do care about performance)?
>
> --
> Best regards,
> Anton Kulaga
> ___
> 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] Contacts on 2nd Level, excluding direct ones

2011-05-19 Thread Max De Marzi Jr.
Take a look at 
https://github.com/maxdemarzi/neography/blob/master/examples/facebook.rb
for an example but basically it's just:

@neo.traverse(node,"nodes", {"order" => "breadth first",
  "uniqueness" => "node global",
  "relationships" => {"type"=>
"friends", "direction" => "in"},
  "return filter" => {
"language" => "javascript",
"body" =>
"position.length() == 2;"},
  "depth" => 2})

Stay away from having to look at the properties of a node if you're
worried about speed.

On Thu, May 19, 2011 at 10:48 AM, Stefan Matheis
 wrote:
> Hi Guys,
>
> i'm actually trying to get the Contacts on the 2nd Level, which is
> fine while using max depth = 2. Depending on the Network the result
> could contain Contacts that i'm also directly connected with, which is
> was i'd avoid:
>
> UserA -> UserB
> UserA -> UserC -> UserB
>
> Using the REST-API, i've build the following return filter for a Traversal:
>
> {
> "order":"depth first",
> "return filter":{
> "language":"javascript",
> "body":"position.length() === 2 && -1 ===
> \"UserB\".indexOf(position.endNode().getProperty(\"member_id\"));"
> },
> "max depth":2
> }
>
> which is okay for playing around, but i guess it will be slower (even
> to slow) with more/many contacts? Tied to MySQL, my understanding of
> Graphs is still not good enough to get a better idea :/
>
> If you need further Information - just let me know :)
>
> Regards
> Stefan
> ___
> 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] Getting started with Ruby

2011-05-11 Thread Max De Marzi Jr.
I think each has their place.  This is how I see it:

If you're going "all in" (your graph db is your primary db) then use
the Andreas Neo4j.rb gem.
If you're not, (your graph db is used as a secondary db or as an index
for graph specific tasks) then it may be easier to use my Neography
gem.

I believe the above decision is complicated and depends very much on
how much your model benefits from a graph vs a relational or other
database type.

On Wed, May 11, 2011 at 10:43 PM, Adriano Henrique de Almeida
 wrote:
> I'll put some cons, but the pros are just the opposite for the other.
>
> - Well, one con that comes to my mind regarding the use of the embedded API
> that you're attached to JRuby and maybe you want/have to use plain MRI,
> Rubinius or something else.
>
> - One con that I can think on the REST API is network latency, which may
> become a performance bottleneck.
>
> I think that both configurations are simple. However I prefer using the
> embedded API, just cos I really enjoy the way the embedded API is designed.
>
> Regards
>
> 2011/5/11 Evan Haveman 
>
>> Can someone outline the pros and cons of using Neo4J's embedded API vs its
>> REST API given Ruby as the preferred language.
>>
>> One pro of the embedded API is I believe it is more complete than the REST
>> API -- what is the REST API missing?
>>
>> One pro of the REST API is that my configuration is much simpler.
>>
>> Any others?
>>
>>
>> ___
>> Neo4j mailing list
>> User@lists.neo4j.org
>> https://lists.neo4j.org/mailman/listinfo/user
>>
>
>
>
> --
> Adriano Almeida
> Caelum | Ensino e Inovação
> www.caelum.com.br
> ___
> 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] Finding a Path Between Nodes (filtered by relationship property)

2011-03-21 Thread Max De Marzi Jr.
Add Something like:

"return filter": { "language": "javascript",  "body":
"position.lastRelationship().hasProperty(\"userGroupId\")
position.lastRelationship().getProperty(\"userGroupId\") == 111;"}})

to your traversal.

On Mon, Mar 21, 2011 at 9:44 AM, Kevin Dieter  wrote:
> Hi,
>
> I am using the REST API from a .Net application and have a need to find
> paths between nodes and I would like to include or exclude relationships
> based on a property value.
>
> For example:
>
>   1. Node1 has an outgoing relationship of type "Friend", with relationship
>   property userGroupId= 111 to Node2
>   2. Node2 has an outgoing relationship of type "Family", with relationship
>   property userGroupId= 111 to Node3
>   3. Node1 has an outgoing relationship of type "WorkedWith", with
>   relationship property userGroupId= 222 to Node3
>
>
> I would like to find paths from Node1 to Node3 using relationships of any
> type, but only using those relationships with userGroupId=111.  This should
> return the path that includes Node2 and the first two relationships, but
> should not include the direct path that uses the third relationship.
>
> Is this possible using the REST API?
>
> Thanks,
>
> Kevin
> ___
> 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] Announcing Neo4j 1.3 “Abisko Lampa” M04

2011-03-11 Thread Max De Marzi Jr.
Oh and removing the "http://neography.org:7474/"; from
neo4j-server.properties did the trick for me as far as being able to
get webadmin to work.  Both data and other tabs are coming up fine at
http://neography.org



On Fri, Mar 11, 2011 at 4:03 PM, Max De Marzi Jr.  wrote:
> v0.0.12 of https://github.com/maxdemarzi/neography is out there with
> the thin wrapper updates to index deletions and advanced queries.
> I'll do the phase 2 version of these two next.
>
> On Fri, Mar 11, 2011 at 12:40 PM, Max De Marzi Jr.  
> wrote:
>> My Steps:
>>
>> Pulled DB from 1.3.M02
>> neo4j start fails
>>
>> Turn on allow_store_upgrade=true in neo4j.properties file
>> Configure neo4j-server.propeties specified earlier
>> neo4j start works
>>
>> pulling data from http://neovigator.heroku.com/?neoid=2 works
>> http://neography.org  (webadmin) doesn't work
>>
>>
>> On Fri, Mar 11, 2011 at 12:31 PM, Joshi Hemant - hjoshi
>>  wrote:
>>> I have similar problem. I upgraded existing database from 1.2 to 1.3M04
>>> By explicit upgrade, do you mean setting allow_store_upgrade=true in 
>>> neo4j.properties file?
>>> I get only data tab of webadmin.
>>> -Hemant
>>>
>>> -Original Message-
>>> From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
>>> Behalf Of Peter Neubauer
>>> Sent: Friday, March 11, 2011 10:59 AM
>>> To: Neo4j user discussions
>>> Subject: Re: [Neo4j] Announcing Neo4j 1.3 “Abisko Lampa” M04
>>>
>>> Do you have an existing db? In that case you need to upgrade explicitly...
>>>
>>> /peter
>>>
>>> Send from my mobile device, please excuse typos and brevity.
>>> On Mar 11, 2011 4:45 PM, "Max De Marzi Jr."  wrote:
>>>> Hum... webadmin is not coming up for me...
>>>>
>>>> This is what I changed in the neo4j-server.propeties.
>>>>
>>>> # REST endpoint for the data API
>>>> # Note the / in the end is mandatory
>>>> #org.neo4j.server.webadmin.data.uri=http://localhost:7474/db/data/
>>>> org.neo4j.server.webadmin.data.uri=http://neography.org:7474/db/data/
>>>>
>>>> # REST endpoint of the administration API (used by Webadmin)
>>>> #org.neo4j.server.webadmin.management.uri=http://localhost:7474/db/manage/
>>>> org.neo4j.server.webadmin.management.uri=
>>> http://neography.org:7474/db/manage/
>>>>
>>>>
>>>>
>>>> On Fri, Mar 11, 2011 at 8:31 AM, Javier de la Rosa 
>>> wrote:
>>>>> On Fri, Mar 11, 2011 at 09:02, Chris Gioran
>>>>>  wrote:
>>>>>> the REST interface for Indexing operations. As always, extended
>>>>>
>>>>> Really great news for REST clients! Now it's our time to implement it.
>>>>> Thank you.
>>>>>
>>>>>
>>>>> --
>>>>> Javier de la Rosa
>>>>> http://versae.es
>>>>> ___
>>>>> 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
>>> ***
>>> The information contained in this communication is confidential, is
>>> intended only for the use of the recipient named above, and may be legally
>>> privileged.
>>>
>>> If the reader of this message is not the intended recipient, you are
>>> hereby notified that any dissemination, distribution or copying of this
>>> communication is strictly prohibited.
>>>
>>> If you have received this communication in error, please resend this
>>> communication to the sender and delete the original message or any copy
>>> of it from your computer system.
>>>
>>> Thank You.
>>> 
>>>
>>> ___
>>> 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] Announcing Neo4j 1.3 “Abisko Lampa” M04

2011-03-11 Thread Max De Marzi Jr.
v0.0.12 of https://github.com/maxdemarzi/neography is out there with
the thin wrapper updates to index deletions and advanced queries.
I'll do the phase 2 version of these two next.

On Fri, Mar 11, 2011 at 12:40 PM, Max De Marzi Jr.  wrote:
> My Steps:
>
> Pulled DB from 1.3.M02
> neo4j start fails
>
> Turn on allow_store_upgrade=true in neo4j.properties file
> Configure neo4j-server.propeties specified earlier
> neo4j start works
>
> pulling data from http://neovigator.heroku.com/?neoid=2 works
> http://neography.org  (webadmin) doesn't work
>
>
> On Fri, Mar 11, 2011 at 12:31 PM, Joshi Hemant - hjoshi
>  wrote:
>> I have similar problem. I upgraded existing database from 1.2 to 1.3M04
>> By explicit upgrade, do you mean setting allow_store_upgrade=true in 
>> neo4j.properties file?
>> I get only data tab of webadmin.
>> -Hemant
>>
>> -Original Message-
>> From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
>> Behalf Of Peter Neubauer
>> Sent: Friday, March 11, 2011 10:59 AM
>> To: Neo4j user discussions
>> Subject: Re: [Neo4j] Announcing Neo4j 1.3 “Abisko Lampa” M04
>>
>> Do you have an existing db? In that case you need to upgrade explicitly...
>>
>> /peter
>>
>> Send from my mobile device, please excuse typos and brevity.
>> On Mar 11, 2011 4:45 PM, "Max De Marzi Jr."  wrote:
>>> Hum... webadmin is not coming up for me...
>>>
>>> This is what I changed in the neo4j-server.propeties.
>>>
>>> # REST endpoint for the data API
>>> # Note the / in the end is mandatory
>>> #org.neo4j.server.webadmin.data.uri=http://localhost:7474/db/data/
>>> org.neo4j.server.webadmin.data.uri=http://neography.org:7474/db/data/
>>>
>>> # REST endpoint of the administration API (used by Webadmin)
>>> #org.neo4j.server.webadmin.management.uri=http://localhost:7474/db/manage/
>>> org.neo4j.server.webadmin.management.uri=
>> http://neography.org:7474/db/manage/
>>>
>>>
>>>
>>> On Fri, Mar 11, 2011 at 8:31 AM, Javier de la Rosa 
>> wrote:
>>>> On Fri, Mar 11, 2011 at 09:02, Chris Gioran
>>>>  wrote:
>>>>> the REST interface for Indexing operations. As always, extended
>>>>
>>>> Really great news for REST clients! Now it's our time to implement it.
>>>> Thank you.
>>>>
>>>>
>>>> --
>>>> Javier de la Rosa
>>>> http://versae.es
>>>> ___
>>>> 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
>> ***
>> The information contained in this communication is confidential, is
>> intended only for the use of the recipient named above, and may be legally
>> privileged.
>>
>> If the reader of this message is not the intended recipient, you are
>> hereby notified that any dissemination, distribution or copying of this
>> communication is strictly prohibited.
>>
>> If you have received this communication in error, please resend this
>> communication to the sender and delete the original message or any copy
>> of it from your computer system.
>>
>> Thank You.
>> 
>>
>> ___
>> 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] Announcing Neo4j 1.3 “Abisko Lampa” M04

2011-03-11 Thread Max De Marzi Jr.
My Steps:

Pulled DB from 1.3.M02
neo4j start fails

Turn on allow_store_upgrade=true in neo4j.properties file
Configure neo4j-server.propeties specified earlier
neo4j start works

pulling data from http://neovigator.heroku.com/?neoid=2 works
http://neography.org  (webadmin) doesn't work


On Fri, Mar 11, 2011 at 12:31 PM, Joshi Hemant - hjoshi
 wrote:
> I have similar problem. I upgraded existing database from 1.2 to 1.3M04
> By explicit upgrade, do you mean setting allow_store_upgrade=true in 
> neo4j.properties file?
> I get only data tab of webadmin.
> -Hemant
>
> -Original Message-
> From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
> Behalf Of Peter Neubauer
> Sent: Friday, March 11, 2011 10:59 AM
> To: Neo4j user discussions
> Subject: Re: [Neo4j] Announcing Neo4j 1.3 “Abisko Lampa” M04
>
> Do you have an existing db? In that case you need to upgrade explicitly...
>
> /peter
>
> Send from my mobile device, please excuse typos and brevity.
> On Mar 11, 2011 4:45 PM, "Max De Marzi Jr."  wrote:
>> Hum... webadmin is not coming up for me...
>>
>> This is what I changed in the neo4j-server.propeties.
>>
>> # REST endpoint for the data API
>> # Note the / in the end is mandatory
>> #org.neo4j.server.webadmin.data.uri=http://localhost:7474/db/data/
>> org.neo4j.server.webadmin.data.uri=http://neography.org:7474/db/data/
>>
>> # REST endpoint of the administration API (used by Webadmin)
>> #org.neo4j.server.webadmin.management.uri=http://localhost:7474/db/manage/
>> org.neo4j.server.webadmin.management.uri=
> http://neography.org:7474/db/manage/
>>
>>
>>
>> On Fri, Mar 11, 2011 at 8:31 AM, Javier de la Rosa 
> wrote:
>>> On Fri, Mar 11, 2011 at 09:02, Chris Gioran
>>>  wrote:
>>>> the REST interface for Indexing operations. As always, extended
>>>
>>> Really great news for REST clients! Now it's our time to implement it.
>>> Thank you.
>>>
>>>
>>> --
>>> Javier de la Rosa
>>> http://versae.es
>>> ___
>>> 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
> ***
> The information contained in this communication is confidential, is
> intended only for the use of the recipient named above, and may be legally
> privileged.
>
> If the reader of this message is not the intended recipient, you are
> hereby notified that any dissemination, distribution or copying of this
> communication is strictly prohibited.
>
> If you have received this communication in error, please resend this
> communication to the sender and delete the original message or any copy
> of it from your computer system.
>
> Thank You.
> 
>
> ___
> 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] Announcing Neo4j 1.3 “Abisko Lampa” M04

2011-03-11 Thread Max De Marzi Jr.
Hum... webadmin is not coming up for me...

This is what I changed in the neo4j-server.propeties.

# REST endpoint for the data API
# Note the / in the end is mandatory
#org.neo4j.server.webadmin.data.uri=http://localhost:7474/db/data/
org.neo4j.server.webadmin.data.uri=http://neography.org:7474/db/data/

# REST endpoint of the administration API (used by Webadmin)
#org.neo4j.server.webadmin.management.uri=http://localhost:7474/db/manage/
org.neo4j.server.webadmin.management.uri=http://neography.org:7474/db/manage/



On Fri, Mar 11, 2011 at 8:31 AM, Javier de la Rosa  wrote:
> On Fri, Mar 11, 2011 at 09:02, Chris Gioran
>  wrote:
>> the REST interface for Indexing operations. As always, extended
>
> Really great news for REST clients! Now it's our time to implement it.
> Thank you.
>
>
> --
> Javier de la Rosa
> http://versae.es
> ___
> 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] limiting results

2011-03-07 Thread Max De Marzi Jr.
I believe you can tie in to returnedNodesCount()

http://components.neo4j.org/neo4j-examples/1.3.M02/apidocs/index.html?org/neo4j/graphdb/StopEvaluator.html


@neo.traverse(school,"nodes", {"order" => "breadth first",
  "uniqueness" => "node global",
  "relationships" => {"type"=>
"attended", "direction" => "in"},
  "return filter" => {
"language" => "javascript",
"body" =>
"position.returnedNodesCount() <= 10 ;"}})


On Mon, Mar 7, 2011 at 5:12 PM, charlie  wrote:
> Is there a way to limit the number of results that are returned from a 
> traverse?  I have a traversal
> that returns thousands of nodes.  Ideally I would like to get either a random 
> set of those nodes,
> failing that I would be happy with the the first N nodes.
>
> Charlie White
> Avvo, Inc.
> 1218 Third Avenue, Suite 300
> Seattle, WA 98101
> ___
> 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 to query based on properties

2011-02-23 Thread Max De Marzi Jr.
Traverse the graph returning all nodes with at least 1 matching property.
For each node returned add up the matching properties to node A and
put that in a list.
Sort the list.


On Thu, Feb 24, 2011 at 1:49 AM, Cedric Hurst  wrote:
> Not sure if its the best one, but one possible strategy would be to
> define a comparator with a constructor that takes an argument of your
> comparison node (A), and then implement the compareTo() function to
> retrieve the number of common properties for one node against the
> number of common properties for other node and return the difference.
> Then, you would simply iterate through all the nodes using
> graph.getAllNodes(), load them into an arraylist, sort it using your
> comparator, and navigate it in reverse.   This doesn't leverage any
> features of the graph, really, but it does give you a solution.  I'm
> curious to know if there's a "graphier" way of doing this.
>
> On Thu, Feb 24, 2011 at 12:36 AM, Agam Dua  wrote:
>> Hey
>>
>> I'm a graph database and Neo4j newbie and I'm in a bit of a fix:
>>
>> *Problem Description*
>> Let's say I have 'n' nodes in the graph, representing the same type of
>> object. They have certain undirected links between them.
>> Now each of these 'n' nodes has the same 10 properties, the *values* of
>> which may differ.
>>
>> *Problem Statement*
>> Take starting node A. I need to find a way to traverse all the nodes of the
>> graph and print out which nodes have the most properties in common with A.
>> For example, if A, C, D, E, F, G have 'x' properties in common I want to
>> print the nodes.
>> Then, I want to print the nodes which have 'x-1' properties with the same
>> value. Then 'x-2', and so on.
>>
>> *Question*
>> Now my question is, is this possible? If so, what would be the best way to
>> go about it?
>>
>> Thanks in advance!
>> Agam.
>> *
>> *
>> ___
>> 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] simple traverse question

2011-02-23 Thread Max De Marzi Jr.
Ok it's out there on 0.0.11

Thing is when you add a node to an index (before creating the index),
Neo4j creates the index on its own.

@neo.create_node_index(name, type, provider)   # creates
an index, defaults are "exact" and "lucene"
@neo.create_relationship_index(name, "fulltext")  # creates a
relationship index with "fulltext" option


On Wed, Feb 23, 2011 at 9:57 AM, Max De Marzi Jr.  wrote:
>>>Since I want to later search for nodes by their mysql_id, do I need to 
>>>create an index and add the
> mysql_id to that index?  It appears as if that is the only way to
> efficiently find nodes by a key
> other than their neo generated ID.  Before I went down the path of
> creating indexes, I wanted to
> make sure that is the correct approach.
>
> This is one way... the other way is to store the neo_id in the relational db.
>
>>>It also appears as if the neography gem does not support index creation.
>
> I'll do it today.
>
>
>
>
>
> On Wed, Feb 23, 2011 at 9:50 AM, charlie  wrote:
>> Very nice, thanks.
>>
>> A follow-on question:
>> Since I want to later search for nodes by their mysql_id, do I need to 
>> create an index and add the
>> mysql_id to that index?  It appears as if that is the only way to 
>> efficiently find nodes by a key
>> other than their neo generated ID.  Before I went down the path of creating 
>> indexes, I wanted to
>> make sure that is the correct approach.
>>
>> It also appears as if the neography gem does not support index creation.  I 
>> can easily curl the
>> index creation so it is not a significant issue.  I just wanted to make sure 
>> that I am not missing
>> something in my understanding of neography.
>>
>> thanks again.
>>
>> Charlie White
>> Avvo, Inc.
>> 1218 Third Avenue, Suite 300neo.get_node_relationships(
>> Seattle, WA 98101
>>
>> On Tuesday 22 February 2011 7:48:35 pm Max De Marzi Jr. wrote:
>>> Here you go...
>>>
>>> Full code with setup:
>>>
>>> https://github.com/maxdemarzi/neography/blob/master/examples/traversal_exam
>>>ple2.rb
>>>
>>> Interesting bit:
>>>
>>> def graduated_with_me(student)
>>>   student = student["self"].split('/').last
>>>   student_attended = @neo.get_node_relationships(student)[0]
>>>   graduated = student_attended["data"]["graduated"]
>>>   school = student_attended["end"].split('/').last
>>>
>>>   @neo.traverse(school,"nodes", {"order" => "breadth first",
>>>                                           "uniqueness" => "node global",
>>>                                           "relationships" => {"type"=>
>>> "attended", "direction" => "in"},
>>>                                           "return filter" => {
>>>                                             "language" => "javascript",
>>>                                             "body" => "position.length() ==
>>> 1 &&
>>> position.endNode().getId() != #{student}
>>>                                                        &&
>>> position.lastRelationship().getProperty(\"graduated\") ==
>>> #{graduated};"}})
>>> end
>>>
>>>
>>> Visualize it (sort of... I need to add relationship properties):
>>> http://neovigator.heroku.com/?neoid=201
>>>
>>> Neo4j guys, how do we use the new Evaluator via Rest?
>>>
>>> Thanks,
>>> Max
>>>
>>> On Tue, Feb 22, 2011 at 6:50 PM, charlie  wrote:
>>> > Hi,
>>> > I am new to neo4j and I am having some difficulty figuring out how to
>>> > query it to get me what I need.  We are using Ruby and not JRuby so I am
>>> > trying to do all my queries via the REST API.
>>> >
>>> > Currently I have a set of "people" nodes and a set of "school" nodes.
>>> >  Each node has an id field and a name.  The ID field is not to be
>>> > confused with the ID field assigned by neo, but rather a key into a
>>> > relational database elsewhere.
>>> > I have created a people and school index so I can find the nodes by ids
>>> > curl -H Accept:application/json
>>> > http://localhost:7474/db/data/index/node/person/person_id/28995
>>> &g

Re: [Neo4j] simple traverse question

2011-02-23 Thread Max De Marzi Jr.
>>Since I want to later search for nodes by their mysql_id, do I need to create 
>>an index and add the
mysql_id to that index?  It appears as if that is the only way to
efficiently find nodes by a key
other than their neo generated ID.  Before I went down the path of
creating indexes, I wanted to
make sure that is the correct approach.

This is one way... the other way is to store the neo_id in the relational db.

>>It also appears as if the neography gem does not support index creation.

I'll do it today.





On Wed, Feb 23, 2011 at 9:50 AM, charlie  wrote:
> Very nice, thanks.
>
> A follow-on question:
> Since I want to later search for nodes by their mysql_id, do I need to create 
> an index and add the
> mysql_id to that index?  It appears as if that is the only way to efficiently 
> find nodes by a key
> other than their neo generated ID.  Before I went down the path of creating 
> indexes, I wanted to
> make sure that is the correct approach.
>
> It also appears as if the neography gem does not support index creation.  I 
> can easily curl the
> index creation so it is not a significant issue.  I just wanted to make sure 
> that I am not missing
> something in my understanding of neography.
>
> thanks again.
>
> Charlie White
> Avvo, Inc.
> 1218 Third Avenue, Suite 300neo.get_node_relationships(
> Seattle, WA 98101
>
> On Tuesday 22 February 2011 7:48:35 pm Max De Marzi Jr. wrote:
>> Here you go...
>>
>> Full code with setup:
>>
>> https://github.com/maxdemarzi/neography/blob/master/examples/traversal_exam
>>ple2.rb
>>
>> Interesting bit:
>>
>> def graduated_with_me(student)
>>   student = student["self"].split('/').last
>>   student_attended = @neo.get_node_relationships(student)[0]
>>   graduated = student_attended["data"]["graduated"]
>>   school = student_attended["end"].split('/').last
>>
>>   @neo.traverse(school,"nodes", {"order" => "breadth first",
>>                                           "uniqueness" => "node global",
>>                                           "relationships" => {"type"=>
>> "attended", "direction" => "in"},
>>                                           "return filter" => {
>>                                             "language" => "javascript",
>>                                             "body" => "position.length() ==
>> 1 &&
>> position.endNode().getId() != #{student}
>>                                                        &&
>> position.lastRelationship().getProperty(\"graduated\") ==
>> #{graduated};"}})
>> end
>>
>>
>> Visualize it (sort of... I need to add relationship properties):
>> http://neovigator.heroku.com/?neoid=201
>>
>> Neo4j guys, how do we use the new Evaluator via Rest?
>>
>> Thanks,
>> Max
>>
>> On Tue, Feb 22, 2011 at 6:50 PM, charlie  wrote:
>> > Hi,
>> > I am new to neo4j and I am having some difficulty figuring out how to
>> > query it to get me what I need.  We are using Ruby and not JRuby so I am
>> > trying to do all my queries via the REST API.
>> >
>> > Currently I have a set of "people" nodes and a set of "school" nodes.
>> >  Each node has an id field and a name.  The ID field is not to be
>> > confused with the ID field assigned by neo, but rather a key into a
>> > relational database elsewhere.
>> > I have created a people and school index so I can find the nodes by ids
>> > curl -H Accept:application/json
>> > http://localhost:7474/db/data/index/node/person/person_id/28995
>> >
>> > I have also created relationships between each person and school called
>> > "attended".  I set a graduation date and degree name as attributes of
>> > each attended relationship.
>> >
>> > The query that I want to find all people that attended the same school as
>> > I did and graduated at the same time.
>> > person => school => person1, person2, ... personN.
>> >
>> >
>> > More advanced:
>> > Later I might want to add to that people with the same degree as well as
>> > graduation date.  And, after that, I would probably want to find
>> > "friends" of those same people.   Of course that implies that I added a
>> > relationship of "firend" between people.
>> >
>> > Any help that you can provide me on this would be helpful.  I think that
>> > once I get started with a couple of examples, I will be able to take off.
>> >
>> > thanks,
>> >
>> > Charlie White
>> > Avvo, Inc.
>> > 1218 Third Avenue, Suite 300
>> > Seattle, WA 98101
>> > ___
>> > 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] simple traverse question

2011-02-22 Thread Max De Marzi Jr.
Here you go...

Full code with setup:

https://github.com/maxdemarzi/neography/blob/master/examples/traversal_example2.rb

Interesting bit:

def graduated_with_me(student)
  student = student["self"].split('/').last
  student_attended = @neo.get_node_relationships(student)[0]
  graduated = student_attended["data"]["graduated"]
  school = student_attended["end"].split('/').last

  @neo.traverse(school,"nodes", {"order" => "breadth first",
  "uniqueness" => "node global",
  "relationships" => {"type"=>
"attended", "direction" => "in"},
  "return filter" => {
"language" => "javascript",
"body" => "position.length() == 1
   &&
position.endNode().getId() != #{student}
   &&
position.lastRelationship().getProperty(\"graduated\") ==
#{graduated};"}})
end


Visualize it (sort of... I need to add relationship properties):
http://neovigator.heroku.com/?neoid=201

Neo4j guys, how do we use the new Evaluator via Rest?

Thanks,
Max


On Tue, Feb 22, 2011 at 6:50 PM, charlie  wrote:
> Hi,
> I am new to neo4j and I am having some difficulty figuring out how to query 
> it to get me what I
> need.  We are using Ruby and not JRuby so I am trying to do all my queries 
> via the REST API.
>
> Currently I have a set of "people" nodes and a set of "school" nodes.  Each 
> node has an id field and
> a name.  The ID field is not to be confused with the ID field assigned by 
> neo, but rather a key
> into a relational database elsewhere.
> I have created a people and school index so I can find the nodes by ids
> curl -H Accept:application/json 
> http://localhost:7474/db/data/index/node/person/person_id/28995
>
> I have also created relationships between each person and school called 
> "attended".  I set a
> graduation date and degree name as attributes of each attended relationship.
>
> The query that I want to find all people that attended the same school as I 
> did and graduated at the
> same time.
> person => school => person1, person2, ... personN.
>
>
> More advanced:
> Later I might want to add to that people with the same degree as well as 
> graduation date.  And,
> after that, I would probably want to find "friends" of those same people.   
> Of course that implies
> that I added a relationship of "firend" between people.
>
> Any help that you can provide me on this would be helpful.  I think that once 
> I get started with a
> couple of examples, I will be able to take off.
>
> thanks,
>
> Charlie White
> Avvo, Inc.
> 1218 Third Avenue, Suite 300
> Seattle, WA 98101
> ___
> 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] Neovigator Weekend Project

2011-02-20 Thread Max De Marzi Jr.
Guys,

So I ran into the Ask Ken project ( http://askken.heroku.com/ ) by
Michael Aufreiter yesterdat, and though it was pretty awesome... so I
ported it to using Neo4j.

Check it out: http://neovigator.heroku.com/

On github at https://github.com/maxdemarzi/neovigator

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


Re: [Neo4j] Index question (ReST API)

2011-02-19 Thread Max De Marzi Jr.
The indexing piece is really lacking in Neography.  I keep meaning to
get around to it, and it's about time I did (next week).

It would be nice if we had full indexing support in the REST API first
since whatever I implement will need to change when we do.

If the specs are done, but not yet implemented, can we get a preview?

On Sat, Feb 19, 2011 at 5:03 PM, Michael Hunger
 wrote:
> The problem (as before) is that you have both in neography - the direct REST 
> API methods that just expose the procedural calls to ruby, and the more 
> OO-like Node and Relationship classes.
>
> Easy to mix them up and take them for the same API, but they aren't.
>
> Cheers
>
> Michael
>
> Am 19.02.2011 um 21:34 schrieb Mark Nijhof:
>
>> I think I got confused because neography has node classes that contain
>> properties. So key didn't make much sense to me. I actually think I'll drop
>> neography and start using actual ReST command to get a better understanding.
>>
>> -Mark
>>
>> On Sat, Feb 19, 2011 at 9:21 PM, Peter Neubauer <
>> peter.neuba...@neotechnology.com> wrote:
>>
>>> Yes, that should be about right! Is
>>>
>>> http://components.neo4j.org/neo4j-server/1.3-SNAPSHOT/rest.html#Add_to_index
>>> unclear? In that case, we need to put that out more clearly ...
>>>
>>> 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               - Your high performance graph database.
>>> http://startupbootcamp.org/    - Öresund - Innovation happens HERE.
>>> http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
>>>
>>>
>>>
>>> On Sat, Feb 19, 2011 at 8:56 PM, Mark Nijhof
>>>  wrote:
 Hmm ok, is it this?

 Key is the property name
 Value is the property value

 ?

 -Mark

 On Sat, Feb 19, 2011 at 8:09 PM, Mark Nijhof <
>>> mark.nij...@cre8ivethought.com
> wrote:

> Hi,
>
> I have a question about indexes, when looking at neography I see a
>>> method: add_node_to_index(index,
> key, value, node)
>
> I can understand that index is the name of the index that I want to put
>>> the
> node into, what I don't understand is the key value part of it.
>
> -Mark
>
>
>
> --
> Mark Nijhof
> m: 0047 95 00 99 37
> e:  mark.nij...@cre8ivethought.com
> b:  cre8ivethought.com/blog/index
>
>
>
> "Walking on water and developing software from a specification are easy
>>> if
> both are frozen."
>
> -- Edward V Berard
>
>
>
>


 --
 Mark Nijhof
 m: 0047 95 00 99 37
 e:  mark.nij...@cre8ivethought.com
 b:  cre8ivethought.com/blog/index



 "Walking on water and developing software from a specification are easy
>>> if
 both are frozen."

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

>>>
>>
>>
>>
>> --
>> Mark Nijhof
>> m: 0047 95 00 99 37
>> e:  mark.nij...@cre8ivethought.com
>> b:  cre8ivethought.com/blog/index
>>
>>
>>
>> "Walking on water and developing software from a specification are easy if
>> both are frozen."
>>
>> -- Edward V Berard
>> ___
>> 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] Benchmarking Neo4j with Rtree index -v- PostgreSQL/PostGIS (Peter Neubauer) (Peter Neubauer)

2011-02-01 Thread Max De Marzi Jr.
Not sure if this will work

dd for windows:
http://www.chrysocome.net/dd

command (if = input file, of = output file):
dd if=nodestore.id of=/dev/null


On Tue, Feb 1, 2011 at 11:52 AM, Dave Hesketh
 wrote:
> Peter
> As you suggested, I rerun the searches without closing the db. On the 2nd
> iteration, the search times dropped by 66% and leveled-off after that.
> Unfortunately I don't understand your suggestion: 'You can even warm up
> the OS file caches by doing dd nodestore.id >> /dev/null for all store files
> a couple of times'. I can't find the command or executable dd. I'm running
> on Windows 7 and what you suggest looks to me like a Unix or Linux command.
> Rgds Dave
> ___
> 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 REST server in readonly mode

2011-01-19 Thread Max De Marzi Jr.
Couldn't you put a web server in front of it (Apache, Nginx, etc) and
filter out the post requests while passing the gets?

On Wed, Jan 19, 2011 at 3:11 PM, Jim Webber  wrote:
> Hi Hemant,
>
> Bringing up the REST API in readonly mode is not possible I'm afraid.
>
> We could consider adding it to the Neo4j server, depending on the effort  
> required and whether there are other workarounds.
>
> Jim
> ___
> 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 to get friends of friends using rest?

2010-12-12 Thread Max De Marzi Jr.
This page has how to do exactly that.

https://github.com/maxdemarzi/neography/blob/master/examples/facebook.rb
Try:

{
  "order": "breadth first",
  "uniqueness": "node global",
  "relationships": [
{ "type": "friends", "direction": "in" },
  ],
  "return filter": {
"language": "javascript",
"body": "position.length() == 2;"
  },
  "max depth": 2
}


On Sun, Dec 12, 2010 at 2:11 PM, Peter Neubauer
 wrote:
> Hi Snipe,
> Max has been putting out a lot of good examples for the REST API in
> his Ruby bindings, look at   https://github.com/maxdemarzi/neography.
>
> In there, you will find for instance
>
> n1.outgoing(:friends).depth(2).include_start_node
>
> Which I think does exactly what you are trying to do? Not sure right
> now what the REST call looks like but I would say something like
>
> POST /node/123/traverse/node
>
> with a body of
>
> {
>  "order": "depth first",
>  "uniqueness": "node path",
>  "relationships": [
>    { "type": "KNOWS", "direction": "out" }
>  ],
>  "return filter": {
>    "language": "javascript",
>    "name": "position.length == 2"
>  },
>  "max depth": 2
> }
>
> Does that work? I hope that very soon we are going to move to real
> scripting support when it comes to traversals, so you can do them in
> JavaScript, JRuby or Gremlin. Until then, the above should be
> something you can work with ...
>
> Cheers,
>
> /peter neubauer
>
> COO and Sales, Neo Technology
>
> 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               - Your high performance graph database.
> http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
>
>
>
> On Sun, Dec 12, 2010 at 8:40 PM, snipe  wrote:
>> Hi,
>>
>> I am a new user of neo4j and I think it's great:) Unfortunately, I
>> have a small problem with using REST. I have already defined nodes and
>> relations between them, but I can't get friends of friends (the 2nd
>> level of relationship, example: me => jonh => jack; I want to get jack
>> and others on this level). How can I do it with prune evaluator and
>> return filter? Could you help me? : D Any javascript examples? :)
>>
>> Regards,
>> snipe
>> ___
>> 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] Rest API requests

2010-11-30 Thread Max De Marzi Jr.
> Cheers,
>
> /peter neubauer
>
> COO and Sales, Neo Technology
>
> 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               - Your high performance graph database.
> http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
>
>
>
> On Sat, Nov 27, 2010 at 12:27 AM, Max De Marzi Jr.  
> wrote:
>> Try upping the number of nodes created.  Try 200, 500, 1000.
>>
>> On Fri, Nov 26, 2010 at 9:30 AM, Peter Neubauer
>>  wrote:
>>> Ok,
>>> Andreas helped me to get RVM set up and things working.
>>>
>>> When are you getting the problem? My testing ran good ...
>>>
>>> /peter
>>>
>>> On Wed, Nov 24, 2010 at 5:26 AM, Max De Marzi Jr. 
>>> wrote:
>>>> Hum... not sure try just:
>>>>
>>>>  rspec spec/integration/rest_experimental_spec.rb
>>>>
>>>> On Tue, Nov 23, 2010 at 3:20 PM, Peter Neubauer
>>>>  wrote:
>>>>> Mmh,
>>>>> to start with, I am stuck with some OpenSSL error when trying to run
>>>>> rspecs:
>>>>>
>>>>> bundle exec rspec spec/integration/rest_node_spec.rb
>>>>> JRuby limited openssl loaded. gem install jruby-openssl for full
>>>>> support.
>>>>> http://jruby.kenai.com/pages/JRuby_Builtin_OpenSSL
>>>>> JRuby limited openssl loaded. gem install jruby-openssl for full
>>>>> support.
>>>>> http://jruby.kenai.com/pages/JRuby_Builtin_OpenSSL
>>>>> No Extensions Found: /Users/peterneubauer/.neography
>>>>> FFF
>>>>>
>>>>> Failures:
>>>>>  1) Neography::Rest get_root can get the root node
>>>>>     Failure/Error: root_node = @neo.get_root
>>>>>     OpenSSL::SSL requires the jruby-openssl gem
>>>>>     # ./lib/neography/rest.rb:268:in `get'
>>>>>     # ./lib/neography/rest.rb:27:in `get_root'
>>>>>     # ./spec/integration/rest_node_spec.rb:10
>>>>>     # :1
>>>>>
>>>>>  2) Neography::Rest create_node can create an empty node
>>>>>     Failure/Error: new_node = @neo.create_node
>>>>>     uninitialized constant OpenSSL::SSL
>>>>>     # ./lib/neography/rest.rb:272:in `post'
>>>>>     # ./lib/neography/rest.rb:35:in `create_node'
>>>>>     # ./spec/integration/rest_node_spec.rb:17
>>>>>     # :1
>>>>>
>>>>>  3) Neography::Rest create_node can create a node with one property
>>>>>     Failure/Error: new_node = @neo.create_node("name" => "Max")
>>>>>     uninitialized constant OpenSSL::SSL
>>>>>     # ./lib/neography/rest.rb:272:in `post'
>>>>>     # ./lib/neography/rest.rb:33:in `create_node'
>>>>>     # ./spec/integration/rest_node_spec.rb:22
>>>>>     # :1
>>>>>
>>>>>
>>>>> Any hints what could be the reason? I have installed
>>>>>
>>>>> gem install jruby-openssl but are still getting that error on Mac OSX.
>>>>> Any hints?
>>>>>
>>>>> /peter
>>>>> ___
>>>>> 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


Re: [Neo4j] Rest API requests

2010-11-26 Thread Max De Marzi Jr.
Try upping the number of nodes created.  Try 200, 500, 1000.

On Fri, Nov 26, 2010 at 9:30 AM, Peter Neubauer
 wrote:
> Ok,
> Andreas helped me to get RVM set up and things working.
>
> When are you getting the problem? My testing ran good ...
>
> /peter
>
> On Wed, Nov 24, 2010 at 5:26 AM, Max De Marzi Jr.  
> wrote:
>> Hum... not sure try just:
>>
>>  rspec spec/integration/rest_experimental_spec.rb
>>
>> On Tue, Nov 23, 2010 at 3:20 PM, Peter Neubauer
>>  wrote:
>>> Mmh,
>>> to start with, I am stuck with some OpenSSL error when trying to run
>>> rspecs:
>>>
>>> bundle exec rspec spec/integration/rest_node_spec.rb
>>> JRuby limited openssl loaded. gem install jruby-openssl for full support.
>>> http://jruby.kenai.com/pages/JRuby_Builtin_OpenSSL
>>> JRuby limited openssl loaded. gem install jruby-openssl for full support.
>>> http://jruby.kenai.com/pages/JRuby_Builtin_OpenSSL
>>> No Extensions Found: /Users/peterneubauer/.neography
>>> FFF
>>>
>>> Failures:
>>>  1) Neography::Rest get_root can get the root node
>>>     Failure/Error: root_node = @neo.get_root
>>>     OpenSSL::SSL requires the jruby-openssl gem
>>>     # ./lib/neography/rest.rb:268:in `get'
>>>     # ./lib/neography/rest.rb:27:in `get_root'
>>>     # ./spec/integration/rest_node_spec.rb:10
>>>     # :1
>>>
>>>  2) Neography::Rest create_node can create an empty node
>>>     Failure/Error: new_node = @neo.create_node
>>>     uninitialized constant OpenSSL::SSL
>>>     # ./lib/neography/rest.rb:272:in `post'
>>>     # ./lib/neography/rest.rb:35:in `create_node'
>>>     # ./spec/integration/rest_node_spec.rb:17
>>>     # :1
>>>
>>>  3) Neography::Rest create_node can create a node with one property
>>>     Failure/Error: new_node = @neo.create_node("name" => "Max")
>>>     uninitialized constant OpenSSL::SSL
>>>     # ./lib/neography/rest.rb:272:in `post'
>>>     # ./lib/neography/rest.rb:33:in `create_node'
>>>     # ./spec/integration/rest_node_spec.rb:22
>>>     # :1
>>>
>>>
>>> Any hints what could be the reason? I have installed
>>>
>>> gem install jruby-openssl but are still getting that error on Mac OSX.
>>> Any hints?
>>>
>>> /peter
>>> ___
>>> 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] [SPAM] Re: Datetimes in Neo4j REST Server

2010-11-24 Thread Max De Marzi Jr.
I was thinking about this...Neo4j doesn't really do Dates.  It's Java
Primitives or Strings.

So how about we just establish a convention?

Something like:

Any field ending in "date", "time", "_at", or "_on" is assumed to be a
date (in Unix Epoch milliseconds) and will be converted (from string,
int, long, float, double) into whatever the idiomatic way for handling
dates is (in the language of the library being used).




On Wed, Nov 24, 2010 at 2:15 AM, Mattias Persson
 wrote:
> Neo4j REST/Server handles array values:
>
> { "array-property": [10, 321, 45] }
>
> 2010/11/24 Max De Marzi Jr. 
>
>> BSON seems to have an Array type as well.
>>
>> http://bsonspec.org/#/specification
>>
>>
>>
>> On Tue, Nov 23, 2010 at 7:40 PM, Javier de la Rosa 
>> wrote:
>> > IMHO, the data types that are not supported by the Neo4j REST API are
>> > Date and Binary data. So it could be a solution add a Neo4j special
>> > dictionary for these cases:
>> > {
>> > "address":
>> >     {
>> >         "streetAddress": "21 2nd Street",
>> >         "city": "New York",
>> >         "state": "NY",
>> >         "postalCode": "10021",
>> >         "birthdate": {
>> >                 "__ntype__": "/Date(36779659600.0)/", # Timestamp in
>> > Javascript supports BC dates
>> >                 "__nval__": "1971-02-03T00:00:00"  # ISO Format also
>> > supports BC dates
>> >         }
>> >     },
>> > }
>> > On the other hand, I don't know how Neo4j handles Arrays and Objects
>> > in order to put them like values in properties when they came from a
>> > REST client. It Neo4j doesn't handle this, then it's not a problem to
>> > have some special dics for dates.
>> >
>> > All of this come from the limitations on JSON by itself. It's more
>> > usual of what we think to use a domain specific implementation for the
>> > JSON interchange. For example, Cassandra uses JSON2SStable to
>> > import/export data, and mongoDB created BSON [1] to support Date and
>> > binary data.
>> >
>> > Best regards.
>> >
>> >
>> > [1] http://bsonspec.org/
>> >
>> > On Tue, Nov 23, 2010 at 19:02, Max De Marzi Jr. 
>> wrote:
>> >> What about:
>> >>
>> >> "data": {"name" : "NeoS::Max"}, "age": {"NeoI::31" }
>> >> "data": {"name" : "NeoS[]::Max,Javier,Peter"}, "age":
>> {"NeoI[]::31,29,33" }
>> >>
>> >>
>> >>
>> >> On Tue, Nov 23, 2010 at 4:59 PM, Rick Bullotta
>> >>  wrote:
>> >>> FWIW, we store all dates as milliseconds relative to UTC, and pass them
>> >>> around in that format.  We identify the data types of fields/properties
>> in
>> >>> separate metadata structures embedded in the response, making the
>> returned
>> >>> content easily parsable and interpretable by relatively dumb clients.
>> >>>
>> >>> -Original Message-
>> >>> From: user-boun...@lists.neo4j.org [mailto:
>> user-boun...@lists.neo4j.org] On
>> >>> Behalf Of Javier de la Rosa
>> >>> Sent: Tuesday, November 23, 2010 4:26 PM
>> >>> To: Neo4j user discussions
>> >>> Subject: [SPAM] Re: [Neo4j] Datetimes in Neo4j REST Server
>> >>>
>> >>> On Tue, Nov 23, 2010 at 16:05, Peter Neubauer
>> >>>  wrote:
>> >>>> Jim, what do you say about that? How type safe can we make the REST
>> >>>> API? At least I think this warrants an issue over at
>> >>>> https://trac.neo4j.org/ticket/286 for this.
>> >>>
>> >>> Thank you Peter and Max for the quick response. It would be great to
>> >>> have well defined data types in the REST server.
>> >>> I hope the solution also works in order to talk to the server what
>> >>> types are sent to it, because now we have no way to create Date or
>> >>> List objects like properties in nodes or relationships trhough the
>> >>> REST API.
>> >>>
>> >>> It's not easy manage with Dates and objects in JSON. The proposal in
>> >>

Re: [Neo4j] Rest API requests

2010-11-23 Thread Max De Marzi Jr.
Hum... not sure try just:

 rspec spec/integration/rest_experimental_spec.rb

On Tue, Nov 23, 2010 at 3:20 PM, Peter Neubauer
 wrote:
> Mmh,
> to start with, I am stuck with some OpenSSL error when trying to run rspecs:
>
> bundle exec rspec spec/integration/rest_node_spec.rb
> JRuby limited openssl loaded. gem install jruby-openssl for full support.
> http://jruby.kenai.com/pages/JRuby_Builtin_OpenSSL
> JRuby limited openssl loaded. gem install jruby-openssl for full support.
> http://jruby.kenai.com/pages/JRuby_Builtin_OpenSSL
> No Extensions Found: /Users/peterneubauer/.neography
> FFF
>
> Failures:
>  1) Neography::Rest get_root can get the root node
>     Failure/Error: root_node = @neo.get_root
>     OpenSSL::SSL requires the jruby-openssl gem
>     # ./lib/neography/rest.rb:268:in `get'
>     # ./lib/neography/rest.rb:27:in `get_root'
>     # ./spec/integration/rest_node_spec.rb:10
>     # :1
>
>  2) Neography::Rest create_node can create an empty node
>     Failure/Error: new_node = @neo.create_node
>     uninitialized constant OpenSSL::SSL
>     # ./lib/neography/rest.rb:272:in `post'
>     # ./lib/neography/rest.rb:35:in `create_node'
>     # ./spec/integration/rest_node_spec.rb:17
>     # :1
>
>  3) Neography::Rest create_node can create a node with one property
>     Failure/Error: new_node = @neo.create_node("name" => "Max")
>     uninitialized constant OpenSSL::SSL
>     # ./lib/neography/rest.rb:272:in `post'
>     # ./lib/neography/rest.rb:33:in `create_node'
>     # ./spec/integration/rest_node_spec.rb:22
>     # :1
>
>
> Any hints what could be the reason? I have installed
>
> gem install jruby-openssl but are still getting that error on Mac OSX.
> Any hints?
>
> /peter
> ___
> 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] [SPAM] Re: Datetimes in Neo4j REST Server

2010-11-23 Thread Max De Marzi Jr.
BSON seems to have an Array type as well.

http://bsonspec.org/#/specification



On Tue, Nov 23, 2010 at 7:40 PM, Javier de la Rosa  wrote:
> IMHO, the data types that are not supported by the Neo4j REST API are
> Date and Binary data. So it could be a solution add a Neo4j special
> dictionary for these cases:
> {
> "address":
>     {
>         "streetAddress": "21 2nd Street",
>         "city": "New York",
>         "state": "NY",
>         "postalCode": "10021",
>         "birthdate": {
>                 "__ntype__": "/Date(36779659600.0)/", # Timestamp in
> Javascript supports BC dates
>                 "__nval__": "1971-02-03T00:00:00"  # ISO Format also
> supports BC dates
>         }
>     },
> }
> On the other hand, I don't know how Neo4j handles Arrays and Objects
> in order to put them like values in properties when they came from a
> REST client. It Neo4j doesn't handle this, then it's not a problem to
> have some special dics for dates.
>
> All of this come from the limitations on JSON by itself. It's more
> usual of what we think to use a domain specific implementation for the
> JSON interchange. For example, Cassandra uses JSON2SStable to
> import/export data, and mongoDB created BSON [1] to support Date and
> binary data.
>
> Best regards.
>
>
> [1] http://bsonspec.org/
>
> On Tue, Nov 23, 2010 at 19:02, Max De Marzi Jr.  wrote:
>> What about:
>>
>> "data": {"name" : "NeoS::Max"}, "age": {"NeoI::31" }
>> "data": {"name" : "NeoS[]::Max,Javier,Peter"}, "age": {"NeoI[]::31,29,33" }
>>
>>
>>
>> On Tue, Nov 23, 2010 at 4:59 PM, Rick Bullotta
>>  wrote:
>>> FWIW, we store all dates as milliseconds relative to UTC, and pass them
>>> around in that format.  We identify the data types of fields/properties in
>>> separate metadata structures embedded in the response, making the returned
>>> content easily parsable and interpretable by relatively dumb clients.
>>>
>>> -Original Message-
>>> From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On
>>> Behalf Of Javier de la Rosa
>>> Sent: Tuesday, November 23, 2010 4:26 PM
>>> To: Neo4j user discussions
>>> Subject: [SPAM] Re: [Neo4j] Datetimes in Neo4j REST Server
>>>
>>> On Tue, Nov 23, 2010 at 16:05, Peter Neubauer
>>>  wrote:
>>>> Jim, what do you say about that? How type safe can we make the REST
>>>> API? At least I think this warrants an issue over at
>>>> https://trac.neo4j.org/ticket/286 for this.
>>>
>>> Thank you Peter and Max for the quick response. It would be great to
>>> have well defined data types in the REST server.
>>> I hope the solution also works in order to talk to the server what
>>> types are sent to it, because now we have no way to create Date or
>>> List objects like properties in nodes or relationships trhough the
>>> REST API.
>>>
>>> It's not easy manage with Dates and objects in JSON. The proposal in
>>> https://trac.neo4j.org/ticket/286 adds some overhead although I think
>>> is a very good solution. However, there wouldn't be backwards
>>> compatibility.
>>>
>>> Best regards.
>>>
>>>
>>>
>>> --
>>> Javier de la Rosa
>>> http://versae.es
>>> ___
>>> 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
>>
>
>
>
> --
> Javier de la Rosa
> http://versae.es
> ___
> 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] [SPAM] Re: Datetimes in Neo4j REST Server

2010-11-23 Thread Max De Marzi Jr.
What about:

"data": {"name" : "NeoS::Max"}, "age": {"NeoI::31" }
"data": {"name" : "NeoS[]::Max,Javier,Peter"}, "age": {"NeoI[]::31,29,33" }



On Tue, Nov 23, 2010 at 4:59 PM, Rick Bullotta
 wrote:
> FWIW, we store all dates as milliseconds relative to UTC, and pass them
> around in that format.  We identify the data types of fields/properties in
> separate metadata structures embedded in the response, making the returned
> content easily parsable and interpretable by relatively dumb clients.
>
> -Original Message-
> From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On
> Behalf Of Javier de la Rosa
> Sent: Tuesday, November 23, 2010 4:26 PM
> To: Neo4j user discussions
> Subject: [SPAM] Re: [Neo4j] Datetimes in Neo4j REST Server
>
> On Tue, Nov 23, 2010 at 16:05, Peter Neubauer
>  wrote:
>> Jim, what do you say about that? How type safe can we make the REST
>> API? At least I think this warrants an issue over at
>> https://trac.neo4j.org/ticket/286 for this.
>
> Thank you Peter and Max for the quick response. It would be great to
> have well defined data types in the REST server.
> I hope the solution also works in order to talk to the server what
> types are sent to it, because now we have no way to create Date or
> List objects like properties in nodes or relationships trhough the
> REST API.
>
> It's not easy manage with Dates and objects in JSON. The proposal in
> https://trac.neo4j.org/ticket/286 adds some overhead although I think
> is a very good solution. However, there wouldn't be backwards
> compatibility.
>
> Best regards.
>
>
>
> --
> Javier de la Rosa
> http://versae.es
> ___
> 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] Datetimes in Neo4j REST Server

2010-11-23 Thread Max De Marzi Jr.
Hum...maybe we should have the type of object in the json string?

"data": {"name" : {"string" : "Max"}, "age": {"int" :31} }

also how about arrays?   "string[]" : ["Max", "Javier","Peter"]


On Tue, Nov 23, 2010 at 1:02 PM, Javier de la Rosa  wrote:
> I was writting some extra tests for the python rest client and
> checking what are the types allowed.
> The boolean, strings, integers and floats seem to be OK when the
> client receives the JSOn from the server. But if I serialize a date or
> datetime, I have no way to know whether I must do a casting the data
> to a datetime object or whether it's simply a string containing a
> date. What should I do? Are the dates handled in a different way?
>
> --
> Javier de la Rosa
> http://versae.es
> ___
> 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] Rest API requests

2010-11-23 Thread Max De Marzi Jr.
Yup, just run:

gem install bundler

Assuming you have a forks\neography directory:

cd forks\neography
git pull upstream master
bundle install
bundle exec rspec spec/integration/rest_bulk_spec.rb

I'm on JRuby 1.6.0.dev (2010-08-30 3040e75) (a bit old...)

On Tue, Nov 23, 2010 at 10:57 AM, Peter Neubauer
 wrote:
> Max,
> did you install bundler to do the "bundle exec"? Are you running Ruby
> or JRuby, and where is the "bundle" binary installed after I do
>
> gem install bundler?
>
> 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               - Your high performance graph database.
> http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
>
>
>
> On Tue, Nov 23, 2010 at 9:23 AM, Max De Marzi Jr.  
> wrote:
>> Hello,
>>
>> I started adding "fake" bulk operations to neography (
>> https://github.com/maxdemarzi/neography ) but ran into issues when
>> trying to create or get more than 100 nodes at a time.
>>
>> ubuntu ~/forks/neography: bundle exec rspec 
>> spec/integration/rest_bulk_spec.rb
>> No Extensions Found: /home/max/.neography
>> .      user     system      total        real
>> create 100 nodes            3.411000   0.00   3.411000 (  3.411000)
>> create 100 nodes threaded   1.909000   0.00   1.909000 (  1.909000)
>> create 200 nodes threaded^C
>> Exiting... Interrupt again to exit immediately.
>>
>> It just hangs when I try 200 and eventually I get a "execution
>> expired" error.  150 fails, 125 fails, 110 sometimes worked, 100
>> ALWAYS worked (threaded and non-threaded).
>>
>> Did you guys see any issues like this with your test harness against
>> the Rest API?
>> Anybody using another Rest client having these issues?
>>
>> Thanks,
>> Max
>> ___
>> 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] Rest API requests

2010-11-23 Thread Max De Marzi Jr.
Hello,

I started adding "fake" bulk operations to neography (
https://github.com/maxdemarzi/neography ) but ran into issues when
trying to create or get more than 100 nodes at a time.

ubuntu ~/forks/neography: bundle exec rspec spec/integration/rest_bulk_spec.rb
No Extensions Found: /home/max/.neography
.  user system  totalreal
create 100 nodes3.411000   0.00   3.411000 (  3.411000)
create 100 nodes threaded   1.909000   0.00   1.909000 (  1.909000)
create 200 nodes threaded^C
Exiting... Interrupt again to exit immediately.

It just hangs when I try 200 and eventually I get a "execution
expired" error.  150 fails, 125 fails, 110 sometimes worked, 100
ALWAYS worked (threaded and non-threaded).

Did you guys see any issues like this with your test harness against
the Rest API?
Anybody using another Rest client having these issues?

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


Re: [Neo4j] neo4j-rest

2010-11-22 Thread Max De Marzi Jr.
Hum...

Check out the gist, I'm getting 7 node level 5's back.

Maybe my node layout is wrong, tweak it to what you have and we can
try a few things...

On Mon, Nov 22, 2010 at 1:28 AM, Anees Haider  wrote:
> Thanks Max, It is now at least full filling some of the requirements. Now
> the only limitation I am having is that I am only getting close nodes i.e. I
> --> J --> K (nodes at most 2 hops away) not nodes further away (more than 2
> hops away) such as I --> A --> B --> C --> K, (please note I and K are
> represeneted in both cases).
>
>
>
> Regards,
>
> Anees Haider
>
>
> P.S. That was typo, "results filter" ---instead of---> "return filter"
> ___
> 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-rest

2010-11-21 Thread Max De Marzi Jr.
Something like this:

https://gist.github.com/709623

 "prune evaluator" => {
"language" => "javascript",
"body" =>
"position.startNode().hasProperty('NODE_LEVEL')
&&
position.startNode().getProperty('NODE_LEVEL')==5
&&
position.startNode().getId()!=#{starting_id};"},
 "return filter" => {
"language" => "javascript",
"body" =>
"position.endNode().hasProperty('NODE_LEVEL') &&
position.endNode().getProperty('NODE_LEVEL')==5;"},



On Sun, Nov 21, 2010 at 11:50 PM, Max De Marzi Jr.  wrote:
> "result filter"? shouldn't that be "return filter" or was that not a
> copy and paste?
>
> On Sun, Nov 21, 2010 at 11:34 PM, Anees Haider  wrote:
>> Hi all,
>>
>>
>>
>> I want to write an prune evaluator for neo4j-rest, such that we have a node
>> type "N" (having property "p" set to value "v", i.e. NODE_LEVEL==5), we
>> start from a node of type "N" and traverse to other nodes, when we reach to
>> other node of type  "N" we should include that node in result but prune the
>> nodes from there, results should consists of nodes of type "N", I have
>> written following JavaScript code, but it is not giving correct results (it
>> is returning all connected nodes):
>>
>>
>>
>>
>>
>> curl -H Accept:application/json -H Content-Type:application/json -X POST -d
>> '{"order": "breadth first",
>>
>> "prune evaluator": { "language": "javascript",
>>
>>  "body": "
>>
>>  var n=position.startNode();
>>
>> if(n.hasProperty('\''NODE_LEVEL'\'') && n.getProperty('\''NODE_LEVEL'\'')==5
>> && n.getId()!=448)  // 448 is start node Id of type "N"
>>
>> { true; }
>>
>> false;"
>>
>> },
>>
>> "result filter": { "language": "javascript",
>>
>> "body": "
>>
>> var n=position.getNode();
>>
>> if(n.hasProperty('\''NODE_LEVEL'\'') &&
>> n.getProperty('\''NODE_LEVEL'\'')==5)
>>
>> { true; }
>>
>> false;"
>>
>> }}' http://localhost:/node/448/traverse/path
>>
>>
>>
>>
>>
>> Thanks and regards,
>>
>> Anees Haider
>>
>>
>>
>> P.S. sorry for repost, I thought more clarification would be better.
>>
>> ___
>> 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-rest

2010-11-21 Thread Max De Marzi Jr.
"result filter"? shouldn't that be "return filter" or was that not a
copy and paste?

On Sun, Nov 21, 2010 at 11:34 PM, Anees Haider  wrote:
> Hi all,
>
>
>
> I want to write an prune evaluator for neo4j-rest, such that we have a node
> type "N" (having property "p" set to value "v", i.e. NODE_LEVEL==5), we
> start from a node of type "N" and traverse to other nodes, when we reach to
> other node of type  "N" we should include that node in result but prune the
> nodes from there, results should consists of nodes of type "N", I have
> written following JavaScript code, but it is not giving correct results (it
> is returning all connected nodes):
>
>
>
>
>
> curl -H Accept:application/json -H Content-Type:application/json -X POST -d
> '{"order": "breadth first",
>
> "prune evaluator": { "language": "javascript",
>
>  "body": "
>
>  var n=position.startNode();
>
> if(n.hasProperty('\''NODE_LEVEL'\'') && n.getProperty('\''NODE_LEVEL'\'')==5
> && n.getId()!=448)  // 448 is start node Id of type "N"
>
> { true; }
>
> false;"
>
> },
>
> "result filter": { "language": "javascript",
>
> "body": "
>
> var n=position.getNode();
>
> if(n.hasProperty('\''NODE_LEVEL'\'') &&
> n.getProperty('\''NODE_LEVEL'\'')==5)
>
> { true; }
>
> false;"
>
> }}' http://localhost:/node/448/traverse/path
>
>
>
>
>
> Thanks and regards,
>
> Anees Haider
>
>
>
> P.S. sorry for repost, I thought more clarification would be better.
>
> ___
> 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] Hello list

2010-11-16 Thread Max De Marzi Jr.
Jose,

Cual es tu pregunta en espa~nol?  Yo puedo traducir por ti.

Parece que estas preguntado cual es el modelo que neo4j usa, pero no
entendemos a lo que te refieres.

El modelo es cualquier cosa que puedes modelar con simple puntos y
relaciones.  Los puntos pueden ser de cualqier forma (con tal de que
sean un Java Primitive, tambienes puedes usar a String para
reprecentar algo mas complicado con JSON o algo parecido).
No puedes tener un punto que sea otra grapha, pero si necesitas hacer
algo asi lo puedes hacer con segmentos de puntos desconectados y
temporariamente crear relaciones entre los puntos cuando necesitas.

-

What is your question is spanish? I can translate for you.

It seems like you are asking what model neo4j uses, put we do not
understand quite what you are referring to.
The "model" is whatever you can describe with a series of nodes and
relationships.  The nodes can be anything (as long as they are Java
Primitives, you can also use a String to represent something more
complicated using JSON or whatever).
You cannot have a node that is itself a graph, but if you need to do
something like this, you can do it with disjointed node segments and
temporarily create relationships between them as you need them.


--Max

On Tue, Nov 16, 2010 at 7:23 PM, Jose Angel Inda Herrera
 wrote:
> Andrea Taylor
> sorry by my english, realy is bad.
> My quetion is,
> What is the data model that use neo4j or your specification.
> thanks you very much.
> ___
> 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-Rails and Ext-JS

2010-10-30 Thread Max De Marzi Jr.
That example is for the OLD gem.

Try http://github.com/andreasronge/neo4j-rails-example

 Andreas is almost ready with http://github.com/andreasronge/neo4j

On Sat, Oct 30, 2010 at 2:19 AM, Ahmed Abdelsalam
 wrote:
> Hi,
>
>
>
> I'm working on a project for using Neo4j as a database for JRuby-based Rails
> application. I found a good example here:
> http://github.com/maxdemarzi/neo4j-rails-example and I was able to start
> developing my application.
>
>
>
> However, I have another requirement that needs to implement the rails
> application using Ext-JS library.
>
>
>
> I know that the plugin ext_scaffold is helpful in generating resources based
> on Ext-JS, however, I tried this but no success. Neo4j-Rails removes the
> dependency on ActiveRecord ad replaces it with Neo4J as a database, while
> the ext-scaffold plugin requires ActiveRecord.
>
>
>
> Any help on this? Thank you in advance.
>
>
>
> Regards,
>
>
>
> Ahmed Abdelsalam
>
>
>
> ___
> 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 to traverse by the number of relationships between nodes?

2010-07-09 Thread Max De Marzi Jr.
Can you expand on this a bit... as to what the graph internals are doing:

Option 1:
You have "colored" relationships (RED, BLUE, GREEN, etc to 10k colors).
>From a random node, you traverse the graph finding all nodes that it is
connected to via the PURPLE or FUSIA relationship.

vs

Option 2:
You have a COLOR relationship with a name property that contains the actual
color name.
>From a random node, you traverse the graph finding all nodes that it is
connected to via the COLOR relationship containing the name "PURPLE" or
"FUSIA" in the relationship.


For some reason I thought it was more expensive (in terms of traversal time)
to look up a property on a relationship than to simply pass a named
relationship type.


On Fri, Jul 9, 2010 at 8:45 AM, Johan Svensson wrote:

> Hi,
>
> I would not recommend to use large amounts of different (dynamically
> created) relationship types. It is better to use well defined
> relationship types with an additional property on the relationship
> whenever needed. The limit is actually not 64k but 2^31, but having
> large amounts of relationship types like 10k-100k+ will reduce
> performance and consume a lot of memory.
>
> Regards,
> Johan
>
> On Thu, Jul 8, 2010 at 4:13 PM, Max De Marzi Jr. 
> wrote:
> > Can somebody verify the max number of relationship types? If it is 64k,
> is
> > there a way to increase it without significant effort?
> >
> >
> >>  I believe you can have something like 64k
> >> relationship types, so using the relationship type for the route name is
> >> possible.
> ___
> 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 to traverse by the number of relationships between nodes?

2010-07-08 Thread Max De Marzi Jr.
Can somebody verify the max number of relationship types? If it is 64k, is
there a way to increase it without significant effort?


>  I believe you can have something like 64k
> relationship types, so using the relationship type for the route name is
> possible.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] General questions

2010-05-02 Thread Max De Marzi Jr.
Ilya,

Remember that we have no 3 way relationships (as in types), you have use a
node for anything that connects more than two objects. So break down Show
into Episodes if you want to to track the 1st (or only) airing of that
episode.

Actor  1 = Node 1 Class Actor
Show 1 = Node 2 Class Show
Network 1 = Node 3 Class Network
Season 1 = Node 4 Class Season
Season 2 = Node 5 Class Season
Episodes 1-12 = Nodes 6-17 Class Episodes
Network 2 = Node 18 Class Network
Episodes 13-24 = Nodes 19-30 Class Episodes

Actor 1 STARRED_ON Show 1
Actor 1 APPEARED_ON Episode 3
Actor 1 APPEARED_ON Episode 20
Episode 1 AIRED_ON Network 1
Episode 20 AIRED_ON Network 2
--

Now, if you want to keep track of Re-Runs on different networks then you
have to change that AIRED_ON relationship into a Node class.

Aired_on 1 PLAYED_ON Network 2
Aired_on 1 IS_A Episode 20

The trick for me has been to find all the many-to-many relationships and
break them down into nodes and if the idea is to eventually have a data
warehouse with "slowly changing dimensions", then bake those in as
"Instances".

With the rest API NEO4j becomes a web server.  Have 50 of them if you want,
multicast the writes, load balance the reads, etc.


>Suppose I haveActor – starts in à Show – airs on à Network


I want to keep track when given actor started in given show that air on
given Network.  I’d like to keep this 3 way relationship as constant but
have property (or something similar) that will keep track of dates when
Actors/networks change while relationships and show remain constant.



On Sun, May 2, 2010 at 4:44 PM, ilya  wrote:

> Max and Anders,
>
>
>
> Thanks much for your replies and detail info!
>
>
>
> I think I have better understanding now about reusability via inheritance
> and interfaces.  I see now that if I want to define things once and then
> extend/reuse them I simply need to create my own wrappers in language of
> choice (ie Java)  IMDB role as wrapper around relationship is perfect
> example.
>
>
>
> For multi-value I like setProperty API – very useful.
>
>
>
> Categorizing/grouping – I realized I might’ve not been very clear.  So let
> me provide different example.
>
> Suppose I haveActor – starts in à Show – airs on à Network
>
>
> I want to keep track when given actor started in given show that air on
> given Network.  I’d like to keep this 3 way relationship as constant but
> have property (or something similar) that will keep track of dates when
> Actors/networks change while relationships and show remain constant.
>
>
>
> Max, for clustering, I checked Restful API (very useful) but still ties
> everything into one app server that neo is running under.
> I won’t be able to run that server as cluster unless I have some smart
> logic
> that will have server not running Neo hit other server that runs Neo via
> Rest API which is messy.  It’s definitely possibility but hope there better
> way.
>
>
>
> Regards,
>
> Ilya
>
> ___
> Neo mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] General questions

2010-05-01 Thread Max De Marzi Jr.
I'm no expert, but I tried to answer your questions.

On Sat, May 1, 2010 at 7:23 PM, ilya  wrote:

> Hi all,
>
>
>
> I went through all docs on Neo site and it looks very interesting.
>  However,
> I still have couple of things I was wondering about that I couldn’t find
> answers to.  I hope I can get some information or someone can point me in
> the right direction on some of these.
>
> Sorry for many questions but really appreciate it even if only some can be
> answered.
>
>
>
> 1)  Inheritance.
> Suppose I want to draw tree where every node is derived from other node;
> say
> Car à Sedan à Toyota
> So when creating Toyota node I don’t need to recreate same properties and
> relationships that Sedan has.
>
> Is there something in Neo that will help me achieve this? If not what’s the
> best (or good approach) of achieving this? (ie assuming I use Java  -
> should
> I keep my own class hierarchy?)
> At the same time I wonder how this structure will affect indexing/searching
> (ie find all car/sedan/Toyotas)
>
> Just create a Camry Se Node that IS_A Sedan and IS_A Car.  Traverse IS_A
> relationships and add property where the property doesn't already exist.
>
> 2)  Multi value properties
> When it come to properties I see I can store key=value pairs but what if I
> want to store key=values
> For example, I’d like to have property possibleColors where my values are
> red, blue, green, etc
>
> Do I need to create separate nodes and properties for each color?
>

You can store a delimited string as a property or use JSON.

3)  Interfaces
> If I have the following: person – drives -> car,  person – drives -> boat
> Is there a way to define drives interface which might have its own
> properties that can be used as template or even reused in both
> relationships
> above? If not what’s the good approach to achieve this?
>
>

Drives can be a relationship type which has its own properties which you can
customize. Remember that NEO doesn't really enforce the properties in a node
or a relationship, so you can add whatever you want.


> 4)  Categorizing/grouping multiple nodes including relationships
> What  is the best strategy of grouping nodes if I want to include
> relationships as well?
> For example, person 1 – owns à car 1car 1 – sold à person 2  then car 1
> -- sold àperson 3
> I want to keep track of how long each person had car 1; this also need to
> account for each person having more than one car.
>

3 Person nodes, 2 Car nodes
Person 1 OWNED (relationship: start_date, end_date) Car 1 Node
Person 1 OWNED (relationship: start_date, end_date) Car 2 Node
Person 2 OWNED (relationship: start_date, end_date) Car 1 Node

For multi relationship objects you switch from a relationship to a node.
Trasfer Node - Sold_By Relationship to Person 1
Trasfer Node - Sold_to Relationship to Person 2
Trasfer Node - Thing_Sold Relationship to Car 1
Transfer Node can have a property of transfer_date, and transfer_price




>
> 5)  Neo clustering (load balancing) / accessing from multiple sources
> From what I read I understand that Neo only accessible from JVM that runs
> it.
> So if I want to access it from the web I would probably setup Application
> server such as JBoss and have it run in the same JVM.  How does one address
> the following:
>
> -  In case I want to do load balancing say run 2 JBoss instances in
> cluster mode that need to access Neo?
>
> -  What if I want to connect to Neo both via web and via stand
> alone
> process (probably run on different machine) for batch processing.
>
>
> See work on REST API.


>
> Sorry for too many questions but these are really important for my
> architecture.
>
>
>
> Thanks a lot,
>
> Ilya
>
> ___
> Neo mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] How to efficiently query in Neo4J?

2010-04-09 Thread Max De Marzi Jr.
On first traversal, add a relationship to a "found node" to each node that
would return, and check for this relationship on the second traversal?
Maybe create a unique id, set a property or add a node property with the
unique id on the first traversal, and check for this property on the second
traversal?


On Fri, Apr 9, 2010 at 8:04 AM, Alastair James  wrote:

> On 9 April 2010 07:50, Peter Neubauer  >wrote:
>
> > Marko and me tried to summarize what is working especially good with
> > Graph Databases and what not:
> >
>
> Yes, but in my mind, my use case is a *perfect* example of what should work
> well in a graph DB. It is an exact example of inforamtion organised by
> related categories and other relations. After all, in effect, every website
> IS a graph already. Using a graph data model allows us to build site
> engines
> that are can harness the flexibility of the web without requiring loads of
> joining tables as typically found in SQL databases that try model this.
>
> So therefore, I do not accept that this is not a good use case for graphs.
> I
> probably presented a too simplistic example of just posts and tags, but I
> envisage a system where posts relate to posts, to tags, tags relate to tags
> whatever. It would be a *nightmare* to implement in SQL.
>
> So, I suppose this question boils down to, is there an efficient way to
> calculate the union of two traversals without retrieving all result sets
> and
> performing the union in user code?
>
> Al
> ___
> Neo mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] How to efficiently query in Neo4J?

2010-04-08 Thread Max De Marzi Jr.
You know this is something that I think needs to be made clear... using just
the graph is not the right way to go unless you have a very special
application.

I was trying to traverse over cities/people/jobs/skills and they were taking
a while (as in 10-15 seconds).
Then I did it sqlserver... less than 1 second.  I tried running ALL users
through it.. 2 minutes vs god knows how long for doing a traversal for each
user (400k users).

Some things are better not done in the graph.  So I decided to keep that in
tables, and just move the "person relationships" to the graph (works with,
manages, knows, friends, etc).

I treat the graph like a specialized index.
Makes a lot more sense now, and I get the best of both worlds.



On Thu, Apr 8, 2010 at 4:35 PM, Michael Ludwig  wrote:

> Alastair James schrieb am 07.04.2010 um 15:53:50 (+0100)
> [[Neo] How to efficiently query in Neo4J?]:
>
> > Briefly, the site consists of posts, each tagged with various
> > attributes, e.g. (its a travel site) location, theme, cost etc... Also
> > the tags are hierarchical. So, for location we have (say) 'tuscany'
> > inside 'italy' inside 'europe'. For theme we have (say) 'cycling'
> > inside 'activity'.
>
> After giving this some thought, it looks to me as if there is nothing
> particularly graphy in your example. I know, most everything is a graph,
> but here the data is more regular: Your hierarchical catalog of tags
> immediately made me think of Joe Celko's nested sets, which is a very
> efficient way to represent trees in terms of sets, as found in SQL
> databases. (Heresy again, I know, but well.) And the relationship of
> posts to tags is simply N-M, and that's it.
>
> There aren't any real links (edges) between posts, which arguably would
> make your data model more graphy. In your model, related posts are
> related by virtue of their attributes (they share some tags, or are
> posted by the same user), and not eis ipsis. So I'd say there is not
> much in the way of graphiness.
>
> --
> Michael Ludwig
> ___
> Neo mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] How to efficiently query in Neo4J?

2010-04-07 Thread Max De Marzi Jr.
I've had similar issues and they way I've done it (which may not be the
right way) is to run the first traversal and store the returned nodes.  Then
run the second traversal and return only if it is contained in the set of
returned nodes in the first traversal.

The traverses hit each node only once, and since we want to return only if
they are found twice, I don't think there is a clean way to do it in a
single traversal.

On Wed, Apr 7, 2010 at 9:53 AM, Alastair James  wrote:

> Hi there...
>
> I am looking at moving a website to a model based on Neo4J, however, I am
> having trouble seeing how to optimise the 'main query' type for Neo4J.
>
> Briefly, the site consists of posts, each tagged with various attributes,
> e.g. (its a travel site) location, theme, cost etc... Also the tags
> are hierarchical. So, for location we have (say) 'tuscany' inside 'italy'
> inside 'europe'. For theme we have (say) 'cycling' inside 'activity'.
>
> I can beautifully model the parent child relationships of these 'tags'
> using
> a graph Db as objects with a 'CHILD_OF' relationship type. Then the posts
> go
> in and have related 'tags' related to them with a 'TAGGED_WITH'
> relationship
> types. Fine.
>
> However, here is the complex bit (well to me): I need to be able to find
> all
> posts tagged with a set of tags (AND operation so each post must be tagged
> with each tag).
>
> Whats more, these queries need to respect the parent relationships in the
> tags. So if I search for 'activity' in 'france' it needs to traverse the
> CHILD_OF relationships to find things tagged with any child of 'activity'
> AND any child of 'France'.
>
> It seems pretty easy to write a traversal class that would find all posts
> in
> any child of ether 'tag' node, simply follow 'CHILD_OF' and 'TAGGED_WITH'
> backwards and return nodes of type post.
>
> However how to do the AND bit? The only way I can see is to return both
> lists and union them in user code... however that seems inelegant and may
> not scale brilliantly.
>
> Any ideas how to optimise?
>
> Al
> ___
> Neo mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo] Choosing between a property or a node

2010-02-18 Thread Max De Marzi Jr.
Hello,

What is the proper way to handle things that have only a few choices like:

gender (male/female/unknown)
status (active, inactive, purged)
race(10 choices + other)
etc.

As properties of a Person node, or as nodes that link to the Person node?

Pros or Cons of each method?

How about something with instances?

Student took a Class (twice) once with This teacher, once with Another
Teacher.

The first time he failed, the second time he got a B.

Create a StudentClass node with a property of Grade, linked to Teacher?

In order to answer:

Find all students who took the class.
Find all students who took the class when it was offered in the spring
semester (or taught by This Teacher).
Find all students who got a B
Find all students to got a B in this class?
Find all students to got a B in this class during the spring semester?
Find all students to got a B in this class when This Teacher taught it?

Is there a better way to do it?  Rely on indexes? Pros/Cons?

Thanks,
Max
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user