[Neo4j] Heroku and Spatial Info

2011-10-07 Thread Hesham
I'm pretty new to Neo4j and I have a rails application that will probably use
Neo4j. Some of the items in the DB are currently location-tagged so I can
perform spatial calculation.

Can this be done with the Heroku add-on? Better yet, can some one point me
to documentation/example of query records with spatial info?

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


Re: [Neo4j] Neo4j low-level data storage

2011-10-07 Thread Michael Hunger
Lots of thoughts,

I just want to add a side note on store "defragmentation".

Mattias and I wrote a little tool for a customer who was in need of recreation 
of his
store with some properties/relationships omitted but using the original 
node-ids.

We did that by iterating through the existing store and using the 
batch-inserters
createNode and createRelationship methods which take an _explict_ id value. So 
you can control which id's are assigned for which nodes. That would allow e.g. 
for 
the R-Trees to be layed out in a way that they fit in a single 
Persistence-Window and
can be read in one go (that's just the index) it would probably interesting to 
co-locate
the way-nodes inside the bounding-box frame too.

Cheers

Michael

Am 07.10.2011 um 22:52 schrieb Craig Taverner:

> I think Daniels questions are very relevant, but not just to OSM. Any large
> graph (of which OSM is simply a good example) will be affected by
> fragmentation, and that can affect performance. I recently was hit by
> performance of GIS queries (not OSM) related to fragmentation of the index
> tree. I will describe that problem below, but first let me describe my view
> on Daniels question.
> 
> It is true that if parts of the graph that are geographically close are also
> close on disk the load time for bounding box queries will be faster.
> However, this is not a problem that is easy to solve in a generic way,
> because it requires knowledge of the domain. I can see two ways to create a
> less fragmented graph:
> 
>   - Have a de-fragmenting algorithm that re-organizes an existing graph
>   according to some rules. This does not exist in neo4j (yet?), but is
>   probably easier to generalize, since it should be possible to first analyse
>   the connectedness of the graph, and then defragment based on that. This
>   means a reasonable solution might be possible without knowing the domain.
>   - Be sure to load domain specific data in the order you wish to query it.
>   In other words, create a graph that is already de-fragmented.
> 
> This second approach is the route I have started following (at least I've
> taken one or two tiny baby-steps in that direction, but plan for more). In
> the case of the OSM model produced by the OSMImporter in Neo4j-Spatial, we
> do not do much here. We are importing the data in the order it was created
> in the original postgres database (ie. in the order it was originally added
> to open street map). However, since the XML format puts ways after all
> nodes, we actually also store all ways after all nodes, which means that to
> load any particular way completely from the database requires hitting disk
> at at least two very different locations, the location of the way node and
> the interconnects between the nodes, and the location(s) of the original
> location nodes. This multiple hit will occur on the nodes, relationships and
> properties tables in a similar way. So I can also answer a question Daniel
> asked about the ids. The Neo4j nodes, relationships and properties have
> their own id space. So you can have node 1, relationship 1 and property 1.
> Lets consider a real example, a street made of 5 points, added early to OSM
> (so low id's in both postgres and in neo4j). The OSM file will have these
> nodes near the top, but the way that connects them together will be near the
> bottom of the file. In Postgres the nodes and ways are in different tables,
> and will both be near the top. In neo4j both osm-ways and osm-nodes are
> neo4j-nodes (in the same 'table'). The osm-nodes will have low ids, but the
> ways will have a high id. Also we use proxy nodes to connect osm-ways to
> osm-nodes, and these will be created together with the way. So we will have
> 5 nodes with low ids, and 8 nodes with high id's (5 proxy nodes, 1 way node,
> 1 geometry node and 1 tags node). If the way was big and/or edited multiple
> times, we could get even higher fragmentation. Personally I think that
> fragmenting one geometry into a few specific locations is not a big problem
> for the neo4j caches. However, when we are talking about a result-set or
> traversal of thousands or hundreds of thousands of geometries, then doubling
> or tripling the number of disk hits due to fragmentation can definitely have
> a big impact.
> 
> How can this fragmentation situation be improved? One idea is to load the
> data with two passes. The current loader is trying to optimize OSM import
> speed, which is difficult already (and slower than in rdbms due to increased
> explicit structure), and so we have a single pass loader, with a lucene
> index for reconnecting ways to nodes. However, I think we could change this
> to a two pass loader, with the first pass reading and indexing the point
> nodes into a unique id-index (for fast postgres id lookup), and the second
> pass would connect the ways, and store both the nodes and ways to the
> database at the same time, in continuous disk space. This would improve
> query performance, and

Re: [Neo4j] Problem Installing Spatial (Beginner)

2011-10-07 Thread Craig Taverner
Sorry for such a late response, I missed this mail.

I must first point out that it seems you are trying to use Neo4j-Spatial in
the standalone server version of Neo4j. That is possible, but not well
supported. We have only exposed a few of the functions in the server, and do
not test it regularly.

The main way we are using neo4j-spatial at the moment is in the embedded
version of neo4j. This is where the maven instructions come in because they
assume you are writing a Java application that will embed the database. If
you are using a java application, and you can start using maven, then
everything should be easy to get working.

However, since I am relatively sure you are using neo4j-server, I think you
are getting into deep water. We need to improve our support for neo4j server
more before I can recommend you try it. The next release, 0.7, is focusing
on geoprocessing features, and then we hope to expose this in neo4j-server
in 0.8. Hopefully then things will be much easier for you.

On Tue, Sep 27, 2011 at 5:24 PM, handloomweaver  wrote:

> Hi
>
> I wonder if someone would be so kind to help. I'm new to Neo4j and was
> trying to install Neo4jSpatial to try its GIS features out. I need to be
> clear that I have no experience of Java & Maven so I'm struggling a bit.
>
> I want to install Neo4j & Spatial once somewhere on my 4GB MacBook Pro. I
> have no problem downloading the Neo4j Java Binary and starting it. But I'm
> confused about the Spatial library. Looking at the Github page it says
> either use Maven or copy a zip file into a folder in Neo4j. Is the zip file
> the Github repository contents or something else?
>
> I've tried the Maven way (mvn install) described on GitHub but I'm firstly
> confused about if/where Neo4j is being installed (does it install it first,
> where?) and anyway the install fails. It seems to be a JVM Heap memory
> problem? Why is it failing. How can I make it not fail. Is it a config file
> somewhere needing tweaked?
>
> http://handloomweaver.s3.amazonaws.com/Terminal_Output.txt
> http://handloomweaver.s3.amazonaws.com/surefire-reports.zip
>
> I'm really keen to use Neo4J spatial but the barrier to entry for the less
> technical GIS developer is proving too high for me!
>
> I'd SO appreciate some help/pointers. I apologise that I am posting such a
> NOOB question on your forum but I've exhausted Google searches.
>
> Thanks
>
>
>
>
>
> --
> View this message in context:
> http://neo4j-community-discussions.438527.n3.nabble.com/Problem-Installing-Spatial-Beginner-tp3372924p3372924.html
> Sent from the Neo4j Community Discussions mailing list archive at
> Nabble.com.
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Neo4j in GIS Applications

2011-10-07 Thread Craig Taverner
Hi all,

I am certainly behind on my emails, but I did just answer a related question
about OSM and fragmentation, and I think that might have answered some of
Daniels questions.

But I can say a little more about OSM and Neo4j here, specifically about the
issue of joins in postgres. Let me start by describing where I think
postgres might be faster than neo4j, and then move onto where neo4j is
faster than postgres.

Importing OSM data into postgres will be faster than neo4j because the
foreign keys are simple integer references between tables and are indexed
using postgres high performance indexes. In Neo4j the relationships are much
more detailed explicit bi-directional references taking more disk space (but
no index space). The disk write time is longer (more data written), but the
advantages of not having an index make it worth while.

So that leads naturally to where neo4j is faster. The reason there is no
index on the foreign key is because there is no need for one. Each
relationship contains the id of the node it points to (and points from), and
that id is directly mapped to the location on disk of the node itself. So
this is more like an array lookup, because all nodes are the same size on
disk. So the 'join' you perform when traversing from one osm-node to another
is extremely fast, but more importantly it is not affected by database size.
It is O(1) in performance! Fantastic! In rdbms, the need for an index on the
foreign key means you are building a tree structure to get the join down
from O(N) to O(ln(N)) or something better, but never as good as O(1).

In neo4j-spatial, if you perform a bounding box query, you are traversing an
RTree, which does not exist in posgres, but does exist in PostGIS. In both
Neo4j-Spatial and PostGIS you are working with a tree index that will slow
things down if there is a lot of data, and currently the postgis rtree is
better optimized than the neo4j-spatial rtree. But if you are performing
more graph-like processing, for example proximity searches, or routing
analysis, then you will get the full O(1) benefits of the graph database,
and no way can postgres match that :-)

