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

2011-11-29 Thread Alfredas Chmieliauskas
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] Max flow using gremlin

2011-11-18 Thread Alfredas Chmieliauskas
Dear all,

has anyone implemented any of the max flow algorithms using gremlin?

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


Re: [Neo4j] Max flow using gremlin

2011-11-18 Thread Alfredas Chmieliauskas
Hey Marko,

I'm modeling the european gas transport/pipeline network. I need to
have a good way to calculate maximum flow from source to sink and get
the nodes in the path .

Alfredas

On Fri, Nov 18, 2011 at 2:48 PM, Marko Rodriguez okramma...@gmail.com wrote:
 Hi,

 has anyone implemented any of the max flow algorithms using gremlin?

 Most of the algorithms in my toolbox are flow-based algorithms. What in 
 particular are you trying to do?

 Marko.

 http://markorodriguez.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] Max flow using gremlin

2011-11-18 Thread Alfredas Chmieliauskas
Great! Thanks.

Also its missing the !... should be
source.outE.inV.loop(2){!it.object.equals(sink)}.paths.each{

A


On Fri, Nov 18, 2011 at 9:47 PM, Marko Rodriguez okramma...@gmail.com wrote:
 Hey,

 Perhaps the simplist way to explore flow is to simply get the paths between 
 source and sink and then calculate some function f over the path to determine 
 its flow. For example:

        def f = { List path -
                // some function over the path where every other element is an 
 edge (see traversal below)
        }

        source.outE.inV.loop(2){it.object.equals(sink)}.paths.each{
                println(it +  has a flow of  + f(it))
        }

 This assumes you have a determined source and a determined sink and that 
 there are no cycles in your gas pipeline. If there are cycles, then you can 
 tweak the expression to make sure you break out of the loop when appropriate.

 From this basic idea you can then tweak it to simulate decay over time/step 
 or implement random walks through the gasline if you are interested in 
 sampling or studying local eigenvectors in the pipeline.

 Hope that provides you a good starting point.

 Enjoy!,
 Marko

 http://markorodriguez.com

 On Nov 18, 2011, at 1:20 PM, Alfredas Chmieliauskas wrote:

 Hey Marko,

 I'm modeling the european gas transport/pipeline network. I need to
 have a good way to calculate maximum flow from source to sink and get
 the nodes in the path .

 Alfredas

 On Fri, Nov 18, 2011 at 2:48 PM, Marko Rodriguez okramma...@gmail.com 
 wrote:
 Hi,

 has anyone implemented any of the max flow algorithms using gremlin?

 Most of the algorithms in my toolbox are flow-based algorithms. What in 
 particular are you trying to do?

 Marko.

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

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

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

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


Re: [Neo4j] Max flow using gremlin

2011-11-18 Thread Alfredas Chmieliauskas
This seems to calculate the max flow (edges have capacity):

source.outE.inV.loop(2){!it.object.equals(sink)}.paths.each{flow =
it.capacity.min(); maxFlow += flow;
it.findAll{it.capacity}.each{it.capacity -= flow}};

I can't believe this is so short!

A



On Fri, Nov 18, 2011 at 10:51 PM, Marko A. Rodriguez
okramma...@gmail.com wrote:
 Great! Thanks.

 Also its missing the !... should be
 source.outE.inV.loop(2){!it.object.equals(sink)}.paths.each{


 Yes...good catch.

 Good luck,
 Marko.

 http://markorodriguez.com






 On Fri, Nov 18, 2011 at 9:47 PM, Marko Rodriguez okramma...@gmail.com 
 wrote:
 Hey,

 Perhaps the simplist way to explore flow is to simply get the paths between 
 source and sink and then calculate some function f over the path to 
 determine its flow. For example:

        def f = { List path -
                // some function over the path where every other element is 
 an edge (see traversal below)
        }

        source.outE.inV.loop(2){it.object.equals(sink)}.paths.each{
                println(it +  has a flow of  + f(it))
        }

 This assumes you have a determined source and a determined sink and that 
 there are no cycles in your gas pipeline. If there are cycles, then you can 
 tweak the expression to make sure you break out of the loop when 
 appropriate.

 From this basic idea you can then tweak it to simulate decay over time/step 
 or implement random walks through the gasline if you are interested in 
 sampling or studying local eigenvectors in the pipeline.

 Hope that provides you a good starting point.

 Enjoy!,
 Marko

 http://markorodriguez.com

 On Nov 18, 2011, at 1:20 PM, Alfredas Chmieliauskas wrote:

 Hey Marko,

 I'm modeling the european gas transport/pipeline network. I need to
 have a good way to calculate maximum flow from source to sink and get
 the nodes in the path .

 Alfredas

 On Fri, Nov 18, 2011 at 2:48 PM, Marko Rodriguez okramma...@gmail.com 
 wrote:
 Hi,

 has anyone implemented any of the max flow algorithms using gremlin?

 Most of the algorithms in my toolbox are flow-based algorithms. What in 
 particular are you trying to do?

 Marko.

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

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

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

 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user
 ___
 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] Gremlin plugin and script engine question

2011-11-17 Thread Alfredas Chmieliauskas
Dear all,
This concerns gremlin plugin and the script engine.
Maybe there's an explanation for this behavior:
1) gremlin x = [];
g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops  4};
    gremlin x;

== v[7]
== v[3]
== v[5]

2) gremlin x = [];
g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops  4}; x;
returns nothing...

Thanks,

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


Re: [Neo4j] Gremlin plugin and script engine question

2011-11-17 Thread Alfredas Chmieliauskas
Thanks!

What exactly does iterate() do?

A

On Thu, Nov 17, 2011 at 4:07 PM, Marko Rodriguez okramma...@gmail.com wrote:
 Hey Alfredas,

 Be sure to iterate your pipeline

        x = []; g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops  
 4}.iterate(); x

 * NOTE: You can also do:
        g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops  4} -1
   but the  convention is no longer with us in Gremlin 1.4-SNAPSHOT.

 HTH,
 Marko.

 http://markorodriguez.com

 On Nov 17, 2011, at 7:21 AM, Alfredas Chmieliauskas wrote:

 Dear all,
 This concerns gremlin plugin and the script engine.
 Maybe there's an explanation for this behavior:
 1) gremlin x = [];
 g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops  4};
     gremlin x;

 == v[7]
 == v[3]
 == v[5]

 2) gremlin x = [];
 g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops  4}; x;
 returns nothing...

 Thanks,

 Alfredas
 ___
 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] Gremlin plugin and script engine question

2011-11-17 Thread Alfredas Chmieliauskas
Got it. Thanks!

Rick  -1

A


On Thu, Nov 17, 2011 at 6:36 PM, Marko Rodriguez okramma...@gmail.com wrote:
 What exactly does iterate() do?

 A Gremlin expression yields a Pipeline and
        PipelineS,E implements IteratorS,E

 Thus, a Gremlin expression doesn't return the results of a traversal, only a 
 lazy iterator for .next()'ing results. For people doing a traversal to yield 
 a sideEffect (e.g. aggregate, groupCount, etc.), iterate() is there to 
 while(hasNext()) { next() } for you to fill up your side effect data 
 structure.

 Finally, the Gremlin REPL automagically iterates and System.out.printlns() 
 any objects in an Iterator it gets so thats why the behavior in the Gremlin 
 REPL looks like a Gremlin expression returns results.

 Hope that is clear,
 Marko.

 http://markorodriguez.com

 A

 On Thu, Nov 17, 2011 at 4:07 PM, Marko Rodriguez okramma...@gmail.com 
 wrote:
 Hey Alfredas,

 Be sure to iterate your pipeline

        x = []; g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops  
 4}.iterate(); x

 * NOTE: You can also do:
        g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops  4} -1
   but the  convention is no longer with us in Gremlin 1.4-SNAPSHOT.

 HTH,
 Marko.

 http://markorodriguez.com

 On Nov 17, 2011, at 7:21 AM, Alfredas Chmieliauskas wrote:

 Dear all,
 This concerns gremlin plugin and the script engine.
 Maybe there's an explanation for this behavior:
 1) gremlin x = [];
 g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops  4};
     gremlin x;

 == v[7]
 == v[3]
 == v[5]

 2) gremlin x = [];
 g.v(1).out(from).out(to).aggregate(x).loop(3){it.loops  4}; x;
 returns nothing...

 Thanks,

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

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

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

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

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


Re: [Neo4j] Spring Data Graph 1.1.0.M1 milestone released

2011-06-17 Thread Alfredas Chmieliauskas
Thanks a lot.

On Thu, Jun 16, 2011 at 3:20 PM, Michael Hunger
michael.hun...@neotechnology.com wrote:
 You could just use the direct repository factory for that.

 directGraphRepositoryFactory.createGraphRepository(clazz).findAll()


 normally you would have a

 interface PersonRepository extends GraphRepositoryPerson {}


yep. that looks like a good solution. My use case is a bit special -
ie I have a a lot of classes and having repos for each would be a
waste. But again that's because we're using this technology in a weird
way (20 domain classes)

