Re: [Neo4j] New Bug Logged - Gremlin 114

2011-11-30 Thread Peter Neubauer
Thanks Romiko,
will look into it first time when I have time. How critical is it for you?

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

brew install neo4j  neo4j start
heroku addons:add neo4j



On Wed, Nov 30, 2011 at 1:31 AM, Romiko Derbynew
romiko.derby...@readify.net wrote:
 Hi,

 New bugged logged at: https://github.com/neo4j/community/issues/114

 Details below for others to peruse.

 Gremlin Table Projections - Column Order Incorrect when using chained 
 .As('x').As('y')

 EXPECTED Order: Createdy, ReferralGroup, ReferralId, ReferralData

 When AS statements appear next to each other.
 Consider A (WORKS - But not logical - have to reverse order when more than 1 
 AS statement is chained together right after each other for column array to 
 match):
 {script:g.v(0).outE[[label:'HOSTS']].inV.filter{ it.Key == 'romikoagency' 
 }.inE[[label:'USER_BELONGS_TO']].outV.filter{ it.Username == 
 'romiko.derbynew' 
 }.as('CreatedBy').outE[[label:'USER_LINKED_TO_PROGRAM']].inV.as('ReferralGroup').inE[[label:'HAS_SUGGESTED_PROGRAM']].outV.inE[[label:'REFERRAL_HAS_DECISIONS_SECTION']].outV.as('ReferralDate').as('ReferralId').table(new
  Table()){it.Username}{it.Name}{it.UniqueId}{it.DateInitiatedUtc}.cap
 }

 notice: as('ReferralDate').as('ReferralId') and then notice the column order 
 below is opposite this: columns  ReferralId, ReferralDate ]

 Results
 [ [ {
 data : [ [ romiko.derbynew, Testa, 331, /Date(1322007153048+1100)/ ], 
 [ romiko.derbynew, Testa, 321, /Date(1322003375637+1100)/ ]],
 columns : [ CreatedBy, ReferralGroup, ReferralId, ReferralDate ]
 } ] ]


 Consider B (Does not work - this is more LOGICAL from gremlin perspective but 
 is bugged, the Chained AS right after each other gets reversed in the column 
 array.)
 {script:g.v(0).outE[[label:'HOSTS']].inV.filter{ it.Key == 'romikoagency' 
 }.inE[[label:'USER_BELONGS_TO']].outV.filter{ it.Username == 
 'romiko.derbynew' 
 }.as('CreatedBy').outE[[label:'USER_LINKED_TO_PROGRAM']].inV.as('ReferralGroup').inE[[label:'HAS_SUGGESTED_PROGRAM']].outV.inE[[label:'REFERRAL_HAS_DECISIONS_SECTION']].outV.as('ReferralId').as('ReferralDate').table(new
  Table()){it.Username}{it.Name}{it.UniqueId}{it.DateInitiatedUtc}.cap
 }

 Notice: .as('ReferralId').as('ReferralDate') and then the columns columns 
  ReferralDate, ReferralId ]

 Results
 [ [ {
 data : [ [ romiko.derbynew, Testa, 331, /Date(1322007153048+1100)/ ]],
 columns : [ CreatedBy, ReferralGroup, ReferralDate, ReferralId ]
 } ] ]


 ___
 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 return the start nodes of all the paths with Cypher

2011-11-30 Thread Andres Taylor
On Wed, Nov 30, 2011 at 9:13 AM, Michael Hunger 
michael.hun...@neotechnology.com wrote:

 what about

 start c=node(1)
 match path = c-[*]-n
 return NODES(path)


Ouch... This is probably a rather slow query. It starts from 'c' and goes
all the way out to the end of the graph for, for every path connected from
c. And that could be a LOT of paths. I don't think this is what dnagir was
looking for :)

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


Re: [Neo4j] RETURN DISTINCT with ORDER BY

2011-11-30 Thread Andres Taylor
On Wed, Nov 30, 2011 at 6:27 AM, dnagir dna...@gmail.com wrote:

 But the query with both DISTINCT and ORDER BY doesn't return anything:


There was a bug concerning distinct and order by in the same query that has
been solved now. It was fixed in the stable 1.5 release. My suggestion is
that you upgrade to that and report if you still have problems.

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


Re: [Neo4j] RETURN DISTINCT with ORDER BY

2011-11-30 Thread dnagir
Thanks. This does work indeed.

Much like in SQL :)



On 30/11/2011, at 6:37 PM, readic [via Neo4j Community Discussions] wrote:

 try this: 
 start d=node(17) match d-[*0..99]-x return distinct x,x.name order by x.name 
 
 If you reply to this email, your message will be added to the discussion 
 below:
 http://neo4j-community-discussions.438527.n3.nabble.com/RETURN-DISTINCT-with-ORDER-BY-tp3547366p3547551.html
 To unsubscribe from RETURN DISTINCT with ORDER BY, click here.
 NAML



--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/RETURN-DISTINCT-with-ORDER-BY-tp3547366p3547899.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] How to return the start nodes of all the paths with Cypher

2011-11-30 Thread Andres Taylor
On Wed, Nov 30, 2011 at 11:32 AM, dnagir dna...@gmail.com wrote:

 I would probably like to write something among these lines (it's not valid
 query of course):


 START s=node(10)
 MATCH p = s-[:whatever]-t
 RETURN t, LENGTH(p) as len
 HAVING len = MAX( LENGTH(p) )


Well, this query would also return 'b' in the example you shared above. I
think we need something that says follow this path until you can't follow
it any more. If you're working with a B-tree, you should be able to say
given this sub-root, give me all leafs. Something like:

START c = node(17)
MATCH x-[*END]-c
RETURN x

I really don't like this syntax, but I think the information belongs in
there somewhere...

Seems like clause similar to SQL HAVING is missing.

 It doesn't exactly reflect what I want but just thought from top of my
 head.

 So currently I have to use other query language if I want to do this.
 Right?


A traversal would do it pretty simply. Maybe someone else can share a
end-of-graph traversal example?

I'm sure Gremlin can do it as well. Don't know how to do it in Gremlin
though - Peter, Marko?

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


Re: [Neo4j] How to return the start nodes of all the paths with Cypher

2011-11-30 Thread dnagir


On 30/11/2011, at 9:46 PM, Andres Taylor [via Neo4j Community Discussions] 
wrote:

 Well, this query would also return 'b' in the example you shared above.

You're right. Too late here already. Can't think clearly.

 I think we need something that says follow this path until you can't follow 
 it any more. If you're working with a B-tree, you should be able to say 
 given this sub-root, give me all leafs.

I don't need all leaves. It's a bit the other way around. I need the root of 
the tree.


 Something like: 
 
 START c = node(17) 
 MATCH x-[*END]-c 
 RETURN x 
 I really don't like this syntax, but I think the information belongs in 
 there somewhere... 

I actually don't mind this syntax. It's looks like the right place and clearly 
shows the intent.



--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/How-to-return-the-start-nodes-of-all-the-paths-with-Cypher-tp3547480p3547928.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Id capacity exceeded

2011-11-30 Thread Peter Neubauer
Alfredas,
AFAIK there is a limit on the number of Relationship types is max
32000 in the cache layer, a bit higher in the storage layer. Mattias
has been doing a branch for more in order to support Rene Pickhard in
his Activity Stream algo that uses types heavily, see
http://www.rene-pickhardt.de/data-structure-for-social-news-streams-on-graph-data-bases/
but that is not in master.

So, I think a property on the relationships is a better way to go right now.

Also updated the docs to reflect this, see
https://github.com/neo4j/manual/commit/796ef8d2e3bf99df7410f53e37860296e6b616c6

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

brew install neo4j  neo4j start
heroku addons:add neo4j



On Tue, Nov 29, 2011 at 6:58 PM, Alfredas Chmieliauskas
alfredas...@gmail.com wrote:
 Dear all,

 after creating some relations i get the error
 org.neo4j.kernel.impl.nioneo.store.UnderlyingStorageException: Id
 capacity exceeded
 See trace below.

 I have to create around 1m relations. Out of those there are 100'000
 different types of relations. Probably the number of relation types
 this is the cause of the problem. Alternatively I could create 1 type
 of relation but add a property to identify them. I just want to be
 sure about the cause of the error and if there are any configurable
 ways to get around it...

 Alfredas

 org.neo4j.kernel.impl.nioneo.store.UnderlyingStorageException: Id
 capacity exceeded
        at 
 org.neo4j.kernel.impl.nioneo.store.IdGeneratorImpl.assertIdWithinCapacity(IdGeneratorImpl.java:170)
        at 
 org.neo4j.kernel.impl.nioneo.store.IdGeneratorImpl.nextId(IdGeneratorImpl.java:161)
        at 
 org.neo4j.kernel.impl.nioneo.store.CommonAbstractStore.nextId(CommonAbstractStore.java:393)
        at 
 org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource.nextId(NeoStoreXaDataSource.java:428)
        at 
 org.neo4j.kernel.impl.nioneo.xa.NioNeoDbPersistenceSource.nextId(NioNeoDbPersistenceSource.java:111)
        at 
 org.neo4j.kernel.impl.persistence.IdGenerator.nextId(IdGenerator.java:43)
        at 
 org.neo4j.kernel.impl.core.DefaultRelationshipTypeCreator$RelTypeCreater.run(DefaultRelationshipTypeCreator.java:98)
 org.neo4j.graphdb.TransactionFailureException: Unable to create
 relationship type 4791005
        at 
 org.neo4j.kernel.impl.core.DefaultRelationshipTypeCreator.getOrCreate(DefaultRelationshipTypeCreator.java:58)
        at 
 org.neo4j.kernel.impl.core.RelationshipTypeHolder.createRelationshipType(RelationshipTypeHolder.java:142)
        at 
 org.neo4j.kernel.impl.core.RelationshipTypeHolder.addValidRelationshipType(RelationshipTypeHolder.java:81)
        at 
 org.neo4j.kernel.impl.core.NodeManager.createRelationship(NodeManager.java:289)
        at 
 org.neo4j.kernel.impl.core.NodeImpl.createRelationshipTo(NodeImpl.java:495)
        at 
 org.neo4j.kernel.impl.core.NodeProxy.createRelationshipTo(NodeProxy.java:197)
 ___
 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 return the start nodes of all the paths with Cypher

2011-11-30 Thread Peter Neubauer
Well,
in Gremlin, it is basically scripting, so you would probably do a loop
and follow the pattern until you are at the right depth, see
http://docs.neo4j.org/chunked/snapshot/gremlin-plugin.html#rest-api-flow-algorithms-with-gremlin
for a flow algo that loops until the target node = sink, without any
hard limitation.

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

brew install neo4j  neo4j start
heroku addons:add neo4j



On Wed, Nov 30, 2011 at 11:46 AM, Andres Taylor
andres.tay...@neotechnology.com wrote:
 On Wed, Nov 30, 2011 at 11:32 AM, dnagir dna...@gmail.com wrote:

 I would probably like to write something among these lines (it's not valid
 query of course):


 START s=node(10)
 MATCH p = s-[:whatever]-t
 RETURN t, LENGTH(p) as len
 HAVING len = MAX( LENGTH(p) )


 Well, this query would also return 'b' in the example you shared above. I
 think we need something that says follow this path until you can't follow
 it any more. If you're working with a B-tree, you should be able to say
 given this sub-root, give me all leafs. Something like:

 START c = node(17)
 MATCH x-[*END]-c
 RETURN x

 I really don't like this syntax, but I think the information belongs in
 there somewhere...

 Seems like clause similar to SQL HAVING is missing.

 It doesn't exactly reflect what I want but just thought from top of my
 head.

 So currently I have to use other query language if I want to do this.
 Right?


 A traversal would do it pretty simply. Maybe someone else can share a
 end-of-graph traversal example?

 I'm sure Gremlin can do it as well. Don't know how to do it in Gremlin
 though - Peter, Marko?

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


[Neo4j] Moving to u...@neo4j.org

2011-11-30 Thread Peter Neubauer
Hi all,
we are going to move from mailman to google groups,
http://groups.google.com/a/neo4j.org/groups/dir soon, I just wanted to
give you a heads-up that I will invite add of the current members to
http://groups.google.com/a/neo4j.org/group/user/topics?lnk when we are
ready.

Just wanted to warn you that there might be a surprising welcome
message from that group soonish, hope you don't mind!

Let me know if you have any objections.

Happy hacking!

/peter neubauer

GTalk:      neubauer.peter
Skype       peter.neubauer
Phone       +46 704 106975
LinkedIn   http://www.linkedin.com/in/neubauer
Twitter      http://twitter.com/peterneubauer

brew install neo4j  neo4j start
heroku addons:add neo4j
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Named matched with depth gives error

2011-11-30 Thread dnagir
Hi,

I am trying this query:

*START u=node(5963) MATCH p = (u)-[r:selling*1..99]-() WHERE
r.development=7867 RETURN p*

But it gives the error: Error: *NoSuchElementException - key not found: r*

When I remove the depth specification (*1..99) from the MATCH, it works as
expected.

What's a deal with it?

Thanks,
Dmytrii.

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Named-matched-with-depth-gives-error-tp3548195p3548195.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Moving to u...@neo4j.org

2011-11-30 Thread Niels Hoogeveen

Good decision. Immediately signed up.

 From: peter.neuba...@neotechnology.com
 Date: Wed, 30 Nov 2011 13:55:44 +0100
 To: user@lists.neo4j.org
 Subject: [Neo4j] Moving to u...@neo4j.org
 
 Hi all,
 we are going to move from mailman to google groups,
 http://groups.google.com/a/neo4j.org/groups/dir soon, I just wanted to
 give you a heads-up that I will invite add of the current members to
 http://groups.google.com/a/neo4j.org/group/user/topics?lnk when we are
 ready.
 
 Just wanted to warn you that there might be a surprising welcome
 message from that group soonish, hope you don't mind!
 
 Let me know if you have any objections.
 
 Happy hacking!
 
 /peter neubauer
 
 GTalk:  neubauer.peter
 Skype   peter.neubauer
 Phone   +46 704 106975
 LinkedIn   http://www.linkedin.com/in/neubauer
 Twitter  http://twitter.com/peterneubauer
 
 brew install neo4j  neo4j start
 heroku addons:add neo4j
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user
  
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Neo4j Spatial build / run problems

2011-11-30 Thread danielb
Hi Peter,

the tests are running and now I get the following results:

cypher start n=node:geom('bbox:[9.9996186, 9.9996186, 48.4027913,
48.4027913]')
cypher return n
cypher 
== +--+
== | n|
== +--+
== | Node[205373]{vertices-1,bbox-[D@4613e058,gtype-1} |
== +--+
== 1 rows, 194 ms

http POST /db/data/ext/SpatialPlugin/graphdb/findGeometriesInLayer
{layer:geom,minx:9.9996186,maxx:9.9996186,miny:48.4027913,maxy:48.4027913}
 
== 200 OK
== [ {
==   outgoing_relationships :
http://localhost:7474/db/data/node/205373/relationships/out;,
==   data : {
== bbox : [ 9.9996186, 9.9996186, 48.4027913, 48.4027913 ],
== vertices : 1,
== gtype : 1
==   },
==   traverse :
http://localhost:7474/db/data/node/205373/traverse/{returnType};,
==   all_typed_relationships :
http://localhost:7474/db/data/node/205373/relationships/all/{-list||types},
==   property :
http://localhost:7474/db/data/node/205373/properties/{key};,
==   self : http://localhost:7474/db/data/node/205373;,
==   properties : http://localhost:7474/db/data/node/205373/properties;,
==   outgoing_typed_relationships :
http://localhost:7474/db/data/node/205373/relationships/out/{-list||types},
==   incoming_relationships :
http://localhost:7474/db/data/node/205373/relationships/in;,
==   extensions : {
==   },
==   create_relationship :
http://localhost:7474/db/data/node/205373/relationships;,
==   paged_traverse :
http://localhost:7474/db/data/node/205373/paged/traverse/{returnType}{?pageSize,leaseTime};,
==   all_relationships :
http://localhost:7474/db/data/node/205373/relationships/all;,
==   incoming_typed_relationships :
http://localhost:7474/db/data/node/205373/relationships/in/{-list||types}
== } ]

To get to this point I have to follow exactly the following steps:

1. Create a new database
2. Run the OSMImporter and name the layer 'geom' (Cypher don't like \ / :)
- separate osmPath and Layername in importer
3. Start the server and call the following through HTTP:

http POST /db/data/ext/SpatialPlugin/graphdb/addSimplePointLayer
{layer:geom, lat:lat, lon:lon}
== 200 OK
== [ {
==   outgoing_relationships :
http://localhost:7474/db/data/node/582567/relationships/out;,
==   data : {
== layer_class : org.neo4j.gis.spatial.osm.OSMLayer,
== layerprops : [ FIXME, TMC:cid_58:tabcd_1:Class,
TMC:cid_58:tabcd_1:Direction, TMC:cid_58:tabcd_1:LCLversion,
TMC:cid_58:tabcd_1:LocationCode, TMC:cid_58:tabcd_1:NextLocationCode,
TMC:cid_58:tabcd_1:PrevLocationCode, access, addr:city,
addr:country, addr:housenumber, addr:postcode, addr:state,
addr:street, admin_level, agricultural, alt_name, amenity, area,
asb, atm, backrest, barrier, bell, bench, bicycle,
bicycle_parking, boundary, brand, bridge, building,
building:cladding, building:height, building:levels, building:roof,
building:type, building:use, bus, cables, capacity,
capacity:disabled, class:bicycle, collection_times, covered,
created_by, crossing, crossing_ref, cuisine, cutting, cycleway,
denomination, denotation, description, destination, detail,
direction, ele, electrified, email, emergency, fax, fee,
fixme, foot, frequency, from, gauge, grade, hgv, highway,
historic, history, horse, hour_off, hour_on, incline, int_ref,
is_in, junction, landuse, lanes, layer, leisure, light, lit,
man_made, material, maxheight, maxspeed, maxspeed:source,
maxweight, moped, motor_vehicle, motorcar, motorcycle,
motorroad, mtb:scale, name, natural, network, noexit, note,
note:de, office, oneway, onkz, openGeoDB:auto_update,
openGeoDB:community_identification_number, openGeoDB:is_in,
openGeoDB:is_in_loc_id, openGeoDB:layer, openGeoDB:license_plate_code,
openGeoDB:loc_id, openGeoDB:name, openGeoDB:sort_name,
openGeoDB:version, opening_hours, operator, park_ride, parking,
payment:coins, payment:telephone_cards, phone, place, postal_code,
power, power:type, priority, psv, public_transport, rail,
railway, recycling:clothes, recycling:glass, recycling:paper, ref,
ref:color, religion, restriction, route, sac_scale, segregated,
service, shelter, shop, smoking, smoothness, source,
source:lit, source:maxspeed, sport, surface, tactile_paving, to,
tourism, tracks, tracktype, traffic_sign, trail_visibility,
tram, tunnel, type, usability:skate, vehicle, vending,
voltage, waterway, website, wheelchair, wheelchair:description,
width, wikipedia, wires, wood, workrules, wpt_description ],
== layer : geom,
== geomencoder : org.neo4j.gis.spatial.osm.OSMGeometryEncoder,
== ctime : 1322660287742
==   },
==   traverse :
http://localhost:7474/db/data/node/582567/traverse/{returnType};,
==   all_typed_relationships :
http://localhost:7474/db/data/node/582567/relationships/all/{-list||types},
==   property :
http://localhost:7474/db/data/node/582567/properties/{key};,
==   self : http://localhost:7474/db/data/node/582567;,

Re: [Neo4j] Neo4j Spatial build / run problems

2011-11-30 Thread Peter Neubauer
Daniel,
glad to hear it works out! I think we need to make the loading of the
index more robust, so the order is less important. Feel free to
suggest improvements on that, and make some more tests for it.

Also, keep us informed on how your project is going. Maybe a small
blog is in order to show off?

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

brew install neo4j  neo4j start
heroku addons:add neo4j



On Wed, Nov 30, 2011 at 3:04 PM, danielb danielbercht...@gmail.com wrote:
 Now I missed another important point:
 With that settings the database would still not return any results. I
 changed the bounding box values to 9.9 and 48.4. I then got an error message
 with insufficient heap space. With more digits it would load even more from
 the R-tree.
 I increased the cache sizes from the standard few megabytes to several
 hundreds of megabytes and now can do the queries. (600k nodes, 1M
 properties, 1M relationships)

 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Spatial-build-run-problems-tp3515519p3548384.html
 Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Using in-memory DB for unit tests

2011-11-30 Thread Jon Walton
Oh man do I feel stupid - thank you both.   The IMDB tutorial was so good I
created a project without fully reading the API docs.

Regards,

Jon



On Tue, Nov 29, 2011 at 10:54 PM, Michael Hunger 
michael.hun...@neotechnology.com wrote:

 you can also use
 rel.getOtherNode(startNode)

 Michael

 mobile mail please excuse brevity and typos

 Am 30.11.2011 um 06:03 schrieb Jim Webber j...@neotechnology.com:

  Hi Jon,
 
 // This one results in a not found exception on the 'asn' property.
 @Test
 public void testIncoming()
 {
 
 Node network = svc.createNode();
 Node as = svc.createNode();
 as.setProperty( asn, 123 );
 
 as.createRelationshipTo( network,
 DynamicRelationshipType.withName( AS ) );
 
 System.out.println( network.getSingleRelationship(
 IPAddressRelationshipType.AS, Direction.INCOMING )
 .getStartNode()
 // It's the start node of the incoming relationship,
 which is the same as the end node of the outgoing relationship
 .getProperty( asn ) );
 
 }
 
 
  You got the start and end node wrong - I changed that and your test ran
 just fine.
 
  Good luck with your first project - I hope it's as enjoyable as my first
 Neo4j project :-)
 
  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

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


[Neo4j] Neo4j Tutorial

2011-11-30 Thread bigToch
Hello geeks,

I would like if possible that somebody walks me through a complete tutorial
on Neo4j. I am a newbie of Noe4j and I have read some stuffs on the wiki web
page but still I have not caught yet the procedure. I just need a simple
scenario and a step-by-step guide to implement the scenario.

I know that it may sound weird but I would like to have an aid because I
will be building an app using the Neo4j.

Thank you guys, 

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


Re: [Neo4j] Neo4j Tutorial

2011-11-30 Thread Jacob Hansson
If you are interested in one-on-one help, take a look at the neo4j events
calendar. Joining a local meetup or a webinar could be a good route to go.
Such Neo4j events are listed here:

http://plancast.com/neo4j

Also, take a look at the neo4j koans, a set of unit tests that walk you
through how to work with the neo4j java API:

https://github.com/jimwebber/neo4j-tutorial/

Cheers!
/jake

On Wed, Nov 30, 2011 at 3:42 PM, bigToch arsene.toche...@corenett.comwrote:

 Hello geeks,

 I would like if possible that somebody walks me through a complete tutorial
 on Neo4j. I am a newbie of Noe4j and I have read some stuffs on the wiki
 web
 page but still I have not caught yet the procedure. I just need a simple
 scenario and a step-by-step guide to implement the scenario.

 I know that it may sound weird but I would like to have an aid because I
 will be building an app using the Neo4j.

 Thank you guys,

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




-- 
Jacob Hansson
Phone: +46 (0) 763503395
Twitter: @jakewins
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] New Bug Logged - Gremlin 114

2011-11-30 Thread Marko Rodriguez
Hi,

Please put this into the Gremlin issue tracker. 

https://github.com/tinkerpop/gremlin/issues

The table is not intended to be ordered with the location of the named as 
steps. It was just not engineered that way. However, others have brought this 
up. I suspect for Gremlin 1.5 (Gremlin 1.4 is being released soon), we can have 
the behavior ordered.

Thanks Romiko and Peter,
Marko.

http://markorodriguez.com

On Nov 30, 2011, at 1:20 AM, Peter Neubauer wrote:

 Thanks Romiko,
 will look into it first time when I have time. How critical is it for you?
 
 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
 
 brew install neo4j  neo4j start
 heroku addons:add neo4j
 
 
 
 On Wed, Nov 30, 2011 at 1:31 AM, Romiko Derbynew
 romiko.derby...@readify.net wrote:
 Hi,
 
 New bugged logged at: https://github.com/neo4j/community/issues/114
 
 Details below for others to peruse.
 
 Gremlin Table Projections - Column Order Incorrect when using chained 
 .As('x').As('y')
 
 EXPECTED Order: Createdy, ReferralGroup, ReferralId, ReferralData
 
 When AS statements appear next to each other.
 Consider A (WORKS - But not logical - have to reverse order when more than 1 
 AS statement is chained together right after each other for column array to 
 match):
 {script:g.v(0).outE[[label:'HOSTS']].inV.filter{ it.Key == 'romikoagency' 
 }.inE[[label:'USER_BELONGS_TO']].outV.filter{ it.Username == 
 'romiko.derbynew' 
 }.as('CreatedBy').outE[[label:'USER_LINKED_TO_PROGRAM']].inV.as('ReferralGroup').inE[[label:'HAS_SUGGESTED_PROGRAM']].outV.inE[[label:'REFERRAL_HAS_DECISIONS_SECTION']].outV.as('ReferralDate').as('ReferralId').table(new
  Table()){it.Username}{it.Name}{it.UniqueId}{it.DateInitiatedUtc}.cap
 }
 
 notice: as('ReferralDate').as('ReferralId') and then notice the column order 
 below is opposite this: columns  ReferralId, ReferralDate ]
 
 Results
 [ [ {
 data : [ [ romiko.derbynew, Testa, 331, /Date(1322007153048+1100)/ 
 ], [ romiko.derbynew, Testa, 321, /Date(1322003375637+1100)/ ]],
 columns : [ CreatedBy, ReferralGroup, ReferralId, ReferralDate ]
 } ] ]
 
 
 Consider B (Does not work - this is more LOGICAL from gremlin perspective 
 but is bugged, the Chained AS right after each other gets reversed in the 
 column array.)
 {script:g.v(0).outE[[label:'HOSTS']].inV.filter{ it.Key == 'romikoagency' 
 }.inE[[label:'USER_BELONGS_TO']].outV.filter{ it.Username == 
 'romiko.derbynew' 
 }.as('CreatedBy').outE[[label:'USER_LINKED_TO_PROGRAM']].inV.as('ReferralGroup').inE[[label:'HAS_SUGGESTED_PROGRAM']].outV.inE[[label:'REFERRAL_HAS_DECISIONS_SECTION']].outV.as('ReferralId').as('ReferralDate').table(new
  Table()){it.Username}{it.Name}{it.UniqueId}{it.DateInitiatedUtc}.cap
 }
 
 Notice: .as('ReferralId').as('ReferralDate') and then the columns columns 
  ReferralDate, ReferralId ]
 
 Results
 [ [ {
 data : [ [ romiko.derbynew, Testa, 331, /Date(1322007153048+1100)/ 
 ]],
 columns : [ CreatedBy, ReferralGroup, ReferralDate, ReferralId ]
 } ] ]
 
 
 ___
 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] New Bug Logged - Gremlin 114

2011-11-30 Thread Marko Rodriguez
Hi,

Actually, I know how to solve your problem. See below.

 g.v(0).outE[[label:'HOSTS']].inV.filter{ it.Key == 'romikoagency' 
 }.inE[[label:'USER_BELONGS_TO']].outV.filter{ it.Username == 
 'romiko.derbynew' 
 }.as('CreatedBy').outE[[label:'USER_LINKED_TO_PROGRAM']].inV.as('ReferralGroup').inE[[label:'HAS_SUGGESTED_PROGRAM']].outV.inE[[label:'REFERRAL_HAS_DECISIONS_SECTION']].outV.as('ReferralId').as('ReferralDate').table(new
  Table()){it.Username}{it.Name}{it.UniqueId}{it.DateInitiatedUtc}.cap

You can not do two as() steps in a row. Do a toString() on your Pipeline 
representation (e.g. cap.toString()). You will notice that your first as() 
step is wrapped by the second one. To rectify this, insert an identity. For 
example: as('ReferralId')._.as('ReferralDate').

Also, here are some optimizations to your expression that you might want to 
consider. The first and the third are to make it easier on the eyes (and a bit 
faster as well). The second is to make it faster.

outE[[label:'HOSTS']].inV   ---turn into-- 
 out('HOSTS')
filter{it.Key == 'romikoagency'}---turn into-- 
filter{it.getProperty('Key') == 'romikoagency'}
inE[[label:'USER_BELONGS_TO']].outV ---turn into-- 
in('USER_BELONGS_TO')

See: https://github.com/tinkerpop/gremlin/wiki/Gremlin-Groovy-Path-Optimizations

Enjoy!,
Marko.

http://markorodriguez.com

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


[Neo4j] Cypher Query Optimizing

2011-11-30 Thread Martin Junghanns
Hey,

I'm currently converting some SQL Queries to Cypher and I'm very happy 
to see what is possible with the language.
I was wondering if the following query can be optimized, it selects the 
edges between neighbours of a given node (137) who also know each other:

SQL:
select w1.w1_id,w1.w2_id,w1.freq,w1.sig from co_s w1
where
 w1.w1_id in (select w2.w2_id from co_s w2 where w2.w1_id=137)
and
 w1.w2_id in (select w3.w2_id from co_s w3 where w3.w1_id=137);

Cypher:

START n=node:words(w_id = 137) MATCH n-[:CO_S]-m, n-[:CO_S]- t, 
m-[r:CO_S]- t return m.w_id, t.w_id, r.sig, r.freq


The results are the same, but the Cypher Query is about 10 times slower 
than the SQL pendant. I currently do not use any additional indices. 
Just  a map (words) between my word ID and the neo4j node id.

Thx for your help! Great work! Rock on!

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


Re: [Neo4j] Cypher Query Optimizing

2011-11-30 Thread Tero Paananen
 Cypher:

 START n=node:words(w_id = 137) MATCH n-[:CO_S]-m, n-[:CO_S]- t,
 m-[r:CO_S]- t return m.w_id, t.w_id, r.sig, r.freq


 The results are the same, but the Cypher Query is about 10 times slower
 than the SQL pendant. I currently do not use any additional indices.
 Just  a map (words) between my word ID and the neo4j node id.

Doing index lookups is much slower than node lookups.

In the application I'm developing, we've removed most index lookups
and replaced them with node lookups. We keep a keyword to nodeId
mapping in a key/value store and lookup the nodeId before running any
Cypher queries.

In your case:

START n=node(1) MATCH n-[:CO_S]-m, n-[:CO_S]- t,
m-[r:CO_S]- t return m.w_id, t.w_id, r.sig, r.freq

(where 1 is the corresponding nodeId to w_id = 137)

If I understood your email correctly, you already have that map available
to you (137 - 1). I'd use that to see if it's any quicker.

Your mileage may vary, of course. In our application the speed improvements
were roughly 10x. See my post on the mailing list with subject:

Comparing Lucene index lookup performance to lookup by node id

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


[Neo4j] social network may exceed the number of nodes / relationships / properties

2011-11-30 Thread gustavoboby
Hi peoples,

I need to do in a social network the same of facebook does into a private
messages and post's.

However, I have the following concern:

It is expected up to 1 million users in the social network, if each person
to write one million times (between posts and private messages) in one year.
My fear is exceeding the number of properties / relationships / nodes

How would you do in this situation? what do you recommend?

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/social-network-may-exceed-the-number-of-nodes-relationships-properties-tp3549025p3549025.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Cypher Query Optimizing

2011-11-30 Thread Martin Junghanns
@Tero @Krzysztof
thx for your fast replies.

@Krzysztof
for me it was not fairly well known. I will also check out the 
traverser api.

@Tero
I tried the same query using the internal id instead of my mapping index 
(lucene)

orig:
START n=node:words(w_id = '137') MATCH n-[:CO_S]-m, n-[:CO_S]- t, 
m-[r:CO_S]- t return m.w_id, t.w_id, r.sig, r.freq
took: 662ms (average of 100 runs after 10 warmups)

new:
START n=node(119) MATCH n-[:CO_S]-m, n-[:CO_S]- t, m-[r:CO_S]- t 
return m.w_id, t.w_id, r.sig, r.freq
took: 644ms (average of 100 runs after 10 warmups)

So it doesn't seem to be much more faster not using the index for node 
lookup.

I will check out your posts concerning Lucene Index.

Greetings, Martin

Am 30.11.2011 18:08, schrieb Krzysztof Raczyński:
 It is fairly well known that cypher queries are not (yet) optimised.
 If speed is a concern for you, try using traversal API, i can confirm
 it is much faster than cypher.

 cheers
 ___
 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] Id capacity exceeded

2011-11-30 Thread Alfredas Chmieliauskas
Thanks Peter. I got it to work with relationship properties. I am
pretty sure that the number of different relationships I was trying to
create was less than 32K. Maybe its a good idea to test that limit..

A

On Wed, Nov 30, 2011 at 11:52 AM, Peter Neubauer
peter.neuba...@neotechnology.com wrote:
 Alfredas,
 AFAIK there is a limit on the number of Relationship types is max
 32000 in the cache layer, a bit higher in the storage layer. Mattias
 has been doing a branch for more in order to support Rene Pickhard in
 his Activity Stream algo that uses types heavily, see
 http://www.rene-pickhardt.de/data-structure-for-social-news-streams-on-graph-data-bases/
 but that is not in master.

 So, I think a property on the relationships is a better way to go right now.

 Also updated the docs to reflect this, see
 https://github.com/neo4j/manual/commit/796ef8d2e3bf99df7410f53e37860296e6b616c6

 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

 brew install neo4j  neo4j start
 heroku addons:add neo4j



 On Tue, Nov 29, 2011 at 6:58 PM, Alfredas Chmieliauskas
 alfredas...@gmail.com wrote:
 Dear all,

 after creating some relations i get the error
 org.neo4j.kernel.impl.nioneo.store.UnderlyingStorageException: Id
 capacity exceeded
 See trace below.

 I have to create around 1m relations. Out of those there are 100'000
 different types of relations. Probably the number of relation types
 this is the cause of the problem. Alternatively I could create 1 type
 of relation but add a property to identify them. I just want to be
 sure about the cause of the error and if there are any configurable
 ways to get around it...

 Alfredas

 org.neo4j.kernel.impl.nioneo.store.UnderlyingStorageException: Id
 capacity exceeded
        at 
 org.neo4j.kernel.impl.nioneo.store.IdGeneratorImpl.assertIdWithinCapacity(IdGeneratorImpl.java:170)
        at 
 org.neo4j.kernel.impl.nioneo.store.IdGeneratorImpl.nextId(IdGeneratorImpl.java:161)
        at 
 org.neo4j.kernel.impl.nioneo.store.CommonAbstractStore.nextId(CommonAbstractStore.java:393)
        at 
 org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource.nextId(NeoStoreXaDataSource.java:428)
        at 
 org.neo4j.kernel.impl.nioneo.xa.NioNeoDbPersistenceSource.nextId(NioNeoDbPersistenceSource.java:111)
        at 
 org.neo4j.kernel.impl.persistence.IdGenerator.nextId(IdGenerator.java:43)
        at 
 org.neo4j.kernel.impl.core.DefaultRelationshipTypeCreator$RelTypeCreater.run(DefaultRelationshipTypeCreator.java:98)
 org.neo4j.graphdb.TransactionFailureException: Unable to create
 relationship type 4791005
        at 
 org.neo4j.kernel.impl.core.DefaultRelationshipTypeCreator.getOrCreate(DefaultRelationshipTypeCreator.java:58)
        at 
 org.neo4j.kernel.impl.core.RelationshipTypeHolder.createRelationshipType(RelationshipTypeHolder.java:142)
        at 
 org.neo4j.kernel.impl.core.RelationshipTypeHolder.addValidRelationshipType(RelationshipTypeHolder.java:81)
        at 
 org.neo4j.kernel.impl.core.NodeManager.createRelationship(NodeManager.java:289)
        at 
 org.neo4j.kernel.impl.core.NodeImpl.createRelationshipTo(NodeImpl.java:495)
        at 
 org.neo4j.kernel.impl.core.NodeProxy.createRelationshipTo(NodeProxy.java:197)
 ___
 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] Spring integration problem

2011-11-30 Thread Frank
Hi,

I would like to use the Spring integration feature described on the
springdataNeo4j page.

My project already uses both Spring and Maven, and I am familiar with how to
set up dependencies and Spring beans. I already have the neo4j server
running on my localhost and I've been able to test it via the browser
interface, so I know that part works.

Unfortunately, despite carefully following the tutorial's instructions, and
carefully examining everything I'm doing including making sure that every
possible dependency is declared correctly, I cannot get Spring to load the
graph database service due to an exception Invalid NamespaceHandler class.

This is my Spring configuration file:

?xml version=1.0 encoding=UTF-8?
beans 
xmlns=http://www.springframework.org/schema/beans;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:neo4j=http://www.springframework.org/schema/data/neo4j;
xsi:schemaLocation=http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/data/neo4j
http://www.springframework.org/schema/data/neo4j/spring-neo4j-2.0.xsd;