OK. Lots of hype, but I get enthusiastic sometimes. Take anything I say with
a pinch of salt. Believe the part that make sense to you, and try some tests
otherwise. It would be great to hear your experiences with modeling OSM in
neo4j versus postgres.

Regards, Craig

On Tue, Oct 4, 2011 at 7:18 PM, Andreas Kollegger <
andreas.kolleg...@neotechnology.com> wrote:

> Hi Daniel,
>
> If you haven't yet, you should check out the work done in the Neo4j Spatial
> project - https://github.com/neo4j/spatial - which has fairly
> comprehensive
> support for GIS.
>
> Data locality, as you mention, is exactly a big advantage of using a graph
> for geospatial data. Take a look at the Neo4j Spatial project and let us
> know what you think.
>
> Best,
> Andreas
>
> On Tue, Oct 4, 2011 at 9:58 AM, danielb  wrote:
>
> > Hello everyone,
> >
> > I am going to write my master thesis about the suitability of graph
> > databases in GIS applications (at least I hope so^^). The database has to
> > provide topological queries, network analysis and the ability to store
> > large
> > amount of mapdata for viewing - all based on OSM-data of Germany (< 100M
> > nodes). Most likely I will compare Neo4j to PostGIS.
> > As a starting point I want to know why you would recommend Neo4j to do
> the
> > job? What are the main advantages of a graph database compared to a
> > (object-)relational database in the GIS environment? The main focus and
> the
> > goal of this work should be to show a performance improvement over
> > relational databases.
> > In a student project (OSM navigation system) we worked with relational
> > (SQLite) and object-oriented (Perst) databases on netbook hardware and
> > embedded systems. The relational database approach showed us two
> problems:
> > If you transfer the OSM model directly into tables then you have a lot of
> > joins which slows everything down (and lots of redundancy when using
> > different tables for each zoom level). The other way is to store as much
> as
> > possible in one big (sparse) table. But this would also have some
> > performance issues I guess and from a design perspective it is not a nice
> > solution. The object-oriented database also suffered from many random
> reads
> > when loading a bounding box. In addition we could not say how data was
> > stored in detail.
> > The performance indeed increased after caching occured or by the use of
> SSD
> > hardware. You can also store everything in RAM (money does the job), but
> > for
> > now you have to assume that all of the data has to be read from a slow
> disk
> > the first time. Can Neo4j be configured to read for example a bounding
> box
> > of OSM data from disk in an efficient way (data locality)?
> > Maybe you also have some suggestions where I should have a look at in
> this
> > work and what can be improved in Neo4j to get 

Re: [Neo4j] Best practise for multi language properties

2011-10-07 Thread Moootron
Both possibilities we thought about. 

Using special characters like description.de is a good idea.

Actually in one of our prototypes we have a global array 
language=(de,en,sp,...) and the
properties are arrays where the values have the same order, so we could parse 
the responsed REST Object into a JSON object, which we could use as a view model
object for the GUI.
But the properties have most of the time empty fields. ... we are not happy 
about that.

Ottmar

Am 07.10.2011 um 14:19 schrieb Rick Bullotta :

> Property names can have special characters in them, so we use a pattern like:
> 
> Description
> Description.EN
> Description.DE
> 
> This way we can keep any number of localiz(able) expressions on a node.  
> Based on the user's language, we first try to get the value in the local 
> language, then the default.
> 
> 
> 
> -Original Message-
> From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
> Behalf Of Michael Hunger
> Sent: Friday, October 07, 2011 8:07 AM
> To: Neo4j user discussions
> Subject: Re: [Neo4j] Best practise for multi language properties
> 
> You mean something like internationalization?
> 
> I don't know if that itself is a responsibility of the datamode/graph.
> 
> You could probably use string arrays to store those.
> 
> Or do you mean multi-language property names?
> 
> Cheers
> 
> Michael, Dresden,Germany
> 
> Am 07.10.2011 um 09:24 schrieb Moootron:
> 
>> Best Practice for multilanguage properties
>> 
>> Just a few month I am working with neo4j. We are modeling graphs for new 
>> Applications combining ontologies and data for production data.
>> 
>> The most important thing actually is to have multi language properties for 
>> nodes and relations with the following most  important use cases:
>> 
>> - language amount of each node could differ, this means that node 123 could 
>> have EN and DE and node 234 EN and SP.
>> - it should be possible to have a simple update process, like language 
>> packages, that we can fire to the graph
>> 
>> Are there any best practices, base concepts or contacts to solve this? ... 
>> 
>> Thanks and regards from Regensburg-Germany,
>> 
>> Ottmar
>> ___
>> 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] Gremlin add/remove vertex/edge functions

2011-10-07 Thread Peter Neubauer
Kan,
glad you sorted it out, was just about to answer something along these lines :)

Well done!

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 Fri, Oct 7, 2011 at 10:44 PM, KanTube  wrote:
> found my solution
>
> to remove relationships/edges
> g.v(0).outE('friend').each{ g.removeEdge(it) }
>
> to create relationships/edges
> [1,2,3,4, etc...].each{ g.addEdge(g.v(0), g.v(it), 'friend') }
>
> simple once you know the answer :)
>
> --
> View this message in context: 
> http://neo4j-community-discussions.438527.n3.nabble.com/Gremlin-add-remove-vertex-edge-functions-tp3402170p3404042.html
> Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Neo4j low-level data storage

