Discussion Forum

Error in loading schema file in grakn 2.0.1

I am using grakn 2.0.1 and grakn workbase 2.0.1. While adding schema to the workbase using grakn console i am getting this error '[TYW28] Invalid Type Write: The role type ‘role’ is already declared by a supertype of ‘userRoles’. Please check server logs for the stack trace '.

Here ‘userRoles’ is a relation which relates with ‘role’. And an entity named ‘roles’ plays ‘userRoles:role’ in my schema file. Please let me know how to resolve this.

Hi @Anupriya!

Welcome to the community. Just to clarify, how are you going about loading your schema file?

Can you provide more of your schema?

Hi @daniel !

Thanks for replying. Here is a part of my schema file for your reference.

roles sub entity,
owns roleName,
plays userRoles:role;

languages sub entity,
owns language,
owns languageAbbreviation,
plays userLanguages:languageKnown;

eduQualifications sub entity,
owns degreeName;

facilities sub entity,
owns facilityName,
plays hospitalFacilities:facility;

specialities sub entity,
owns specialityName,
plays doctorSpecialities:speciality;

cities sub entity,
owns cityName,
owns tier;

states sub entity,
owns stateName;

departments sub entity,
owns departmentName,
plays doctorDepartments:department;

userRoles sub relation,
relates user,
relates role,
owns isDirty,
owns isActive,
owns createdDate,
owns createdBy,
owns modifiedDate,
owns modifiedBy;

Thanks for this.

You aren’t allowed to use role as a role type as it is used in the backend of Grakn. Changing that type should allow you to load the schema via the console just fine.


Thanks…it worked by changing ‘role’ with some other word. Is there any file that i missed in grakn documentation in which i can get the reserved keywords? If it is please share the link.

here we are: https://dev.grakn.ai/docs/schema/overview#reserved-keywords

bit hard to find, not sure why search doesn’t turn them up…

@joshua Thanks for sharing!