Newer
Older
from yams.buildobjs import EntityType, RelationDefinition, String
from cubicweb.schema import WorkflowableEntityType
# Worklowable entity type to check the container structure ignores
# workflow-related rtypes.
class Agent(WorkflowableEntityType):
"""An agent (eg. person, group, software or physical artifact)."""
name = String()
class knows(RelationDefinition):
subject = 'Agent'
object = 'Agent'
symmetric = True
class OnlineAccount(EntityType):
"""An online account"""
class account(RelationDefinition):
"""Indicates an account held by an agent"""
subject = 'Agent'
object = 'OnlineAccount'
cardinality = '*1'
composite = 'subject'
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
class Biography(EntityType):
"""Biography"""
class biography(RelationDefinition):
subject = 'Agent'
object = 'Biography'
cardinality = '?1'
composite = 'subject'
inlined = True
class Event(EntityType):
"""Event in the life of an Agent, gathered in its Biography"""
class Anecdote(EntityType):
"""Short story, not as important as an Event"""
class event(RelationDefinition):
subject = 'Biography'
object = ('Event', 'Anecdote')
cardinality = '*1'
composite = 'subject'
class narrated_by(RelationDefinition):
subject = 'Anecdote'
object = 'Agent'
cardinality = '?*'
composite = 'object'
class Group(EntityType):
"""A collection of individual agents"""
class member(RelationDefinition):
"""Indicates a member of a Group."""
subject = 'Group'
object = 'Agent'