Well, the meta structure is really just a helper for keeping data
according to a certain structure... if you make those checks against
it yourself, that is. There's nothing automatic in validation or
insertion by using this framework as of yet.

Inserting data is still done by using the neo4j API...
NeoService#createNode(), Node#setProperty( String, Object ) a.s.o. See
http://wiki.neo4j.org/ for more info there.

2009/8/4 Jerry Juanico <jtjuan...@gmail.com>:
> Oh I see,
> Maybe I have to refresh again.
> Anyway, just another question.
> For example I already have configured the meta structure, with all the data
> type( string, integer...), data range, etc.
> Can you give an idea on how can I use or put values in it?
> I'm lost here. Thanks.
>
> Jers
>
> On Mon, Aug 3, 2009 at 11:08 PM, Mattias Persson
> <matt...@neotechnology.com>wrote:
>
>> 2009/8/3 Jerry Juanico <jtjuan...@gmail.com>:
>> > Using the sample provided I was able to retrieve the properties, but what
>> I
>> > wanted  is to be able to put values in it.
>> > Here is a sample code:
>> >        MetaStructureClass employee = namespace.getMetaClass( "employee",
>> > true );
>> >        MetaStructureProperty firstName = namespace.getMetaProperty(
>> > "firstName", true );
>> >        firstName.setRange( new DatatypeClassRange( String.class ) );
>> >        MetaStructureProperty lastName = namespace.getMetaProperty(
>> > "lastName", true );
>> >        lastName.setRange( new DatatypeClassRange( String.class ) );
>> >        MetaStructureProperty middleName = namespace.getMetaProperty(
>> > "middleName", true );
>> >        middleName.setRange( new DatatypeClassRange( String.class ) );
>> >        MetaStructureProperty age = namespace.getMetaProperty( "age", true
>> > );
>> >        age.setRange( new DatatypeClassRange( Integer.class ) );
>> >        employee.getDirectProperties().add( firstName );
>> >        employee.getDirectProperties().add( lastName );
>> >        employee.getDirectProperties().add( middleName );
>> >        employee.getDirectProperties().add( age );
>> >
>> > My objective is to put/add property values to the ff as in:
>> > firstName = "John";
>> > lastName = "Doe";
>> > middleName = "Smith";
>> > age = 25;
>> >
>> > That's what I understand using meta structure, but would that be
>> possible?
>> > If yes can you please show me how?
>> >
>> > Thanks.
>> >
>> > Jers
>> >
>>
>> May I ask what ff means? And currently there's no way of inserting
>> data via the meta structure... that'd certainly be nice to have, but
>> you have to do those things manually at the moment.
>>
>> >
>> > On Mon, Aug 3, 2009 at 9:30 PM, Mattias Persson
>> > <matt...@neotechnology.com>wrote:
>> >
>> >> Oh ok, you use the same methods for getting the classes and properties
>> >> as for creating them:
>> >> (the true/false 2:nd argument is the "allowCreate" option, so that if
>> >> true then the class/property will be created if it didn't already
>> >> exist).
>> >>
>> >> MetaStructureClass myClass =
>> >>    namespace.getMetaClass( "myClass", false );
>> >> MetaStructureProperty myProperty =
>> >>    namespace.getMetaProperty( "myProperty", false );
>> >> myProperty.setCardinalty( 1 );
>> >>
>> >> for ( MetaStructureProperty propertyAssociatedWithMyClass :
>> >>    myClass.getDirectProperties() )
>> >> {
>> >> }
>> >> ...or...
>> >> for ( MetaStructureProperty propertyAssociatedWithMyClass :
>> >>    myClass.getAllProperties() )
>> >> {
>> >> }
>> >>
>> >>
>> >> At least that's what I think you mean :)
>> >>
>> >> 2009/8/3 Jerry Juanico <jtjuan...@gmail.com>:
>> >> > Hi Mattias,
>> >> >
>> >> > With this information I was able to fix my dilemma.Thanks.
>> >> >
>> >> > One more thing. OK I already set-up the schema.
>> >> > Along with it is the expected values, range, data type, etc.
>> >> >
>> >> > But the thing is I cannot access or put values on the properties that
>> I
>> >> have
>> >> > created.
>> >> > I ran out of options, can u give me some hint?
>> >> > Thanks again
>> >> >
>> >> > Jers
>> >> >
>> >> > On Mon, Aug 3, 2009 at 5:39 PM, Mattias Persson
>> >> > <matt...@neotechnology.com>wrote:
>> >> >
>> >> >> Hi,
>> >> >>
>> >> >> I think you'd like to use something like this:
>> >> >>
>> >> >> MetaStructureClass userClass = ...
>> >> >> MetaStructureClass accountClass = ...
>> >> >> MetaStructureProperty userHasAccount =
>> >> >>    namespace.getMetaProperty( "user_has_account", true );
>> >> >> userClass.getDirectProperties().add( userHasAccount );
>> >> >> userHasAccount.setRange(
>> >> >>    new MetaStructureClassRange( accountClass ) );
>> >> >>
>> >> >> Is that what you're looking for?
>> >> >>
>> >> >> 2009/8/3 Jerry Juanico <jtjuan...@gmail.com>:
>> >> >> > Hi All,
>> >> >> >
>> >> >> > I am currently working with one of the features of ne04j, which is
>> the
>> >> >> meta
>> >> >> > structure.
>> >> >> > I have tried implementing the test examples and it works fine.
>> >> >> > But the whole concept is still vague to me.
>> >> >> >
>> >> >> > I have noticed that the relationship type is automatic once I
>> invoke
>> >> the
>> >> >> > class and property instance.
>> >> >> >
>> >> >> > I am expecting that it's possible to defined specific relationship
>> >> type
>> >> >> as I
>> >> >> > did in a simple node/relationship/property structure, but I cannot
>> >> find
>> >> >> any
>> >> >> > from the list of  meta structure API.
>> >> >> >
>> >> >> > Can someone tell me how?
>> >> >> >
>> >> >> > Thanks.
>> >> >> >
>> >> >> > Jerry
>> >> >> > _______________________________________________
>> >> >> > Neo mailing list
>> >> >> > User@lists.neo4j.org
>> >> >> > https://lists.neo4j.org/mailman/listinfo/user
>> >> >> >
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> Mattias Persson, [matt...@neotechnology.com]
>> >> >> Neo Technology, www.neotechnology.com
>> >> >> _______________________________________________
>> >> >> 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
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Mattias Persson, [matt...@neotechnology.com]
>> >> Neo Technology, www.neotechnology.com
>> >> _______________________________________________
>> >> 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
>> >
>>
>>
>>
>> --
>> Mattias Persson, [matt...@neotechnology.com]
>> Neo Technology, www.neotechnology.com
>> _______________________________________________
>> 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
>



-- 
Mattias Persson, [matt...@neotechnology.com]
Neo Technology, www.neotechnology.com
_______________________________________________
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to