On the other hand - graph db is probably the best option for us, as
having 20 tables instead would make it a nightmare. So in a way it
really supports the case for neo4j, although such application is
really a niche one.

 and get this injected.

 @Autowired PersonRepository personRepository;

 personRepository.findAll();

 Cheers

 Michael

 Today I discussed some nice derived-method for cypher queries.
 See: 
 https://github.com/SpringSource/spring-data-graph/wiki/Repository-query-methods


 Am 16.06.2011 um 14:30 schrieb Alfredas Chmieliauskas:

 Dear Michael,

 sounds great! Especially the annotated repository methods. That was
 something *really* desirable and now its there. Fantastischt!

 One question though. Before the upgrade i used to have a handy method
 to find all things of a type (Class) by using a method like

 public T extends NodeBacked IterableT findAll(ClassT clazz) {
   finderFactory.createNodeEntityFinder(clazz).findAll();
 }

 is there a good way to replicate such functionality in the current release?

 Alfredas

 P.S. we're delayed with publishing our energy simulations (bureaucracy
 problems more than technical or conceptual). but i'm still determined
 to make it happen (publish the thing online) before summer end.

 On Wed, Jun 15, 2011 at 10:17 AM, Michael Hunger
 michael.hun...@neotechnology.com wrote:
 Dear Graphistas,

 After some quiet time that I spend on other important issues, we're back on 
 our regular release cycle/rhythm.

 We discussed the future SDG roadmap with our CEO Emil and decided to work 
 first on the issues that were
 reported by our users here on the mailing list, on the spring forums and on 
 twitter.

 So primarily we updated the dependencies to Neo4j 1.4.M04 and AspectJ 
 (1.6.12.M1), the latter fixing some issues.

 With the new Neo4j release we are also able to start working some important 
 new features.

 The most interesting one is the adoption of the query language cypher 
 which is now accessible from NodeEntities (dynamic annotated fields, 
 introduced methods) and repositories (annotated repository interface 
 methods).
 (https://jira.springsource.org/browse/DATAGRAPH-91)

 Example, NodeEntity-field:

 @GraphQuery(start me=(%d) match 
 (me)-[:works_at]-(company)-[:works_at]-(colleague) return colleague)
 IterablePerson colleagues;

 Example, Repository:

 interface PersonRepository extends GraphRepositoryPerson {
   @GraphQuery(start person=(%d) match (person)-[:boss]-(boss) return 
 boss)
   Person findBoss(Person developer);
 }

 We also accommodate for the change of allowing self-relationships.

 Another annoyance for SDG users - the need to specify an elementClass on 
 @RelatedTo annotations has also been removed this change will also be added 
 to the other annotations that we use.

 We would like to get your feedback on those changes and also on Spring Data 
 Graph in general, so please check it out and get back to us.

 And please spread the word: 
 http://twitter.com/#!/neo4j/statuses/80503228319547392

 Cheers

 Michael

 Announcement: http://www.springsource.org/node/3152
 JIRA: https://jira.springsource.org/browse/DATAGRAPH
 Project Page: http://www.springsource.org/spring-data/neo4j
 Forum: forum.springsource.org/forumdisplay.php?f=80

 Github: http://github.com/springsource/spring-data-graph
 Download: 
 http://www.springsource.com/download/community?project=Spring%20Data%20Neo4j






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

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

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

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


[Neo4j] Use case for Neo4j spatial

2011-06-07 Thread Alfredas Chmieliauskas
Dear all,

I'm looking at a problem that could present an interesting use case
for neo4j spatial capabilities.
I've managed to compile a list of natural gas pipelines with their
coordinates, see
http://enipedia.tudelft.nl/wiki/NaturalGasInfrastructure
Its a web of paths that go from gas fields to major consumption and
trading areas. The question I'm looking at is which
points/intersections of the grid have the best reach - ie connect most
sources to most consumers.
Also what minimal additions to the grid could make the most difference
in gas distribution.

In addition to these conceptual questions, I also have to solve some
simple problems. The way pipe paths are recorded (lat and lng point
series) they do not meet at the same exact spot (lat and lon
precision), so I need to be able to approximate/infer intersections.

The intention is to build a tool allowing to evaluate the
infrastructure expansion options.

For more info on the gas map see the uber-geeky story of its creation:
http://enipedia.tudelft.nl/blog/?p=6

I would appreciate any pointers/links/ideas.

Thanks a lot,

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


Re: [Neo4j] EmbeddedReadOnlyGraphDatabase workings

2011-04-06 Thread Alfredas Chmieliauskas
Hey,

Thanks for the ideas.
Both 
readOnlyGraphDb.getConfig().getGraphDbModule().getNodeManager().clearCache()
and cache_type=none worked.

But I've run into some issues down the road.

To test i've taken the same db folder with some nodes, properties and
relations and created a read-only embedded db with it; later the same
folder for standard embedded db.

When opening the db as read-only:
1) node.getRelationships() is empty for all nodes whereas it is not
the case in the standard mode
2) node.getPropertyKeys() sometimes throws
org.neo4j.kernel.impl.nioneo.store.InvalidRecordException:
Position[63] requested for operation is high id[24], store is ok[true]

org.neo4j.kernel.impl.nioneo.store.CommonAbstractStore.acquireWindow(CommonAbstractStore.java:521)

org.neo4j.kernel.impl.nioneo.store.AbstractDynamicStore.getLightRecords(AbstractDynamicStore.java:425)

org.neo4j.kernel.impl.nioneo.store.PropertyIndexStore.getRecord(PropertyIndexStore.java:196)

org.neo4j.kernel.impl.nioneo.xa.ReadTransaction.getPropertyIndex(ReadTransaction.java:201)

org.neo4j.kernel.impl.nioneo.xa.NioNeoDbPersistenceSource$ReadOnlyResourceConnection.loadIndex(NioNeoDbPersistenceSource.java:206)

org.neo4j.kernel.impl.persistence.PersistenceManager.loadIndex(PersistenceManager.java:84)

org.neo4j.kernel.impl.core.PropertyIndexManager.getIndexFor(PropertyIndexManager.java:141)
org.neo4j.kernel.impl.core.NodeManager.getIndexFor(NodeManager.java:765)
org.neo4j.kernel.impl.core.Primitive.getPropertyKeys(Primitive.java:117)
org.neo4j.kernel.impl.core.NodeProxy.getPropertyKeys(NodeProxy.java:129)

which works  fine in the  standard mode.

I wonder am I doing something wrong or are these issues known?

Alfredas

On Wed, Apr 6, 2011 at 9:18 AM, Mattias Persson
matt...@neotechnology.com wrote:
 A refresh, i.e. clearing of caches can be performed by (API may change):


 readOnlyGraphDb.getConfig().getGraphDbModule().getNodeManager().clearCache();

 and you could maybe keep the default cache_type setting. That should do what
 you're asking for.

 2011/4/5 David Montag david.mon...@neotechnology.com

 Alfredas,

 A solution based on EmbeddedReadOnlyGraphDatabase would not be able to
 benefit from caching, as each refresh of the view would have to clear the
 caches. You could possibly achieve the solution you want by setting the
 config parameter cache_type=none for the read-only instance. Then it should
 not cache anything and always read from disk or OS cache. This would
 however
 yield degraded performance if you repeatedly read the same data.

 If your processing could benefit from caching, then you're better off
 creating a new instance, or manually clearing the caches. Or going with the
 HA-based solution that Jim and Mattias outlined.

 David

 On Tue, Apr 5, 2011 at 9:36 AM, Alfredas Chmieliauskas
 al.fre...@gmail.comwrote:

  Yes. The read only client would query the db at time intervals.
 
  Alfredas
 
  On Tue, Apr 5, 2011 at 5:40 PM, David Montag
  david.mon...@neotechnology.com wrote:
   Alfredas,
   When you say watch, do you mean poll the graph at some interval? What
   would the read-only client do?
   Thanks,
   David
  
   On Tue, Apr 5, 2011 at 5:26 AM, Alfredas Chmieliauskas 
  al.fre...@gmail.com
   wrote:
  
   Dear all,
  
   we have the following situation:
   - 1 client is writing to the embedded db (writer)
   - 1 client would like to watch that (read-only)
  
   is that possible with the EmbeddedReadOnlyGraphDatabase?
   Currently it seems that the read-only db does not see the updates from
   the writer since its creation. It there a way to force refresh besides
   creating a new instance?
  
   Also are there any other/better ways to do that (1 writer, 1 reader)
   without going into the server mode?
  
   Thanks a lot,
  
   Alfredas
   ___
   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
  
 



 --
 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




 --
 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

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


[Neo4j] EmbeddedReadOnlyGraphDatabase workings

2011-04-05 Thread Alfredas Chmieliauskas
Dear all,

we have the following situation:
- 1 client is writing to the embedded db (writer)
- 1 client would like to watch that (read-only)

is that possible with the EmbeddedReadOnlyGraphDatabase?
Currently it seems that the read-only db does not see the updates from
the writer since its creation. It there a way to force refresh besides
creating a new instance?

Also are there any other/better ways to do that (1 writer, 1 reader)
without going into the server mode?

Thanks a lot,

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


Re: [Neo4j] EmbeddedReadOnlyGraphDatabase workings

2011-04-05 Thread Alfredas Chmieliauskas
Yes. The read only client would query the db at time intervals.

Alfredas

On Tue, Apr 5, 2011 at 5:40 PM, David Montag
david.mon...@neotechnology.com wrote:
 Alfredas,
 When you say watch, do you mean poll the graph at some interval? What
 would the read-only client do?
 Thanks,
 David

 On Tue, Apr 5, 2011 at 5:26 AM, Alfredas Chmieliauskas al.fre...@gmail.com
 wrote:

 Dear all,

 we have the following situation:
 - 1 client is writing to the embedded db (writer)
 - 1 client would like to watch that (read-only)

 is that possible with the EmbeddedReadOnlyGraphDatabase?
 Currently it seems that the read-only db does not see the updates from
 the writer since its creation. It there a way to force refresh besides
 creating a new instance?

 Also are there any other/better ways to do that (1 writer, 1 reader)
 without going into the server mode?

 Thanks a lot,

 Alfredas
 ___
 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] Lucene index: Too many open files

2011-03-31 Thread Alfredas Chmieliauskas
I get that too, but sometimes. I got the feeling that it relates to
the number of @Transactional annotations that get nested. I might be
completely wrong.
But I got rid of it by revising my annotations.

Alfredas

On Wed, Mar 30, 2011 at 11:40 PM, rick.bullo...@burningskysoftware.com
rick.bullo...@burningskysoftware.com wrote:
 Sounds like a bug to me.

 - Reply message -
 From: Axel Morgner a...@morgner.de
 Date: Wed, Mar 30, 2011 1:23 pm
 Subject: [Neo4j] Lucene index: Too many open files
 To: Neo4j user discussions user@lists.neo4j.org

 Hi,

 during stress tests, I got a Too many open files message (see detailed
 stack trace below). Server is a Debian Linux 2.6.26 x86_64 w/ 24 GB RAM,
 Core i7 which handles the load with ease.

 cat /proc/sys/fs/file-max
 2399285

 The parameter fs.file-max was already set very high, but I'll increase
 it further and see if it will happen again.

 fs.file-max = 6815744
 fs.aio-max-nr = 1048576

 Are there recommendations of linux kernel parameters? Or/and would you
 recommend other things to circumvent that, f.e. using multiple indexes
 instead of one?

 And it seems to me that finishing a Neo4j transaction will always
 trigger a LuceneTransaction.doCommit, even if there was no update on
 index (I try to avoid for the log nodes). Can this be switched off?

 Thanks and greetings

 Axel


 [1] Stack trace

 java.lang.RuntimeException: java.io.FileNotFoundException:
 /opt/structr/t5s/db/index/lucene/node/fulltextAllNodes/_ngl.fdx (Too
 many open files)
     at
 org.neo4j.index.impl.lucene.LuceneTransaction.doCommit(LuceneTransaction.java:272)
     at
 org.neo4j.kernel.impl.transaction.xaframework.XaTransaction.commit(XaTransaction.java:318)
     at
 org.neo4j.kernel.impl.transaction.xaframework.XaResourceManager.commit(XaResourceManager.java:446)
     at
 org.neo4j.kernel.impl.transaction.xaframework.XaResourceHelpImpl.commit(XaResourceHelpImpl.java:64)
     at
 org.neo4j.kernel.impl.transaction.TransactionImpl.doCommit(TransactionImpl.java:516)
     at
 org.neo4j.kernel.impl.transaction.TxManager.commit(TxManager.java:621)
     at
 org.neo4j.kernel.impl.transaction.TxManager.commit(TxManager.java:584)
     at
 org.neo4j.kernel.impl.transaction.TransactionImpl.commit(TransactionImpl.java:104)
     at
 org.neo4j.kernel.TopLevelTransaction.finish(TopLevelTransaction.java:85)
     at
 org.structr.core.node.TransactionCommand.execute(TransactionCommand.java:37)
     at org.structr.core.entity.AbstractNode.commit(AbstractNode.java:1048)
     at org.structr.core.log.LogService.flushQueue(LogService.java:101)
     at org.structr.core.log.LogService.run(LogService.java:73)
 Caused by: java.io.FileNotFoundException:
 /opt/structr/t5s/db/index/lucene/node/fulltextAllNodes/_ngl.fdx (Too
 many open files)
     at java.io.RandomAccessFile.open(Native Method)
     at java.io.RandomAccessFile.init(RandomAccessFile.java:233)
     at
 org.apache.lucene.store.SimpleFSDirectory$SimpleFSIndexOutput.init(SimpleFSDirectory.java:180)
     at
 org.apache.lucene.store.NIOFSDirectory.createOutput(NIOFSDirectory.java:74)
     at org.apache.lucene.index.FieldsWriter.init(FieldsWriter.java:86)
     at

 ___
 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] A picture worth a 170'000 nodes and 650'000 edges

