def process(self):
        """
        The original knowledge base is stored in triplets.
        This function will parse these triplets and build the DGLGraph.
        """
        root_path = self.raw_path
        entity_path = os.path.join(root_path, "entities.dict")
        relation_path = os.path.join(root_path, "relations.dict")
        train_path = os.path.join(root_path, "train.txt")
        valid_path = os.path.join(root_path, "valid.txt")
        test_path = os.path.join(root_path, "test.txt")
        entity_dict = _read_dictionary(entity_path)
        relation_dict = _read_dictionary(relation_path)
        train = np.asarray(
            _read_triplets_as_list(train_path, entity_dict, relation_dict)
        )
        valid = np.asarray(
            _read_triplets_as_list(valid_path, entity_dict, relation_dict)
        )
        test = np.asarray(
            _read_triplets_as_list(test_path, entity_dict, relation_dict)
        )
        num_nodes = len(entity_dict)
        num_rels = len(relation_dict)
        if self.verbose:
            print("# entities: {}".format(num_nodes))
            print("# relations: {}".format(num_rels))
            print("# training edges: {}".format(train.shape[0]))
            print("# validation edges: {}".format(valid.shape[0]))
            print("# testing edges: {}".format(test.shape[0]))

        # for compatability
        self._train = train
        self._valid = valid
        self._test = test

        self._num_nodes = num_nodes
        self._num_rels = num_rels
        # build graph
        g, data = build_knowledge_graph(
            num_nodes, num_rels, train, valid, test, reverse=self.reverse
        )
        (
            etype,
            ntype,
            train_edge_mask,
            valid_edge_mask,
            test_edge_mask,
            train_mask,
            val_mask,
            test_mask,
        ) = data
        g.edata["train_edge_mask"] = train_edge_mask
        g.edata["valid_edge_mask"] = valid_edge_mask
        g.edata["test_edge_mask"] = test_edge_mask
        g.edata["train_mask"] = train_mask
        g.edata["val_mask"] = val_mask
        g.edata["test_mask"] = test_mask
        g.edata["etype"] = etype
        g.ndata["ntype"] = ntype
        self._g = g

        The original knowledge base is stored in triplets.
        This function will parse these triplets and build the DGLGraph.
        
python/dgl/data/knowledge_graph.py