[Cubicweb] About SubjectRelation and RelationType differences
aurelien.campeas at logilab.fr
Fri May 25 17:16:43 CEST 2012
Le 25/05/2012 17:14, Sylvain Thénault a écrit :
> On 25 mai 14:48, Nicolas Chauvat wrote:
>> On Fri, May 25, 2012 at 02:20:50PM +0200, Stéphane Bugat wrote:
>>> It is not clear to me from the CW documentation in which cases it is
>>> better to use a SubjectRelation attribute or a RelationType relation
>>> between two entities in my scheme. As far as I understood,
>>> SubjectRelation is more dedicated to "inlined" relations where both
>>> entities are strongly correlated, whereas RelationType refers to
>>> more complex types of relations where both entities may refer to
>>> very different objects. Although both of them seem to lead to the
>>> same scheme, so maybe there is nothing to worry about...
>> yams knows about Entities and Relationships. SubjectRelation,
>> RelationType and RelationDefinition are different ways to define the
>> same thing: a Relation.
> Though there is some subtilities...
> RelationType defines only a semantic kind of relation, e.g. 'documented_by'.
> RelationDefinition defines a 3-uple subject relation-type object, e.g. 'Project documented_by File'.
> SubjectRelation is just a syntactic sugar for RelationDefinition.
> Now, some yams properties such as inlined are common to all relations
> of a given type, while some others are defined per definition.
> Definition properties that are defined on a relation type means "force all
> relation definition to have this value for this property".
there is no override mechanism ?
are there warnings if an rtype AND an rdef compete to define such a ppty ?
More information about the Cubicweb