/* Node data structure */
typedef struct node {
	id* node_id;
	str type;
	in prop_num;

	// Array of pointers to nodes properties
	int properties[prop_num];

	return node_id;

} Object;

/* Edge data-structure */
typedef struct edge {
	id* edge_id;
	str type;
	id* src;
	id* targ;
	return edge_id;

} Object;

/* Property data-structure */
typedef struct prop {
	id* property_id;
	id* node_id;
	str prop_name;
	str prop_val
	return property_id;

} Object;

/* Used to read in CSV File */
const char* getfield(char* line, int num)
{
    const char* tok;
    for (tok = strtok(line, ";");
            tok && *tok;
            tok = strtok(NULL, ";\n"))
    {
        if (!--num)
            return tok;
    }
    return NULL;
}

/* Import Node CSV / Import Edge CSV / Assign Pointers between Graph IDs */
int main(string, string*) {

	int file_row = 0;
	// Arry of property names
	str p_names[line.length - 1];

	/* Read Input String as File Path Directory */
	FILE* stream = fopen("input", "r");
    	char line[1024];
    	while (fgets(line, 1024, stream))
    	{
		/* The first row will have the titles of the columns - first column is node ID, second node type, rest property names

		// Need an array to store the names of prop
		file_row = file_row + 1;
        	char* tmp = strdup(line);
		
		/* the index of the getfield attribute gets you the index of each column element */

		// Rows as Nodes / Properties with pointer link
		if( file_row == 0 ) {
			str val
			int prop_num = 0;
      			for ( x = 2; x < line.length; x++ ) {
				str val = getfield(tmp, x);
				p_names[prop_num] = val;
			}
   		}
   		else {
			str node_id = getfield(tmp, 0);
			str node_type = getfield(tmp, 1);
			id* node_make = node(node_id, node_type);

			for ( x = 2; x < line.length; x++ ) {
				str val = getfield(tmp, x);
				str prop_pointer* = prop(p_names[x], val);
				node.properties.add(prop_pointer);
			}
   		}

        	free(tmp);
    	}

	clean tmp;
	return 0;
}