2011-10-07 Thread Craig Taverner
I think Daniels questions are very relevant, but not just to OSM. Any large
graph (of which OSM is simply a good example) will be affected by
fragmentation, and that can affect performance. I recently was hit by
performance of GIS queries (not OSM) related to fragmentation of the index
tree. I will describe that problem below, but first let me describe my view
on Daniels question.

It is true that if parts of the graph that are geographically close are also
close on disk the load time for bounding box queries will be faster.
However, this is not a problem that is easy to solve in a generic way,
because it requires knowledge of the domain. I can see two ways to create a
less fragmented graph:

   - Have a de-fragmenting algorithm that re-organizes an existing graph
   according to some rules. This does not exist in neo4j (yet?), but is
   probably easier to generalize, since it should be possible to first analyse
   the connectedness of the graph, and then defragment based on that. This
   means a reasonable solution might be possible without knowing the domain.
   - Be sure to load domain specific data in the order you wish to query it.
   In other words, create a graph that is already de-fragmented.

This second approach is the route I have started following (at least I've
taken one or two tiny baby-steps in that direction, but plan for more). In
the case of the OSM model produced by the OSMImporter in Neo4j-Spatial, we
do not do much here. We are importing the data in the order it was created
in the original postgres database (ie. in the order it was originally added
to open street map). However, since the XML format puts ways after all
nodes, we actually also store all ways after all nodes, which means that to
load any particular way completely from the database requires hitting disk
at at least two very different locations, the location of the way node and
the interconnects between the nodes, and the location(s) of the original
location nodes. This multiple hit will occur on the nodes, relationships and
properties tables in a similar way. So I can also answer a question Daniel
asked about the ids. The Neo4j nodes, relationships and properties have
their own id space. So you can have node 1, relationship 1 and property 1.
Lets consider a real example, a street made of 5 points, added early to OSM
(so low id's in both postgres and in neo4j). The OSM file will have these
nodes near the top, but the way that connects them together will be near the
bottom of the file. In Postgres the nodes and ways are in different tables,
and will both be near the top. In neo4j both osm-ways and osm-nodes are
neo4j-nodes (in the same 'table'). The osm-nodes will have low ids, but the
ways will have a high id. Also we use proxy nodes to connect osm-ways to
osm-nodes, and these will be created together with the way. So we will have
5 nodes with low ids, and 8 nodes with high id's (5 proxy nodes, 1 way node,
1 geometry node and 1 tags node). If the way was big and/or edited multiple
times, we could get even higher fragmentation. Personally I think that
fragmenting one geometry into a few specific locations is not a big problem
for the neo4j caches. However, when we are talking about a result-set or
traversal of thousands or hundreds of thousands of geometries, then doubling
or tripling the number of disk hits due to fragmentation can definitely have
a big impact.

How can this fragmentation situation be improved? One idea is to load the
data with two passes. The current loader is trying to optimize OSM import
speed, which is difficult already (and slower than in rdbms due to increased
explicit structure), and so we have a single pass loader, with a lucene
index for reconnecting ways to nodes. However, I think we could change this
to a two pass loader, with the first pass reading and indexing the point
nodes into a unique id-index (for fast postgres id lookup), and the second
pass would connect the ways, and store both the nodes and ways to the
database at the same time, in continuous disk space. This would improve
query performance, and if we make a good unique-id index faster than lucene,
we will actually also improve import speed .. :-)

Now all of the above does not answer the original question regarding
bounding box queries. All we will have done with this is improve the load
time for complete OSM geometries (by reducing geometry fragmentation). But
what about the index itself. We are storing the index as part of the graph.
Today, Neo4j-spatial uses an RTree index that is created at the end of the
load in OSMImporter. This means we load the complete OSM file, and then we
index it. This is a good idea because it will store the entire RTree in
contiguous disk space. Sort of  there is one issue with the RTree node
splitting that will cause slight fragmentation, but I think it is not too
serious. Now when performing bounding box queries, the main work done by the
RTree will hit the minimum amount of disk space, until 

Re: [Neo4j] Gremlin add/remove vertex/edge functions

2011-10-07 Thread KanTube
found my solution 

to remove relationships/edges
g.v(0).outE('friend').each{ g.removeEdge(it) }

to create relationships/edges 
[1,2,3,4, etc...].each{ g.addEdge(g.v(0), g.v(it), 'friend') }

simple once you know the answer :)   

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


Re: [Neo4j] MUST_NOT in Index.query leads to NPE

2011-10-07 Thread Michael Hunger
I haven't found any lucene docs that describe the use of MUST_NOT in queries:

what I found was: 
http://semeru2007.wordpress.com/2007/10/17/lucene-an-introduction/

which would applied to your query mean:
> StreetAddress:"Kurfürstendamm 41" AND City:"Zwickau" AND State:"SN" AND 
> ZipCode:"08001" AND Country:"DE" AND  
> -UUID:"03df5826-5236-4075-86dd-1d121e127ade"


Am 07.10.2011 um 22:05 schrieb D. Frej:

> the final query looks like
> 
> StreetAddress:"Kurfürstendamm 41" AND City:"Zwickau" AND State:"SN" AND 
> ZipCode:"08001" AND Country:"DE" AND UUID:MUST_NOT 
> "03df5826-5236-4075-86dd-1d121e127ade"
> 
> My nodes only have properties of type String
> 
> 
> 
>  Original-Nachricht 
>> Datum: Fri, 7 Oct 2011 20:50:25 +0200
>> Von: Michael Hunger 
>> An: Neo4j user discussions 
>> Betreff: Re: [Neo4j] MUST_NOT in Index.query leads to NPE
> 
>> What value is your uuid in that case? is it probably null or empty?
>> 
>> Can we see the final query string?
>> 
>> Am 07.10.2011 um 20:25 schrieb dieter_f...@gmx.net:
>> 
>>> Hi everybody,
>>> 
>>> I want to query the Index with the Method query(String). Therefore, I
>> build my query and execute the method:
>>> 
>>> StringBuffer query = new StringBuffer();
>>> ...
>>> query.append(" AND ");
>>> query.append("UUID:");
>>> query.append("MUST_NOT ");
>>> query.append("\"" + uuid + "\"");
>>> 
>>> IndexHits hits = nodeIndex.query(query.toString());
>>> 
>>> This leads to the following Exception:
>>> 
>>> Exception in thread "main" java.lang.NullPointerException
>>> at
>> org.apache.lucene.util.SimpleStringInterner.intern(SimpleStringInterner.java:54)
>>> at org.apache.lucene.util.StringHelper.intern(StringHelper.java:36)
>>> at org.apache.lucene.index.Term.(Term.java:38)
>>> at
>> org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:643)
>>> at
>> org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:752)
>>> at
>> org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1556)
>>> at
>> org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1309)
>>> at
>> org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:1266)
>>> at
>> org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:1226)
>>> at
>> org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:206)
>>> at org.neo4j.index.impl.lucene.IndexType.query(IndexType.java:281)
>>> at org.neo4j.index.impl.lucene.LuceneIndex.query(LuceneIndex.java:207)
>>> at org.neo4j.index.impl.lucene.LuceneIndex.query(LuceneIndex.java:218)
>>> at testdata.ReadTestData.listInformation(ReadTestData.java:112)
>>> at testdata.ReadTestData.main(ReadTestData.java:153)
>>> 
>>> The syntax of the build query is correct - at least it executes in Luke
>> (https://code.google.com/p/luke/) without complaining.
>>> 
>>> Am I doing something wrong or did I miss something?
>>> 
>>> Cheers,
>>> 
>>> Didi
>>> -- 
>>> Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
>>> belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
>>> ___
>>> 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
> 
> -- 
> NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie! 
> Jetzt informieren: http://www.gmx.net/de/go/freephone
> ___
> 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] MUST_NOT in Index.query leads to NPE

