[Cubicweb] About SubjectRelation and RelationType differences

Sylvain Thénault sylvain.thenault at logilab.fr
Fri May 25 17:44:16 CEST 2012

On 25 mai 17:16, Aurélien Campéas wrote:
> Le 25/05/2012 17:14, Sylvain Thénault a écrit :
> >>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".
> force ?

force. I.e. yams will complain with an error in case of conflicting values.

> there is no override mechanism ?

you can still change values / delete attributes on the class inheriting
the RelationType.

> are there warnings if an rtype AND an rdef compete to define such a ppty ?

see above

Sylvain Thénault, LOGILAB, Paris ( - Toulouse (
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
CubicWeb, the semantic web framework:    http://www.cubicweb.org

More information about the Cubicweb mailing list