neo4j:config graphDatabaseService=graphDatabaseService/

bean id=graphDatabaseService
class=org.springframework.data.neo4j.rest.SpringRestGraphDatabase
constructor-arg value=http://localhost:7474/db/data//
/bean

/beans

This is the full stack trace of the exception:

11/30/2011 13:07:34 [INFO] main (XmlBeanDefinitionReader.java:315) - Loading
XML bean definitions from class path resource [neo4j.xml]
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected
exception parsing XML document from class path resource [neo4j.xml]; nested
exception is org.springframework.beans.FatalBeanException: Invalid
NamespaceHandler class
[org.springframework.data.neo4j.config.DataGraphNamespaceHandler] for
namespace [http://www.springframework.org/schema/data/neo4j]: problem with
handler class file or dependent class; nested exception is
java.lang.NoClassDefFoundError:
org/springframework/beans/factory/xml/NamespaceHandlerSupport
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)
at
org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:126)
at
org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:92)
at
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
at
org.springframework.context.support.ClassPathXmlApplicationContext.init(ClassPathXmlApplicationContext.java:139)
at
org.springframework.context.support.ClassPathXmlApplicationContext.init(ClassPathXmlApplicationContext.java:93)
at neo4j.Populate.init(Populate.java:32)
at neo4j.Populate.main(Populate.java:18)
Caused by: org.springframework.beans.FatalBeanException: Invalid
NamespaceHandler class
[org.springframework.data.neo4j.config.DataGraphNamespaceHandler] for
namespace [http://www.springframework.org/schema/data/neo4j]: problem with
handler class file or dependent class; nested exception is
java.lang.NoClassDefFoundError:
org/springframework/beans/factory/xml/NamespaceHandlerSupport
at
org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.resolve(DefaultNamespaceHandlerResolver.java:139)
at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1333)
at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1328)
at

Re: [Neo4j] New Bug Logged - Gremlin 114

2011-11-30 Thread Romiko Derbynew
Not too bad, I have a work around in our fluent api to reverse them.

-Original Message-
From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
Behalf Of Peter Neubauer
Sent: Wednesday, 30 November 2011 7:20 PM
To: Neo4j user discussions
Cc: mystory-develop...@barnardos.org.au
Subject: Re: [Neo4j] New Bug Logged - Gremlin 114

Thanks Romiko,
will look into it first time when I have time. How critical is it for you?

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

brew install neo4j  neo4j start
heroku addons:add neo4j



On Wed, Nov 30, 2011 at 1:31 AM, Romiko Derbynew romiko.derby...@readify.net 
wrote:
 Hi,

 New bugged logged at: https://github.com/neo4j/community/issues/114

 Details below for others to peruse.

 Gremlin Table Projections - Column Order Incorrect when using chained 
 .As('x').As('y')

 EXPECTED Order: Createdy, ReferralGroup, ReferralId, ReferralData

 When AS statements appear next to each other.
 Consider A (WORKS - But not logical - have to reverse order when more than 1 
 AS statement is chained together right after each other for column array to 
 match):
 {script:g.v(0).outE[[label:'HOSTS']].inV.filter{ it.Key == 'romikoagency' 
 }.inE[[label:'USER_BELONGS_TO']].outV.filter{ it.Username == 
 'romiko.derbynew' 
 }.as('CreatedBy').outE[[label:'USER_LINKED_TO_PROGRAM']].inV.as('ReferralGroup').inE[[label:'HAS_SUGGESTED_PROGRAM']].outV.inE[[label:'REFERRAL_HAS_DECISIONS_SECTION']].outV.as('ReferralDate').as('ReferralId').table(new
  Table()){it.Username}{it.Name}{it.UniqueId}{it.DateInitiatedUtc}.cap
 }

 notice: as('ReferralDate').as('ReferralId') and then notice the column 
 order below is opposite this: columns  ReferralId, 
 ReferralDate ]

 Results
 [ [ {
 data : [ [ romiko.derbynew, Testa, 331, 
 /Date(1322007153048+1100)/ ], [ romiko.derbynew, Testa, 321, 
 /Date(1322003375637+1100)/ ]], columns : [ CreatedBy, 
 ReferralGroup, ReferralId, ReferralDate ] } ] ]


 Consider B (Does not work - this is more LOGICAL from gremlin 
 perspective but is bugged, the Chained AS right after each other gets 
 reversed in the column array.) 
 {script:g.v(0).outE[[label:'HOSTS']].inV.filter{ it.Key == 'romikoagency' 
 }.inE[[label:'USER_BELONGS_TO']].outV.filter{ it.Username == 
 'romiko.derbynew' 
 }.as('CreatedBy').outE[[label:'USER_LINKED_TO_PROGRAM']].inV.as('ReferralGroup').inE[[label:'HAS_SUGGESTED_PROGRAM']].outV.inE[[label:'REFERRAL_HAS_DECISIONS_SECTION']].outV.as('ReferralId').as('ReferralDate').table(new
  Table()){it.Username}{it.Name}{it.UniqueId}{it.DateInitiatedUtc}.cap
 }

 Notice: .as('ReferralId').as('ReferralDate') and then the columns 
 columns  ReferralDate, ReferralId ]

 Results
 [ [ {
 data : [ [ romiko.derbynew, Testa, 331, 
 /Date(1322007153048+1100)/ ]], columns : [ CreatedBy, 
 ReferralGroup, ReferralDate, ReferralId ] } ] ]


 ___
 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] Persisting community information

2011-11-30 Thread Paul A. Jackson
Suppose I have a graph and I run a community detection algorithm on it. These 
algorithms usually return a dendrogram, representing the division of the graph 
from whole network to individual nodes. Does anyone have experience persisting 
these results? I suppose it could be stored as a separate graph, but is there a 
way to store it within the graph itself? 

Paul Jackson, Principal Software Engineer
Pitney Bowes Business Insight
4200 Parliament Place | Suite 600 | Lanham, MD  20706-1844  USA
O: 301.918.0850 | M: 703.862.0120 | www.pb.com
paul.jack...@pb.com 
 
Every connection is a new opportunity(tm)
 
 
 
Please consider the environment before printing or forwarding this email. If 
you do print this email, please recycle the paper.
 
This email message may contain confidential, proprietary and/or privileged 
information. It is intended only for the use of the intended recipient(s). If 
you have received it in error, please immediately advise the sender by reply 
email and then delete this email message. Any disclosure, copying, distribution 
or use of the information contained in this email message to or by anyone other 
than the intended recipient is strictly prohibited. Any views expressed in this 
message are those of the individual sender, except where the sender 
specifically states them to be the views of the Company.

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


Re: [Neo4j] Persisting community information

2011-11-30 Thread Akhil
I did something similar by storing my query as a property withing a new 
node and connecting the node with the result nodes. I also store 
additional contextual information in the connecting edges.

Akhil
On 11/30/2011 3:14 PM, Paul A. Jackson wrote:
 Suppose I have a graph and I run a community detection algorithm on it. These 
 algorithms usually return a dendrogram, representing the division of the 
 graph from whole network to individual nodes. Does anyone have experience 
 persisting these results? I suppose it could be stored as a separate graph, 
 but is there a way to store it within the graph itself?

 Paul Jackson, Principal Software Engineer
 Pitney Bowes Business Insight
 4200 Parliament Place | Suite 600 | Lanham, MD  20706-1844  USA
 O: 301.918.0850 | M: 703.862.0120 | www.pb.com
 paul.jack...@pb.com

 Every connection is a new opportunity(tm)



 Please consider the environment before printing or forwarding this email. If 
 you do print this email, please recycle the paper.

 This email message may contain confidential, proprietary and/or privileged 
 information. It is intended only for the use of the intended recipient(s). If 
 you have received it in error, please immediately advise the sender by reply 
 email and then delete this email message. Any disclosure, copying, 
 distribution or use of the information contained in this email message to or 
 by anyone other than the intended recipient is strictly prohibited. Any views 
 expressed in this message are those of the individual sender, except where 
 the sender specifically states them to be the views of the Company.

 ___
 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] Using Neo4j as a document database (SO-Question)

2011-11-30 Thread Michael Hunger
Dear Graphistas,

if you have experience with that  topic, could you please answer him.
I think, real world answers help more than my general ones.

Thanks a lot

Michael

http://stackoverflow.com/questions/8332647/is-it-possible-to-use-graph-database-as-a-document-oriented-database

Suppose I have a large ammount of heterogeneous JSON documents (i.e. named 
key-value mappings) and a hierarchy of classes (i.e. named sets) that these 
documents are attached to. I need to set up a data structure that will allow:

• CRUD operations on JSON documents.
• Retrieving JSON documents by ID really quickly.
• Retrieving all JSON documents that are attached to a certain class 
really quickly.
• Editing class hierarchy: adding/deleting classes, rearranging them.
I've initially came up with the idea of storing JSON documents in a 
document-oriented database (like CouchDB or MongoDB) and storing class 
hierarchy in a graph database (like Neo4j). 1, 2 and 4 are then figured out 
naturally, and 3 solved by maintaining list of attached document IDs for every 
class in the graph.

But then I figured that a graph database could actually do the 
document-oriented part of retrieving JSON documents by ID. At a first glance 
this seems true, but I'm still concerned about 2 and 3. Is there a graph 
database that is able to retrieve documents (nodes) at a speed 
document-oriented db's serve documents? How fast will it serve 3-like queries? 
I've heard a little bit about graph databases being slow, reification problem, 
etc.