2011-10-07 Thread D. Frej
the final query looks like

StreetAddress:"Kurfürstendamm 41" AND City:"Zwickau" AND State:"SN" AND 
ZipCode:"08001" AND Country:"DE" AND UUID:MUST_NOT 
"03df5826-5236-4075-86dd-1d121e127ade"

My nodes only have properties of type String



 Original-Nachricht 
> Datum: Fri, 7 Oct 2011 20:50:25 +0200
> Von: Michael Hunger 
> An: Neo4j user discussions 
> Betreff: Re: [Neo4j] MUST_NOT in Index.query leads to NPE

> What value is your uuid in that case? is it probably null or empty?
> 
> Can we see the final query string?
> 
> Am 07.10.2011 um 20:25 schrieb dieter_f...@gmx.net:
> 
> > Hi everybody,
> > 
> > I want to query the Index with the Method query(String). Therefore, I
> build my query and execute the method:
> > 
> > StringBuffer query = new StringBuffer();
> > ...
> > query.append(" AND ");
> > query.append("UUID:");
> > query.append("MUST_NOT ");
> > query.append("\"" + uuid + "\"");
> > 
> > IndexHits hits = nodeIndex.query(query.toString());
> > 
> > This leads to the following Exception:
> > 
> > Exception in thread "main" java.lang.NullPointerException
> > at
> org.apache.lucene.util.SimpleStringInterner.intern(SimpleStringInterner.java:54)
> > at org.apache.lucene.util.StringHelper.intern(StringHelper.java:36)
> > at org.apache.lucene.index.Term.(Term.java:38)
> > at
> org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:643)
> > at
> org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:752)
> > at
> org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1556)
> > at
> org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1309)
> > at
> org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:1266)
> > at
> org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:1226)
> > at
> org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:206)
> > at org.neo4j.index.impl.lucene.IndexType.query(IndexType.java:281)
> > at org.neo4j.index.impl.lucene.LuceneIndex.query(LuceneIndex.java:207)
> > at org.neo4j.index.impl.lucene.LuceneIndex.query(LuceneIndex.java:218)
> > at testdata.ReadTestData.listInformation(ReadTestData.java:112)
> > at testdata.ReadTestData.main(ReadTestData.java:153)
> > 
> > The syntax of the build query is correct - at least it executes in Luke
> (https://code.google.com/p/luke/) without complaining.
> > 
> > Am I doing something wrong or did I miss something?
> > 
> > Cheers,
> > 
> > Didi
> > -- 
> > Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
> > belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
> > ___
> > 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

-- 
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!   
Jetzt informieren: http://www.gmx.net/de/go/freephone
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] MUST_NOT in Index.query leads to NPE

2011-10-07 Thread Michael Hunger
What value is your uuid in that case? is it probably null or empty?

Can we see the final query string?

Am 07.10.2011 um 20:25 schrieb dieter_f...@gmx.net:

> Hi everybody,
> 
> I want to query the Index with the Method query(String). Therefore, I build 
> my query and execute the method:
> 
> StringBuffer query = new StringBuffer();
> ...
> query.append(" AND ");
> query.append("UUID:");
> query.append("MUST_NOT ");
> query.append("\"" + uuid + "\"");
> 
> IndexHits hits = nodeIndex.query(query.toString());
> 
> This leads to the following Exception:
> 
> Exception in thread "main" java.lang.NullPointerException
>   at 
> org.apache.lucene.util.SimpleStringInterner.intern(SimpleStringInterner.java:54)
>   at org.apache.lucene.util.StringHelper.intern(StringHelper.java:36)
>   at org.apache.lucene.index.Term.(Term.java:38)
>   at 
> org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:643)
>   at 
> org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:752)
>   at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1556)
>   at 
> org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1309)
>   at 
> org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:1266)
>   at 
> org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:1226)
>   at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:206)
>   at org.neo4j.index.impl.lucene.IndexType.query(IndexType.java:281)
>   at org.neo4j.index.impl.lucene.LuceneIndex.query(LuceneIndex.java:207)
>   at org.neo4j.index.impl.lucene.LuceneIndex.query(LuceneIndex.java:218)
>   at testdata.ReadTestData.listInformation(ReadTestData.java:112)
>   at testdata.ReadTestData.main(ReadTestData.java:153)
> 
> The syntax of the build query is correct - at least it executes in Luke 
> (https://code.google.com/p/luke/) without complaining.
> 
> Am I doing something wrong or did I miss something?
> 
> Cheers,
> 
> Didi
> -- 
> Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
> belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
> ___
> 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] MUST_NOT in Index.query leads to NPE

2011-10-07 Thread dieter_frej
Hi everybody,

I want to query the Index with the Method query(String). Therefore, I build my 
query and execute the method:

StringBuffer query = new StringBuffer();
...
query.append(" AND ");
query.append("UUID:");
query.append("MUST_NOT ");
query.append("\"" + uuid + "\"");

IndexHits hits = nodeIndex.query(query.toString());

This leads to the following Exception:

Exception in thread "main" java.lang.NullPointerException
at 
org.apache.lucene.util.SimpleStringInterner.intern(SimpleStringInterner.java:54)
at org.apache.lucene.util.StringHelper.intern(StringHelper.java:36)
at org.apache.lucene.index.Term.(Term.java:38)
at 
org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:643)
at 
org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:752)
at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1556)
at 
org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1309)
at 
org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:1266)
at 
org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:1226)
at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:206)
at org.neo4j.index.impl.lucene.IndexType.query(IndexType.java:281)
at org.neo4j.index.impl.lucene.LuceneIndex.query(LuceneIndex.java:207)
at org.neo4j.index.impl.lucene.LuceneIndex.query(LuceneIndex.java:218)
at testdata.ReadTestData.listInformation(ReadTestData.java:112)
at testdata.ReadTestData.main(ReadTestData.java:153)

The syntax of the build query is correct - at least it executes in Luke 
(https://code.google.com/p/luke/) without complaining.

Am I doing something wrong or did I miss something?

Cheers,

Didi
-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] template tool

2011-10-07 Thread andrew ton


Thank you Jim!

Cheers,



From: Jim Webber 
To: Neo4j user discussions 
Sent: Friday, October 7, 2011 10:09 AM
Subject: Re: [Neo4j] template tool

Hi Andrew,

> I have a quick question regarding string template. When we create a node 
> index the server returns a template
>  http://localhost:7474/db/data/index/node/favorites/{key}/{value}
> 
> Does Neo4J have any API similar to StringTemplate that can replace 
> placeholders in the template with the real
> values?

