You have to take into account these aspects:
1. N4J is schemaless, so a node represeting a "record" may not have the same properties as another node representing the same "type" of element. That's the nature of the db and it's suitable for most use cases.
2. There can't be null property values. You can't set "FirstName" to null, for example. That will raise an IllegalArgumentException.
Try checking your data model constrains at application level, not at db level. Yeah, this can be a downside depending on the point of view.
Charles Edward Bedón Cortázar
Network Management, Data Analysis and Free Software http://www.neotropic.co | Follow Neotropic on Twitter
Open Source Network Inventory for the masses! http://kuwaiba.sourceforge.net | Follow Kuwaiba on Twitter
Linux Registered User #386666
---- Am Wed, 15 Aug 2012 20:17:01 -0500 Michael Hunger <michael.hun...@neopersistence.com> schrieb ----
All your properties except the id are nullable so what do want to enforce?
Which language/deployment ?
Why do you want to enforce the attributes?
Sent from mobile device
Am 15.08.2012 um 21:33 schrieb Christopher Hydak <chy...@identropy.com>:
I'm having some difficulties making the transition from a traditional schema-based database to a graph database and I was hoping that someone here can beat the truth into me. I am creating a user store, which obviously can have many relationships and attributes. It makes certain sense to use a graphdb for this type of data, but I can't get over how I can enforce required attributes when creating a new person. I find that I want to create a template graph that is pretty much the same thing as a schema. Is that even possible in neo4j or am I missing the point?
Here is a sample SQL schema for a person object that I am using.
CREATE TABLE [dbo].[Users](
[UID_Person] [nvarchar](38) NOT NULL,
[FirstName] [nvarchar](50) NULL,
[LastName] [nvarchar](50) NULL,
[DepartmentUID] [nvarchar](38) NULL,
[WorkPhone] [nvarchar](15) NULL,
[ManagerUID] [nvarchar](38) NULL,
CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED