Re: [Neo] General questions

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

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

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

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

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

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


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

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

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




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


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


[Neo] General questions

2010-05-01 Thread ilya
Hi all,

 

I went through all docs on Neo site and it looks very interesting.  However,
I still have couple of things I was wondering about that I couldn’t find
answers to.  I hope I can get some information or someone can point me in
the right direction on some of these.

Sorry for many questions but really appreciate it even if only some can be
answered.

 

1)  Inheritance.
Suppose I want to draw tree where every node is derived from other node; say
Car à Sedan à Toyota
So when creating Toyota node I don’t need to recreate same properties and
relationships that Sedan has.

Is there something in Neo that will help me achieve this? If not what’s the
best (or good approach) of achieving this? (ie assuming I use Java  - should
I keep my own class hierarchy?)
At the same time I wonder how this structure will affect indexing/searching
(ie find all car/sedan/Toyotas)



2)  Multi value properties
When it come to properties I see I can store key=value pairs but what if I
want to store key=values
For example, I’d like to have property possibleColors where my values are
red, blue, green, etc

Do I need to create separate nodes and properties for each color?



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



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

 

5)  Neo clustering (load balancing) / accessing from multiple sources
>From what I read I understand that Neo only accessible from JVM that runs
it.
So if I want to access it from the web I would probably setup Application
server such as JBoss and have it run in the same JVM.  How does one address
the following:

-  In case I want to do load balancing say run 2 JBoss instances in
cluster mode that need to access Neo? 

-  What if I want to connect to Neo both via web and via stand alone
process (probably run on different machine) for batch processing.



Sorry for too many questions but these are really important for my
architecture.

 

Thanks a lot,

Ilya

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


[Neo] General questions

2010-05-01 Thread ilya
Hi all,

 

I went through all docs on Neo site and it looks very interesting.  However,
I still have couple of things I was wondering about that I couldn’t find
answers to.  I hope I can get some information or someone can point me in
the right direction on some of these.

Sorry for many questions but really appreciate it even if only some can be
answered.

 

1)  Inheritance.
Suppose I want to draw tree where every node is derived from other node; say
Car à Sedan à Toyota
So when creating Toyota node I don’t need to recreate same properties and
relationships that Sedan has.

Is there something in Neo that will help me achieve this? If not what’s the
best (or good approach) of achieving this? (ie assuming I use Java  - should
I keep my own class hierarchy?)
At the same time I wonder how this structure will affect indexing/searching
(ie find all car/sedan/Toyotas)



2)  Multi value properties
When it come to properties I see I can store key=value pairs but what if I
want to store key=values
For example, I’d like to have property possibleColors where my values are
red, blue, green, etc

Do I need to create separate nodes and properties for each color?



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



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

 

5)  Neo clustering (load balancing) / accessing from multiple sources
>From what I read I understand that Neo only accessible from JVM that runs
it.
So if I want to access it from the web I would probably setup Application
server such as JBoss and have it run in the same JVM.  How does one address
the following:

-  In case I want to do load balancing say run 2 JBoss instances in
cluster mode that need to access Neo? 

-  What if I want to connect to Neo both via web and via stand alone
process (probably run on different machine) for batch processing.



Sorry for too many questions but these are really important for my
architecture.

 

Thanks a lot,

Ilya

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


Re: [Neo] indexing mode on MetamodelProperties

2010-05-01 Thread Niels Hoogeveen

Thanks Mattias,
Having added this. I wonder if it would be a good idea to have a length 
attribute on MetaModelProperty, like found in schemas of all relational 
databases. For string properties such an attribute makes perfect sense, for 
ints and longs such an attribute only makes sense as long as the length 
attribute lies within the range of the underlying primitives, but for chars, 
bytes and booleans the attribute makes no sense at all. 
We could opt for spelling out all specific propertytypes, automatically 
assigning them with the correct DatatypeClassRange and only providing a length 
attribute on those propertytypes where a length attribute makes sense. 
Any thoughts on this?
Niels
> Date: Sat, 1 May 2010 08:49:35 +0200
> From: matt...@neotechnology.com
> To: user@lists.neo4j.org
> Subject: Re: [Neo] indexing mode on MetamodelProperties
> 
> Great, good to see you progressing with the meta model!
> 
> 2010/5/1, Niels Hoogeveen :
> >
> > Today I added an indexing mode to MetamodelProperties, with the following
> > options.
> > NO_INDEX (default)INDEX UNIQUE_INDEXFULL_TEXT_INDEX
> > The functionality added does not perform any indexing itself, but provides
> > information about which properties need to be indexed and what mode of
> > indexing needs to used. 
> > _
> > Express yourself instantly with MSN Messenger! Download today it's FREE!
> > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
> > ___
> > Neo mailing list
> > User@lists.neo4j.org
> > https://lists.neo4j.org/mailman/listinfo/user
> >
> 
> 
> -- 
> Mattias Persson, [matt...@neotechnology.com]
> Hacker, Neo Technology
> www.neotechnology.com
> ___
> Neo mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
  
_
New Windows 7: Simplify what you do everyday. Find the right PC for you.
http://windows.microsoft.com/shop
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] Event framework has landed

2010-05-01 Thread Georg M. Sorst
Hi Mattias, hi list

that's just what I've been looking for, congratulations on the amazing 
progress you are making on Neo4j!

I am actually trying to use the TransactionEventHandler to implement 
automatic versioning similar to what was discussed a while ago. The 
beforeCommit() handler seems like a perfect fit and provides all the 
data I need.

Still, I have one problem: in beforeCommit() I fetch and increment a 
revision number that's stored in a special node and use that number to 
build the current revision structure. This brings up a few questions:

1. How atomic are Neo4j commits? Will two concurrent commits interfere 
when getting and incrementing the revision number?

2. How can I return the revision number from the TransactionEventHandler 
so I can use it in the caller (my service classes in this case)?

3. The caller should be able to pass data to the transaction, for now 
just the commit message. Of course I can temporarily store this in a 
node or attach it to the thread etc. but that just seems wrong. How can 
I do this right?

Thanks and best regards,
Georg

On 27.04.2010 10:15, Mattias Persson wrote:
> Hi everyone!
>
> I'm quite pleased to announce that the new event framework has been
> committed in kernel 1.1-SNAPSHOT. After feedback from you guys the framework
> got quite small and cosy. Here's a summary.
>
> *TransactionEventHandler*
> can be registered at a GraphDatabaseService and will thereafter recieve
> diffs of modifications made in each transaction before and after they are
> committed. The transaction can still be modified in beforeCommit() and that
> method can also throw an exception to prevent the transaction from
> committing, causing a TransactionFailureException to be thrown from the code
> which is committing the transaction.
>
> *KernelEventHandler*
> can be registered at a GraphDatabaseService and will receive notifications
> about when a shutdown is about to occur for the GraphhDatabaseService
> instance. It will also receive notifications about "kernel panics" which is
> a state which the kernel can come to from where it cannot continue without
> needing to be restarted. An example of such an error would be a hard drive
> breakdown or when no more space is left on the device the graph database is
> running on.
>
> The next step is to write an "auto indexer" for the IndexService so that
> that you won't have to do the manual indexService.index( node, key, value )
> anymore. Another thing would be to remove (deprecate) the
> IndexService#shutdown() method as it no longer would be required.
>
> So it'd be great if you guys would try this out and tell us how it feels.
>

-- 
Georg M. Sorst
Dipl. Inf. (FH)

http://vergiss-blackjack.de

Ignaz-Harrer-Str. 13 / Top 19
5020 Salzburg
Österreich

Tel: +43 (0)650 / 53 47 200
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user