Short answer: no.

The reason we used these URI templates is that we can't enumerate (in the 
general case) the contents of an index, so we have to invite clients to compute 
them (hence the URI template). 

So the thinking goes, since it's you (as the client) that creates the index 
entries, knowing the {key} and {value} expansions are easy for you to perform.

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] template tool

2011-10-07 Thread Jim Webber
Hi Andrew,

> I have a quick question regarding string template. When we create a node 
> index the server returns a template
>  http://localhost:7474/db/data/index/node/favorites/{key}/{value}
> 
> Does Neo4J have any API similar to StringTemplate that can replace 
> placeholders in the template with the real
> values?

Short answer: no.

The reason we used these URI templates is that we can't enumerate (in the 
general case) the contents of an index, so we have to invite clients to compute 
them (hence the URI template). 

So the thinking goes, since it's you (as the client) that creates the index 
entries, knowing the {key} and {value} expansions are easy for you to perform.

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


[Neo4j] template tool

2011-10-07 Thread andrew ton


Hello,

I have a quick question regarding string template. When we create a node index 
the server returns a template
 http://localhost:7474/db/data/index/node/favorites/{key}/{value}

Does Neo4J have any API similar to StringTemplate that can replace placeholders 
in the template with the real
values?

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


Re: [Neo4j] Neo4j embedded

2011-10-07 Thread Jacob Hansson
If you choose to use the server or if you choose the embedded database will
have a significant impact on how those results turn out. For performing
large queries, the server should not be much slower than the embedded
database. It will be significantly slower (more than two orders of
magnitude) on single read/write operations.

Like Jim mentioned, we are looking at a new REST implementation that
essentially nullifies this speed difference. It is currently at an
experimental stage, but we will make sure to share details and get feedback
on it from y'all as it progresses, stay tuned.

/Jake

On Fri, Oct 7, 2011 at 3:15 PM, Antriani Stylianou wrote:

> Thanks again for the answer but my system is actually a benchmarking
> system!
> In other words I am trying to find out if there are performance
> difference between the 2 DBs not through an application.
>
> On 10/7/11 1:36 PM, Jim Webber wrote:
> > Hi Antriani,
> >
> >> Ok, but the REST API doesn't produce more network overhead (i.e.
> >> HTTP...) compared to a driver implementation using sockets for access
> >> for example MySQL JDBC  ?
> > I have no data to support this, but I'm going to make an educated guess
> and say that the MySQL JDBC driver is overall faster than our REST API :-)
> >
> > But my point stands: measure your system, not its components.
> >
> > Neo4j might well have a slower network API than MySQL, but you might find
> that because of the data model, you ship less data over the network, or the
> queries run so much faster that network differences become negligible.
> >
> > Something will be your bottleneck in either the Neo4j case or the MySQL
> case, but if the Neo4j case is faster despite having a slower network
> interface, then you might not care.
> >
> > 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
>



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


Re: [Neo4j] Neo4j low-level data storage

2011-10-07 Thread Peter Neubauer
Daniel,
for OSM data and GIS, have you looked at
https://github.com/neo4j/spatial, especially the OSM examples at
https://github.com/neo4j/spatial/blob/master/src/test/java/org/neo4j/gis/spatial/pipes/GeoPipesTest.java
and 
https://github.com/neo4j/spatial/blob/master/src/test/java/org/neo4j/gis/spatial/OsmAnalysisTest.java
?

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 Fri, Oct 7, 2011 at 3:46 PM, danielb  wrote:
> Hello Chris,
>
> thanks for your postings, they are a great starting point for me to assume a
> good performance of this database. However I have some questions left.
> Lets say I have a node store and a property store. Both of them are
> individual files. I am going to implement a GIS application which fetches
> OSM data from the hard disk. When I load a bounding box I want to avoid to
> many random reads from the disk.
> More precisely I want to load nodes and properties inside a given bounding
> box. It would be great if both the nodes and the properties are organized in
> successive blocks. Is there one id-pool for both nodes and properties, so
> that I can load for example the nodes with id 1 and 2 and the properties 3,
> 4 and 5 with one block read? I can be totally wrong because if I save a new
> node file with id 1, 2 and then save a new property file with id 3, it will
> start on a new block (windows block size like 4K). When then writing a new
> node id it would be saved in the first block I guess. What about
> fragmentation? And is there an improvement when using a Linux system
> (inodes? I don't know Linux well)? When I am finished with saving the nodes
> and properties is there some way of reorganization on the hard disk? Lets
> say I want to enter a new node which is connected to a low id. Will it get
> the first free id (and it will be saved on the other end of the harddisk
> perhaps) or does it just get an allready used id and the following records
> will be reorganized (insert performance)?
> Maybe I am totally wrong about this, but I would appreciate an efficient way
> of storage for GIS data.
>
> best regards, Daniel
>
> --
> View this message in context: 
> http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-low-level-data-storage-tp3336483p3402827.html
> Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Neo4j low-level data storage

2011-10-07 Thread danielb
Hello Chris,

thanks for your postings, they are a great starting point for me to assume a
good performance of this database. However I have some questions left.
Lets say I have a node store and a property store. Both of them are
individual files. I am going to implement a GIS application which fetches
OSM data from the hard disk. When I load a bounding box I want to avoid to
many random reads from the disk.
More precisely I want to load nodes and properties inside a given bounding
box. It would be great if both the nodes and the properties are organized in
successive blocks. Is there one id-pool for both nodes and properties, so
that I can load for example the nodes with id 1 and 2 and the properties 3,
4 and 5 with one block read? I can be totally wrong because if I save a new
node file with id 1, 2 and then save a new property file with id 3, it will
start on a new block (windows block size like 4K). When then writing a new
node id it would be saved in the first block I guess. What about
fragmentation? And is there an improvement when using a Linux system
(inodes? I don't know Linux well)? When I am finished with saving the nodes
and properties is there some way of reorganization on the hard disk? Lets
say I want to enter a new node which is connected to a low id. Will it get
the first free id (and it will be saved on the other end of the harddisk
perhaps) or does it just get an allready used id and the following records
will be reorganized (insert performance)?
Maybe I am totally wrong about this, but I would appreciate an efficient way
of storage for GIS data.

best regards, Daniel 

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


Re: [Neo4j] Neo4j embedded

2011-10-07 Thread Antriani Stylianou
Thanks again for the answer but my system is actually a benchmarking system!
In other words I am trying to find out if there are performance 
difference between the 2 DBs not through an application.

On 10/7/11 1:36 PM, Jim Webber wrote:
> Hi Antriani,
>
>> Ok, but the REST API doesn't produce more network overhead (i.e.
>> HTTP...) compared to a driver implementation using sockets for access
>> for example MySQL JDBC  ?
> I have no data to support this, but I'm going to make an educated guess and 
> say that the MySQL JDBC driver is overall faster than our REST API :-)
>
> But my point stands: measure your system, not its components.
>
> Neo4j might well have a slower network API than MySQL, but you might find 
> that because of the data model, you ship less data over the network, or the 
> queries run so much faster that network differences become negligible.
>
> Something will be your bottleneck in either the Neo4j case or the MySQL case, 
> but if the Neo4j case is faster despite having a slower network interface, 
> then you might not care.
>
> 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] Best practise for multi language properties

2011-10-07 Thread Rick Bullotta
Property names can have special characters in them, so we use a pattern like:

Description
Description.EN
Description.DE

This way we can keep any number of localiz(able) expressions on a node.  Based 
on the user's language, we first try to get the value in the local language, 
then the default.



-Original Message-
From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
Behalf Of Michael Hunger
Sent: Friday, October 07, 2011 8:07 AM
To: Neo4j user discussions
Subject: Re: [Neo4j] Best practise for multi language properties

You mean something like internationalization?

I don't know if that itself is a responsibility of the datamode/graph.

You could probably use string arrays to store those.

Or do you mean multi-language property names?

Cheers

Michael, Dresden,Germany

Am 07.10.2011 um 09:24 schrieb Moootron:

> Best Practice for multilanguage properties
> 
> Just a few month I am working with neo4j. We are modeling graphs for new 
> Applications combining ontologies and data for production data.
> 
> The most important thing actually is to have multi language properties for 
> nodes and relations with the following most  important use cases:
> 
> - language amount of each node could differ, this means that node 123 could 
> have EN and DE and node 234 EN and SP.
> - it should be possible to have a simple update process, like language 
> packages, that we can fire to the graph
> 
> Are there any best practices, base concepts or contacts to solve this? ... 
> 
> Thanks and regards from Regensburg-Germany,
> 
> Ottmar
> ___
> 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] Big Traverser perfomance : are '23 rels per milliseconds' good ?

2011-10-07 Thread Michael Hunger
It should, but in Guillaume's example they didn't differ by much, both were 
slow.

It seems to be running with the default soft references cache which might turn 
over if every node and property is just visited once and then only a second 
time in the second run.

Michael

Am 07.10.2011 um 09:19 schrieb Mattias Persson:

> Also, is that the first run directly after a JVM start? The first time you
> encounter a Node or Relationship it is loaded from disk into memory so that
> the next time it's read from memory instead. The difference between two runs
> can be order of magnitudes in difference.
> 
> 2011/10/6 Michael Hunger 
> 
>> Hmm virtual machines might be difficult, esp. with the io indirection.
>> 
>> Your memory settings for the db are:
>>   • Fri Oct 07 00:10:01 IST 2011:
>> neostore.nodestore.db.mapped_memory=20M
>>   • Fri Oct 07 00:10:01 IST 2011:
>> neostore.propertystore.db.arrays.mapped_memory=130M
>>   • Fri Oct 07 00:10:01 IST 2011:
>> neostore.propertystore.db.index.keys.mapped_memory=1M
>>   • Fri Oct 07 00:10:01 IST 2011:
>> neostore.propertystore.db.index.mapped_memory=1M
>>   • Fri Oct 07 00:10:01 IST 2011:
>> neostore.propertystore.db.mapped_memory=90M
>>   • Fri Oct 07 00:10:01 IST 2011:
>> neostore.propertystore.db.strings.mapped_memory=130M
>>   • Fri Oct 07 00:10:01 IST 2011:
>> neostore.relationshipstore.db.mapped_memory=100M
>> 
>> Can you change that so that it uses the rest of your memory (say 2GB).
>> 
>>   • Fri Oct 07 00:10:01 IST 2011:
>> neostore.nodestore.db.mapped_memory=200M
>>   • Fri Oct 07 00:10:01 IST 2011:
>> neostore.propertystore.db.arrays.mapped_memory=100M
>>   • Fri Oct 07 00:10:01 IST 2011:
>> neostore.propertystore.db.index.keys.mapped_memory=1M
>>   • Fri Oct 07 00:10:01 IST 2011:
>> neostore.propertystore.db.index.mapped_memory=1M
>>   • Fri Oct 07 00:10:01 IST 2011:
>> neostore.propertystore.db.mapped_memory=1000M
>>   • Fri Oct 07 00:10:01 IST 2011:
>> neostore.propertystore.db.strings.mapped_memory=200M
>>   • Fri Oct 07 00:10:01 IST 2011:
>> neostore.relationshipstore.db.mapped_memory=800M
>> 
>> See also:
>> http://docs.neo4j.org/chunked/snapshot/configuration.html
>> 
>> Could you also have a look at this:
>> http://wiki.neo4j.org/content/Linux_Performance_Guide
>> 
>> Is it possible to share your code/graphdb(generator) - also off-list. I'd
>> like to have a look.
>> 
>> Thanks
>> 
>> Michael
>> 
>> Am 06.10.2011 um 22:14 schrieb Guillaume ALLEE:
>> 
>>> Hi,
>>> 
>>> Here are the answers I can give you quickly:
>>> 
>>> How much memory does your machine have?
 5066 MB (from free -m)
>>> 
>>> What kind of disk is in there?
 I do not know, the machine is a VM  provided by another department of my
>>> company. What I can tell you is that on my i5 laptop the same was taking
>> 6-8
>>> minutes.
>>> 
>>> Have you looked at the memory config for the neo4j db?
 No I did only change the head size.
>>> 
>>> What kind of scheduler do you use (please try deadline or as)?
 it seems to be as.
>>> 
>>> Can you please share the config and JVM info that is output at the head
>> of
>>> graphdb/messages.log ?
 see here http://pastebin.com/0geHdbNu
>>> 
>>> 
>>> 
>>> --
>>> View this message in context:
>> http://neo4j-community-discussions.438527.n3.nabble.com/Big-Traverser-perfomance-are-23-rels-per-milliseconds-good-tp3400711p3400925.html
>>> Sent from the Neo4j Community Discussions mailing list archive at
>> Nabble.com.
>>> ___
>>> Neo4j mailing list
>>> User@lists.neo4j.org
>>> https://lists.neo4j.org/mailman/listinfo/user
>> 
>> ___
>> Neo4j mailing list
>> User@lists.neo4j.org
>> https://lists.neo4j.org/mailman/listinfo/user
>> 
> 
> 
> 
> -- 
> 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


Re: [Neo4j] Best practise for multi language properties

2011-10-07 Thread Michael Hunger
You mean something like internationalization?

I don't know if that itself is a responsibility of the datamode/graph.

You could probably use string arrays to store those.

Or do you mean multi-language property names?

Cheers

Michael, Dresden,Germany

Am 07.10.2011 um 09:24 schrieb Moootron:

> Best Practice for multilanguage properties
> 
> Just a few month I am working with neo4j. We are modeling graphs for new 
> Applications combining ontologies and data for production data.
> 
> The most important thing actually is to have multi language properties for 
> nodes and relations with the following most  important use cases:
> 
> - language amount of each node could differ, this means that node 123 could 
> have EN and DE and node 234 EN and SP.
> - it should be possible to have a simple update process, like language 
> packages, that we can fire to the graph
> 
> Are there any best practices, base concepts or contacts to solve this? ... 
> 
> Thanks and regards from Regensburg-Germany,
> 
> Ottmar
> ___
> 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 embedded

2011-10-07 Thread Jim Webber
Hi Antriani,

