Add getvid as an attribute

Hi all,

I am trying to add the vertex id as an attribute. for some reason, I am getting “no type can be inferred” error.

The code:

Result = SELECT m
FROM Movie:m
WHERE m.title == “”
POST-ACCUM
m.title = getvid(m);

PRINT Result;

Thanks

Hi yaakovtayeb,

Could you provide some more information about the schema of your graph so we can get a better understanding of where that error might be coming from?

You can also set a vertex id as an attribute through your schema by selecting the ‘As Attribute’ checkbox, or using the WITH primary_id_as_attribute="true" option at the end of your CREATE VERTEX statement.

Thanks Dan.

This is the schema:

regarding the movie vertex its:
CREATE VERTEX Movie (PRIMARY_ID id string, title string, description string, avg_vote float, votes int, duration int, country string, date_published datetime, data1 float, data2 float)

for some weird reason I upload the string to the title but on some cases (~15% of the data) it didn’t uploaded even though the id and title are the same. so I wanted to fix it.

Any ideas?

@yaakovtayeb When designing the schema did you click the checkbox for [x] Primary ID as an attribute?

Sometimes data will load “weird” if you have escape charters in your titles. If you are doing comma-separated values sometimes there are commas in certain data fields. One thing to look into.

1 Like

Thanks Jon.

I changed the CSV file into TSV file and it indeed solves the problem. Moved to ‘\t’ separator for goods.
Thanks.

1 Like