2011-03-25 Thread Alfredas Chmieliauskas
On Fri, Mar 25, 2011 at 1:38 AM, Keiichiro Ono kei...@gmail.com wrote:
 Nice visualization!  How long did it take to render this image?

For 3m edges and 1m nodes it takes around 20min on a AMD PhenomII X4.


 By the way, we are going to hire a student through Google Summer of
 Code to use Cytoscape 3 as a visualizer for Neo4j.  If any of you are
 a student and interested in this type of coding project, please apply:


Offtopic for Neo4j - does  Cytoscape provide any Sparql support (as is
advertised on the front page :-). I could not find any.

 http://chihuahua.ucsf.edu/cgi-bin/wikigsoc.pl    (Idea #4)

 Thanks,
 Kei
 Cytoscape Core Developer:  http://cytoscape.org/

 2011/3/24 Tobias Ivarsson tobias.ivars...@neotechnology.com:
 Nice to see my visualization code being put to good use.

 The most recent version has moved to github, along with the rest of Neo4j,
 since this is an unofficial tool it is on my personal github:
 https://github.com/thobe/neoviz

 Cheers,
 Tobias

 On Thu, Mar 24, 2011 at 8:09 PM, Alfredas Chmieliauskas al.fre...@gmail.com
 wrote:

 For fun:

 This is a visualization of the graph resulting from a simulation
 (interacting energy markets).

 http://test.eeni.tbm.tudelft.nl/~alfredas/d13n-graph.png

 After 10 simulation ticks we have ~170'000 entities (agents, markets,
 power plants, bids, substances, technologies, etc) and ~650'000
 relations between these entities. Different colors represent different
 types of relations. These relations are created at a rate of ~60'000
 per tick, as a result of agents trading, investing and energy flows.
 By the end of the simulation we get ~1m nodes and ~4m edges.

 The visualization was made using neo-graphviz:
 https://svn.neo4j.org/laboratory/components/neo-graphviz/

 The crazy part is that we can still make sense of what's happening
 there, using a few pipes and traversals :-)

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




 --
 Tobias Ivarsson tobias.ivars...@neotechnology.com
 Hacker, Neo Technology
 www.neotechnology.com
 Cellphone: +46 706 534857
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




 --
 Keiichiro Ono    http://www.keiono.net/
 ___
 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] A picture worth a 170'000 nodes and 650'000 edges

2011-03-24 Thread Alfredas Chmieliauskas
For fun:

This is a visualization of the graph resulting from a simulation
(interacting energy markets).

http://test.eeni.tbm.tudelft.nl/~alfredas/d13n-graph.png

After 10 simulation ticks we have ~170'000 entities (agents, markets,
power plants, bids, substances, technologies, etc) and ~650'000
relations between these entities. Different colors represent different
types of relations. These relations are created at a rate of ~60'000
per tick, as a result of agents trading, investing and energy flows.
By the end of the simulation we get ~1m nodes and ~4m edges.

The visualization was made using neo-graphviz:
https://svn.neo4j.org/laboratory/components/neo-graphviz/

The crazy part is that we can still make sense of what's happening
there, using a few pipes and traversals :-)

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


Re: [Neo4j] A picture worth a 170'000 nodes and 650'000 edges

2011-03-24 Thread Alfredas Chmieliauskas
Estonia is nice. But unfortunately I'm in Delft, NL most of the time.
It would be great though to meet somewhere in the middle at some
point, maybe Cph?

Alfredas

On Thu, Mar 24, 2011 at 9:20 PM, Michael Hunger
michael.hun...@neotechnology.com wrote:
 But Alfredas is in the Netherlands, right, in Delft?

 Btw. they used Spring Data Graph successfully for their project, I already 
 got some great feedback.

 Thanks for that

 Cheers

 Michael

 Am 24.03.2011 um 21:06 schrieb Peter Neubauer:

 Wow!
 That is some wicked impressive visualization! Well done! Also, there
 will be a GeekOut in Tallin, Estonia, http://twitter.com/#!/GeekOut_ee

 Maybe we could meet up there and have some Graph-fun and you show off
 this stuff to the geeks?

 Cheers,

 /peter neubauer

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

 http://www.neo4j.org               - Your high performance graph database.
 http://startupbootcamp.org/    - Öresund - Innovation happens HERE.
 http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.



 On Thu, Mar 24, 2011 at 8:09 PM, Alfredas Chmieliauskas
 al.fre...@gmail.com wrote:
 For fun:

 This is a visualization of the graph resulting from a simulation
 (interacting energy markets).

 http://test.eeni.tbm.tudelft.nl/~alfredas/d13n-graph.png

 After 10 simulation ticks we have ~170'000 entities (agents, markets,
 power plants, bids, substances, technologies, etc) and ~650'000
 relations between these entities. Different colors represent different
 types of relations. These relations are created at a rate of ~60'000
 per tick, as a result of agents trading, investing and energy flows.
 By the end of the simulation we get ~1m nodes and ~4m edges.

 The visualization was made using neo-graphviz:
 https://svn.neo4j.org/laboratory/components/neo-graphviz/

 The crazy part is that we can still make sense of what's happening
 there, using a few pipes and traversals :-)

 Alfredas
 ___
 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] Neo4j powering the Web of Things

2011-03-15 Thread Alfredas Chmieliauskas
Great presentation!

On a related topic - as of today we have a working agent-based model
(simulation) of the Dutch and German power market running Neo4j and
Spring data.

The model includes 7 interacting markets (electricity, CO2,
commodities), a few power companies, numerous power plants and other
agents connected in a giant graph driven by complex policies and
behaviours.

The model helps understand the effects of energy policies on the
behaviour of the actors of the power system.

I think this primarily relates to the topic of the presentation. If
Rick or Emil are interested - it would be great share experiences and
ideas in the area of using graphs to understand our environment
better :-)

Thanks for a great piece of technology,

Alfredas

On Tue, Mar 15, 2011 at 9:51 AM, Anders Nawroth
and...@neotechnology.com wrote:
 Hi!

 The slides from the QCon presentation by Rick Bullotta and Emil Eifrem
 are available:
 http://bit.ly/gLqtjV

 More about ThingWorx can be found here:
 http://www.thingworx.com/
 http://www.slideshare.net/rfadel/thingworx-product-overview

 Really cool stuff Rick and his team are doing using Neo4j!


 /anders
 ___
 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 powering the Web of Things

2011-03-15 Thread Alfredas Chmieliauskas
On Tue, Mar 15, 2011 at 6:01 PM, Michael Hunger
michael.hun...@neotechnology.com wrote:
 sounds perfect and would make a great case study

 I would be very much interested in your feedback on spring data graph

there are a few things that could be improved, also we used the M02
version. I'll try to move M03 and compile a list of
suggestions/questions.

 also which kind of graphy evaluations/queries do you run on this dataset

Nothing too fancy. But my goal was to build a layer that would allow
the queries to be expressed in multiple formats: traversal
descriprtions, tinkerpop pipes, gremlin and sparql. I managed to
enable all except sparql. Thats the next step.

So for your business logic you create a @Repository that extends
AbstractRepositoryYourDomainClass, which provides a bunch of utility
methods such as findByProperty, findByTraversalDescription,
findByGremlin, etc. It also allows you to deal with your domain
objects even when using pipes, instead of vertices.


 thanks

 Michael

What kind of input would you like to get and in what form. I would be
glad to collaborate.

A

 Sent from my iBrick4


 Am 15.03.2011 um 17:54 schrieb Alfredas Chmieliauskas al.fre...@gmail.com:

 Great presentation!

 On a related topic - as of today we have a working agent-based model
 (simulation) of the Dutch and German power market running Neo4j and
 Spring data.

 The model includes 7 interacting markets (electricity, CO2,
 commodities), a few power companies, numerous power plants and other
 agents connected in a giant graph driven by complex policies and
 behaviours.

 The model helps understand the effects of energy policies on the
 behaviour of the actors of the power system.

 I think this primarily relates to the topic of the presentation. If
 Rick or Emil are interested - it would be great share experiences and
 ideas in the area of using graphs to understand our environment
 better :-)

 Thanks for a great piece of technology,

 Alfredas

 On Tue, Mar 15, 2011 at 9:51 AM, Anders Nawroth
 and...@neotechnology.com wrote:
 Hi!

 The slides from the QCon presentation by Rick Bullotta and Emil Eifrem
 are available:
 http://bit.ly/gLqtjV

 More about ThingWorx can be found here:
 http://www.thingworx.com/
 http://www.slideshare.net/rfadel/thingworx-product-overview

 Really cool stuff Rick and his team are doing using Neo4j!


 /anders
 ___
 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] Beer and Talk

2011-03-14 Thread Alfredas Chmieliauskas
Amsterdam

On Mon, Mar 14, 2011 at 1:15 PM, Axel Morgner a...@morgner.de wrote:
 Hi everybody,

 as said, here's a new thread for the idea of having beer and talk
 meetings.

 Possible locations so far:

 Malmö
 London
 Berlin
 Frankfurt

 Looking forward to seeing more Neo4j people in personal!

 Greetings

 Axel


 On 14.03.2011 13:02, Peter Neubauer wrote:

   Berlin sounds great.
   Last year a couple of guys met up at StudiVZ, and suddenly we were 30
   people. Go for it, there is a LOT of good vibe in Beerlin!
  
   Cheers,
  
   /peter neubauer
  
   GTalk:      neubauer.peter
   Skype       peter.neubauer
   Phone       +46 704 106975
   LinkedIn   http://www.linkedin.com/in/neubauer
   Twitter      http://twitter.com/peterneubauer
  
   http://www.neo4j.org               - Your high performance graph
 database.
   http://startupbootcamp.org/    - Öresund - Innovation happens HERE.
   http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
  
  
  
   On Mon, Mar 14, 2011 at 12:37 PM, Michael Hunger
   michael.hun...@neotechnology.com wrote:
   They guys could create at least one in Malmö? Isn't Andreas there as
 well, and certainly some more fine folks?
  
   We can do one locally here in Gemany, perhaps Berlin (perhaps we can
 combine that with our monthly flight to CPH).
  
   Cheers
  
   Michael
  
   Am 14.03.2011 um 11:50 schrieb Jim Webber:
  
   Hey Rick,
  
   It was a pleasure to meet you too. And this got me thinking - it
 would be great to meet more folks from this list, or to form user
 groups, or generally just get a beer and talk Neo4j graphs.
  
   Is there, for example, a strong London contingent on this list? I
 only know me and Nat Pryce so far. Anyone else care to get together in
 London?
  
   Jim

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

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


Re: [Neo4j] Beer and Talk

2011-03-14 Thread Alfredas Chmieliauskas
Who would like to start a social networking site for developers (on
top of neo4j technology and community)?
I'm in.

A


On Mon, Mar 14, 2011 at 1:45 PM, bhargav gunda bhargav@gmail.com wrote:
 Stockholm, Sweden

 On Mon, Mar 14, 2011 at 1:41 PM, Alfredas Chmieliauskas
 al.fre...@gmail.com wrote:

 Amsterdam

 On Mon, Mar 14, 2011 at 1:15 PM, Axel Morgner a...@morgner.de wrote:
  Hi everybody,
 
  as said, here's a new thread for the idea of having beer and talk
  meetings.
 
  Possible locations so far:
 
  Malmö
  London
  Berlin
  Frankfurt
 
  Looking forward to seeing more Neo4j people in personal!
 
  Greetings
 
  Axel
 
 
  On 14.03.2011 13:02, Peter Neubauer wrote:
 
    Berlin sounds great.
    Last year a couple of guys met up at StudiVZ, and suddenly we were 30
    people. Go for it, there is a LOT of good vibe in Beerlin!
   
    Cheers,
   
    /peter neubauer
   
    GTalk:      neubauer.peter
    Skype       peter.neubauer
    Phone       +46 704 106975
    LinkedIn   http://www.linkedin.com/in/neubauer
    Twitter      http://twitter.com/peterneubauer
   
    http://www.neo4j.org               - Your high performance graph
  database.
    http://startupbootcamp.org/    - Öresund - Innovation happens HERE.
    http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing
  party.
   
   
   
    On Mon, Mar 14, 2011 at 12:37 PM, Michael Hunger
    michael.hun...@neotechnology.com wrote:
    They guys could create at least one in Malmö? Isn't Andreas there as
  well, and certainly some more fine folks?
   
    We can do one locally here in Gemany, perhaps Berlin (perhaps we can
  combine that with our monthly flight to CPH).
   
    Cheers
   
    Michael
   
    Am 14.03.2011 um 11:50 schrieb Jim Webber:
   
    Hey Rick,
   
    It was a pleasure to meet you too. And this got me thinking - it
  would be great to meet more folks from this list, or to form user
  groups, or generally just get a beer and talk Neo4j graphs.
   
    Is there, for example, a strong London contingent on this list? I
  only know me and Nat Pryce so far. Anyone else care to get together in
  London?
   
    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


Re: [Neo4j] Beer and Talk

2011-03-14 Thread Alfredas Chmieliauskas
Great! I think thats a great idea!
A

On Mon, Mar 14, 2011 at 2:02 PM, Michael Hunger
michael.hun...@neotechnology.com wrote:
 I would,

 I already have extensive plans for that.

 I will share them with you :)

 Cheers

 Michael

 Am 14.03.2011 um 13:50 schrieb Alfredas Chmieliauskas:

 Who would like to start a social networking site for developers (on
 top of neo4j technology and community)?
 I'm in.

 A


 On Mon, Mar 14, 2011 at 1:45 PM, bhargav gunda bhargav@gmail.com wrote:
 Stockholm, Sweden

 On Mon, Mar 14, 2011 at 1:41 PM, Alfredas Chmieliauskas
 al.fre...@gmail.com wrote:

 Amsterdam

 On Mon, Mar 14, 2011 at 1:15 PM, Axel Morgner a...@morgner.de wrote:
 Hi everybody,

 as said, here's a new thread for the idea of having beer and talk
 meetings.

 Possible locations so far:

 Malmö
 London
 Berlin
 Frankfurt

 Looking forward to seeing more Neo4j people in personal!

 Greetings

 Axel


 On 14.03.2011 13:02, Peter Neubauer wrote:

   Berlin sounds great.
   Last year a couple of guys met up at StudiVZ, and suddenly we were 30
   people. Go for it, there is a LOT of good vibe in Beerlin!
  
   Cheers,
  
   /peter neubauer
  
   GTalk:      neubauer.peter
   Skype       peter.neubauer
   Phone       +46 704 106975
   LinkedIn   http://www.linkedin.com/in/neubauer
   Twitter      http://twitter.com/peterneubauer
  
   http://www.neo4j.org               - Your high performance graph
 database.
   http://startupbootcamp.org/    - Öresund - Innovation happens HERE.
   http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing
 party.
  
  
  
   On Mon, Mar 14, 2011 at 12:37 PM, Michael Hunger
   michael.hun...@neotechnology.com wrote:
   They guys could create at least one in Malmö? Isn't Andreas there as
 well, and certainly some more fine folks?
  
   We can do one locally here in Gemany, perhaps Berlin (perhaps we can
 combine that with our monthly flight to CPH).
  
   Cheers
  
   Michael
  
   Am 14.03.2011 um 11:50 schrieb Jim Webber:
  
   Hey Rick,
  
   It was a pleasure to meet you too. And this got me thinking - it
 would be great to meet more folks from this list, or to form user
 groups, or generally just get a beer and talk Neo4j graphs.
  
   Is there, for example, a strong London contingent on this list? I
 only know me and Nat Pryce so far. Anyone else care to get together in
 London?
  
   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 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] Clear graph (delete all nodes and relations)

2011-03-03 Thread Alfredas Chmieliauskas
On Wed, Mar 2, 2011 at 12:14 PM, Peter Neubauer
peter.neuba...@neotechnology.com wrote:
 Well,
 you can set the reference node to anything, so you could do

 graph.delete();
 newRoot = neo4j.createNode();
 neo4j.setReferenceNode(newRoot);

I bet this is the problem: the reference node gets deleted. I one of
solving it would be not to delete the ref node at all.
The other way is as you have outlined here, I'm just not sure that
there's a method setReferenceNode() (at least could not find it).

Also - where is Marko? It would be great to have your opinion on whats
happening from the point of view of blueprints neo4j impl.

Alfredas


 Cheers,

 /peter neubauer

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

 http://www.neo4j.org               - Your high performance graph database.
 http://startupbootcamp.org/    - Öresund - Innovation happens HERE.
 http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.



 On Wed, Mar 2, 2011 at 12:10 PM, Craig Taverner cr...@amanzi.com wrote:
 Is this not because blueprints does not respect the neo4j reference node,
 and so deletes it (really clears the graph). Is there a way to create the
 reference node again? Perhaps as simple as db.createNode(), and the first
 will be node 0?

 On Wed, Mar 2, 2011 at 12:08 PM, Peter Neubauer 
 peter.neuba...@neotechnology.com wrote:

 Mmh,
 have you committed the transaction after your clear, and How are you
 trying to create the Relationship? It seems you are trying to use Node
 0 for it, which you have deleted before? In that case, you need to add
 a new node and use that as the starting point for your relationship?

 Cheers,

 /peter neubauer

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

 http://www.neo4j.org               - Your high performance graph database.
 http://startupbootcamp.org/    - Öresund - Innovation happens HERE.
 http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.



 On Wed, Mar 2, 2011 at 11:44 AM, Alfredas Chmieliauskas
 al.fre...@gmail.com wrote:
  Dear all,
 
  a crazy primitive question. How do I clear a graph (without doing rm -f)
 ?
  If I delete all the nodes and relationships or use blueprints
  graph.clear() I get a weird error later when adding new nodes:
 
  Caused by: java.lang.IllegalStateException: First node[0] is deleted
  and cannot be used to create a relationship
         at
 org.neo4j.kernel.impl.nioneo.xa.WriteTransaction.relationshipCreate(WriteTransaction.java:1475)
         at
 org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaConnection$RelationshipEventConsumerImpl.createRelationship(NeoStoreXaConnection.java:257)
         at
 org.neo4j.kernel.impl.nioneo.xa.NioNeoDbPersistenceSource$NioNeoDbResourceConnection.relationshipCreate(NioNeoDbPersistenceSource.java:371)
         at
 org.neo4j.kernel.impl.persistence.PersistenceManager.relationshipCreate(PersistenceManager.java:154)
         at
 org.neo4j.kernel.impl.core.NodeManager.createRelationship(NodeManager.java:310)
         at
 org.neo4j.kernel.impl.core.NodeImpl.createRelationshipTo(NodeImpl.java:388)
         at
 org.neo4j.kernel.impl.core.NodeProxy.createRelationshipTo(NodeProxy.java:187)
         at
 org.neo4j.util.GraphDatabaseUtil.getOrCreateSingleOtherNode(GraphDatabaseUtil.java:137)
         at
 org.neo4j.util.GraphDatabaseUtil.getOrCreateSubReferenceNode(GraphDatabaseUtil.java:167)
         at
 org.neo4j.util.GraphDatabaseUtil.getOrCreateSubReferenceNode(GraphDatabaseUtil.java:150)
         at
 org.springframework.data.graph.neo4j.support.GraphDatabaseContext.getOrCreateSubReferenceNode(GraphDatabaseContext.java:275)
         at
 org.springframework.data.graph.neo4j.support.SubReferenceNodeTypeStrategy.obtainSubreferenceNode(SubReferenceNodeTypeStrategy.java:167)
         at
 org.springframework.data.graph.neo4j.support.SubReferenceNodeTypeStrategy.postEntityCreation(SubReferenceNodeTypeStrategy.java:66)
         at
 org.springframework.data.graph.neo4j.support.GraphDatabaseContext.postEntityCreation(GraphDatabaseContext.java:219)
         at
 org.springframework.data.graph.neo4j.fieldaccess.NodeEntityStateAccessors.createAndAssignState(NodeEntityStateAccessors.java:54)
         at
 org.springframework.data.graph.neo4j.fieldaccess.DetachableEntityStateAccessors.createAndAssignState(DetachableEntityStateAccessors.java:113)
         at
 org.springframework.data.graph.neo4j.support.node.Neo4jNodeBacking.ajc$before$org_springframework_data_graph_neo4j_support_node_Neo4jNodeBacking$1$74591ff9(Neo4jNodeBacking.aj:84)
 
  Also I'm using Spring Data Graph to create new nodes and relations.
 
  Any ideas?
 
  Alfredas
  ___
  Neo4j mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org

Re: [Neo4j] Clear graph (delete all nodes and relations)

2011-03-03 Thread Alfredas Chmieliauskas
On Thu, Mar 3, 2011 at 12:30 PM, Peter Neubauer
peter.neuba...@neotechnology.com wrote:
 Well,
 reference nodes are not part of the Blueprints API. Neo4j is not
 decided yet how and if to change the reference node approach. Either
 make it a setup option, keep it, or remove it totally.

 Marko is coming over in April, so there will be fighting at the Malmö
 office over this :)

Sounds great. Let us know who wins.

... just to be clear -  for now there's no elegant way to
clear the graph using blueprints or spring-data-graph api, right?

Thanks,

Alfredas


 Cheers,

 /peter neubauer

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

 http://www.neo4j.org               - Your high performance graph database.
 http://startupbootcamp.org/    - Öresund - Innovation happens HERE.
 http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.



 On Thu, Mar 3, 2011 at 12:12 PM, Alfredas Chmieliauskas
 al.fre...@gmail.com wrote:
 On Wed, Mar 2, 2011 at 12:14 PM, Peter Neubauer
 peter.neuba...@neotechnology.com wrote:
 Well,
 you can set the reference node to anything, so you could do

 graph.delete();
 newRoot = neo4j.createNode();
 neo4j.setReferenceNode(newRoot);

 I bet this is the problem: the reference node gets deleted. I one of
 solving it would be not to delete the ref node at all.
 The other way is as you have outlined here, I'm just not sure that
 there's a method setReferenceNode() (at least could not find it).

 Also - where is Marko? It would be great to have your opinion on whats
 happening from the point of view of blueprints neo4j impl.

 Alfredas


 Cheers,

 /peter neubauer

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

 http://www.neo4j.org               - Your high performance graph database.
 http://startupbootcamp.org/    - Öresund - Innovation happens HERE.
 http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.



 On Wed, Mar 2, 2011 at 12:10 PM, Craig Taverner cr...@amanzi.com wrote:
 Is this not because blueprints does not respect the neo4j reference node,
 and so deletes it (really clears the graph). Is there a way to create the
 reference node again? Perhaps as simple as db.createNode(), and the first
 will be node 0?

 On Wed, Mar 2, 2011 at 12:08 PM, Peter Neubauer 
 peter.neuba...@neotechnology.com wrote:

 Mmh,
 have you committed the transaction after your clear, and How are you
 trying to create the Relationship? It seems you are trying to use Node
 0 for it, which you have deleted before? In that case, you need to add
 a new node and use that as the starting point for your relationship?

 Cheers,

 /peter neubauer

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

 http://www.neo4j.org               - Your high performance graph database.
 http://startupbootcamp.org/    - Öresund - Innovation happens HERE.
 http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.



 On Wed, Mar 2, 2011 at 11:44 AM, Alfredas Chmieliauskas
 al.fre...@gmail.com wrote:
  Dear all,
 
  a crazy primitive question. How do I clear a graph (without doing rm -f)
 ?
  If I delete all the nodes and relationships or use blueprints
  graph.clear() I get a weird error later when adding new nodes:
 
  Caused by: java.lang.IllegalStateException: First node[0] is deleted
  and cannot be used to create a relationship
         at
 org.neo4j.kernel.impl.nioneo.xa.WriteTransaction.relationshipCreate(WriteTransaction.java:1475)
         at
 org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaConnection$RelationshipEventConsumerImpl.createRelationship(NeoStoreXaConnection.java:257)
         at
 org.neo4j.kernel.impl.nioneo.xa.NioNeoDbPersistenceSource$NioNeoDbResourceConnection.relationshipCreate(NioNeoDbPersistenceSource.java:371)
         at
 org.neo4j.kernel.impl.persistence.PersistenceManager.relationshipCreate(PersistenceManager.java:154)
         at
 org.neo4j.kernel.impl.core.NodeManager.createRelationship(NodeManager.java:310)
         at
 org.neo4j.kernel.impl.core.NodeImpl.createRelationshipTo(NodeImpl.java:388)
         at
 org.neo4j.kernel.impl.core.NodeProxy.createRelationshipTo(NodeProxy.java:187)
         at
 org.neo4j.util.GraphDatabaseUtil.getOrCreateSingleOtherNode(GraphDatabaseUtil.java:137)
         at
 org.neo4j.util.GraphDatabaseUtil.getOrCreateSubReferenceNode(GraphDatabaseUtil.java:167)
         at
 org.neo4j.util.GraphDatabaseUtil.getOrCreateSubReferenceNode(GraphDatabaseUtil.java:150)
         at
 org.springframework.data.graph.neo4j.support.GraphDatabaseContext.getOrCreateSubReferenceNode(GraphDatabaseContext.java:275

[Neo4j] Clear graph (delete all nodes and relations)

2011-03-02 Thread Alfredas Chmieliauskas
Dear all,

a crazy primitive question. How do I clear a graph (without doing rm -f) ?
If I delete all the nodes and relationships or use blueprints
graph.clear() I get a weird error later when adding new nodes:

Caused by: java.lang.IllegalStateException: First node[0] is deleted
and cannot be used to create a relationship
at 
org.neo4j.kernel.impl.nioneo.xa.WriteTransaction.relationshipCreate(WriteTransaction.java:1475)
at 
org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaConnection$RelationshipEventConsumerImpl.createRelationship(NeoStoreXaConnection.java:257)
at 
org.neo4j.kernel.impl.nioneo.xa.NioNeoDbPersistenceSource$NioNeoDbResourceConnection.relationshipCreate(NioNeoDbPersistenceSource.java:371)
at 
org.neo4j.kernel.impl.persistence.PersistenceManager.relationshipCreate(PersistenceManager.java:154)
at 
org.neo4j.kernel.impl.core.NodeManager.createRelationship(NodeManager.java:310)
at 
org.neo4j.kernel.impl.core.NodeImpl.createRelationshipTo(NodeImpl.java:388)
at 
org.neo4j.kernel.impl.core.NodeProxy.createRelationshipTo(NodeProxy.java:187)
at 
org.neo4j.util.GraphDatabaseUtil.getOrCreateSingleOtherNode(GraphDatabaseUtil.java:137)
at 
org.neo4j.util.GraphDatabaseUtil.getOrCreateSubReferenceNode(GraphDatabaseUtil.java:167)
at 
org.neo4j.util.GraphDatabaseUtil.getOrCreateSubReferenceNode(GraphDatabaseUtil.java:150)
at 
org.springframework.data.graph.neo4j.support.GraphDatabaseContext.getOrCreateSubReferenceNode(GraphDatabaseContext.java:275)
at 
org.springframework.data.graph.neo4j.support.SubReferenceNodeTypeStrategy.obtainSubreferenceNode(SubReferenceNodeTypeStrategy.java:167)
at 
org.springframework.data.graph.neo4j.support.SubReferenceNodeTypeStrategy.postEntityCreation(SubReferenceNodeTypeStrategy.java:66)
at 
org.springframework.data.graph.neo4j.support.GraphDatabaseContext.postEntityCreation(GraphDatabaseContext.java:219)
at 
org.springframework.data.graph.neo4j.fieldaccess.NodeEntityStateAccessors.createAndAssignState(NodeEntityStateAccessors.java:54)
at 
org.springframework.data.graph.neo4j.fieldaccess.DetachableEntityStateAccessors.createAndAssignState(DetachableEntityStateAccessors.java:113)
at 
org.springframework.data.graph.neo4j.support.node.Neo4jNodeBacking.ajc$before$org_springframework_data_graph_neo4j_support_node_Neo4jNodeBacking$1$74591ff9(Neo4jNodeBacking.aj:84)

Also I'm using Spring Data Graph to create new nodes and relations.

Any ideas?

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


Re: [Neo4j] [Blog Post] Using graph databases for knowledge representation and reasoning.

2011-02-24 Thread Alfredas Chmieliauskas
Great post.

Despite that the examples you give can be replicated with rdf and
spraql (forget owl). One might argue that OWL is a good example of
over-engineering, as in practice only the owl:sameAs is used :-)
But I think the real power of gremlin is within the grateful dead and
spreading activation example. This is a radically different way that
can be also used for reasoning and inference.
I mean that example really has to get more publicity as its something
completely different and useful :-)

Afredas


On Thu, Feb 24, 2011 at 8:05 AM, Peter Neubauer
peter.neuba...@neotechnology.com wrote:
 Very nice post Marko, clean and to the point!

 Cheers,

 /peter neubauer

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

 http://www.neo4j.org               - Your high performance graph database.
 http://startupbootcamp.org/    - Öresund - Innovation happens HERE.
 http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.



 On Thu, Feb 24, 2011 at 12:27 AM, Marko Rodriguez okramma...@gmail.com 
 wrote:
 Hi,

 I wrote a blog post regarding knowledge representation and reasoning using 
 graph databases:
        
 http://markorodriguez.com/2011/02/23/knowledge-representation-and-reasoning-with-graph-databases/

 Automated reasoning is currently dominated by RDF and its stack of 
 technologies. However, the standard meta modeling language OWL is restricted 
 to description logics. While this is all fine and good, it must be said that 
 there are numerous types of logics. I think that because graph databases 
 don't have a such strict layered cake, the graph database scene is ripe to 
 be a foundation for the exploration and exploitation of other reasoning 
 structures and algorithms.

 Thats that,
 Marko.

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

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

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


Re: [Neo4j] Gremlin from Java Error

2011-02-23 Thread Alfredas Chmieliauskas
On Tue, Feb 22, 2011 at 4:26 PM, Marko Rodriguez okramma...@gmail.com wrote:
 Hey,

 Thanks a lot. Updated to 0.8-SNAPSHOT. Strangely maven did not resolve
 groovy dependence automatically. Had to add it by hand.

 Huh? Gremlin 0.8-SNAPSHOT uses Groovy 1.7.8 (which was released maybe 1 week 
 ago). Gremlin 0.7 was using Groovy 1.7.5. Perhaps something about that was 
 making it burp? What do you mean add it by hand?

I had to add a dependency to groovy in my pom file, i did not need
that with 0.7 (it was inherited?).


 ScriptEngine approach works fine, Gremlin.compile(expr) does not?

 Were you compiling a Pipe or a Gremlin statement? Compile can only be used to 
 create a Pipe:
        public static Pipe compile(final String gremlin);
 See the first section of: 
 https://github.com/tinkerpop/gremlin/wiki/Using-Gremlin-through-Java

 If you want to do an arbitrary Gremlin statement, then you use 
 GremlinScriptEngine.eval();

 ?? Or, is it because you haven't linked Groovy into your project. Realize 
 that Gremlin class is Gremlin.groovy, not Gremlin.java. Thus, you need to 
 make sure you have gmaven-pluggin support in your pom.xml. See the second 
 section of:
        https://github.com/tinkerpop/gremlin/wiki/Using-Gremlin-through-Groovy

I have that. Read the docs.

 I understand that it could be fastercleaner to use groovy, but I need
 to be able to pass string queries and get results back.
 In my use-case this is the definite use of gremlin - arbitrary string
 queries.

 Gotcha.

 For static business logic I can use Pipes - I'm not
 bothered by the wordy expressions.


 Cool. You can get around that by using Gremlin.compile() :P. In that way, you 
 can compile a Gremlin statement to get the raw Pipes.

I like that idea. But still could not get it to work. Will try to
reproduce and send the trace.


Thanks,

A

 Enjoy,
 Marko.

 http://markorodriguez.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] Question: Neo4j and semantic-mediawiki

2011-02-22 Thread Alfredas Chmieliauskas
There is a rdf-sparql component to Neo4j that could in theory be
configured to be used as a backend for semantic mediawiki.
But you still have better chances to configure smw to use a
triplestore http://en.wikipedia.org/wiki/Triplestore

For more info see: http://www.mediawiki.org/wiki/Extension:SparqlExtension

Alfredas

2011/2/22 Дмитрий Медведев dmitry.medve...@gmail.com:
 Hi all!
 Recently I started exploring things about graph databases in conjunction
 with knowledge management and have run across the Neo4j. It now seems to me
 that Neo4j can somehow be used with the semantic-mediawiki to store RDF and
 quiery Neo4j with SPARQL.

 Did anyone have any experience with Neo4j + RDF + SPARQL? Or are there any
 resources worth reading? If so, could someone please point me to such
 resources?..

 PS: Sorry for newbie question, of course.

 
 Dmitry N. Medvedev,

 Tel.:
  +7 916.795.1839

 E-mail:
  dmitry.medve...@gmail.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] Question: Neo4j and semantic-mediawiki

2011-02-22 Thread Alfredas Chmieliauskas
This looks great.
I've encountered a problem when following the example. Here I'm trying
to create a sail out of Neo4jGraph.

java.lang.RuntimeException: No such index exists: edges
at 
com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jGraph.getIndex(Neo4jGraph.java:113)
at 
com.tinkerpop.blueprints.pgm.oupls.sail.GraphSail.init(GraphSail.java:88)
at 
com.tinkerpop.blueprints.pgm.oupls.sail.GraphSail.init(GraphSail.java:66)


Any ideas?

Thanks,

Alfredas