> Ok, but the REST API doesn't produce more network overhead (i.e. 
> HTTP...) compared to a driver implementation using sockets for access 
> for example MySQL JDBC  ?

I have no data to support this, but I'm going to make an educated guess and say 
that the MySQL JDBC driver is overall faster than our REST API :-)

But my point stands: measure your system, not its components.

Neo4j might well have a slower network API than MySQL, but you might find that 
because of the data model, you ship less data over the network, or the queries 
run so much faster that network differences become negligible.

Something will be your bottleneck in either the Neo4j case or the MySQL case, 
but if the Neo4j case is faster despite having a slower network interface, then 
you might not care.

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


Re: [Neo4j] Neo4j embedded

2011-10-07 Thread Antriani Stylianou
Ok, but the REST API doesn't produce more network overhead (i.e. 
HTTP...) compared to a driver implementation using sockets for access 
for example MySQL JDBC  ?

On 10/7/11 12:53 PM, Jim Webber wrote:
> Hi Antriani,
>
> Since Neo4j is an embedded database, the "equal" is quite legitimately to use 
> the Java APIs.
>
> If you want to introduce network and serialisation overhead, then use the 
> REST API.
>
> But I really believe that you should measure the performance of your *system* 
> not just your database. So if you can replace MySQL (or whatever) in your 
> system with Neo4j embedded, then do so and measure that. If you can't (e.g. 
> you're not on the JVM) then replace it with a sensible use of the REST API 
> and measure that.
>
> Jim
>
> On 7 Oct 2011, at 11:28, Antriani Stylianou wrote:
>
>> Ok,thanks!
>>
>> Do you have any suggestions as to what is the best way to use neo4j to
>> benchmark it against a mysql  database (with an "equal" in communication
>> overhead manner)?
>>
>> On 10/7/11 12:23 PM, Jim Webber wrote:
>>> Hi,
>>>
>>> When using Neo4j in embedded mode, communication with the database is via 
>>> in-process Java method calls* since the database resides in your process.
>>>
>>> However when Neo4j is used in HA mode (irrespective of whether it is  
>>> embedded or server), then it will use sockets to maintain consistency of 
>>> the cluster.
>>>
>>> Jim
>>>
>>> * so I guess technically the communication mechanism is stack frames :-)
>>> ___
>>> 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 embedded

2011-10-07 Thread Jim Webber
Hi Antriani,

Since Neo4j is an embedded database, the "equal" is quite legitimately to use 
the Java APIs.

If you want to introduce network and serialisation overhead, then use the REST 
API.

But I really believe that you should measure the performance of your *system* 
not just your database. So if you can replace MySQL (or whatever) in your 
system with Neo4j embedded, then do so and measure that. If you can't (e.g. 
you're not on the JVM) then replace it with a sensible use of the REST API and 
measure that.

Jim

On 7 Oct 2011, at 11:28, Antriani Stylianou wrote:

> Ok,thanks!
> 
> Do you have any suggestions as to what is the best way to use neo4j to 
> benchmark it against a mysql  database (with an "equal" in communication 
> overhead manner)?
> 
> On 10/7/11 12:23 PM, Jim Webber wrote:
>> Hi,
>> 
>> When using Neo4j in embedded mode, communication with the database is via 
>> in-process Java method calls* since the database resides in your process.
>> 
>> However when Neo4j is used in HA mode (irrespective of whether it is  
>> embedded or server), then it will use sockets to maintain consistency of the 
>> cluster.
>> 
>> Jim
>> 
>> * so I guess technically the communication mechanism is stack frames :-)
>> ___
>> 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 embedded

2011-10-07 Thread Antriani Stylianou
Ok,thanks!

Do you have any suggestions as to what is the best way to use neo4j to 
benchmark it against a mysql  database (with an "equal" in communication 
overhead manner)?

On 10/7/11 12:23 PM, Jim Webber wrote:
> Hi,
>
> When using Neo4j in embedded mode, communication with the database is via 
> in-process Java method calls* since the database resides in your process.
>
> However when Neo4j is used in HA mode (irrespective of whether it is  
> embedded or server), then it will use sockets to maintain consistency of the 
> cluster.
>
> Jim
>
> * so I guess technically the communication mechanism is stack frames :-)
> ___
> 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 embedded

2011-10-07 Thread Jim Webber
Hi,

When using Neo4j in embedded mode, communication with the database is via 
in-process Java method calls* since the database resides in your process.

However when Neo4j is used in HA mode (irrespective of whether it is  embedded 
or server), then it will use sockets to maintain consistency of the cluster.

Jim

* so I guess technically the communication mechanism is stack frames :-)
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Neo4j embedded

2011-10-07 Thread antriani.s
Hi,

When using Neo4j as an embedded database in a Java Application how is the
communication made with the database i.e. via sockets? via Inter-process
with shared memory or remote procedure calls or something else?

Thanks,
a.

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


Re: [Neo4j] Gremlin syntax for multiple paths in one call

2011-10-07 Thread Peter Neubauer
Updated.

http://docs.neo4j.org/chunked/snapshot/gremlin-plugin.html#rest-api-collect-multiple-traversal-results

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 Tue, Oct 4, 2011 at 11:16 PM, KanTube  wrote:
> for now it is not an issue for me to update on my development server but if
> you could give an idea when the release is due out that would help.  i am
> not in a hurry for the update since current functionality satisfies my
> business needs.
>
> --
> View this message in context: 
> http://neo4j-community-discussions.438527.n3.nabble.com/Gremlin-syntax-for-multiple-paths-in-one-call-tp3392311p3394635.html
> Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Gremlin add/remove vertex/edge functions

2011-10-07 Thread KanTube
not sure i understand what you mean... 

pretty simple for me to reproduce this error

1) create a node
2) add relationship to node of type 'friend'
3) use gremlin to delete relationship

the command i use is:

post /db/data/ext/GremlinPlugin/graphdb/execute_script/ {"script":
"g.v(0).outE('friend').sideEffect{g.removeEdge(it); }"}

i am not sure if it something i am doing or if it gremlin trying to return
the delete relationship 

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


Re: [Neo4j] Gremlin add/remove vertex/edge functions

