Can't load a graql file ..!


#1

Hi ! I am new to grakn and graql. When tried to load the following ontology it gives following message while try to load a graql file listed below…

error : The concept [Base Type [ENTITY_TYPE] - Id [8216] - Label [artist] - Abstract [false] ] is not of type [interface ai.grakn.concept.RoleType]

when i used “has-resource” instead of "has"it throws a syntax error

insert

#add resources

artist_gid sub resource datatype string;
artist_title sub resource datatype string;
artist_area sub resource datatype string;
release_group_gid sub resource datatype string;
release_group_title sub resource datatype string;
recording_group sub resource datatype string;
recording_gid sub resource datatype string;
recording_title sub resource datatype string;
#work_gid sub resource datatype string
#work_name sub resource datatype string



#add entities

artist sub entity
	has artist_gid
	has artist_title
	has artist_area;

recording sub entity
	has recording_group
	has recording_gid
	has recording_title;

release_group sub entity
	has release_group_gid
	has release_group_title;

# add releations

performs sub relation
	relates artist
	relates recording
	has artist_gid
	has recording_group;


release sub relation
	relates artist
	relates release_group
	relates recording
	has release_group_gid
	has artist_gid
	has recording_gid;

#2

Hi @albincorreya,

The error you are getting is due to using artist as both an EntityType and a RoleType. Specifically you did the following:

artist sub entity
	...;

then later you did

performs sub relation
	relates artist
	...;

this is not allowed. The related keyword must be followed by a RoleType. So in your case you could do something like:

artist sub role;
person plays artist;
performs sub relation
	relates artist
	...;

In this case you are saying that the EntityType person can be an artist and an artist is part of the performs Relation Type