Re: [Neo4j] Look up a node by the value of one of its properties!!!
2011/4/22 Kobla Gbenyo : > Thanks Michael, > > Please, how can I retrieve the location of the indexed node by its index? What exactly do you mean by "location of the indexed node"? > > Kobla >> You can use the indexing part of the REST API. >> That means after creation you have to add the fields you are interested in >> to an index. Then you can retrieve the node(s) later. >> >> See http://components.neo4j.org/neo4j-server/snapshot/rest.html#Add_to_index >> >> HTH >> >> Michael >> >> Sent from my iBrick4 >> >> >> Am 22.04.2011 um 09:39 schrieb Kobla Gbenyo: >> >>> Hello, >>> >>> I am new to this list and I have a question about Neo4j (I am just using >>> Neo4j). >>> >>> I install neo4j server and Jersey Client (REST API) by which I >>> communicate with the Neo4j database. My problem is how do I look up a >>> node (get the location of this node : URI) knowing the value of one of >>> its properties; I do not know the node ID. (for example I have a node >>> {"name":"thomas","age":"20"...}; and I want to get the location(URI) of >>> this node by sending the name "thomas" to the database server). >>> >>> Please, could someone give me his feedback? >>> >>> I will be glad to get any support on graph traversals using REST API. >>> >>> Best regards, >>> >>> -- >>> Kobla GBENYO, >>> S/C M. Jean MATHE, >>> 28 Rue de la Normandie, >>> 79 000 Niort. >>> >>> (+33) 6 26 07 93 41 / 6 62 26 64 47 >>> http://www.gbenyo-expo.fr >>> >>> >>> ___ >>> 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 > -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Look up a node by the value of one of its properties!!!
Kobla, If you read a few lines further down in the API desc you see how to retrieve node-URIs via the REST index-get call: curl -H Accept:application/json http://localhost:7474/db/data/index/node/index_name/property_name/property_value returns a list of nodes with their URIs, properties and discoverable URIs. HTH Michael Am 22.04.2011 um 11:33 schrieb Kobla Gbenyo: > Thanks Michael, > > Please, how can I retrieve the location of the indexed node by its index? > > Kobla >> You can use the indexing part of the REST API. >> That means after creation you have to add the fields you are interested in >> to an index. Then you can retrieve the node(s) later. >> >> See http://components.neo4j.org/neo4j-server/snapshot/rest.html#Add_to_index >> >> HTH >> >> Michael >> >> Sent from my iBrick4 >> >> >> Am 22.04.2011 um 09:39 schrieb Kobla Gbenyo: >> >>> Hello, >>> >>> I am new to this list and I have a question about Neo4j (I am just using >>> Neo4j). >>> >>> I install neo4j server and Jersey Client (REST API) by which I >>> communicate with the Neo4j database. My problem is how do I look up a >>> node (get the location of this node : URI) knowing the value of one of >>> its properties; I do not know the node ID. (for example I have a node >>> {"name":"thomas","age":"20"...}; and I want to get the location(URI) of >>> this node by sending the name "thomas" to the database server). >>> >>> Please, could someone give me his feedback? >>> >>> I will be glad to get any support on graph traversals using REST API. >>> >>> Best regards, >>> >>> -- >>> Kobla GBENYO, >>> S/C M. Jean MATHE, >>> 28 Rue de la Normandie, >>> 79 000 Niort. >>> >>> (+33) 6 26 07 93 41 / 6 62 26 64 47 >>> http://www.gbenyo-expo.fr >>> >>> >>> ___ >>> 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] about delete node
Or are you thinking about transaction events... i.e. notifications about what happens in each transaction, f.ex. you can add a transaction listener which can sit and look at all nodes getting deleted and do operations accordingly. See http://wiki.neo4j.org/content/Event_framework#Transaction_events 2011/4/23 Jose Angel Inda Herrera : > Hi list, > There is some property that when I delete a node you mark me as to be > removed to perform the operation to clear when the transaction is completed > ___ > Neo4j mailing list > User@lists.neo4j.org > https://lists.neo4j.org/mailman/listinfo/user > -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] REST results pagination
Let's discuss sometime soon. Creating resources that need to be cached or saved in session state bring with them a whole bunch of negative aspects... - Reply message - From: "Michael Hunger" Date: Fri, Apr 22, 2011 10:57 pm Subject: [Neo4j] REST results pagination To: "Neo4j user discussions" I spent some time looking at what others are doing for inspiration. I kind of like the Riak/Basho approach with multipart-chunks and the approach of explictely creating a resource for the query that can be navigated (either via pages or first,next,[prev,last] links) and expires (and could be reconstructed). Cheers Michael Good discussion: http://stackoverflow.com/questions/924472/paging-in-a-rest-collection CouchDB: http://wiki.apache.org/couchdb/HTTP_Document_API startKey + limit, endKey + limit, sorting, insert/update order Mongooese: [cursor-id]+batch_size OrientDB: .../[limit] Sones: no real rest API, but a SQL on top of the graph: http://developers.sones.de/documentation/graph-query-language/select/ with limit, offset, but also depth (for graph) HBase explcitly creates scanners, which can be then access with next operations, and expire after no activity for a certain timeout riak: http://wiki.basho.com/REST-API.html client-id header for client identification -> sticky? optional query parameters for including properties, and if to stream the data keys=[true,false,stream] If “keys=stream”, the response will be transferred using chunked-encoding, where each chunk is a JSON object. The first chunk will contain the “props” entry (if props was not set to false). Subsequent chunks will contain individual JSON objects with the “keys” entry containing a sublist of the total keyset (some sublists may be empty). riak seems to support partial json, non closed elements: -d '{"props":{"n_val":5' returns multiple responses in one go, Content-Type: multipart/mixed; boundary=YinLMzyUR9feB17okMytgKsylvh --YinLMzyUR9feB17okMytgKsylvh Content-Type: application/x-www-form-urlencoded Link: ; rel="up" Etag: 16vic4eU9ny46o4KPiDz1f Last-Modified: Wed, 10 Mar 2010 18:01:06 GMT {"bar":"baz"} (this block can be repeated n times) --YinLMzyUR9feB17okMytgKsylvh-- * Connection #0 to host 127.0.0.1 left intact * Closing connection #0 Query results: Content-Type – always multipart/mixed, with a boundary specified Understanding the response body The response body will always be multipart/mixed, with each chunk representing a single phase of the link-walking query. Each phase will also be encoded in multipart/mixed, with each chunk representing a single object that was found. If no objects were found or “keep” was not set on the phase, no chunks will be present in that phase. Objects inside phase results will include Location headers that can be used to determine bucket and key. In fact, you can treat each object-chunk similarly to a complete response from read object, without the status code. < HTTP/1.1 200 OK < Server: MochiWeb/1.1 WebMachine/1.6 (eat around the stinger) < Expires: Wed, 10 Mar 2010 20:24:49 GMT < Date: Wed, 10 Mar 2010 20:14:49 GMT < Content-Type: multipart/mixed; boundary=JZi8W8pB0Z3nO3odw11GUB4LQCN < Content-Length: 970 < --JZi8W8pB0Z3nO3odw11GUB4LQCN Content-Type: multipart/mixed; boundary=OjZ8Km9J5vbsmxtcn1p48J91cJP --OjZ8Km9J5vbsmxtcn1p48J91cJP Content-Type: application/json Etag: 3pvmY35coyWPxh8mh4uBQC Last-Modified: Wed, 10 Mar 2010 20:14:13 GMT {"riak":"CAP"} --OjZ8Km9J5vbsmxtcn1p48J91cJP-- --JZi8W8pB0Z3nO3odw11GUB4LQCN Content-Type: multipart/mixed; boundary=RJKFlAs9PrdBNfd74HANycvbA8C --RJKFlAs9PrdBNfd74HANycvbA8C Location: /riak/test/doc2 Content-Type: application/json Etag: 6dQBm9oYA1mxRSH0e96l5W Last-Modified: Wed, 10 Mar 2010 18:11:41 GMT {"foo":"bar"} --RJKFlAs9PrdBNfd74HANycvbA8C-- --JZi8W8pB0Z3nO3odw11GUB4LQCN-- * Connection #0 to host 127.0.0.1 left intact * Closing connection #0 Riak - MapReduce: Optional query parameters: * chunked – when set to true, results will be returned one at a time in multipart/mixed format using chunked-encoding. Important headers: * Content-Type – application/json when chunked is not true, otherwise multipart/mixed with application/json parts Other interesting endpoints: /ping, /stats ___ 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] New blog post on non-graph stores for graph-y things
Good post, but I thought the product recall example was a bit inaccurate. The aspect of neo4j you're taking advantage of is that it can traverse edges in the reverse direction as well -- e.g. you only added a "purchased" relationship from {customer} to {product}, but neo4j was able to go from {product} to {customer} just as easily. You could easily implement that same aspect in the document store as well -- e.g. instead of having a "purchased" field just on {customer}, add one to {product} too. So it's doable -- but the key point I've learned is that neo4j *automatically takes care of this kind of stuff for you*, so you don't have to think about it or manually account for it. Cheers, Aseem On Thu, Apr 21, 2011 at 10:19 AM, Jim Webber wrote: > Hi guys, > > A while ago we were discussing using non-graph native backend for graph > operations. I've finally gotten around to writing up my thoughts on the > thread here: > > http://jim.webber.name/2011/04/21/e2f48ace-7dba-4709-8600-f29da3491cb4.aspx > > As always, I'd value your thoughts and feedback. > > 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