Is there a graph database that is also as comfortable for casual retrieving 
objects by ID, as CouchDB, for example? What is the difference between using 
document-oriented and graph database for storing, retrieving and editing 
JSON-like objects?



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


[Neo4j] NullPointerException in ExecutingRestRequest

2011-11-30 Thread Frank
The server is running on localhost and can be hit from a browser. The
server's configuration was modified to allow requests from any IP address,
although all of my attempts are from the localhost anyway.

I've tried this with and without a trailing slash on the URI, no difference.

Code:

GraphDatabase graphDb = new
SpringRestGraphDatabase(http://localhost:7474/db/data;);
graphDb.getReferenceNode();

Result:

java.lang.NullPointerException
at
org.neo4j.rest.graphdb.ExecutingRestRequest.uriWithoutSlash(ExecutingRestRequest.java:78)
at
org.neo4j.rest.graphdb.ExecutingRestRequest.init(ExecutingRestRequest.java:72)
at
org.neo4j.rest.graphdb.ExecutingRestRequest.with(ExecutingRestRequest.java:149)
at org.neo4j.rest.graphdb.entity.RestEntity.init(RestEntity.java:52)
at org.neo4j.rest.graphdb.entity.RestNode.init(RestNode.java:47)
at org.neo4j.rest.graphdb.RestAPI.getReferenceNode(RestAPI.java:168)
at
org.neo4j.rest.graphdb.RestGraphDatabase.getReferenceNode(RestGraphDatabase.java:71)
at neo4j.Populate.init(Populate.java:35)
at neo4j.Populate.main(Populate.java:18)


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


Re: [Neo4j] Cypher Query Optimizing

2011-11-30 Thread Krzysztof Raczyński
 START n=node(119) MATCH n-[:CO_S]-m, n-[:CO_S]- t, m-[r:CO_S]- t
 return m.w_id, t.w_id, r.sig, r.freq
 took: 644ms (average of 100 runs after 10 warmups)

Can you try using shortestPath cypher function for m-t ?
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] WADL specification is the complete reference for all HTTP interactions with Neo4j?

2011-11-30 Thread yobi
I have noticed that you provide a runtime generated WADL specification for
the HTTP API.

I'm going to create a WADL to Node.js SDK converter so I don't have to
create the functionality and change things manually each time you have a new
release with changes to the HTTP API.
a
But before I do that I wanna be sure that this WADL specification is always
an _up to date_ spec for _all_ HTTP interactions.

Could someone confirm this?

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/WADL-specification-is-the-complete-reference-for-all-HTTP-interactions-with-Neo4j-tp3550226p3550226.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] py2neo - GEOFF enhancements

2011-11-30 Thread Nigel Small
Peter: I am happy with the current state of the neo4j-geoff code so feel it
should be stable enough to adopt when you wish to do so. I have also made a
couple of recent updates to the documentation, most notably the GEOFF.md
file.

Cheers

Nige

*Nigel Small*
Phone: +44 7814 638 246
Blog: http://nigelsmall.name/
GTalk: ni...@nigelsmall.name
MSN: nasm...@live.co.uk
Skype: technige
Twitter: @technige https://twitter.com/#%21/technige
LinkedIn: http://uk.linkedin.com/in/nigelsmall



On 29 November 2011 23:33, Michael Hunger
michael.hun...@neotechnology.comwrote:

 #1 Thanks
 #2 You're probably right

 #3 You can do the index lookup outside and pass in the IndexHitsNode as
 being and Iterator
 #3 I rather thought of {name} for |people| - {name: {hook}} as a shortcut
 for that

 Michael

 But #2 and #3 are probably overkill anyway.

 Cheers

 Michael

 Am 29.11.2011 um 23:59 schrieb Nigel Small:

  Hi Michael
 
  Probably better to just return the full map and let the client code deal
  with it ? (If it isn't interested it would either just ignore the return
  result or discard it quickly).
  Done. Now works as:
 
  MapString,PropertyContainer entities =
 GEOFFLoader.loadIntoNeo4j(reader,
  db, hooks);
  Node nodeFoo = (Node) entities.get((foo));
  Node nodeBar = (Node) entities.get((bar));
 
  Intention behind longs, is when I get them from an external source then
  they can be used to be look up nodes during import.
  This can be done but not sure it's the right place... I'm cautious about
  using IDs directly as they aren't very portable. Also, it's not intuitive
  whether an ID is for a node or relationship. Would like to get a few
 votes
  on this - I'm happy to be outvoted if the consensus is to do it!
 
  Also can hooks be used for index lookups? (Just asking)
  Are you thinking of something like {People:name=bert}? If so, this is
  quite a distance from where we are currently since every token can only
  refer to a single entity, whereas an index lookup could return multiple
  results.
 
  Nige
 
  *Nigel Small*
  Phone: +44 7814 638 246
  Blog: http://nigelsmall.name/
  GTalk: ni...@nigelsmall.name
  MSN: nasm...@live.co.uk
  Skype: technige
  Twitter: @technige https://twitter.com/#%21/technige
  LinkedIn: http://uk.linkedin.com/in/nigelsmall
 
 
 
  On 29 November 2011 22:09, Michael Hunger
  michael.hun...@neotechnology.comwrote:
 
  Hmm good question, that means the namespace keeps everything around
 until
  it is gc'ed ?
 
  Probably better to just return the full map and let the client code deal
  with it ? (If it isn't interested it would either just ignore the return
  result or discard it quickly).
 
  Intention behind longs, is when I get them from an external source then
  they can be used to be look up nodes during import.
 
  Also can hooks be used for index lookups? (Just asking)
 
  Thanks a lot
 
  Michael
 
  Am 29.11.2011 um 22:58 schrieb Nigel Small:
 
  Hi Michael
 
  Doesn't handle iterables (yet) but should be quite easy to add in. What
  purpose did you have behind longs?
 
  I've just committed a few new methods allowing the Neo4jNamespace
  returned
  from a loadIntoNeo4j call to be used to retrieve new entities by name
  (or a
  map of such). The new methods are:
 
  public Node getPreexistingNode(String name)
  public MapString, Node getPreexistingNodes(String... names)
  public Node getNewlyCreatedNode(String name)
  public MapString, Node getNewlyCreatedNodes(String... names)
  public Relationship getPreexistingRelationship(String name)
  public MapString, Relationship getPreexistingRelationships(String...
  names)
  public Relationship getNewlyCreatedRelationship(String name)
  public MapString, Relationship getNewlyCreatedRelationships(String...
  names)
 
  One of the tests in GraphDescriptionTest illustrates simple usage,
 thus:
 
  Neo4jNamespace ns = GEOFFLoader.loadIntoNeo4j(reader, db, hooks);
  Node nodeFoo = ns.getNewlyCreatedNode(foo);
  Node nodeBar = ns.getNewlyCreatedNode(bar);
 
  Hope this helps - I'll have a play with iterables next.
 
  Cheers
 
  Nige
 
  *Nigel Small*
  Phone: +44 7814 638 246
  Blog: http://nigelsmall.name/
  GTalk: ni...@nigelsmall.name
  MSN: nasm...@live.co.uk
  Skype: technige
  Twitter: @technige https://twitter.com/#%21/technige
  LinkedIn: http://uk.linkedin.com/in/nigelsmall
 
 
 
  On 29 November 2011 15:58, Michael Hunger
  michael.hun...@neotechnology.comwrote:
 
  does it also handle iterables of nodes/rels (and probably Longs?)
 
  while thinking about it
  it would be great if the loader could also return a map of variables
 of
  the things generated to be used further in processing
 
  that could also interesting for cascading  geoff and/or cypher
 
  cool stuff big thanks
 
  michael
 
  mobile mail please excuse brevity and typos
 
  Am 29.11.2011 um 16:18 schrieb Peter Neubauer 
  peter.neuba...@neotechnology.com:
 
  That sounds great! Let me know when you are stable, and I will see if
  I can do some more on the 

[Neo4j] Which Ruby REST client for neo4j?

2011-11-30 Thread dnagir
Basically subject says it all.
More detailed question is at SO:
http://stackoverflow.com/questions/8335136/which-ruby-client-for-neo4j-rest-api

So basically there are 3 main options:

neograhy - just plain REST API. Nothing to do with models etc.
neology - is just a wrapper over neography and isn't a full featured
ActiveModel.
architect4r - conforms to ActiveModel, but provides only one way to query
data (Gypher language), also no indexes support.


Which of them and why would you (not) use?

Cheers.

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Which-Ruby-REST-client-for-neo4j-tp3550245p3550245.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Spring integration problem

2011-11-30 Thread Michael Hunger
Hi Frank,

Which version of Srping Data Neo4j (and which version of Spring) are you 
running?

It say it misses one of the Spring classes:
 org/springframework/beans/factory/xml/NamespaceHandlerSupport

Which is normally included in spring-beans-3.0.6-RELEASE.jar

Can you show the output of mvn dependency:tree

Thanks a lot

Michael

Please try the latest version of SDN - 2.0.0.RC1.

Am 30.11.2011 um 20:30 schrieb Frank:

 Hi,
 
 I would like to use the Spring integration feature described on the
 springdataNeo4j page.
 
 My project already uses both Spring and Maven, and I am familiar with how to
 set up dependencies and Spring beans. I already have the neo4j server
 running on my localhost and I've been able to test it via the browser
 interface, so I know that part works.
 
 Unfortunately, despite carefully following the tutorial's instructions, and
 carefully examining everything I'm doing including making sure that every
 possible dependency is declared correctly, I cannot get Spring to load the
 graph database service due to an exception Invalid NamespaceHandler class.
 
 This is my Spring configuration file:
 
 ?xml version=1.0 encoding=UTF-8?
 beans 
   xmlns=http://www.springframework.org/schema/beans;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:neo4j=http://www.springframework.org/schema/data/neo4j;
xsi:schemaLocation=http://www.springframework.org/schema/beans
   http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
   http://www.springframework.org/schema/data/neo4j
   http://www.springframework.org/schema/data/neo4j/spring-neo4j-2.0.xsd;
   
   neo4j:config graphDatabaseService=graphDatabaseService/
   
   bean id=graphDatabaseService
 class=org.springframework.data.neo4j.rest.SpringRestGraphDatabase
   constructor-arg value=http://localhost:7474/db/data//
   /bean
   
 /beans
 
 This is the full stack trace of the exception:
 
 11/30/2011 13:07:34 [INFO] main (XmlBeanDefinitionReader.java:315) - Loading
 XML bean definitions from class path resource [neo4j.xml]
 org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected
 exception parsing XML document from class path resource [neo4j.xml]; nested
 exception is org.springframework.beans.FatalBeanException: Invalid
 NamespaceHandler class
 [org.springframework.data.neo4j.config.DataGraphNamespaceHandler] for
 namespace [http://www.springframework.org/schema/data/neo4j]: problem with
 handler class file or dependent class; nested exception is
 java.lang.NoClassDefFoundError:
 org/springframework/beans/factory/xml/NamespaceHandlerSupport
   at
 org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
   at
 org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
   at
 org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
   at
 org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
   at
 org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
   at
 org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
   at
 org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)
   at
 org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:126)
   at
 org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:92)
   at
 org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
   at
 org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
   at
 org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
   at
 org.springframework.context.support.ClassPathXmlApplicationContext.init(ClassPathXmlApplicationContext.java:139)
   at
 org.springframework.context.support.ClassPathXmlApplicationContext.init(ClassPathXmlApplicationContext.java:93)
   at neo4j.Populate.init(Populate.java:32)
   at neo4j.Populate.main(Populate.java:18)
 Caused by: org.springframework.beans.FatalBeanException: Invalid
 NamespaceHandler class
 [org.springframework.data.neo4j.config.DataGraphNamespaceHandler] for
 namespace [http://www.springframework.org/schema/data/neo4j]: problem with
 handler class file or dependent class; nested exception is
 java.lang.NoClassDefFoundError:
 

Re: [Neo4j] Cypher Query Optimizing

2011-11-30 Thread Michael Hunger
Martin,

would you be so kind as to test the current neo4j-1.6 snapshot with your query?

We did some changes in cypher and would like to see how that affects your query.

Thanks a lot

Michael

Am 30.11.2011 um 18:34 schrieb Martin Junghanns:

 @Tero @Krzysztof
 thx for your fast replies.
 
 @Krzysztof
 for me it was not fairly well known. I will also check out the 
 traverser api.
 
 @Tero
 I tried the same query using the internal id instead of my mapping index 
 (lucene)
 
 orig:
 START n=node:words(w_id = '137') MATCH n-[:CO_S]-m, n-[:CO_S]- t, 
 m-[r:CO_S]- t return m.w_id, t.w_id, r.sig, r.freq
 took: 662ms (average of 100 runs after 10 warmups)
 
 new:
 START n=node(119) MATCH n-[:CO_S]-m, n-[:CO_S]- t, m-[r:CO_S]- t 
 return m.w_id, t.w_id, r.sig, r.freq
 took: 644ms (average of 100 runs after 10 warmups)
 
 So it doesn't seem to be much more faster not using the index for node 
 lookup.
 
 I will check out your posts concerning Lucene Index.
 
 Greetings, Martin
 
 Am 30.11.2011 18:08, schrieb Krzysztof Raczyński:
 It is fairly well known that cypher queries are not (yet) optimised.
 If speed is a concern for you, try using traversal API, i can confirm
 it is much faster than cypher.
 
 cheers
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user
 
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

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


Re: [Neo4j] Spring integration problem

2011-11-30 Thread Frank
Thanks for the reply. I worked with another developer for several hours and we 
seem to have solved the namespace handler problem. However, I'm stuck with 
another problem where I cannot declare the SpringRestGraphDatabase without 
getting a NullPointerException (I can't create it programatically either). I 
posted the details to the list in a separate message.

We're using Spring 3.0.5, but we tried upgrading to 3.0.6 as well.

I tried both 2.0.0.RC1 and 2.0.0.BUILD-SNAPSHOT but didn't see any difference 
between them.

I think the NullPointerException is my last hurdle to getting something working 
at this point.

Frank

On Nov 30, 2011, at 6:46 PM, Michael Hunger [via Neo4j Community Discussions] 
wrote:

 Hi Frank, 
 
 Which version of Srping Data Neo4j (and which version of Spring) are you 
 running? 
 
 It say it misses one of the Spring classes: 
  org/springframework/beans/factory/xml/NamespaceHandlerSupport 
 
 Which is normally included in spring-beans-3.0.6-RELEASE.jar 
 
 Can you show the output of mvn dependency:tree 
 
 Thanks a lot 
 
 Michael 
 
 Please try the latest version of SDN - 2.0.0.RC1. 
 
 Am 30.11.2011 um 20:30 schrieb Frank: 
 
  Hi, 
  
  I would like to use the Spring integration feature described on the 
  springdataNeo4j page. 
  
  My project already uses both Spring and Maven, and I am familiar with how 
  to 
  set up dependencies and Spring beans. I already have the neo4j server 
  running on my localhost and I've been able to test it via the browser 
  interface, so I know that part works. 
  
  Unfortunately, despite carefully following the tutorial's instructions, and 
  carefully examining everything I'm doing including making sure that every 
  possible dependency is declared correctly, I cannot get Spring to load the 
  graph database service due to an exception Invalid NamespaceHandler 
  class. 
  
  This is my Spring configuration file: 
  
  ?xml version=1.0 encoding=UTF-8? 
  beans 
  xmlns=http://www.springframework.org/schema/beans; 
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
 xmlns:neo4j=http://www.springframework.org/schema/data/neo4j; 
 xsi:schemaLocation=http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  http://www.springframework.org/schema/data/neo4j
  http://www.springframework.org/schema/data/neo4j/spring-neo4j-2.0.xsd; 
  
  neo4j:config graphDatabaseService=graphDatabaseService/ 
  
  bean id=graphDatabaseService 
  class=org.springframework.data.neo4j.rest.SpringRestGraphDatabase 
  constructor-arg value=http://localhost:7474/db/data// 
  /bean 
  
  /beans 
  
  This is the full stack trace of the exception: 
  
  11/30/2011 13:07:34 [INFO] main (XmlBeanDefinitionReader.java:315) - 
  Loading 
  XML bean definitions from class path resource [neo4j.xml] 
  org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected 
  exception parsing XML document from class path resource [neo4j.xml]; nested 
  exception is org.springframework.beans.FatalBeanException: Invalid 
  NamespaceHandler class 
  [org.springframework.data.neo4j.config.DataGraphNamespaceHandler] for 
  namespace [http://www.springframework.org/schema/data/neo4j]: problem with 
  handler class file or dependent class; nested exception is 
  java.lang.NoClassDefFoundError: 
  org/springframework/beans/factory/xml/NamespaceHandlerSupport 
  at 
  org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
   
  at 
  org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
   
  at 
  org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
   
  at 
  org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
   
  at 
  org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
   
  at 
  org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
   
  at 
  org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)
   
  at 
  org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:126)
   
  at 
  org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:92)
   
  at 
  org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
   
  at 
  org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
   
  at 
  

Re: [Neo4j] NullPointerException in ExecutingRestRequest

2011-11-30 Thread Michael Hunger
Frank,

sorry to hear that. 

I just tried it and it works as expected.

