Commit abb83aca authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

Only define Agent if it doesn't exists yet

When the seda cube is used from saem_ref, an Agent type is already provided by
the prov cube. We should probably to that differently at some point, but that is
enough to move on for now.
parent 4cec18e07edf
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
# with this program. If not, see <http://www.gnu.org/licenses/>. # with this program. If not, see <http://www.gnu.org/licenses/>.
"""cubicweb-seda schema""" """cubicweb-seda schema"""
from yams.reader import context
from yams.buildobjs import EntityType, RelationType, RelationDefinition from yams.buildobjs import EntityType, RelationType, RelationDefinition
from yams.buildobjs import String from yams.buildobjs import String
...@@ -76,14 +77,6 @@ class seda_keyword_reference_to_scheme(RelationDefinition): ...@@ -76,14 +77,6 @@ class seda_keyword_reference_to_scheme(RelationDefinition):
inlined = True inlined = True
class Agent(EntityType):
"""An agent is something that bears some form of responsibility for an
activity taking place, for the existence of an entity, or for another
agent's activity.
"""
name = String(required=True, fulltextindexed=True)
class container(RelationType): class container(RelationType):
__permissions__ = {'add': (), 'delete': (), 'read': ()} __permissions__ = {'add': (), 'delete': (), 'read': ()}
cardinality = '1*' cardinality = '1*'
...@@ -124,6 +117,15 @@ kind = skos.Label.get_relation('kind') ...@@ -124,6 +117,15 @@ kind = skos.Label.get_relation('kind')
kind.indexed = True kind.indexed = True
if 'Agent' not in context.defined:
class Agent(EntityType):
"""An agent is something that bears some form of responsibility for an
activity taking place, for the existence of an entity, or for another
agent's activity.
"""
name = String(required=True, fulltextindexed=True)
def post_build_callback(schema): def post_build_callback(schema):
from cubes.seda import seda_profile_container_def, iter_all_rdefs from cubes.seda import seda_profile_container_def, iter_all_rdefs
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment