2009/7/17 Andreas Kollegger <akolleg...@tembopublic.org>:
> Glancing through the neo-rdf code, it does look to use neo-meta, as
> does owl2neo (though that package appears to be using an older version
> of the neo-meta api). Not sure how the components use neo-meta.
>
> Mattias, thanks for the guidance about establishing the relationship
> between neilPert and his lugwigKit. Are there plans for expressing
> these kinds of things through the API, so that the class restrictions
> will get applied?
There hasn't been a strong usecase to drive it forward so such
features hasn't been implemented yet. Any useful such additions and
improvements are very welcome indeed.
>
> Also, what about simple properties like strings? That should be a
> regular node property, right? So, to name neilPert I'd say:
>
> MetaStructureProperty name = namespace.getMetaProperty("name", true);
> artist.getDirectProperties().add(name);
> neilPert.setProperty(name.getName(), "Neil Pert");
>
> Best,
> Andreas
>
> On Jul 17, 2009, at 5:51 AM, Rob Challen wrote:
>
>> Can the neo-meta package be used within a neo-rdf / neo-rdf-sail
>> implementation? I would guess there would need to be the same handling
>> of namespaces, and depend on the underlying representation of the RDF
>> in neo....
>>
>> for example something like this as an alternative to the above:
>>
>> org.neo4j.rdf.model.Resource neilPert;
>> drummer.getInstances().add(neilPert.nativeRepresentation());
>>
>> How does all of this relate to the owl2neo component? is the owl2neo
>> stuff built on top of the neo-meta package?
>>
>> Cheers,
>>
>> Rob.
>>
>>
>> On Thu, Jul 16, 2009 at 9:17 PM, Mattias Persson
>> <matt...@neotechnology.com> wrote:
>>>
>>> Right, we should probably add such a method. What you can do is:
>>>
>>> DynamicRelationshipType.withName( plays.getName() )
>>>
>>> to get that relationship type ("plays").
>>>
>>> 2009/7/16 Andreas Kollegger <akolleg...@tembopublic.org>:
>>>> It just occurred to me that I started a thread before the weekend to
>>>> which I need to respond. Before I get back to that, I have a
>>>> practical
>>>> question about using neo-meta.
>>>>
>>>> Consider the following code snippet (a realization of the neo-meta
>>>> introduction):
>>>>
>>>>           MetaStructureClass artist =
>>>> namespace.getMetaClass("artist", true);
>>>>           MetaStructureProperty plays =
>>>> namespace.getMetaProperty("plays",
>>>> true);
>>>>           artist.getDirectProperties().add(plays);
>>>>           MetaStructureClass drummer =
>>>> namespace.getMetaClass("drummer",
>>>> true);
>>>>           artist.getDirectSubs().add(drummer);
>>>>           MetaStructureClass instrument =
>>>> namespace.getMetaClass("instrument", true);
>>>>           MetaStructureClass drums =
>>>> namespace.getMetaClass("drums", true);
>>>>
>>>>           drummer.getDirectSupers().add( artist );
>>>>           drums.getDirectSupers().add( instrument );
>>>>
>>>>           plays.setRange( new
>>>> MetaStructureClassRange( instrument ) );
>>>>           MetaStructureRestriction playsRestriction =
>>>>               drummer.getRestriction( plays, true );
>>>>           playsRestriction.setRange( new
>>>> MetaStructureClassRange( drums ) );
>>>>           playsRestriction.setCardinality( 1 );
>>>>
>>>>        Transaction tx = neo.beginTx();
>>>>        try {
>>>>                   Node neilPert = neo.createNode();
>>>>                   drummer.getInstances().add(neilPert);
>>>>
>>>>                   Node ludwigKit = neo.createNode();
>>>>                   drums.getInstances().add(ludwigKit);
>>>>
>>>>        }
>>>>        finally
>>>>        {
>>>>               tx.finish();
>>>>        }
>>>>
>>>> ...
>>>>
>>>> That lets me get to the point of saying that neilPert is a drummer,
>>>> and that ludwigKit is an instance of drums. What I'm not clear about
>>>> is how to express that "neilPert plays ludwigKit".
>>>>
>>>> I need to establish a relationship between neilPert and lugwigKit,
>>>> but
>>>> am not sure the proper way to do that. I think I want something
>>>> like:
>>>>
>>>>
>>>> neilPert.createRelationshipTo(ludwigKit,
>>>> plays.getRelationshipType());
>>>>
>>>> What's the correct way to do this?
>>>>
>>>>
>>>> Thanks for any guidance,
>>>> Andreas
>>>>
>>>> _______________________________________________
>>>> 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
>
> _______________________________________________
> 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