final SpringRestGraphDatabase gdb = new 
SpringRestGraphDatabase(http://localhost:7474/db/data/;);
final Node node = gdb.getReferenceNode();
assertEquals(0,node.getId());

What version of the Neo4j-Server are you using? Could you please also show the 
output of mvn dependency:tree ?

Thanks a lot

Michael

if you execute it via curl, what are the results?

ynagzet:spring-data-neo4j mh$ curl http://localhost:7474/db/data/ -i
HTTP/1.1 200 OK
Content-Length: 620
Content-Encoding: UTF-8
Content-Type: application/json
Access-Control-Allow-Origin: *
Server: Jetty(6.1.25)

{
  relationship_index : http://localhost:7474/db/data/index/relationship;,
  node : http://localhost:7474/db/data/node;,
  relationship_types : http://localhost:7474/db/data/relationship/types;,
  neo4j_version : 1.6.M01,
  batch : http://localhost:7474/db/data/batch;,
  extensions_info : http://localhost:7474/db/data/ext;,
  node_index : http://localhost:7474/db/data/index/node;,
  reference_node : http://localhost:7474/db/data/node/0;,
  extensions : {
GremlinPlugin : {
  execute_script : 
http://localhost:7474/db/data/ext/GremlinPlugin/graphdb/execute_script;
}
  }
}ynagzet:spring-data-neo4j mh$ curl http://localhost:7474/db/data -i
HTTP/1.1 302 Found
Location: http://localhost:7474/db/data/
Content-Length: 0
Server: Jetty(6.1.25)


Am 01.12.2011 um 00:19 schrieb Frank:

 The server is running on localhost and can be hit from a browser. The
 server's configuration was modified to allow requests from any IP address,
 although all of my attempts are from the localhost anyway.
 
 I've tried this with and without a trailing slash on the URI, no difference.
 
 Code:
 
 GraphDatabase graphDb = new
 SpringRestGraphDatabase(http://localhost:7474/db/data;);
 graphDb.getReferenceNode();
 
 Result:
 
 java.lang.NullPointerException
   at
 org.neo4j.rest.graphdb.ExecutingRestRequest.uriWithoutSlash(ExecutingRestRequest.java:78)
   at
 org.neo4j.rest.graphdb.ExecutingRestRequest.init(ExecutingRestRequest.java:72)
   at
 org.neo4j.rest.graphdb.ExecutingRestRequest.with(ExecutingRestRequest.java:149)
   at org.neo4j.rest.graphdb.entity.RestEntity.init(RestEntity.java:52)
   at org.neo4j.rest.graphdb.entity.RestNode.init(RestNode.java:47)
   at org.neo4j.rest.graphdb.RestAPI.getReferenceNode(RestAPI.java:168)
   at
 org.neo4j.rest.graphdb.RestGraphDatabase.getReferenceNode(RestGraphDatabase.java:71)
   at neo4j.Populate.init(Populate.java:35)
   at neo4j.Populate.main(Populate.java:18)
 
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/NullPointerException-in-ExecutingRestRequest-tp3550067p3550067.html
 Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

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


[Neo4j] CQL find by name

2011-11-30 Thread yobi
I have seen both this:

START root=node:node_auto_index(name = 'FileRoot')

and this used:

START root=node:node_auto_index('name: FileRoot')

Isn't the second one more appropriate since the first one could be mixed up
with an assignment and the second one looks more like a key:value pair. More
simple to get and you don't have to change syntax style when you are using
*.

START root=node:node_auto_index('name: FileRoot*')

Correct me if I am missing something.

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/CQL-find-by-name-tp3550446p3550446.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Will there ever be a native SDK for Node.js?

2011-11-30 Thread yobi
Have been reading through the Java documentation. Having a native SDK seems
to be a big win when interacting with Neo4j.

I wonder if you have any plans on making a native SDK for Node.js since apps
on Heroku could run on Node.js as well.

Thanks

Johnny

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Will-there-ever-be-a-native-SDK-for-Node-js-tp3550518p3550518.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Will there ever be a native SDK for Node.js?

2011-11-30 Thread Dmytrii Nagirniak

 Have been reading through the Java documentation. Having a native SDK seems
 to be a big win when interacting with Neo4j.
What exactly do you mean by that? With REST API you have number of advantages 
too.


 I wonder if you have any plans on making a native SDK for Node.js since apps
 on Heroku could run on Node.js as well.

I don't think the native SDK for non-Java platform will ever be released. It 
would be totally different product then.

So your best bet is the REST API.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] REST API - always batch?

2011-11-30 Thread Dmytrii Nagirniak
Hi,

I wonder what the disadvantages would be if every request to the server would 
always be a batch (even for simple GETs)?

This would make it easier to use the API from the application.

How bad is this idea?

Cheers,
Dima
http://www.ApproachE.com




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


Re: [Neo4j] social network may exceed the number of nodes / relationships / properties

2011-11-30 Thread David Montag
Hi,

I may be mistaken, but I think your estimates are a bit high. Neo4j is
running in production in many social deployments. If you want to build a
social network, then Neo4j is the way to go. By the time your social
network outgrows the current limits of Neo4j, we will most likely support
sharding for wide-scale deployments.

Feel free to keep us posted on your progress.

David

On Wed, Nov 30, 2011 at 9:24 AM, gustavoboby gustavob...@gmail.com wrote:

 Hi peoples,

 I need to do in a social network the same of facebook does into a private
 messages and post's.

 However, I have the following concern:

 It is expected up to 1 million users in the social network, if each person
 to write one million times (between posts and private messages) in one
 year.
 My fear is exceeding the number of properties / relationships / nodes

 How would you do in this situation? what do you recommend?

 --
 View this message in context:
 http://neo4j-community-discussions.438527.n3.nabble.com/social-network-may-exceed-the-number-of-nodes-relationships-properties-tp3549025p3549025.html
 Sent from the Neo4j Community Discussions mailing list archive at
 Nabble.com.
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




-- 
David Montag david.mon...@neotechnology.com
Neo Technology, www.neotechnology.com
Cell: 650.556.4411
Skype: ddmontag
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Will there ever be a native SDK for Node.js?

2011-11-30 Thread yobi
What are the advantages of using HTTP directly over native SDK like the Java
one?

Don't they have a native SDK for Python and Ruby as well (although I think
they are just wrappers for tje HTTP API?)

Johnny

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Will-there-ever-be-a-native-SDK-for-Node-js-tp3550518p3550633.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Gremlin Query - Help

2011-11-30 Thread Romiko Derbynew
Hi,


Scenario 1:
I would like to get all Nodes that do not have a relationship to another node. 
What is the best way to do this Gremlin?

Root = NodeA = NodeB
Root = NodeC

Output should be NodeC

Scenario 2:
Root =  User - Centre

I would like to get all centres for userA, and then get all users who are also 
linked to the same centres of the userA


Scenario 3:
User = Centre
I would like to get all users that do not have a link to a Centre, and if this 
is the case, do a projection that returns a fake centre with property Unknown

Scenario 4:

REFERRAL = PERSON

I would like to combine a query that gets all
Referrals that are linked to a person and project a table result (contains 
referrals and person property values (this is easy to do)
However, I then want to do a SPLIT query, that gets referrals without the 
persons, and then MERGE both back into the table projection? So table projecton 
might look like this.
I guess this is done with .table().it{}cap, but what I am not sure, is how 
to do a split and merge in parallel and then get that merge projected into the 
same table.

ReferralId, Name
1, Bob
2, Jill
3, null
4, null

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


Re: [Neo4j] Will there ever be a native SDK for Node.js?

2011-11-30 Thread Dmytrii Nagirniak

On 01/12/2011, at 4:32 PM, yobi wrote:

 What are the advantages of using HTTP directly over native SDK like the Java
 one?
You have to understand that native runs as as part of the same process. And 
that's why it's supposed to be faster.
Running as part of the app means that you lock the database to one single app 
(you can't just go and fix production data).

With REST, you have a separate server. Thus multiple applications can use. Or 
you can access it directly through normal web browser to fix your data.
Or even run background jobs against that server. All that is not possible with 
native.


 Don't they have a native SDK for Python and Ruby as well (although I think
 they are just wrappers for tje HTTP API?)
No. Saying native it means that it is native to Java only.
So as long as you are on JVM, you can use the native SDK.

There are versions of Ruby (JRuby) and Python (Jypthon) that are built 
specifically to target JVM. And that's why you can use it.
But if you want to use normal Ruby or Python, your only option is REST.

Same applies to your case with Nodejs.  

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


Re: [Neo4j] Will there ever be a native SDK for Node.js?

2011-11-30 Thread Michael Hunger
if you just want to use javascript you can look into rhino.

for the REST APO there neo4j,js and juggledb or using the http calls directly


hth
michael

mobile mail please excuse brevity and typos

Am 01.12.2011 um 07:06 schrieb Dmytrii Nagirniak dna...@gmail.com:

 
 On 01/12/2011, at 4:32 PM, yobi wrote:
 
 What are the advantages of using HTTP directly over native SDK like the Java
 one?
 You have to understand that native runs as as part of the same process. And 
 that's why it's supposed to be faster.
 Running as part of the app means that you lock the database to one single app 
 (you can't just go and fix production data).
 
 With REST, you have a separate server. Thus multiple applications can use. Or 
 you can access it directly through normal web browser to fix your data.
 Or even run background jobs against that server. All that is not possible 
 with native.
 
 
 Don't they have a native SDK for Python and Ruby as well (although I think
 they are just wrappers for tje HTTP API?)
 No. Saying native it means that it is native to Java only.
 So as long as you are on JVM, you can use the native SDK.
 
 There are versions of Ruby (JRuby) and Python (Jypthon) that are built 
 specifically to target JVM. And that's why you can use it.
 But if you want to use normal Ruby or Python, your only option is REST.
 
 Same applies to your case with Nodejs.  
 
 ___
 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 - always batch?

2011-11-30 Thread Peter Neubauer
Dmytri,
sounds like an interesting plan! I don't think there is anything
directly that I can see, except a bug,
https://github.com/neo4j/community/issues/113 with \\ which you
might watch our for, reported by Josh Adell.

Let us know how it works out!

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

brew install neo4j  neo4j start
heroku addons:add neo4j



On Thu, Dec 1, 2011 at 5:53 AM, Dmytrii Nagirniak dna...@gmail.com wrote:
 Hi,

 I wonder what the disadvantages would be if every request to the server would 
 always be a batch (even for simple GETs)?

 This would make it easier to use the API from the application.

 How bad is this idea?

 Cheers,
 Dima
 http://www.ApproachE.com




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