2011-10-07 Thread Peter Neubauer
Kan,
maybe you have created data before, and the IDs are ticking up?

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 Fri, Oct 7, 2011 at 11:04 AM, KanTube  wrote:
> Ok i think i have figured it out but there may be a bug
>
> if i use the gremlin web console and send this command
>
> g.v(0).outE('friend').sideEffect{g.removeEdge(it); }
>
> it will only delete the first relationship
>
> however
>
> if i send the same command to the HTTP web console i receive the following
> error
>
> ==> 500 Internal Server Error
> ==> {
> ==>   "message" : "Relationship[42] not found.",
> ==>   "exception" : "org.neo4j.graphdb.NotFoundException: Relationship[42]
> not found.",
> ==>   "stacktrace" : [
> "org.neo4j.kernel.impl.core.NodeManager.getRelForProxy(NodeManager.java:568)",
> "org.neo4j.kernel.impl.core.RelationshipProxy.getStartNode(RelationshipProxy.java:65)",
> ..
>
> but all relationship are deleted
>
>
> as it turns out Relationship[42] is the first relationship of type 'friend'
> on the g.v(0) node.
>
> is this something i am doing?
>
>
>
>
> --
> View this message in context: 
> http://neo4j-community-discussions.438527.n3.nabble.com/Gremlin-add-remove-vertex-edge-functions-tp3402170p3402299.html
> Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Gremlin add/remove vertex/edge functions

2011-10-07 Thread KanTube
Ok i think i have figured it out but there may be a bug

if i use the gremlin web console and send this command

g.v(0).outE('friend').sideEffect{g.removeEdge(it); }

it will only delete the first relationship 

however

if i send the same command to the HTTP web console i receive the following
error 

==> 500 Internal Server Error
==> {
==>   "message" : "Relationship[42] not found.",
==>   "exception" : "org.neo4j.graphdb.NotFoundException: Relationship[42]
not found.",
==>   "stacktrace" : [
"org.neo4j.kernel.impl.core.NodeManager.getRelForProxy(NodeManager.java:568)",
"org.neo4j.kernel.impl.core.RelationshipProxy.getStartNode(RelationshipProxy.java:65)",
 
..

but all relationship are deleted


as it turns out Relationship[42] is the first relationship of type 'friend'
on the g.v(0) node.

is this something i am doing?




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


Re: [Neo4j] Recommended way to deploy server software

2011-10-07 Thread Jim Webber
Hey,

> Am I really being that hyperbolic?  The deployment tools we have are superb
> and simple to use.  I just don't _want_ to do any prep work outside my
> project folder in order to test my code.  The embedded db made me think it's
> possible (first time I'd ever dealt with one).  (=

Understood. Check out the functional tests from the community edition. There's 
infrastructure in there that will get you running from within your project - in 
fact for testing it's probably better than the WrappingBootStrapper.

> I couldn't locate Jake's.  Do you have a link?  Thanks.

I then I realise that I saw Jake's measurements on a different, non-public 
list. But to summarise, he thinks the REST API could be made to have roughly 
the same throughput as the embedded API, albeit at higher latencies.

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


[Neo4j] Gremlin add/remove vertex/edge functions

2011-10-07 Thread KanTube
using server 1.5-SNAPSHOT (revision: 1.5.M01-693-g712b557-dirty)

I would like to remove all relationship of type "friend".  I tried but just
could not get removeEdge() to work.  Is this supported?  And is addEdge()
supported?

My specific issue is that i have a list of relationship IDs that i would
like to remove and then add another set of relationships to known node IDs. 
I can do this through the REST interface but i would need to make a call for
each remove and add (no big deal since it will never be a very large number
but not a very cool solution).  

on a side note:  The updated Web Administration is VERY GOOD!  i really like
the ability to add filters, colors and icons on the data browser.  It WOWed
my business team! 



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


[Neo4j] Best practise for multi language properties

2011-10-07 Thread Moootron
Best Practice for multilanguage properties

Just a few month I am working with neo4j. We are modeling graphs for new 
Applications combining ontologies and data for production data.

The most important thing actually is to have multi language properties for 
nodes and relations with the following most  important use cases:

- language amount of each node could differ, this means that node 123 could 
have EN and DE and node 234 EN and SP.
- it should be possible to have a simple update process, like language 
packages, that we can fire to the graph

Are there any best practices, base concepts or contacts to solve this? ... 

Thanks and regards from Regensburg-Germany,

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


Re: [Neo4j] Big Traverser perfomance : are '23 rels per milliseconds' good ?

2011-10-07 Thread Mattias Persson
Also, is that the first run directly after a JVM start? The first time you
encounter a Node or Relationship it is loaded from disk into memory so that
the next time it's read from memory instead. The difference between two runs
can be order of magnitudes in difference.

2011/10/6 Michael Hunger 

> Hmm virtual machines might be difficult, esp. with the io indirection.
>
> Your memory settings for the db are:
>• Fri Oct 07 00:10:01 IST 2011:
> neostore.nodestore.db.mapped_memory=20M
>• Fri Oct 07 00:10:01 IST 2011:
> neostore.propertystore.db.arrays.mapped_memory=130M
>• Fri Oct 07 00:10:01 IST 2011:
> neostore.propertystore.db.index.keys.mapped_memory=1M
>• Fri Oct 07 00:10:01 IST 2011:
> neostore.propertystore.db.index.mapped_memory=1M
>• Fri Oct 07 00:10:01 IST 2011:
> neostore.propertystore.db.mapped_memory=90M
>• Fri Oct 07 00:10:01 IST 2011:
> neostore.propertystore.db.strings.mapped_memory=130M
>• Fri Oct 07 00:10:01 IST 2011:
> neostore.relationshipstore.db.mapped_memory=100M
>
> Can you change that so that it uses the rest of your memory (say 2GB).
>
>• Fri Oct 07 00:10:01 IST 2011:
> neostore.nodestore.db.mapped_memory=200M
>• Fri Oct 07 00:10:01 IST 2011:
> neostore.propertystore.db.arrays.mapped_memory=100M
>• Fri Oct 07 00:10:01 IST 2011:
> neostore.propertystore.db.index.keys.mapped_memory=1M
>• Fri Oct 07 00:10:01 IST 2011:
> neostore.propertystore.db.index.mapped_memory=1M
>• Fri Oct 07 00:10:01 IST 2011:
> neostore.propertystore.db.mapped_memory=1000M
>• Fri Oct 07 00:10:01 IST 2011:
> neostore.propertystore.db.strings.mapped_memory=200M
>• Fri Oct 07 00:10:01 IST 2011:
> neostore.relationshipstore.db.mapped_memory=800M
>
> See also:
> http://docs.neo4j.org/chunked/snapshot/configuration.html
>
> Could you also have a look at this:
> http://wiki.neo4j.org/content/Linux_Performance_Guide
>
> Is it possible to share your code/graphdb(generator) - also off-list. I'd
> like to have a look.
>
> Thanks
>
> Michael
>
> Am 06.10.2011 um 22:14 schrieb Guillaume ALLEE:
>
> > Hi,
> >
> > Here are the answers I can give you quickly:
> >
> > How much memory does your machine have?
> >> 5066 MB (from free -m)
> >
> > What kind of disk is in there?
> >> I do not know, the machine is a VM  provided by another department of my
> > company. What I can tell you is that on my i5 laptop the same was taking
> 6-8
> > minutes.
> >
> > Have you looked at the memory config for the neo4j db?
> >> No I did only change the head size.
> >
> > What kind of scheduler do you use (please try deadline or as)?
> >> it seems to be as.
> >
> > Can you please share the config and JVM info that is output at the head
> of
> > graphdb/messages.log ?
> >> see here http://pastebin.com/0geHdbNu
> >
> >
> >
> > --
> > View this message in context:
> http://neo4j-community-discussions.438527.n3.nabble.com/Big-Traverser-perfomance-are-23-rels-per-milliseconds-good-tp3400711p3400925.html
> > Sent from the Neo4j Community Discussions mailing list archive at
> Nabble.com.
> > ___
> > Neo4j mailing list
> > User@lists.neo4j.org
> > https://lists.neo4j.org/mailman/listinfo/user
>
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



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