[Neo4j] Attributes vs Properties in Data Modeling?
The blog entry "Modeling Categories in a Graph Database" (http://blog.neo4j.org/2010/03/modeling-categories-in-graph-database.html) provides an example for modeling a store with products, and the product attributes are modeled as separate nodes instead of storing the data in a single product node, using the node property key/value pairs. The article says: "What can't be expressed nicely in the ER-Diagram are the attribute values, as the actual names of those attributes are defined as data elsewhere in the model. This mix of metadata and data may be a problem when using other underlying data models, but for a graph database, this is actually how it's supposed to be used." Are you saying that you should generally store attribute data individually in separate nodes rather than storing the data as node properties? For example, here is a blog entry with its data contained in one node, using the node-property key/value pairs: entry = graphdb.node( Title="Some Title", Summary="", Body="bla bla bla", langauge="US", Created=2010-12-24, Published=2010-12-24, Revised=2010-12-24) Alternatively, you could set it up so that the attributes in separate nodes: attribute_subref_node = Subreference.Node.ATTRIBUTE_ROOT(graphdb) attribute_subref_node.ATTRIBUTE_TYPE(title_node) attribute_subref_node.ATTRIBUTE_TYPE(summary_node) attribute_subref_node.ATTRIBUTE_TYPE(body_node) attribute_subref_node.ATTRIBUTE_TYPE(language_node) attribute_subref_node.ATTRIBUTE_TYPE(published_date_node) attribute_subref_node.ATTRIBUTE_TYPE(revision_date_node) When should you choose one way over the other? Thanks. James ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] Merry Xmas everyone!
Hi there, just wanted to wish everyone who is affected a great holiday and a Happy New Year! 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. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Transaction and REST API
The way I see it in REST architecture Resource is anything of interest which in simple words can be either data or functionality. After we create ListResource and IndividualResource for each data item we have in our business domain (which already put 2:1 ratio between resources and domain model) it is time to add the functionality resource. In bank application there might be a resource for transferring money between accounts. There is no TransferMoneyData (although there usually a log entry for that) but it is an interesting functionality of the service. My question is Should I have a generic Transaction resource to allow atomic changes to any resource in my service which represent data? Thank you, Ido On Thu, Dec 23, 2010 at 11:47 AM, Jim Webber wrote: > Hi Ido, > > > > BULK resource are not so likable on RESTful people, but I guess it can > work > > really well for my case. > > I think you're both right and wrong here :-) > > You're wrong when you say RESTful people don't like bulk updates. We do, > but we prefer those updates to be just the same as any other update - that > is a PUT (usually) to a resource that represents many individual entities in > the DB. > > People who don't understand REST will complain that there is no atomicity > when the have to PUT updates to individual resources where there is a 1:1 > mapping between resources and the domain model. In general, O(resources) >> > O(domain entities) in a RESTful system. > > You're right when you say it's a good fit for your use case - because it's > the right thing to do. > > Merry Christmas, > > 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