# HG changeset patch # User Adrien Di Mascio # Date 1248347242 -7200 # Node ID ed85d69576b435799d245973fef1c57eece52013 # Parent 1d46c016a564633551ed71e786f3569072bd151e add sameAs support in cubicweb standard schema diff -r 1d46c016a564 -r ed85d69576b4 schemas/base.py --- a/schemas/base.py Thu Jul 23 13:03:50 2009 +0200 +++ b/schemas/base.py Thu Jul 23 13:07:22 2009 +0200 @@ -205,6 +205,29 @@ """generic relation to link one entity to another""" symetric = True +class ExternalUri(EntityType): + """a URI representing an object in external data store""" + uri = String(required=True, unique=True, maxsize=256, + description=_('the URI of the object')) + +class same_as(RelationType): + """generic relation to specify that an external entity represent the same + object as a local one: + http://www.w3.org/TR/owl-ref/#sameAs-def + + NOTE: You'll have to explicitly declare which entity types can have a + same_as relation + """ + permissions = { + 'read': ('managers', 'users', 'guests',), + 'add': ('managers', 'users'), + 'delete': ('managers', 'owners'), + } + cardinality = '*1' + symetric = True + # NOTE: the 'object = ExternalUri' declaration will still be mandatory + # in the cube's schema. + object = 'ExternalUri' class CWCache(EntityType): """a simple cache entity characterized by a name and