On Tue, Feb 22, 2011 at 4:17 PM, Marko Rodriguez okramma...@gmail.com wrote:
 Hi,

 Did anyone have any experience with Neo4j + RDF + SPARQL? Or are there any
 resources worth reading? If so, could someone please point me to such
 resources?..

 There is a 1-to-1 RDF mapper in Blueprints. It turns any Blueprints GraphDB 
 into a Sail-based RDF triple/quad store. Given the 1-to-1 nature, you can 
 work with your data from the perspective of the Blueprints API, Sail API, or 
 Neo4j API.

        https://github.com/tinkerpop/blueprints/wiki/Sail-Ouplementation

 Through Sail you can do SPARQL, SeRQL, RQL, and Gremlin.

 See ya,
 Marko.

 http://markorodriguez.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] Question: Neo4j and semantic-mediawiki

2011-02-22 Thread Alfredas Chmieliauskas
Got it. It would be great to be able to use Sparql on neo4j or any
other Blueprint db.

Do you think it would be possible to map/translate sparql query to
gremlin/pipes?

Alfredas


 On Tue, Feb 22, 2011 at 5:09 PM, Marko Rodriguez okramma...@gmail.com wrote:
 Hi,

 I apologize. When I said 1-to-1, I spoke with exaggeration. You will need to 
 create a GraphSail from a blank Neo4jGraph initially.

        Sail sail = new GraphSail(new Neo4jGraph(/tmp/neo4jgraphsail))

 At that point, you can move back and forth. The reason being, GraphSail 
 requires indices that are appropriate for efficient statement/SPARQL type 
 queries. Moreover, you can't simply take a Neo4jGraph that you already have 
 an make it an RDF triple/quad store. This is because RDF requires URIs, 
 blank nodes, and literals for it to work -- thus, arbitrary properties on a 
 graph are not allowed through Sail. So, 1-to-1 should read: Once you have 
 created a GraphSail, you can GraphSail.getGraph() to work with your graph 
 using native APIs.

 Apologies for the confusion,
 Marko.

 http://markorodriguez.com


 On Feb 22, 2011, at 10:01 AM, Alfredas Chmieliauskas wrote:

 This looks great.
 I've encountered a problem when following the example. Here I'm trying
 to create a sail out of Neo4jGraph.

 java.lang.RuntimeException: No such index exists: edges
       at 
 com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jGraph.getIndex(Neo4jGraph.java:113)
       at 
 com.tinkerpop.blueprints.pgm.oupls.sail.GraphSail.init(GraphSail.java:88)
       at 
 com.tinkerpop.blueprints.pgm.oupls.sail.GraphSail.init(GraphSail.java:66)


 Any ideas?

 Thanks,

 Alfredas


 On Tue, Feb 22, 2011 at 4:17 PM, Marko Rodriguez okramma...@gmail.com 
 wrote:
 Hi,

 Did anyone have any experience with Neo4j + RDF + SPARQL? Or are there any
 resources worth reading? If so, could someone please point me to such
 resources?..

 There is a 1-to-1 RDF mapper in Blueprints. It turns any Blueprints 
 GraphDB into a Sail-based RDF triple/quad store. Given the 1-to-1 nature, 
 you can work with your data from the perspective of the Blueprints API, 
 Sail API, or Neo4j API.

        https://github.com/tinkerpop/blueprints/wiki/Sail-Ouplementation

 Through Sail you can do SPARQL, SeRQL, RQL, and Gremlin.

 See ya,
 Marko.

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

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

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


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


Re: [Neo4j] Question: Neo4j and semantic-mediawiki

2011-02-22 Thread Alfredas Chmieliauskas
Well I'm in general interested in having all these different
mechanisms (native (traverse), pipes, gremlin, sparql) to query the
same graph.
That would give so much more flexibility when writing domain methods.
Ideally you would not want to write domain methods at all, but
annotate interfaces with some queries, something like:

interface PersonRepository {

@SparqlQuery(query=where {?p foaf:knows ??person . })
public ListPerson findMyFriends(Person person);

@GremlinQuery(query=person.bothE('foaf:knows').bothV.except([person]))
public ListPerson findMyFriends2(Person person);

}

That would be quite great, but thats of course a bit more JPA inspired
approach and many other useful roads can be taken...

Alfredas





On Tue, Feb 22, 2011 at 6:03 PM, Marko Rodriguez okramma...@gmail.com wrote:
 Hi,

 Got it. It would be great to be able to use Sparql on neo4j or any
 other Blueprint db.

 Yea it would.


 Do you think it would be possible to map/translate sparql query to
 gremlin/pipes?

 I plan to create a new DSL over Gremlin/Pipes that has a syntax flavor like 
 this. E.g.

 x = []; y = []
 g.select(x, y).where(
        g.v('marko').outE('knows').inV.var(x)
        var(x).outE('knows').inV.var(y))

 EQUIVALENT TO:

 SELECT ?x, ?y WHERE {
  marko knows ?x
  ?x knows ?y
 }

 In short, traversal-based SPARQL (similar to the SPARQL engine developed by 
 Neo4j). The benefits is that a line is property graph-based, not restricted 
 to RDF graphs only. E.g.

 x = []; y = []
 g.select(x, y).where(
        g.v('marko').outE('knows').inV.var(x)
        var(x).outE('knows').inV{it.age  30}.var(y))

 I haven't gotten to starting this project yet, but if anyone is interested in 
 helping, that would be great.

 Thanks,
 Marko.

 http://markorodriguez.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] Spring data and Pipes

2011-02-21 Thread Alfredas Chmieliauskas
Thanks.

On Sun, Feb 20, 2011 at 10:18 PM, Michael Hunger
michael.hun...@neotechnology.com wrote:
 Alfredas,

 very interesting ideas. I think that kind of repository would have to be 
 built in your application, _but_ we should provide the building blocks so 
 that you can easily put it together.

Yep. I certainly feel that the methods i'm trying to assemble could be
part of the generic repo provided.


 I'm thinking about providing support for Repositories in the Hades/Spring JPA 
 style where you get a generic repository as base with additional 
 finder-method-name parsing and whatever you add to that
 as a kind of custom extension gets exposed in your repo too.

Yes. Exactly.
The way i'm providing the generic methods right now is in the fashion of:
 ListT findByTraversalDescription(TraversalDescription td)
 ListT findByPipeline(Pipeline pipe)
 ListT findBySparql(String query)



 So if you're interested in this we can make this a use case for the M4 
 release of Spring-Data-Graph and experiment with that.
Sure. That would be very interesting.


 I'm currently working on the Neo4jTemplate API for Spring-Data-Graph, if you 
 (or anyone else) would like to look at that and provide feedback, I'd be 
 happy.

 http://gist.github.com/835408

Will do.

 I think you spotted a least issue with the relateTo. Currently it assumes 
 that you relate the father - OUTGOING - child. (Would you please try 
 child.relateTo(father) for incoming rels and communicate the results).


The child.relateTo(father) when child --outgoing-- father works fine.
It seems that one should rather just use collections (add/remove)
instead of relateTo as it might be confusing. Is there any reason to
provide that method?

 That is because it doesn't rely existing annotated relationships when doing 
 that operation. I could extend it in looking for such annotated fields and 
 use the values given there.
 But then you can also just add the child to the collection to create the 
 relationship.


 Cheers Michael




 Am 20.02.2011 um 21:22 schrieb Alfredas Chmieliauskas:

 On Sun, Feb 20, 2011 at 8:20 PM, Michael Hunger
 michael.hun...@neotechnology.com wrote:
 all finders map back to the underlying graph so it doesnt matter which one 
 to use.

 one could still add a toVertex wrapper to your domain objects to have them 
 be usable in tinkerpop

 what is the usecase you want to achieve with the combination of spring data 
 graph and tinkerpop

 So far I'm just experimenting with different ways query the graph :-)
 In the end I hope to build an AbstractRepositoryT class that would
 allow me to find things in the same underlying graph using
 TraversalDescriptions, Pipes, Gremlin or even SPARQL.
 Having that would add a lot of flexibility in writing domain methods.

 glad that spring data graph works well for you if you have any feedback or 
 issues just ping me

 Yes. Spring data is very interesting. Although I am still trying to
 understand how to query a graph of heterogeneous nodes and
 relationships and discover patterns.

 A quick/trick question:
 I noticed that father.relateTo(child, RelationshipTypes.PARENT) works
 only if father has Direction.BOTH or Direction.OUTGOING; and

 @RelatedTo(type = PARENT, elementClass = Person.class, direction =
 Direction.INCOMING)
 private SetPerson children;
 
 father.relateTo(child, RelationshipTypes.PARENT);
 
 father.getChildren()

 would return empty in case of  Direction.INCOMING

 this might be confusing!

 Thanks,

 Alfredas
 ___
 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] Gremlin from Java Error

2011-02-21 Thread Alfredas Chmieliauskas
Dear all,

I have the following code:

ScriptEngine engine = new GremlinScriptEngineFactory().getScriptEngine();
ListVertex results = new ArrayListVertex();
engine.getBindings(ScriptContext.ENGINE_SCOPE).put(g, getGraph());
engine.getBindings(ScriptContext.ENGINE_SCOPE).put(v, getVertex(startNode));
engine.getBindings(ScriptContext.ENGINE_SCOPE).put(results, results);
try {
engine.eval(v.outE('KNOWS').inV  results);
} catch (ScriptException e) {
logger.error(e.getMessage(), e);
}

produces the following error:


ERROR javax.script.ScriptException:
groovy.lang.MissingMethodException: No signature of method:
com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jVertex.outE() is
applicable for argument types: (java.lang.String) values: [KNOWS]
Possible solutions: outE(groovy.lang.Closure), dump(),
use([Ljava.lang.Object;), getAt(java.lang.String),
getAt(java.lang.String), with(groovy.lang.Closure)
javax.script.ScriptException: javax.script.ScriptException:
groovy.lang.MissingMethodException: No signature of method:
com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jVertex.outE() is
applicable for argument types: (java.lang.String) values: [KNOWS]
Possible solutions: outE(groovy.lang.Closure), dump(),
use([Ljava.lang.Object;), getAt(java.lang.String),
getAt(java.lang.String), with(groovy.lang.Closure)
   at 
org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:117)
   at 
com.tinkerpop.gremlin.jsr223.GremlinScriptEngine.eval(GremlinScriptEngine.java:36)
   at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:247)
   at 
com.tinkerpop.gremlin.jsr223.GremlinScriptEngine.eval(GremlinScriptEngine.java:32)
   at 
alfredas.springdatagraph.template.domain.AbstractRepository.findAllByGremlin2(AbstractRepository.java:94)
   at alfredas.springdatagraph.template.App.init(App.java:84)
   at alfredas.springdatagraph.template.App.main(App.java:93)
Caused by: javax.script.ScriptException:
groovy.lang.MissingMethodException: No signature of method:
com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jVertex.outE() is
applicable for argument types: (java.lang.String) values: [KNOWS]
Possible solutions: outE(groovy.lang.Closure), dump(),
use([Ljava.lang.Object;), getAt(java.lang.String),
getAt(java.lang.String), with(groovy.lang.Closure)
   at 
org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:318)
   at 
org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:111)
   ... 6 more
Caused by: groovy.lang.MissingMethodException: No signature of method:
com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jVertex.outE() is
applicable for argument types: (java.lang.String) values: [KNOWS]
Possible solutions: outE(groovy.lang.Closure), dump(),
use([Ljava.lang.Object;), getAt(java.lang.String),
getAt(java.lang.String), with(groovy.lang.Closure)
   at 
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:54)
   at 
org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:46)
   at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
   at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
   at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
   at Script1.run(Script1.groovy:43)
   at 
org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:315)
   ... 7 more


And the alternative method:

Gremlin.compile(outE('KNOWS').inV);

gives:

Exception in thread main groovy.lang.MissingMethodException: No
signature of method: Script1.outE() is applicable for argument types:
(java.lang.String) values: [KNOWS]
Possible solutions: run(), run(), dump(), use([Ljava.lang.Object;),
putAt(java.lang.String, java.lang.Object), with(groovy.lang.Closure)
   at 
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:54)
   at 
org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:78)
   at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
   at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
   at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149)
   at Script1.run(Script1.groovy:22)
   at groovy.lang.GroovyShell.evaluate(GroovyShell.java:576)
   at groovy.lang.GroovyShell.evaluate(GroovyShell.java:614)
   at groovy.lang.GroovyShell.evaluate(GroovyShell.java:585)
   at groovy.lang.GroovyShell$evaluate.call(Unknown Source)
   at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
   at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
   at 

Re: [Neo4j] Gremlin from Java Error

2011-02-21 Thread Alfredas Chmieliauskas
Thanks a lot. Updated to 0.8-SNAPSHOT. Strangely maven did not resolve
groovy dependence automatically. Had to add it by hand.

ScriptEngine approach works fine, Gremlin.compile(expr) does not?

I understand that it could be fastercleaner to use groovy, but I need
to be able to pass string queries and get results back.
In my use-case this is the definite use of gremlin - arbitrary string
queries. For static business logic I can use Pipes - I'm not
bothered by the wordy expressions.

Alfredas


On Mon, Feb 21, 2011 at 4:23 PM, Marko Rodriguez okramma...@gmail.com wrote:
 Hi,

 outE(String) is in Gremlin 0.8-SNASPHOT, not Gremlin 0.7.

 Note at the bottom of the main Wiki page: Gremlin documentation is up to 
 date with the current Gremlin codebase, not with the latest Gremlin release.

 I do this so its easier for me to maintain documentation. The documentation 
 for Gremlin 0.7 is in the doc/wiki directory of the distribution.

 If you still want to use Gremlin 0.7, do this:

 engine.eval(v.outE[[label='KNOWS']].inV  results);

 Finally, I would recommend using Groovy in your codebase instead of JSR 223 
 ScriptEngine. Groovy and Java work seamlessly together and its so much 
 handier/cleaner/faster than through JSR 223. See:
        https://github.com/tinkerpop/gremlin/wiki/Using-Gremlin-through-Groovy

 Hope that helps,
 Marko.

 http://markorodriguez.com


 On Feb 21, 2011, at 9:15 AM, Alfredas Chmieliauskas wrote:

 Dear all,

 I have the following code:

 ScriptEngine engine = new GremlinScriptEngineFactory().getScriptEngine();
 ListVertex results = new ArrayListVertex();
 engine.getBindings(ScriptContext.ENGINE_SCOPE).put(g, getGraph());
 engine.getBindings(ScriptContext.ENGINE_SCOPE).put(v, 
 getVertex(startNode));
 engine.getBindings(ScriptContext.ENGINE_SCOPE).put(results, results);
 try {
    engine.eval(v.outE('KNOWS').inV  results);
 } catch (ScriptException e) {
    logger.error(e.getMessage(), e);
 }

 produces the following error:


 ERROR javax.script.ScriptException:
 groovy.lang.MissingMethodException: No signature of method:
 com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jVertex.outE() is
 applicable for argument types: (java.lang.String) values: [KNOWS]
 Possible solutions: outE(groovy.lang.Closure), dump(),
 use([Ljava.lang.Object;), getAt(java.lang.String),
 getAt(java.lang.String), with(groovy.lang.Closure)
 javax.script.ScriptException: javax.script.ScriptException:
 groovy.lang.MissingMethodException: No signature of method:
 com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jVertex.outE() is
 applicable for argument types: (java.lang.String) values: [KNOWS]
 Possible solutions: outE(groovy.lang.Closure), dump(),
 use([Ljava.lang.Object;), getAt(java.lang.String),
 getAt(java.lang.String), with(groovy.lang.Closure)
       at 
 org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:117)
       at 
 com.tinkerpop.gremlin.jsr223.GremlinScriptEngine.eval(GremlinScriptEngine.java:36)
       at 
 javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:247)
       at 
 com.tinkerpop.gremlin.jsr223.GremlinScriptEngine.eval(GremlinScriptEngine.java:32)
       at 
 alfredas.springdatagraph.template.domain.AbstractRepository.findAllByGremlin2(AbstractRepository.java:94)
       at alfredas.springdatagraph.template.App.init(App.java:84)
       at alfredas.springdatagraph.template.App.main(App.java:93)
 Caused by: javax.script.ScriptException:
 groovy.lang.MissingMethodException: No signature of method:
 com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jVertex.outE() is
 applicable for argument types: (java.lang.String) values: [KNOWS]
 Possible solutions: outE(groovy.lang.Closure), dump(),
 use([Ljava.lang.Object;), getAt(java.lang.String),
 getAt(java.lang.String), with(groovy.lang.Closure)
       at 
 org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:318)
       at 
 org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:111)
       ... 6 more
 Caused by: groovy.lang.MissingMethodException: No signature of method:
 com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jVertex.outE() is
 applicable for argument types: (java.lang.String) values: [KNOWS]
 Possible solutions: outE(groovy.lang.Closure), dump(),
 use([Ljava.lang.Object;), getAt(java.lang.String),
 getAt(java.lang.String), with(groovy.lang.Closure)
       at 
 org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:54)
       at 
 org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:46)
       at 
 org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
       at 
 org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
       at 
 org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
       at Script1.run(Script1.groovy:43)
       at 
 org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval

[Neo4j] Traversal Framework question

2011-02-20 Thread Alfredas Chmieliauskas
Dear all,

could somebody point me to more documentation on the new traversal
framework (besides http://wiki.neo4j.org/content/Traversal_Framework)?
Also the new Evaluator and how to use it?

If we have a graph described in the pipes Co-Developers example
(https://github.com/tinkerpop/pipes/wiki/Using-Pipes-to-Traverse-Graphs).
Would this traversal return the co-developers?

Traversal.description()
.depthFirst()
.relationships(RelationshipTypes.CREATED, Direction.OUTGOING)
.relationships(RelationshipTypes.CREATED, Direction.INCOMING)
.traverse(developer).nodes()

Thanks,

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


Re: [Neo4j] Traversal Framework question

2011-02-20 Thread Alfredas Chmieliauskas
Thanks.

On Sun, Feb 20, 2011 at 2:24 PM, Tobias Ivarsson
tobias.ivars...@neotechnology.com wrote:
 On Sun, Feb 20, 2011 at 10:48 AM, Alfredas Chmieliauskas 
 al.fre...@gmail.com wrote:

 Dear all,

 could somebody point me to more documentation on the new traversal
 framework (besides http://wiki.neo4j.org/content/Traversal_Framework)?
 Also the new Evaluator and how to use it?


 That page, along with the examples pages is the best there is:
 * http://components.neo4j.org/neo4j-examples/snapshot/traversal.html
 * http://wiki.neo4j.org/content/Traversal_HowTo


I think that some of the examples are deprecated in the new release.



 If we have a graph described in the pipes Co-Developers example
 (https://github.com/tinkerpop/pipes/wiki/Using-Pipes-to-Traverse-Graphs).
 Would this traversal return the co-developers?

 Traversal.description()
 .depthFirst()
 .relationships(RelationshipTypes.CREATED, Direction.OUTGOING)
 .relationships(RelationshipTypes.CREATED, Direction.INCOMING)
 .traverse(developer).nodes()


 No, unfortunately it wouldn't. Relationship type specifications in
 TraversalDescriptions are not ordered, what you have written is just a
 different spelling of:

 Traversal.description()
 .depthFirst()
 .relationships(RelationshipTypes.CREATED, Direction.BOTH)
 .traverse(developer).nodes()

So this would be one way of finding co-developers using traversal:

Traversal.description()
.depthFirst()
.relationships(RelationshipTypes.CREATED)
.evaluator(new Evaluator() {
   @Override
   public Evaluation evaluate(Path path) {
   if (path.length()  1) {
   // co-developer
   return Evaluation.INCLUDE_AND_CONTINUE;
   } else {
   // project
   return Evaluation.EXCLUDE_AND_CONTINUE;
   }
   }
   });

I can imagine a few more ways to do that. I wonder if there are any
guidelines on whats the better way to do it (performance
considerations).

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


[Neo4j] Spring data and Pipes

2011-02-20 Thread Alfredas Chmieliauskas
Dear all,

I'm trying to combine spring data with tinkerpop pipes.

This is the way I'm trying to get a Blueprints graph from a
GraphDatabaseService injected by spring.

Graph graph = new
Neo4jGraph(this.getGraphDatabaseContext().getGraphDatabaseService());

But this gives me an exception:

Exception in thread main java.lang.NullPointerException
at 
com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jGraph.loadIndices(Neo4jGraph.java:76)
at 
com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jGraph.init(Neo4jGraph.java:69)

Everything else in the spring-data domain works.

Any ideas?

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


Re: [Neo4j] Spring data and Pipes

2011-02-20 Thread Alfredas Chmieliauskas
Updated to  0.5-SNAPSHOT. Works. Great!

On a more abstract topic - I'm wondering it there's a good way to use
your domain objects in Pipes instead of vertices and edges?
So far I've just created a new PipeVertex, T that converts the
vertices to your domain object by referring to node id.

What would be a better way?

Alfredas



On Sun, Feb 20, 2011 at 7:09 PM, Marko Rodriguez okramma...@gmail.com wrote:
 Hi,

 But this gives me an exception:

 Exception in thread main java.lang.NullPointerException
       at 
 com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jGraph.loadIndices(Neo4jGraph.java:76)
       at 
 com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jGraph.init(Neo4jGraph.java:69)

 Everything else in the spring-data domain works.

 Any ideas?

 This is because there is a bug in Blueprints 0.4 regarding Neo4j indices and 
 Blueprints. Blueprints 0.5-SNAPSHOT currently has this fixed if you want to 
 try that.

 dependency
  groupIdcom.tinkerpop/groupId
  artifactIdblueprints/artifactId
  version0.5-SNAPSHOT/version
 /dependency

 However, note that Blueprints 0.5-SNAPSHOT has a slightly different Index API 
 (Index, AutomaticIndex) than 0.4, so be vigilant.
        
 https://github.com/tinkerpop/blueprints/tree/master/src/main/java/com/tinkerpop/blueprints/pgm

 TinkerPop plans to release Blueprints 0.5 next week sometime (hopefully).

 If you care -- the reason it throws a NullPointerException is because 
 Blueprints checks for Blueprints-related index metadata on the Neo4j index. 
 If you create your indices with Blueprints, then there is no problem. If you 
 create your indices with Neo4j and then go to using Blueprints, Blueprints 
 goes ah?! There is no metadata on this index---let me be dumb and not check 
 on null. :) ... As stated previously, Blueprints 0.5-SNAPSHOT handles the 
 null with grace and behaves appropriately.

 Hope that helps,
 Marko.

 http://markorodriguez.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] Spring data and Pipes

2011-02-20 Thread Alfredas Chmieliauskas
On Sun, Feb 20, 2011 at 7:43 PM, Marko Rodriguez okramma...@gmail.com wrote:
 Hi,

 Updated to  0.5-SNAPSHOT. Works. Great!

 Excellent. (Again: note that IndexableGraph and AutomaticIndex are slightly 
 different in 0.5 than 0.4).

 On a more abstract topic - I'm wondering it there's a good way to use
 your domain objects in Pipes instead of vertices and edges?
 So far I've just created a new PipeVertex, T that converts the
 vertices to your domain object by referring to node id.

 The trick to Pipes is to build more abstract relations with lower-level 
 pipes. So yes, you want to go from 'graph speak' of edges, vertex, etc. to 
 'domain speak' of people, companies, etc. --- for example, 
 MyDomainSpecificFriendRecommendationPipePerson,MapPerson,Integer. See 
 slide 117 here:


Thats exactly what I did.

class MappingPipe extends AbstractPipeVertex, T implements PipeVertex, T {
@Override
protected T processNextStart() throws NoSuchElementException {
Vertex v = this.starts.next();
return findById((Long) v.getId());
}
}

I'm just not sure if findById((Long) v.getId()); is the best way to
map. findById is provided by NodeFinder of spring data.


 http://www.slideshare.net/slidarko/memoirs-of-a-graph-addict-despair-to-redemption


I know that presentation! It still is one of the most comprehensive
graph presentations out there. If someone asks me graphs... what? I
usually send that link. Thanks :-)

 Finally, see slide 116 in the same slideshow. All you have to do is overwrite 
 AbstractPipe.processNextStarts() and you can map from any type to any other 
 type.

 Hope that answers your question.

 Take care,
 Marko.

 http://markorodriguez.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] Spring data and Pipes

2011-02-20 Thread Alfredas Chmieliauskas
On Sun, Feb 20, 2011 at 8:20 PM, Michael Hunger
michael.hun...@neotechnology.com wrote:
 all finders map back to the underlying graph so it doesnt matter which one to 
 use.

 one could still add a toVertex wrapper to your domain objects to have them be 
 usable in tinkerpop

 what is the usecase you want to achieve with the combination of spring data 
 graph and tinkerpop

So far I'm just experimenting with different ways query the graph :-)
In the end I hope to build an AbstractRepositoryT class that would
allow me to find things in the same underlying graph using
TraversalDescriptions, Pipes, Gremlin or even SPARQL.
Having that would add a lot of flexibility in writing domain methods.

 glad that spring data graph works well for you if you have any feedback or 
 issues just ping me

Yes. Spring data is very interesting. Although I am still trying to
understand how to query a graph of heterogeneous nodes and
relationships and discover patterns.

A quick/trick question:
I noticed that father.relateTo(child, RelationshipTypes.PARENT) works
only if father has Direction.BOTH or Direction.OUTGOING; and

@RelatedTo(type = PARENT, elementClass = Person.class, direction =
Direction.INCOMING)
private SetPerson children;

father.relateTo(child, RelationshipTypes.PARENT);

father.getChildren()

would return empty in case of  Direction.INCOMING

this might be confusing!

Thanks,

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


[Neo4j] Webadmin bug?

2011-02-18 Thread Alfredas Chmieliauskas
Hi,

a small issue with the neo4j webadmin (1.3.M02).

In the data tab if you want to create a new property the value input
box goes red and the input is not saved.
The only way to get it to work is to create a property that has
numbers for key (such as 123)!?! Then the property is saved.

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


Re: [Neo4j] GSoC ideas?

2011-02-18 Thread Alfredas Chmieliauskas
Wrender looks like an attempt to connect Gremlin with JUNG to visually
traverse a graph.

https://github.com/tinkerpop/wrender

Does anyone know what the status of it is? Maybe there's a point to
continue it as long as blueprints already support JungGraph.

Alfredas



On Tue, Feb 8, 2011 at 4:29 PM, kyle adams adam...@gmail.com wrote:
 I agree with the visual aspect.

 Gremlin + SpringGraph (Adobe Flex/Actionscript Component) + Spring Data =
 very cool and intuitive way to traverse a network.

 SpringGraph:
 http://mark-shepherd.com/blog/springgraph-flex-component/
 http://mark-shepherd.com/blog/springgraph-flex-component/

 http://mark-shepherd.com/blog/springgraph-flex-component/--
 Thanks,
 *Kyle Adams*
 *ECM Architect | ECM Developer*
 *Crowley Maritime Corporation*
 9487 REGENCY SQUARE BLVD. • JACKSONVILLE • FLORIDA • 32225
 www.crowley.com
 Cell: 757.235.1410

 On Tue, Feb 8, 2011 at 10:26 AM, Javier de la Rosa ver...@gmail.com wrote:

 On Tue, Feb 8, 2011 at 01:35, Peter Neubauer
 peter.neuba...@neotechnology.com wrote:
  http://wiki.neo4j.org/content/Google_Summer_of_Code_Ideas
 
  May the source be with you!

 My 2 cents: a graphical web admin tool to traverse (visual Gremlin?)
 and browse the graph, with filters and facets, comparable to filters
 in Gephi [1] and sones VisualGraph [2].



 [1] http://www.youtube.com/watch?v=0R86bJVxMrA
 [2] http://www.youtube.com/watch?v=vJhwjls5Gxg



 --
 Javier de la Rosa
 http://versae.es
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

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

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


Re: [Neo4j] strict class persistence vs. projections

2011-01-19 Thread Alfredas Chmieliauskas
I've just started experimenting with neo4j and spring data approach
(I'm new here).
But I find the multiple projection idea a very valuable one.
Consider a very different approach to working with graph data I've
been using so far (before neo4j).
The shared  graph data is stored in a triple-store (used by multiple
apps). The data required by the application is queried by the app
using sparql. The resulting rdf is bound to pojos using a JPA-like
approach. While this method has many drawbacks, the primary benefit is
that it allows for evolution of schema on the back-end (triple store).
The apps can use a completely different data model - either by
specifying it in sparql query or in the JPA binding.
This is very different from the neo4j use-case, but we have found the
flexibility of the lose binding to be a very freeing experience.

It would be great to see such a feat in neo4j.

A




On Wed, Jan 19, 2011 at 9:21 PM, Peter Neubauer
peter.neuba...@neotechnology.com wrote:
 Interesting.
 Then, projections would in many aspects be like the persistence
 counterpart of the Qi4j Mixinx or Scala Traits, not hijacking the
 center of interest (object, node) but rather adding to it or giving it
 type when needed and otherwise keeping out the the way ...

 Cheers,

 /peter neubauer

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

 http://www.neo4j.org               - Your high performance graph database.
 http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.



 On Wed, Jan 19, 2011 at 9:13 PM, Andreas Kollegger
 andreas.kolleg...@neotechnology.com wrote:
 That's an interesting observation David, about single nodes or not. It seems 
 appealing to allow for a completely flexible mapping from any field to 
 locations in a supported data store.  That could be a later elaboration to 
 fully embrace the idea of classes as projections. Initially, one node per 
 projected class is probably confusing enough.

 For me, thinking about the class as a projections creates a consistent 
 mental model that never feels like cheating. The underlying node is no 
 longer looking underneath the covers, instead it's just another projection 
 with graph-like semantics. Versioning, polymorphism, data-hiding, pivoting 
 to an unrelated domain. As you say, David, it's all an interpretation.

 Though, I can certainly imagine use cases and business settings where such a 
 perspective is abhorrent.

 -Andreas

 On Jan 19, 2011, at 7:50 PM, David Montag wrote:

 Hi,

 I think that's a good idea. It makes good use of the schema-free nature of
 the graph database, and also decouples the data from the interpretation of
 the data. I'm not sure it has to be two different modes. Maybe you just use
 one projection of the data if that's all you need. Or you use multiple.

 Does this still imply one node per class (projection)? Are you aiming to
 change that too?

 David

 On Wed, Jan 19, 2011 at 3:40 AM, Michael Hunger 
 michael.hun...@neotechnology.com wrote:

 Today Andreas Kollegger and I had an interesting discussion about the
 prevalence of class based mapping of entities to a graph store.

 One of the strengths of a graph store is that you don't need a strict
 schema for your data and you can use lots of different projections to work
 with it.

 Spring Data Graph currently focuses on a single projection of a node to an
 entity instance (1:1) that traditional ORMs focused on.

 But we could do more. We can project the node to many different classes, as
 long as the properties that are part of the class are there, we can 
 sensibly
 work with the node.
 Even if the projection class is not part of the type hierarchy that was
 originally used to create and populate the node it can be used to access 
 it.

 That makes room for some interesting things like:
 * new domain concepts can be used on top of existing data
 * get rid of inheritance hierarchies
 * traverse over a lot of nodes that support some basic properties that form
 a concept (e.g. Person) using that simple concept during the traversal and
 from there project those nodes to more concrete concepts as needed (e.g.
 Employee, Customer)
 * data/schema evolution / versioning

 We can run DATAGRAPH in a strict mode (not default) where it checks that
 the node requested always fit to the domain class specified (according to
 the type hierarchy stored in the graph). But we can (and should promote)
 running it in a more loosely
 coupled way where this free projection is possible.

 I would like to introduce a T T NodeBacked.projectTo(ClassT) method to
 the aspect so that this projection is easily available.

 Looking for feedback on that.

 Cheers

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




 --
 David Montag
 Neo Technology, www.neotechnology.com
 

Re: [Neo4j] The imdb example is broken

2011-01-17 Thread Alfredas Chmieliauskas
Dear Michael,

thanks for all the help! But I just get the feeling that I am in some
parallel universe.
Because the imdb example still requires import
org.springframework.datastore.graph.annotation.GraphProperty;
see: 
https://github.com/trisberg/spring-datastore-graph-imdb/blob/master/src/main/java/org/neo4j/examples/imdb/domain/Actor.java

but the M1 namespace has changed to data (not datastore), see
https://github.com/SpringSource/spring-data-graph/blob/1.0.0.M1/spring-data-neo4j/src/main/java/org/springframework/data/graph/annotation/GraphProperty.java

Am I still using the wrong versions, or shall I just update the code
and get over it :-)

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


[Neo4j] The imdb example is broken

2011-01-14 Thread Alfredas Chmieliauskas
Dear all,

I am one of the newbies trying to get into experimenting with neo4j.
The first thing that i tried is the imdb example that is broken (even
though there is a lot of great documentation around it!). First of all
the artifactid of spring-datasource-neo4j has changed to
spring-data-neo4j.

dependency
 groupIdorg.springframework.data/groupId
 artifactIdspring-data-neo4j/artifactId
 version1.0.0.BUILD-SNAPSHOT/version
/dependency

Also eclipse gives me an error that the classes Actor and Movie do not
implement the NodeBacked interface. Even though building via maven
seems to work fine.

Still after building, spring gives a bean initialization error
relating to initialization of the graphdb. I cannot get the stack
trace from where i am right now, but if you'd try to check out the
current imdb example and run it - you would be able to reproduce it.

Any help would be appreciated as I ready want to get my hands dirty
with the annotation-driven neo4j use. Also I think the imdb example
does a great job at explaining the benefits of neo4j and it would be
useful to have it working to showcase the features to all the newbies
like me.

Also if anyone could point me to a working annotation based example -
that would be great.

Thanks a lot for great work,

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