{'fraction_non_alphanumeric': 0.0380467886389785, 'fraction_numerical': 0.009001285897985427, 'mean_word_length': 5.0186693822131705, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, 'https://': 8, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A Survey on Heterogeneous Graph Embedding: Methods, Techniques, Applications and Sources

Heterogeneous graphs (HGs) also known as heterogeneous information networks have become ubiquitous in real-world scenarios; therefore, HG embedding, which aims to learn representations in a lower-dimension space while preserving the heterogeneous structures and semantics for downstream tasks (e.g., node/graph classification, node clustering, link prediction), has drawn considerable attentions in recent years. In this survey, we perform a comprehensive review of the recent development on HG embedding methods and techniques. We first introduce the basic concepts of HG and discuss the unique challenges brought by the heterogeneity for HG embedding in comparison with homogeneous graph representation learning; and then we systemically survey and categorize the state-of-the-art HG embedding methods based on the information they used in the learning process to address the challenges posed by the HG heterogeneity. In particular, for each representative HG embedding method, we provide detailed introduction and further analyze its pros and cons; meanwhile, we also explore the transformativeness and applicability of different types of HG embedding methods in the real-world industrial environments for the first time. In addition, we further present several widely deployed systems that have demonstrated the success of HG embedding techniques in resolving real-world application problems with broader impacts. To facilitate future research and applications in this area, we also summarize the open-source code, existing graph learning platforms and benchmark datasets. Finally, we explore the additional issues and challenges of HG embedding and forecast the future research directions in this field.


INTRODUCTION
H ETEROGENEOUS graphs (HGs) [1], which are capable of composing different types of entities (i.e., nodes) and relations, also known as heterogeneous information network, have become ubiquitous in real world scenarios, ranging from bibliographic networks, social networks to recommendation systems. For example, as shown in Fig. 1(a), a bibliographic network (i.e., academic network) can be represented by a HG, which consists of four types of nodes (author, paper, venue, and term) and three types of edges (author-write-paper, paper-contain-term and conference-publish-paper); and these basic relations can be further derived for more complex semantics over the HG (e.g., author-write-paper-contain-item). It has been well recognized that HG is a powerful model that is able to embrace rich semantics and structural information in real world data. Therefore, researches on HG data have been experiencing tremendous growth in data mining and machine learning, many of which have been successfully applied in real world systems such as recommendation [2], [3], text analysis [4], [5], and cybersecurity [6], [7].
Due to the ubiquity of HG data, how to learn embed-dings of HG is a key research problem in various graph analysis applications, e.g., node/graph classification [8], [9], and node clustering [10]. Traditionally, to learn HG embeddings, matrix (e.g., adjacency matrix) factorization methods [11], [12] have been proposed to generate latent-dimension features in a HG. However, the computational cost of decomposing a large-scale matrix is usually very expensive, and also suffers from its statistical performance drawback [13], [14]. To address this challenge, heterogeneous graph embedding (i.e., heterogeneous graph representation learning), aiming to learn a function that maps input space into a lower-dimension space while preserving the heterogeneous structure and semantics, has drawn considerable attentions in recent years. Although there have been ample studies of embedding technology on homogeneous graphs [14] which consist of only one type of nodes and edges, these techniques cannot be directly applicable to HGs due to the heterogeneity of HG data. More specifically, i) the structure in HG is usually semantic dependent, e.g., metapath structure [8], implying that the local structure of one node in HG can be very different when considering different types of relations; ii) different types of nodes and edges have different attributes, which are usually located in different feature spaces, and thus when designing heterogeneous graph embedding methods, especially heterogeneous graph neural networks (HGNNs), we need to overcome the heterogeneity of attributes to fuse information [15], [16]; iii) another one is that HG is usually application dependent: for example, the basic structure of HG usually can be captured by meta-path, however meta-path selection is still challenging in reality, which may need sufficient domain knowledge. To tackle the above issues, various heteroge-neous graph embedding methods have been proposed [17], [18], [8], [9], [15], [2], many of which [19], [20], [6], [21], [22], [23] have demonstrated the success of heterogeneous graph embedding techniques deployed in real world applications including recommendation systems [2], [3], malware detection systems [7], [22], [23], [24], and healthcare systems [25], [26]. Although ample studies of heterogeneous graph embedding have been conducted with various applications in different fields, there have not been systematic and comprehensive survey on heterogeneous graph embedding methods with in-depth analysis of their pros and cons and detailed discussion of their transformativeness and applicability. To bridge this gap, in this paper, we will thoroughly survey the existing works on heterogeneous graph embedding, including representative methods and techniques, deployed systems in real world applications, and publicly available benchmark datasets as well as open-source code/tools. In particular, (1) we will explore recent progress of heterogeneous graph embedding, by introducing its representative methods and techniques with analysis of their pros and cons; then (2) we will introduce and discuss the transformativeness of existing heterogeneous graph embedding methods that have been successfully deployed in real-world applications; afterwards (3) we will summarize publicly available benchmark datasets and open-source code/tools to facilitate researchers and practitioners for future heterogeneous graph embedding works; and finally (4) we will discuss the additional issues and challenges of heterogeneous graph embedding technique and forecast the future research directions in this area. Note that different from the existing surveys which mainly focus on homogeneous graph embedding [14], [27], [28], [29], [30], [31], we aim at exploring the works on heterogeneous graph embedding. Although there have been few survey works on heterogeneous graph embedding [32], [33], we make our unique contributions in this work as summarized below.
• We first discuss the unique challenges brought by the heterogeneity of HG compared with homogeneous graphs; and then we provide a comprehensive survey of existing heterogeneous graph embedding methods, which are categorized based on the information they used in the learning process to address particular type of challenges posed by the HG heterogeneity. • For each representative heterogeneous graph embedding method and technique, we provide detailed introduction and further analyze its pros and cons. In addition, we explore the transformativeness and applicability of different types of HG embedding methods in the real-world industrial environments for the first time. • We summarize the open-source code and benchmark datasets, and give a detailed description to the existing graph learning platforms, to facilitate future research and applications in this area. • We also explore the additional issues and challenges of heterogeneous graph embedding and forecast the future research directions in this field.
The remainder of this survey paper is organized as follows. In Section 2, we first introduce the HG concepts and discuss the unique challenges of heterogeneous graph em-bedding due to the heterogeneity. In Section 3, we categorize and introduce heterogeneous graph embedding methods in details according to the information (e.g., structures, attributes, and application dependent domain knowledge) used in the learning process, based on which we analyze their pros and cons and then discuss their applicability. In Section 4, we further summarize the commonly used techniques in the state-of-the-art heterogeneous graph embedding methods. In Section 5, we further explore the transformativeness of existing heterogeneous graph embedding methods that have been successfully deployed in real-world application systems. Section 5 summarizes the benchmark datasets and open-source code/tools for heterogeneous graph embedding. Section 7 discusses additional issues/challenges of heterogeneous graph embedding and forecasts the future research directions in this field. Finally, Section 8 concludes the paper.

PRELIMINARY
In this section, we will first formally introduce the basic concepts in HG and illustrate the symbols used through this paper; and then we will elaborate the unique challenges brought by the heterogeneity of HG compared with homogeneous graphs.

Basic Concepts
HG is a graph consisting of different types of entities (i.e., nodes) and/or different types of relations (i.e., edges), which can be defined as follows.

Definition 1. Heterogeneous graph (or heterogeneous in-
formation network) [1]. A HG is defined as a graph G = {V, E}, in which V and E represent the node set and the link set, respectively. Each node v ∈ V and each link e ∈ E are associated with their mapping function φ(v) : V → A and ϕ(e) : E → R. A and R denote the node types and link types, respectively, where A + R > 2. The network schema for G is defined as S = (A, R), which can be seen as a meta template of a heterogeneous graph G = {V, E} with the node type mapping function φ(v) : V → A and the link type mapping function ϕ(e) : E → R. The network schema is a graph defined over node types A, with links as relations from R. Note that different meta-paths describe semantic relationships in different views. For example, the meta-path of "APA" indicates the co-author relationship and "APCPA" represents the co-conference relation. Both of them can be used to formulate the relatedness over authors. Although meta-path can be used to depict the relatedness over entities, it fails to capture a more complex relationship, such as motifs [35]. To address this challenge, meta-graph [36] is proposed to use a directed acyclic graph of entity and relation types to capture more complex relationship between two HG entities, defined as follows. Definition 3. Meta-graph [36]. A meta-graph T can be seen as a directed acyclic graph (DAG) composed of multiple meta-paths with common nodes. Formally, meta-graph is defined as T = (V T , E T ), where V T is a set of nodes and E T is a set of links. For any node v ∈ V T , φ(v) ∈ A; for any link e ∈ E T , ϕ(e) ∈ R.
An example meta-graph is shown in Fig. 1(d), which can be regarded as the combination of meta-path "APA" and "APCPA", reflecting a high-order similarity of two nodes. Note that a meta-graph can be symmetric or asymmetric [37]. To learn embeddings of HG data, we formalize the problem of heterogeneous graph embedding as follow. Definition 4. Heterogeneous graph embedding [13]. Heterogeneous graph embedding aims to learn a function Φ : V → R d that embeds the nodes v ∈ V in HG into a low-dimensional Euclidean space with d |V|. Table 1 summarizes symbols used through this paper.

Challenges of HG Embedding due to Heterogeneity
Different from homogeneous graph embedding [14], where the basic problem is preserving structure and property in node embedding [14]. Due to the heterogeneity, heterogeneous graph embedding imposes more challenges, which are illustrated below.
• Complex structure (the complex HG structure caused by multiple types of nodes and edges). In a homogeneous Relation-specific matrix of relation r w ij Weight of link between node i and node j Sr Heterogeneous similarity function with relation r Ct(i) Context nodes of node i with type t N i Neighbors of node i σ Sigmoid function Hadamard product ⊕ Concatenation operator graph, the fundamental structure can be considered as the so-called first-order, second-order, and even higherorder structure [38], [39], [40]. All these structures are well defined and have good intuition. However, the structure in HG will dramatically change depending on the selected relations. Let's still take the academic network in Fig.  1(a) as an example, the neighbors of one paper will be authors with the "write" relation, while with "contain" relation, the neighbors become terms. Complicating things further, the combination of these relations, which can be considered as a higher-order structure in HG, will result in different and more complicated structures. Therefore, how to efficiently and effectively preserve these complex structures is of great challenge in heterogeneous graph embedding, while current efforts have been made towards the meta-path structure [8] and meta-graph structure [41], etc. • Heterogeneous attributes (the fusion problem caused by the heterogeneity of attributes). Since the nodes and edges in a homogeneous graph have the same type, each dimension of the node or edge attributes has the same meaning. In this situation, node can directly fuse the attributes of its neighbors. However, in heterogeneous graph, the attributes of different types of nodes and edges may have different meanings [16], [15]. For example, the attributes of author can be the research fields, while paper may use keywords as attributes. Therefore, how to overcome the heterogeneity of attributes and effectively fuse the attributes of neighbors poses another challenge in heterogeneous graph embedding. • Application dependent. HG is closely related to the real world applications, while many practical problems remain unsolved. For example, constructing an appropriate HG may require sufficient domain knowledge in a real world application. Also, meta-path and/or metagraph are widely used to capture the structure of HG. However, unlike homogeneous graph, where the structure (e.g., the first-order and second-order structure) is well defined, meta-path selection may also need prior knowledge. Furthermore, to better facilitate the real world applications, we usually need to elaborately encode the side information (e.g., node attributes) [15], [16], [42], [43] or more advanced domain knowledge [2], [44], [45] to the heterogeneous graph embedding process.

METHOD TAXONOMY
Various types of nodes and links in HG bring different graph structures and rich attributes (i.e., heterogeneity). As discussed in Section 2.2, in order to make the node embeddings capture the heterogeneous structures and rich attributes, we need to consider the information of different aspects in the embedding, including graph structures, attributes and specific application labels, etc. Based on the aforementioned challenges, in this section, we categorize the existing methods into four categories based on the information they used in heterogeneous graph embedding: (1) Structure-preserved heterogeneous graph embedding. The methods belonging to this category primarily focus on capturing and preserving the heterogeneous structures and semantics, e.g., the meta-path and meta-graph.
(2) Attributeassisted heterogeneous graph embedding. The methods incorporate more information beyond structure, e.g., node and edge attributes, into embedding technology, so as to utilize the neighborhood information more effectively. (3) Applicationoriented heterogeneous graph embedding. We further explore the applicability of the heterogeneous graph embedding methods (i.e., the ones aim to learn application-oriented node embeddings over HG). (4) Dynamic heterogeneous graph embedding. Different from existing survey works that mainly focus on the embedding methods for static heterogeneous graphs. In this work, we further explore and summarize dynamic heterogeneous graph embedding methods, which aim to capture the evolution of heterogeneous graphs and preserve the temporal information in the node embeddings. An overview of different types of heterogeneous graph embedding methods explored in this survey paper is shown in Fig. 2.

Structure-preserved HG Embedding
One basic requirement of graph embedding is to preserve the graph structures properly [14]. Accordingly, the homogeneous graph embedding pays more attention on higherorder graph structures, for example, second-order structures [39], [46], high-order structures [47], [48] and community structures [40]. However, one typical characteristic of HG is that it contains multiple relations among nodes, which inevitably needs to consider the heterogeneity of graph. Therefore, an important direction of heterogeneous graph embedding is to learn semantic information from the graph structures. In this section, we review the typical heterogeneous graph embedding methods based on the basic HG structures, including link (i.e., edge), meta-path, and subgraph. Link is the observed relation between two nodes, meta-path is composed of different types of links and subgraph represents the tiny sub-structure of graph.
The three structures are the most fundamental ingredients of HG, which are able to capture the semantic information from different perspectives. In the followings, we will review the typical structure-preserved heterogeneous graph embedding methods based on these three types of structures and then discuss their pros and cons.

Link-based HG Embedding
One of the most basic information that heterogeneous graph embedding needs to preserve is link. Different from homogeneous graph, link in HG has different types and contains different semantics. To distinguish various types of links, one classical idea is to deal with them in different metric spaces, rather than a unified metric space. A representative work is PME [17], which treats each link type as a relation and uses a relation-specific matrix to transform the nodes into different metric spaces. In this way, nodes connected by different types of links can be close to each other in different metric spaces, thus capturing the heterogeneity of the graph. The distance function is defined as follows: where h i and h j ∈ R d×1 denote the node embeddings of node i and node j, respectively; M r ∈ R d×d is the projection matrix of relation r; and w ij represents the weight of link between node i and node j. Note that Eq. 1 can be seen as a metric learning function: where M r M r ∈ R d×d is the metric matrix of Mahalanobis distance [49]. PME considers the relations between nodes when minimizing the distance of them, thus capturing the heterogeneity of graph. The loss function is the marginbased triple loss function, which requires a distance between the positive and negative samples: (3) where ξ denotes the margin, E r represents the positive links of relation r, and [z] + = max(z, 0). Through Eq. 3, PME makes the node pairs connected by relation r closer to each other than the node pairs without relation r.
By exploiting the relation-specific matrix to capture the link heterogeneity, different from PME, other methods have been proposed aiming to maximize the similarity of two nodes connected by specific relations. For example, EOE [50] and HeGAN [18] use the relation-specific matrix M r to calculate the similarity between two nodes, which can be formulated as: More specifically, EOE is proposed to learn embeddings for coupled heterogeneous graphs, which consist of two different but related sub-graphs. It divides the links in HG into intra-graph links and inter-graph links. Intra-graph link connects two nodes with the same type, and inter-graph link connects two nodes with different types. To capture the heterogeneity in inter-graph link, EOE utilizes Eq. 4 as the similarity function of two nodes. Different from EOE, HeGAN uses generative adversarial networks (GAN) [51] to learn node embeddings for heterogeneous graph. It uses Eq. 4 as a discriminator to determine whether the node embeddings are produced by the generator. Through the game between discriminator and generator, HeGAN can learn more robust node embeddings. The previously discussed methods mainly preserve the link structure based on either the distance or similarity function on node embeddings, while AspEM [52] and HEER [53] aim to maximize the probability of existing links. The heterogeneous similarity function is defined as: where µ r ∈ R d×1 is the embedding of relation r; g ij ∈ R d×1 is the embedding of link between node i and node j; g ij = h i h j and denotes the Hadamard product; and E r ij is the set of negative links, which indicates that there is no link between nodeĩ and node j. It can be seen that µ r g ij measures the closeness between link and its corresponding type. Maximizing S r enlarges the closeness between the existing links and their corresponding types, thus capturing the heterogeneity of the graph.
In addition to the above methods, there are some methods that draw on techniques from other fields. Similar to the idea of TransE [54], MELL [55] uses the equation 'head + relation = tail' to learn the node embeddings for heterogeneous graph. PTE [56] decomposes the heterogeneous graph into multiple bipartite graphs and employs LINE [39], which preserves the first-and second-order structures of graph, to learn node embeddings for each bipartite graph. MNE [57] assigns multiple embeddings for each node and uses a skipgram technique [58] to represent information of multi-type relations into a unified space.
In summary, we can roughly divide the link-based heterogeneous graph embedding methods into two categories: one is to explicitly preserve the proximity of links [52], [53]; the other is to preserve the proximity of nodes, which utilizes the information of links implicitly [17], [50], [18]. These two types of methods both make use of the first-order information of HG.

Path-based HG Embedding
Link-based methods can only capture the local structures of HG, i.e., the first-order relation. In fact, the higher-order relation, describing more complex semantic information, is also critical for heterogeneous graph embedding. For example, in Fig. 1(a), the first-order relation can only reflect the similarity of author-paper, paper-term and paper-venue. While the similarity of author-author, paper-paper and author-conference cannot be well captured. Therefore, the high-order relation is introduced to measure more complex similarity. Because the number of high-order relations is very large, in order to reduce complexity, we usually choose the higher-order relations with rich semantics, called metapath. In this section, we will introduce some representative meta-path-based heterogeneous graph embedding methods, which can be divided into two categories: random walkbased methods [8], [59], [60], [61], [62] and hybrid relationbased methods [9], [63].
Random walk-based methods usually use meta-path to guide random walk on a HG, so that the generated node sequence contains rich semantic information. Through preserving the node sequence structure, node embedding can preserve both first-order and high-order proximity [8]. A representative work is metapath2vec [8] (shown in Fig. 3).

Project Output
Prob. that ! appears Prob. that " appears The architecture of metapath2vec. Node sequence is generated under the meta-path PAP. It projects the embedding of the center node, e.g., p 2 into latent space and maximizes the probability of its meta-path-based context nodes, e.g., p 1 , p 3 , a 1 and a 2 , appearing.
Metapath2vec [8] mainly uses meta-path guided random walk to generate heterogeneous node sequences with rich semantics; and then it designs a heterogeneous skip-gram technique to preserve the proximity between node v and its context nodes, i.e., neighbors in the random walk sequences: where C t (v) represents the context nodes of node v with type t. p(c t |v; θ) denotes the heterogeneous similarity function on node v and its context neighbors c t : From the diagram shown in Fig. 3, Eq. 7 needs to calculate the similarity between center node and its neighbors. Then [58] introduces a negative sampling strategy to reduce the computation. Hence, Eq. 7 can be approximated as: where σ(·) is the sigmoid function, and P (ṽ) is the distribution in which the negative nodeṽ q is sampled for Q times. Through the strategy of negative sampling, the time complexity is greatly reduced. However, when choosing the negative samples, metapath2vec does not consider the types of nodes, i.e., different types of nodes are from the same distribution P (ṽ). It further designs metapath2vec++, which samples the negative nodes of the same type as the central node, i.e.,ṽ q t ∼ P (ṽ t ). The formulation can be rewritten as: After minimizing the objective function, metapath2vec and metapath2vec++ can capture both structural information and semantic information effectively and efficiently. Based on metapath2vec, a series of variants have been proposed. Spacey [59] designs a heterogeneous spacey random walk to unify different meta-paths with a second-order hyper-matrix to control the transition probability among different node types. JUST [60] proposes a random walk method with Jump and Stay strategies, which can flexibly choose to change or maintain the type of the next node in the random walk without meta-path. BHIN2vec [61] proposes an extended skip-gram technique to balance the various types of relations. It treats heterogeneous graph embedding as a multiple relation-based tasks, and balances the influence of different relations on node embeddings by adjusting the training ratio of different tasks. HHNE [62] conducts the meta-path guided random walk in hyperbolic spaces [64], where the similarity between nodes can be measured using hyperbolic distance. In this way, some properties of HG, e.g., hierarchical and power-law structure, can be naturally reflected in the learned node embeddings.
Different from random walk-based methods that learn structural and semantic information from generated node sequences, some methods use the combination of firstorder relation and high-order relation (i.e., meta-path) to capture the heterogeneity of HG. We call these work as hybrid relation-based methods. A typical work is HIN2vec [9] (shown in Fig. 4), which carries out multiple relation prediction tasks jointly to learn the embeddings of nodes and meta-paths. The purpose of HIN2vec is to predict whether two nodes are connected by a meta-path, which can be seen as a multilabel classification task. As illustrated in Fig. 4, given two nodes i and j, HIN2vec uses the following function to compute their similarity under the hybrid relation r: where i, j and r ∈ R N ×1 denote the one-hot vectors of nodes and relation, respectively; W I , W J and W R ∈ R d×N are the mapping matrices; and f 01 (·) is a regularization function, which limits the embedding values between 0 and 1. The loss function is a binary cross-entropy loss: where E r ij denotes the set of positive links. After minimizing the loss function, HIN2vec can learn the embedding of nodes and relations (meta-paths). Besides, in the relation set R, it contains not only the first-order structures (e.g., A-P relation) but also the high-order structures (e.g., A-P-A relation). Therefore, the node embeddings can capture different semantics.
RHINE [63] is another hybrid relation-based method, which designs different distance functions for different relations, thus enhancing the expressive power of node embeddings. It divides the relations into two categories: Affiliation Relations (ARs) and Interaction Relations (IRs). For ARs, a Euclidean distance function is introduced; while for IRs, RHINE proposes a translation-based distance function. Through the combination of these two distance functions, RHINE can learn relation structure-aware heterogeneous node embeddings.
In sum, we can find that random walk-based methods mainly exploit meta-path guided strategy for heterogeneous graph embedding; while hybrid relation-based methods regard a meta-path as high-order relation and learn meta-path based embeddings simultaneously. Compared with random walk-based methods, hybrid relation-based methods can simultaneously integrate multiple meta-paths into heterogeneous graph embedding flexibly.

Subgraph-based HG Embedding
Subgraph represents a more complex structure in the graph. Incorporating subgraphs into graph embedding can significantly improve the ability of capturing complex structural relationships. In this section, we introduce two widely used subgraphs in HG: one is metagraph, which reflects the highorder similarity between nodes [41], [37]; the other is the hyperedge 1 , which connects a series of closely related nodes and preserves the indecomposablity among them [65].
Zhang et al. propose metagraph2vec [41], which uses a metagraph-guided random walk to generate heterogeneous node sequence. Then the heterogeneous skip-gram technique [8] is employed to learn the node embeddings. Based on this strategy, metagraph2vec can capture the rich structural information and high-order similarity among nodes. Different from metagraph2vec that only uses metagraphs in the pre-processing step (i.e., metagraph-guided random walk), mg2vec [37] aims to learn the embeddings for metagraphs and nodes jointly, so that the metagraphs can join the learning process. It first enumerates the metagraphs and then preserves the proximity between nodes and metagraphs: where M i is the embedding of metagraph i and M denotes the set of metagraphs. Clearly, P (M i |v) represents the firstorder relationship between the nodes and its subgraphs. 1. In this paper, we treat the hyperedge as a special kind of subgraph.
Further, mg2vec preserves the proximity between node pair and its subgraph to capture the second-order information: where f (·) is a neural network to learn the embeddings of node pairs. Through preserving the first-order and secondorder proximity between nodes and metagraphs, mg2vec can capture the structural information and the similarity between nodes and metagraphs. DHNE [65] is a typical hyperedge-based graph embedding method. Specifically, it designs a novel deep model to produce a non-linear tuple-wise similarity function while capturing the local and global structures of a given HG. Taking a hyperedge with three nodes a, b and c as an example. The first layer of DHNE is an autoencoder, which is used to learn latent embeddings and preserve the secondorder structures of graph [39]. The second layer is a fully connected layer with embedding concatenated: where L denotes the embedding of the hyperedge; h a , h b and h c ∈ R d×1 are the embeddings of node a, b and c learn by the autoencoder. W a , W b and W c ∈ R d ×d are the transformation matrices for different node types. Finally, the third layer is used to calculate the indecomposability of the hyperedge: where P denote the indecomposability of the hyperedge; W ∈ R 1×3d and b ∈ R 1×1 are the weight matrix and bias, respectively. A higher value of P means these nodes are from the existing hyperedges, otherwise it should be small. HEBE [66] is another hyperedge-based method, which aims to maximize the proximity between the node and the hyperedge it belongs to. After maximizing the proximity, HEBE can preserve the similarity of nodes within the same hyperedge, while reduce the similarity of nodes from different hyperedges. Besides, [67] proposes hyper-path-based random walk to preserve both the structural information and indecomposability of the hyper-graphs. Compared with the structures of link and meta-path, subgraph (with two representative forms of meta-graph and hyperedge) usually contains much higher order structural and semantic information. However, one obstacle of subgraph-based heterogeneous graph embedding methods is the high complexity of subgraph. How to balance the effectiveness and efficiency is required for a practical subgraph-based heterogeneous graph embedding methods, which is worthy of further exploration.

Summary
Generally, structure-preserved heterogeneous graph embedding methods mainly use shallow models, i.e., models without non-linear activation and multiple transformation. A major advantage of this type of methods is that they have good parallelizability and can improve training speed through negative sampling [58]. However, as we can seen, there has been increasingly advanced structural and semantic information from link to path to subgraph, which may improve the performance in nature, but it also requires more calculations. Besides, there are two serious problems: one is that the shallow models need to assign each node a low-dimensional embedding, which requires larger memory spaces to store the parameters. Another is that shallow models can only work on transductive setting, i.e., they cannot learn the embedding of new node. These two shortcomings limit the application of this kind of methods in large-scale industrial scenarios.

Attribute-assisted HG Embedding
In addition to the graph structures, another important component of heterogeneous graph embedding is the rich attributes. Attribute-assisted heterogeneous graph embedding methods aim to encode the complex structures and multiple attributes to learn node embeddings. Different from graph neural networks (GNNs) that can directly fuse the attributes of neighbors to update node embeddings, due to the different types of nodes and edges, HGNNs need to overcome the heterogeneity of attributes and design effective fusion methods to utilize the neighborhood information, thus bringing more challenges. In this section, we divide HGNNs into unsupervised and semi-supervised settings, then discuss their pros and cons.

Unsupervised HGNNs
Unsupervised HGNNs aim to learn node embeddings with good generalization. To this end, they always utilize the interactions among different types of attributes to capture the potential commonalities.
HetGNN [16] is the representative work of unsupervised HGNNs. It consists of three parts: content aggregation, neighbor aggregation and type aggregation. Content aggregation is designed to learn fused embeddings from different node contents, such as images, text or attributes: where C v is the type of node v's attributes. h i is the ith attributes of node v. A bi-directional Long Short-Term Memory (Bi-LSTM) [68] is used to fuse the embeddings learned by multiple attribute encoder FC. Neighbor aggregation aims to aggregate the nodes with same type by using a Bi-LSTM to capture the position information: where N t (v) is the first-order neighbors of node v with type t. Type aggregation uses an attention mechanism to mix the embeddings of different types and produces the final node embeddings.
where h v is the final embedding of node v. O v denotes the set of node types. Finally, a heterogeneous skip-gram loss is used as the unsupervised graph context loss to update the node embeddings. Through the three aggregation methods, HetGNN can preserve the heterogeneity of both graph structures and node attributes.
Other unsupervised methods either capture the heterogeneity of node attributes or the heterogeneity of graph structures. HNE [69] is proposed to learn embeddings for the cross-model data in HG, but it ignores the various types of links. SHNE [70] focuses on capturing the semantic information of nodes by designing a deep semantic encoder with gated recurrent units (GRU) [71]. Although it uses heterogeneous skip-gram to preserve the heterogeneity of graph, SHNE is designed specifically for text data. Cen et al.
propose GATNE [72], which aims to learn node embeddings in multiplex graph, i.e., a heterogeneous graph with different types of edges. Compared with HetGNN, GATNE pays more attention to distinguishing different link relationships between the node pairs.

Semi-supervised HGNNs
Different from unsupervised HGNNs, semi-supervised HGNNs aim to learn task-specific node embeddings in an end-to-end manner. For this reason, they prefer to use attention mechanism to capture the most relevant structural and attribute information to the task.
Wang et al. [15] propose heterogeneous graph attention network (HAN), which uses a hierarchical attention mechanism to capture both node and semantic importance. The architecture of HAN is shown in Fig. 5.  [15]. The whole model can be divided into three parts: Node-Level Attention aims to learn the importance of neighbors' features. Semantic-Level Attention aims to learn the importance of different metapaths. Prediction layer utilizes the labeled nodes to update the node embeddings.
It consists of three parts: node-level attention, semanticlevel attention and prediction. Node-level attention aims to utilize self-attention mechanism [73] to learn the importances of neighbors in a certain meta-path: where N m i is the neighbors of node i in meta-path m, α m ij is the weight of node j to node i under meta-path m. The node-level aggregation is defined as: where h m i denotes the learned embedding of node i based on meta-path m. Because different meta-paths capture different semantic information of HG, a semanticlevel attention mechanism is designed to calculated the importance of meta-paths. Given a set of meta-paths {m 0 , m 1 , · · · , m P }, after feeding node features into nodelevel attention, it has P semantic-specific node embeddings {H m0 , H m1 , · · · , H m P }. To effectively aggregate different semantic embeddings, HAN designs a semantic-level attention mechanism: where W ∈ R d ×d and b ∈ R d ×1 denote the weight matrix and bias of the MLP, respectively. q ∈ R d ×1 is the semanticlevel attention vector. In order to prevent the node embeddings from being too large, HAN uses the softmax function to normalize w mi . Hence, the semantic-level aggregation is defined as: where β mi denotes the normalized w mi , which represents the semantic importance. H ∈ R N ×d denotes the final node embeddings. Finally, a task-specific layer is used to fine-tune the node embeddings with a small number of labels and the embeddings H can be used in the downstream tasks, such as node clustering and link prediction. HAN is the first to extend GNN to the heterogeneous graph and design a hierarchical attention mechanism, which can capture both structural and semantic information. Subsequently, a series of attention-based HGNNs was proposed [74], [75], [74], [76], [77]. MAGNN [74] designs intra-metapath aggregation and inter-metapath aggregation. The former samples some meta-path instances surrounding the target node and uses an attention layer to learn the importance of different instances, and the latter aims to learn the importance of different meta-paths. HetSANN [75] and HGT [76] treat one type of node as query to calculate the importance of other types of nodes around it, through which the method can not only capture the interactions among different types of nodes, but also assign different weights to neighbors during aggregation. [77] uses meta-paths as virtual edges to enhance the performance of graph attention operator.
In addition, there are some HGNNs that focus on other issues. NSHE [78] proposes to incorporate network schema, instead of meta-path, in aggregating neighborhood information. GTN [79] aims to automatically identify the useful meta-paths and high-order links in the process of learning node embeddings. RSHN [80] uses both original node graph and coarsened line graph to design a relation-structure aware HGNN. RGCN [81] uses multiple weight matrices to project the node embeddings into different relation spaces, thus capturing the heterogeneity of the graph.

Summary
As we can see that there are two ways to solve the heterogeneity of attributes: one is to use different encoders or type-specific transformation matrices to map the different attributes into a same space, such as [16], [69]. Another is to treat meta-path as a special edge to connect the nodes with same type, such as [15], [74]. Compared with shallow models, HGNNs have an obvious advantage that they have the ability of inductive learning, i.e., learning embeddings for the out-of-sample nodes [24]. Besides, HGNNs need smaller memory space because they only need to store model parameters. These two reasons are important for the real-world applications. However, they still suffer from the huge time costing in inferencing and retraining.

Application-oriented HG Embedding
Heterogeneous graph embedding also has been closely combined with some specific applications, where the aforementioned information, e.g., attributes, is not sufficient for specific applications. Under such settings, one usually needs to carefully consider two factors: the first is how to construct a HG for a specific application, and the second is what information, i.e., domain knowledge, should be incorporated into heterogeneous graph embedding, so as to finally benefit the application. In this section, we discuss three common types of applications: recommendation, identification and proximity search.

Recommendation
In recommendation system, the interaction among user and item can be naturally modeled as a HG with two types of nodes. Therefore, recommendation is a typical scenario that widely uses HG information [13]. Besides, other types of information, such as the social relationships, can also be easily introduced in HG [82], applying heterogeneous graph embedding to recommendation application is an important research field.
HERec [2] aims to learn the embeddings of users and items under different meta-paths and fuses them for recommendation. It first finds the co-occurrence of users and items based on the meta-path guided random walks on user-item HG. Then it uses node2vec [90] to learn preliminary embeddings from the co-occurrence sequences of users and items. Because the embeddings under different meta-paths contain different semantic information, for better recommendation performance, HERec designs a fusion function to unify the multiple embeddings: where h m u is the embedding of user node u in meta-path m. M denotes the set of meta-paths. The fusion of item embeddings is similar to users. Finally, a prediction layer is used to predict the items that users prefer. HERec optimizes the graph embedding and recommendation objective jointly.
Apart from random walk, some methods try to use matrix factorization to learn user and item embeddings. HeteRec [86] considers the implicit user feedback in HG.
HeteroMF [84] designs a heterogenous matrix factorization technique to consider the context dependence of different types of nodes. FMG [85] incorporates meta-graphs into embedding technology, which can capture some special patterns between users and items.
Previous methods mainly use shallow models to learn the embeddings of users and items, where the ability of express nonlinear interaction between them is limited. Therefore, some neural network-based methods are proposed. One of the most important techniques is attention mechanism, which aims to find the important users and items in HG based recommendation. MCRec [3] designs a neural co-attention mechanism to capture the relationship between user, item and meta-path. Specifically, it uses the users and items to find the important meta-paths. Meanwhile, the important meta-paths are used to find the important users and items in recommendation. Through this mutual selective attention mechanism, MCRec can not only learn embeddings of users, items and meta-paths, but also capture the complex interactions among them. NeuACF [87] and HueRec [89] first calculate multiple meta-path-based commuting matrices, where each row represents the user-user similarity or item-item similarity. Then an attention mechanism is designed to learn the importance of different metapath-based commuting matrices, so as to capture different semantic information.
Another type of important techniques is graph neural networks. PGCN [88] converts the user-item interaction sequences into item-item graph, user-item graph and usersequence graph. Then it designs a HGNN to propagate user and item information in the three graphs, so as to capture the collaborative filtering signals. MEIRec [19] focuses on the problem of intent recommendation in E-commerce, which aims to automatically recommend user intent according to user historical behaviors. It constructs a useritem-query heterogeneous graph and designs a meta-pathguided HGNN to learn the embedding of users, items and queries, which can capture the intent of users. GNewsRec [91] and GNUD [5] are designed for news recommendation. They consider both the content information of news and the collaborative information between users and news. [92] employs graph convolutional network on heterogeneous graphs for basket recommendation.

Identification
Identification is to find the most likely nodes according to the given conditions on HG. For example, finding potential authors of a given paper or identifying users in cross-platform. Currently, two representative identification applications, author identification [44], [93], [94] and user identification [95], [96], [97], have been studied based on heterogeneous graph embedding.
Author identification aims to find the potential authors for an anonymous paper in the academic network. Camel [93] aims to consider both the content information, e.g., the text of papers, and context information, e.g., the cooccurrence of paper and author. For content information, it designs a content encoder to learn embeddings from the abstract of paper and a metric-based loss function is used to learn the pair-wise relations between authors and papers: where ξ is the margin, f (·) represents the content encoder and h v , h u and h u denote the attributes of paper, positive author and negative author, respectively. For context information, a meta-path guided walk integrative learning module (MWIL) is proposed to preserve the graph structures: It is worth noting that L M W IL is a special skip-gram technique, which aims to preserve the proximity of positive author u of paper v within a walk length. Through optimizing L M etric and L M W IL jointly, Camel considers both the heterogeneous graph structures and the pair-wise relation of author-paper. Similar to the idea of Camel, PAHNE [44] considers the pair-wise relations and TaPEm [94] maximizes the proximity between the paper-author pair and the context path around them. Compared with author identification, user identification does not contain the pair-wise relation, i.e., user and paper. Therefore, it focuses on learning discriminating user embeddings with weak supervision information so that the target users can be identified more easily. Player2vec [95], AHIN2vec [96] and Vendor2vec [97] are the principal methods. They can be summarized as a general framework: first, some advanced neural networks, e.g., convolutional neural network (CNN) or recurrent neural network (RNN), are used to learn preliminary node embeddings from the raw features. Then the preliminary node embeddings will be propagated on the graphs, constructed by different metapaths, to utilize the neighborhood information. Finally, a semi-supervised loss function is used to make the node embeddings contain application-specific information. Under the guidance of partially labeled nodes, the node embeddings can distinguish special users from the ordinary users in the graph, which can be used for user identification.

Proximity Search
Given a target node in HG, the proximity search, as shown in Fig. 6, is to find the nodes that are closest to the target node by using structural and semantic information of HG. Some earlier studies have deal with this problem in homogeneous graphs, for example, web search [98]. Recently, some methods try to utilize HG in proximity search [34], [99]. However, these methods only use some statistical information, e.g., the number of connected meta-paths, to measure the similarity of two nodes in HG, which lack flexibility. With the development of deep learning, some embedding methods are proposed. Fig. 6: An example of semantic proximity search [45], which gives a query object (e.g., Alice) and requires the method rank other objects according to the semantic relation (e.g., "who are likely to be her schoolmates?").
Prox [100] uses heterogeneous graph embedding in semantic proximity search. Given a set of training tuples {q i , v i , u i }, where q i is the query node and in each query the similarity S(q i , v i ) between node v i and q i is larger than S(q i , u i ). It firstly samples some heterogeneous sequences for each node in the training tuples and feed them into a LSTM ito learn node embeddings. A ranking-based loss function is used to use the implicit supervision information: Minimizing the function indicates that the similarity between v i and q i should be larger than that between u i and q i . Different from previous methods that use manually calculated similarities of nodes in HG, Prox uses heterogeneous graph embedding to avoid the feature engineering for semantic proximity search, which is an efficient and effective approach.
Then a series of methods are proposed. IPE [45] considers the interactions among different meta-path instances and propose an interactive-paths structure to improve the performance of heterogeneous graph embedding. SPE [101] proposes a subgraph-augmented heterogeneous graph embedding method, which uses a stacked autoencoder to learn the subgraph embedding so as to enhance the effect of semantic proximity search. D2AGE [102] explores the DAG structure for better measuring the similarity between two nodes and designs a DAG-LSTM to learn node embeddings.

Summary
Incorporating heterogeneous graph embedding into specific applications usually need to consider the domain knowledge. For example, in recommendation, meta-path "useritem-user" can be used to capture the user-based collaborative filtering, while "item-user-item" represents the itembased collaborative filtering; in proximity search, methods use meta-paths to capture the semantic relationships between nodes, thus enhancing the performance. Therefore, utilizing HG to capture the application-specific domain knowledge is essential for application-oriented heterogeneous graph embedding.

Dynamic HG Embedding
In the beginning of Section 3, we mention that previous HG surveys [32], [33] focus on summarizing the static methods, while the dynamic methods are largely ignored. Since the real-world graphs are constantly changing over time, to fill this gap, in this section, we summary the dynamic heterogeneous graph embedding methods. Specifically, they can be divided into two categories: incremental update and retrained update methods. The former learns the embedding of new node in the next timestamp by utilize existing node embeddings, while the latter will retrain the models in each timestamp. Both of them have its own pros and cons, and will be discussed in the end.

Incremental HG Embedding
DyHNE [42] is an incremental update method based on the theory of matrix perturbation, which learns node embeddings while considering both the heterogeneity and evolution of HG. To ensure the effectiveness, DyHNE preserves the meta-path based first-and second-order proximities. The first-order proximity requires two nodes connected by meta-path m to have similar embeddings. And the secondorder proximity indicates that the node embedding should be close to the weighted sum of its neighbor embeddings. Specifically, the first-and second-order proximities can be uniformly rewritten as: where γ is a hyperparameter. W = m∈M θ m W m and D = m∈M θ m D m are the fusion of different meta-paths, which lead to L = D − W and T = (I − W) (I − W). The minimization of L can be solved by the eigenvalue decomposition: where Λ = diag(λ 1 , λ 2 · · · λ N ) is the eigenvalue matrix. To model the evolution of HG, DyHNE uses the perturbation of meta-path augmented adjacency matrices to naturally capture changes of graph. At a new timestamp, the matrix becomes: where ∆ denote the perturbation term. ∆h and ∆λ are the changes of the eigenvectors and eigenvalues. Hence, the incremental update of node i is how to calculate the changes of the i-th eigen-pair (∆h i , ∆λ i ). With some approximations, DyHNE can directly update the node embeddings without retraining the whole model. Generally speaking, DyHNE preserves both the structural and semantic information of HG and uses the perturbation of matrix to capture the evolution of HG over time, which is an effective and efficient method. [103], [104] also adopt the idea of incremental update. Change2vec [103] proposes a dynamic version of metapath2vec. MetaDynaMix [104] uses the incremental update on the matrix factorization of HG.

Retrained HG Embedding
Retrained update methods first use GNNs to learn node or edge embeddings in each timestamp and then design some advanced neural network, e.g., RNN or attention mechanism, to capture the temporal information of HG. DyHATR [105] aims to capture the temporal information through the changes of nodes embeddings in different timestamps. To this end, as shown in Fig. 7, it first designs a hierarchical attention mechanism (HAT), which contains a node-and edge-level attention, to learn node embeddings by fusing the attributes of neighbors. The node-level attention is defined as: where N rt i represents the neighbors of node i in edge type r and timestamp t, and a r is the attention vector. And the edge-level attention is: Fig. 7: The architecture of DyHATR [105]. It consists of two parts: first, a hierarchical attention mechanism is designed to learn node embeddings by fusing the attributes of neighbors. Then, a RNN with self-attention mechanism is used to capture the temporal information.
where q T is the attention vector in edge-level attention.
Through the node-and edge-level attention, DyHATR can learn the node embeddings under different timestamps. In order to capture the temporal information hidden in the changes of node embeddings, the node embeddings are fed into a RNN in the order of timestamps. Coincidentally, Dy-HAN [43] also designs a hierarchical attention mechanism to learn the importance of nodes and timestamps, respectively.

Summary
It can be seen that the incremental update methods are efficient, but they can only capture the short-term temporal information (i.e., the last timestamp) [105]. Besides, incremental update methods focus on utilizing shallow model, which lacks the non-linear expressive power. On the contrary, the retrained update methods employ neural networks to capture the long-term temporal information. However, they suffer from the high computational cost. Therefore, how to combine the advantages of these two kinds of models is an important problem. In addition, there are some meaningful problems to consider, e.g., how to eliminate the cumulative errors in incremental update methods.

Miscellanea
In the previous section, we introduce the major applications in heterogeneous graph embedding. There are also some other methods that do not belong to the existing categories.
Here, we briefly introduce them. The first is incorporating HG into natural language processing (NLP). Due to the multiple elements in the corpus, e.g., words, entities, sentences or paragraphs, many NLP tasks can be modeled as HG naturally. Graph-to-sequence (Graph2Seq) learning is an important topic in NLP, which aims to transform the graph-structured embeddings to word sequences for text generation [106], [107]. AMR-to-text generation is a typical Graph2Seq task. It generates text from the Abstract Meaning Representation (AMR) graph, where nodes represent the semantic concepts in the text and edges denote the relations between concepts. In order to learn useful information from the AMR graph, Yao et al. [108] treat AMR graph as a heterogeneous graph and design a heterogeneous graph encoder to learn the semantic information among the concepts. Besides, Hu et al. [4] propose HGAT for short text classification, which treats the topic, entities and documents as a HG and designs a hierachical attention mechanism to learn the similarity among short texts. GNewsRec [91] and GNUD [5] use HG to model the collaborative filtering between news and users in news recommendation task. [109] incorporates HG into topic model for aspect mining. [110] uses HG in fake new detection.
Similar to NLP, multi-modal data can also be modeled by HG due to the various data forms, e.g., text, images or videos. The potential dependencies and connections among multi-model data can be modeled by HG easily. Therefore, some methods try to use heterogeneous graph embedding to capture the potential dependencies and connections. For example, Community Question Answering (CQA) aims to recommend the suitable answers for each question. Because the answers and questions may contain text and pictures, [111], [112] treats the answers and question as a heterogeneous graph to capture the potential connections, thus making the state-of-the-art performance.
Besides, graph embedding in hyperbolic space has received widespread attention [113], [114], [115]. Because whether Euclidean spaces are the optimal isometric spaces is still an unsolved problem, exploring heterogeneous graph embedding in the hyperbolic spaces is a meaningful research direction. [62] shows that hyperbolic spaces can capture the hierarchical and power-law structure of the heterogeneous graph, which provides a theoretical guarantee for the future work to some extent.
Moreover, HG embedding are also widely used to model many other tasks, such as entity set expansion [116], basket recommendation [117], event categorization [118] and social network [119].

TECHNIQUE SUMMARY
In the previous section, we category the heterogeneous graph embedding methods based on different problem setting. In this section, from the technical perspective, we summarize the widely used techniques (or models) in heterogeneous graph embedding, which can be generally divided into two categories: shallow model and deep model.

Shallow Model
Early heterogeneous graph embedding methods focus on employing shallow model. They first initialize the node embeddings randomly, and then learn the node embeddings through optimizing some well-designed objective functions. We divide the shallow model into two categories: random walk-based and decomposition-based.
Random walk-based. In homogeneous graph, random walk, which generates some node sequences in a graph, is usually used to capture the local structure of a graph [90]. While in heterogeneous graph, the node sequence should contain not only the structural information, but also the semantic information. Therefore, a series of semantic-aware random walk techniques are proposed [57], [8], [59], [60], [61], [62], [2]. For example, metapath2vec [8] uses metapath-guided random walk to capture the semantic information of two nodes, e.g., the co-author relationship in academic graph. Spacey [59] and metagraph2vec [41] design metagraph-guided random walks, which preserve a more complex similarity between two nodes.

Decomposition-based.
Decomposition-based techniques aim to decompose HG into several sub-graphs and preserve the proximity of nodes in each sub-graph [17], [50], [52], [53], [55], [56], [66]. PME [17] decomposes the heterogeneous graph into some bipartite graphs according to the types of links and projects each bipartite graph into a relation-specific semantic space. PTE [56] divides the documents into word-word graph, word-document graph and word-label graph. Then it uses LINE [39] to learn the shared node embeddings for each sub-graph. HEBE [66] samples a series of subgraphs from a HG and preserves the proximity between the center node and its subgraph.

Deep Model
Deep model aims to use advanced neural networks to learn embedding from the node attributes or the interactions among nodes, which can be roughly divided into three categories: message passing-based, encoder-decoder-based and adversarial-based.
Message passing-based. The idea of message passing is to send the node embedding to its neighbors, which is always used in GNNs. The key component of message passing-based techniques is to design a suitable aggregation function, which can capture the semantic information of HG [15], [74], [75], [16], [72], [78], [79], [80], [81]. HAN [15] designs a hierarchical attention mechanism to learn the importance of different nodes and meta-paths, which captures both structural information and semantic information of HG. HetGNN [16] uses bi-LSTM to aggregate the embedding of neighbors so as to learn the deep interactions among heterogeneous nodes. GTN [79] designs an aggregation function, which can find the suitable metapaths automatically during the process of message passing.
Encoder-decoder-based. Encoder-decoder-based techniques aim to employ some neural networks as encoder to learn embedding from node attributes and design a decoder to preserve some properties of the graphs [65], [69], [70], [44], [93], [94]. For example, HNE [69] focuses on multimodal heterogeneous graph. It uses CNN and autoencoder to learn embedding from images and texts, respectively. Then it uses the embedding to predict whether there is a link between the images and texts. Camel [93] uses GRU as encoder to learn paper embedding from the abstracts. A skip-gram objective function is used to preserve the local structures of the graphs. DHNE [65] uses autoencoder to learn embedding for the nodes in a hyperedge. Then it designs a binary classification loss to preserve the indecomposability of the hyper-graph.
Adversarial-based. Adversarial-based techniques utilize the game between generator and discriminator to learn robust node embedding. In homogeneous graph, the adversarial-based techniques only consider the structural information, for example, GraphGAN [121] uses Breadth First Search when generating virtual nodes. In a heterogeneous graph, the discriminator and generator are designed to be relation-aware, which captures the rich semantics on HGs. HeGAN [3] is the first to use GAN in heterogeneous graph embedding. It incorporates the multiple relations into the generator and discriminator, so that the heterogeneity of a given graph can be considered. MV-ACM [120] uses GAN to generate the complementary views by computing the similarity of nodes in different views.

Review
In Table 2, we categorize the typical heterogeneous graph embedding methods through different perspectives. Specifically, from the left to right, we gradually coarsen the properties of each method, so as to summarize their commonalities.
The first two columns indicate whether the method has inductive capability and whether it needs labels for training. We can see that most message passing-based methods have the inductive capability because they can update the node embeddings by aggregating neighborhood information. But they need additional labels to guide the training process.
The middle two columns show the information and task in each method. It can be seen that most deep learning-based methods are proposed for HG with attributes or specific application, while the shallow model-based methods are mainly designed for the use of structures. One possible reason is that HG with attributes or specific applications usually needs to introduce additional information or domain knowledge. However, modeling the domain knowledge may be complicated, and the relationship with HG may also need to be described carefully. Deep model provides a more powerful support for this kind of complex modeling, and it helps to make better progress in the complex application scenarios. Meanwhile, the emerging HGNNs can naturally integrate graph structures and attributes, so it is more suitable for the complex scenes and content.
The last two columns summarize the techniques used in HG embedding and their characteristics. Shallow models are easy to parallel. But they are two-stage training, i.e., the embeddings are not relevant to the downstream tasks, and the memory cost is heavy. On the contrary, deep models are end-to-end training and require less memory space. Besides, message passing-based techniques are good at encoding structures and attributes simultaneously, and integrating different semantic information. Compared with message passing-based techniques, encoder-decoder-based techniques are weak in fusing information due to the lack of messaging mechanism. But they are more flexible to introduce different objective function through different decoders. Adversarial-based methods prefer to utilize the negative samples to enhance the robustness of the embeddings. But the choice of negative samples has a huge influence on the performance, thus leading higher variances [18].
It is worth noting that we also list the complexity of each techniques, where τ is the number of random walks, l is the length of random walk, k is the windows size in skipgram [58] and n s is the number of samples. The complexity of random walk technique consists of two parts: random walk and skip-gram, both of which are linear with the number of nodes. Decomposition technique needs to divide HGs into sub-graphs according to the type of edges, so the complexity is linear with the number of edges, which is higher than random walk. Message passing technique mainly uses node-level and semantic-level attention to learn node embeddings, so its complexity is related to the number of nodes and node types. As for the encoder-decoder technique, the complexity of encoder is related to the number of nodes, while decoder is usually used to preserve the network structures, so it is linear with the number of edges. Adversarial technique needs to generate the negative samples for each node, so the complexity is related to the number of nodes and negative samples.

REAL-WORLD DEPLOYED SYSTEMS
Heterogeneous graph embedding is closely related with the real-world applications, as heterogeneous objects and interactions are ubiquitous in many practical systems. Here we focus on summarizing the industrial level applications with heterogeneous graph embedding. Different from those methods with specific tasks mentioned in Section 3.3, methods introduced in this section solve practical problems in applications with industrial data. In addition, for industriallevel applications, we pay more attention to two key components: HG construction with industrial data and graph embedding techniques on the HG.

E-commerce
E-commerce, such as Taobao 1 and Amazon 2 , is the activity of electronic trading of products on online services. It plays an important role in social economy development. Usually, large-scale heterogeneous objects and interactions, such as users, items, and shops, are involved in an e-commerce platform. Therefore, HG is a powerful and nature network analysis paradigm to model such complex data. HG embedding has been applied to various important services and 1. www.taobao.com 2. www.amazon.com (a) E-commerce recommendation HG [20].  tasks in e-commerce, such as item recommendation, intent recommendation, user profiling, and fraudster detection.
Recommendation is an important service of an ecommerce platform. A simple recommendation scenario primarily considers the interactions of users and items. However, due to the real business demands in e-commerce, it is highly desirable to comprehensively model users and items. HG can be used to model the interactions among users, items, and their auxiliary information [82]. As shown in Fig. 8(a), the HG constructed by IntentGC [20] is composed of user part and item part, and each part models the corresponding heterogeneous relationships. IntentGC translates the original HG as a multi-relation graph of users and items and develops a multi-relation graph convolution method to learn node embeddings. Besides integrating the separate auxiliary information of user and item parts, GATNE [72] distinguishes the interactions between user and item pairs as multiple types, models this scenario as an attributed multiplex heterogeneous graph and proposes an unified embedding method that captures both attribute and edge information. More recently, to solve the interaction sparsity problem, Xu et al. [123] transform the original user-item heterogeneous graph into two semi homogeneous graphs from the perspective of users and items respectively. Different from recommending items for users, intent recommendation is a new type of recommendation service in mobile e-commerce Apps, which aims to automatically recommend user intent according to user historical behaviors without any input. Fan et al. [19] propose to represent user intent as default queries in search box and transform the intent recommendation problem as recommending the queries. They construct a HG containing three types of nodes (Users, Items and Queries) and their mutual interactions, shown in Fig. 8(b). Then, a meta-path-guided HGNN, called MEIRec, is designed to learn the nodes' embeddings of users and queries through aggregating the neighbors along the given meta-paths in an end-to-end manner.
User profiling is playing an increasingly important role in providing personalized services in e-commerce platform. Different from previous methods only considering each user as an individual data instance, recent literature begins to model the abundant interaction information of users as a HG to enrich the characteristics of users. Chen et al. [122] construct three kinds of objects (i.e., users, items and attributes) as a HG, shown in Fig. 8(c), and propose a hierarchical heterogeneous GAT to predict the traits of users (e.g., gender and age) by aggregating each layer of objects' embeddings. Apart from trait prediction, Zheng et al. [124] exploit HG to model the interactions between PID and MID with item ID in the e-commerce user alignment task. Then a Heterogeneous Embedding Propagation (HEP) model, encoding the interaction and edge features into node embeddings, is proposed to predict whether PID and MID across different devices refer to the same person.
With the development of e-commerce, there are many fraudsters in e-commerce system, who profit from transactions by illegal means. Due to the heterogeneity of fraudsters behavior patterns, some works try to detect these malicious accounts through HG embedding methods. Liu et al. [21] consider behaviours of fraudsters as "Device aggregation" and "Activity aggregation" in the view of HG, and they propose a GNN, called GEM, which simultaneously models the topology of the heterogeneous accountdevice graph and the characteristics of accounts activities in the local structure. Moreover, to enrich the embeddings of users, Hu et al. [6] treat the users, merchants, devices in credit payment service as different types of nodes and their interactions as edges in a HG, and propose a metapath-based heterogeneous graph embedding method, called HACUD, to classify the cash-out user. Li et al. [125] treat the users and items as nodes in a bipartite graph and associate the reviews as edge features to detect the spam reviews on Xianyu App. Then, a heterogeneous GNN is proposed to classify whether a review is spam or not, based on its local heterogeneous information and global context.

Cybersecurity
Security has been one of the biggest threaten for social development, and it causes countless loss of property and lives. As multiple heterogeneous entities and complex structure are usually involved in security system, recently researchers pay more attention to use HG embedding methods to detect outliers in a wide range of security areas, such as malware detection, key player identification in underground forum, drug trafficker identification.
With the broad scale proliferation of increasingly interconnected devices, malware (e.g., trojans, ransomware, scamware) that deliberately fulfills the harmful intent to device users has become a major threat to compromise the security in cyberspace [126]. In particular, the explosive growth and increasing sophistication of Android malware (a) Malware detection [7].
call for new defensive techniques that are capable of protecting mobile users against novel threats [127]. To combat the evolving Android malware attacks, HG-based methods have been proposed and applied in anti-malware industry. As shown in Fig. 9(a), HinDroid [7] was first proposed to construct a HG to model the complex relations among application programming interface (APIs) and Android applications (apps), based on which meta-paths are used to formulate the relatedness among apps and multi-kernel learning algorithm is proposed to build the classification model for malware detection. Besides modeling apps and APIs, Fan et al. [22] model more types of entities involved in malware into a HG, such as, file, archive and machine, and a metagraph based embedding method is designed to encode high-level semantic similarities between files. After these methods, a series of HG embedding methods are proposed for dynamic malware detection [23], adversarial attack and defense in malware [24], unknown malware detection [128] and cyber threat intelligence [129]. Besides android malware detection, HG embedding methods also play an important role in detecting targeted objects in other security areas which have multiple types of entities and relations available. Zhang et al. [95] extract multiple relations from the underground forum data and construct an attributed HG (AHG) for key player identification, shown in Fig. 9(b). By treating the relatedness over users depicted by each meta-path as one view, a multi-view GCN is proposed to identify the key player. As illustrated in Fig. 9(c), Zhang et al. [97] leverage AHG to depict vendors, drugs, texts, photos and their associated attributes in darknet markets for drug trafficker identification. Then an attribute-aware AHG embedding method, named Vendor2Vec, consisting of attribute-aware meta-path random walk and skip-gram technique, is proposed to predict whether a given pair of vendors are the same individual or not.

Others
With the development of biological medicine, medical informatics has received considerable attentions, especially, mining Electronic Health Records (EHR) for reducing error and improving quality of disease diagnosis [25]. Previous work on medical HG mainly utilizes HeteSim [99] to analyze the similarities between objects [131]. Recently, Hosseini et al. [26] treat the diagnostic and treatment events as the nodes and corresponding relations extracted from raw text as edges in a HG, and propose a meta-path-guided HG embedding method to rank each patient's potential diagnosis.
Besides, heterogeneous graph embedding is also applied in real-time event prediction on ride-hailing platform, such as Uber 3 and DiDi 4 . Luo et al. [132] dynamically construct heterogeneous graph for each ongoing event, such as Pre-View page and request, to encode the attributes of the event and the condition information from its surrounding area. And a multilayer GNN is proposed to learn the impact of historical actions and the surrounding environment on the current events, and generate an event embedding to improve the accuracy of the response model. Hong et al. [133] propose HetETA to leverage HG to model the spatiotemporal information in time-of-arrival (ETA) estimation task. And a multi-component GNN is proposed to model temporal information from different time spans for ETA task.

BENCHMARKS AND OPEN-SOURCE TOOLS
In this section, we summarize the commonly used datasets of heterogeneous graph embedding. Besides, we introduce some useful resources and open-source tools about heterogeneous graph embedding.

Benchmark Datasets
High-quality datasets are essential for academic research. Here, we introduce some popular real world HG datasets, which can be divided into three categories: academic networks, business networks and film networks. Specifically, we summarize their detailed statistical information in Table  3, including node types, link types and meta-paths etc.

Open-source Code and Tools
Open resources and tools are of great significance to the development of academic research. In this subsection, we provide the resources of heterogeneous graph embedding and introduce some useful open-source platforms and toolkits.

Open-source Code
Source code is important for researchers to reproduce the corresponding method. In Table 3, we refer to the related papers of the datasets. Furthermore, we collect the source code of the related papers and list them in Table 4. Besides, we provide some commonly used website about graph embedding.
becomes to a comprehensive academic system that provides a variety of academic resources. The address is https://www.aminer.cn/. • Open Academic Society (OAS). It is an open and expanding knowledge graph for research and education, contributed by Microsoft Research and AMiner. It publishes Open Academic Graph (OAG), which unifies two billion-scale academic graphs. The address is https://www.openacademic.ai/. • HG Resources. It is a website focusing on heterogeneous graphs, which collects a series of papers on HG and divides them into different categories, including classficiation, clustering and embedding. Code and datasets of the popular methods are also provided. The address is http://shichuan.org/.
• AliGraph. It is an industrial-grade machine learning platform for graph data, supporting the calculation of hundreds of millions of nodes and edges. Besides, it considers the characteristics of real world industrial graph data, i.e., large-scale, heterogeneous, attributed and dynamic, and makes special optimizations. One instance can be found in https://www.aliyun.com/product/bigdata/product. • Deep Graph Library (DGL). It is an open-source deep learning platform for graph data, which designs its own data structures and implements many popular methods. Specifically, it provides independent Application Programming Interfaces (APIs) for homogeneous graph, heterogeneous graph and knowledge graph. One instance can be found in https://www.dgl.ai/. • Pytorch Geometric. It is a geometric deep learning extension library for pytorch. Specifically, it focuses on the methods for deep learning on graphs and other irregular structures. Same as DGL, it also has its own data structures and operators. One instance can be found in https://pytorch-geometric.readthedocs.io/en/latest/. • OpenHINE. It is an open-source toolkit for heterogeneous graph embedding, which implements many popular heterogeneous graph embedding methods with a unified data interface. One instance can be found in https://github.com/BUPT-GAMMA/OpenHINE.

CHALLENGES AND FUTURE DIRECTIONS
Heterogeneous graph embedding has made great progress in recent years, which clearly shows that it is a powerful and promising graph analysis paradigm. In this section, we discuss additional issues/challenges and explore a series of possible future research directions.

Preserving HG Structures
The basic success of heterogeneous graph embedding builds on the HG structure preservation. This also motivates many heterogeneous graph embedding methods to exploit different HG structures, where the most typical one is metapath [8], [13]. Following this line, meta-graph structure is 8. https://github.com/thunlp/OpenNE 9. https://github.com/THUDM/cogdl naturally considered [41]. However, HG is far more than these structures. Selecting the most appropriate meta-path is still very challenging in the real world. An improper meta-path will fundamentally hinder the performance of heterogeneous graph embedding method. Whether we can explore other techniques, e.g., motif [130], [36] or network schema [78] to capture HG structure is worth pursuing. Moreover, if we rethink the goal of traditional graph embedding, i.e., replacing the structure information with the distance/similarity in a metric space, a research direction to explore is whether we can design a heterogeneous graph embedding method which can naturally learn such distance/similarity rather than using pre-defined metapath/meta-graph.

Capturing HG Properties
As mentioned before, many current heterogeneous graph embedding methods mainly take the structures into account. However, some properties, which usually provide additional useful information to model HG, have not been fully considered. One typical property is the dynamics of HG, i.e., a real world HG always evolves over time. Despite that the incremental learning on dynamic HG is proposed [42], dynamic heterogeneous graph embedding is still facing big challenges. For example, [103] is only proposed with a shallow model, which greatly limits its embedding ability. How can we learn dynamic heterogeneous graph embedding in deep learning framework is worth pursuing. The other property is the uncertainty of HG, i.e., the generation of HG is usually multi-faceted and the node in a HG contains different semantics. Traditionally, learning a vector embedding usually cannot well capture such uncertainty. Gaussian distribution may innately represent the uncertainty property [135], [136], which is largely ignored by current heterogeneous graph embedding methods. This suggests a huge potential direction for improving heterogeneous graph embedding.
One natural question may arise that what is the essential difference between GNNs and HGNNs. More theoretical analysis on HGNNs are seriously lacking. For example, it is well accepted that the GNNs suffer from over-smoothing problem [139], so will heterogeneous GNNs also have such problem? If the answer is yes, what factor causes the oversmoothing problem in HGNNs since they usually contain multiple aggregation strategies [15], [16].
In addition to theoretical analysis, new technique design is also important. One of the most important directions is the self-supervised learning. It uses the pretext tasks to train the neural networks, thus reducing the dependence on manual labels. [140]. Considering the actual demand that label is insufficient, self-supervised learning can greatly benefit the unsupervised and semi-supervised learning, and has shown remarkable performance on homogeneous graph embedding [141], [142], [143], [144]. Therefore, exploring self-supervised learning on heterogeneous graph embedding is expected to further facilitate the development of this area.
Another important direction is the pre-training of HGNNs [145], [146]. Nowadays, HGNNs are designed independently, i.e., the proposed method usually works well for some certain tasks, but the transfer ability across different tasks is ill-considered. When dealing with a new HG or task, we have to train a heterogeneous graph embedding method from scratch, which is time-consuming and requires large amounts of labels. In this situation, if there is a well pretrained HGNN with strong generalization that can be finetuned with few labels, the time and label consumption can be reduced.

Making HG embedding reliable
Except from the properties and techniques in HG, we are also concerned about the ethical issues in HG embedding, such as fairness, robustness and interpretability. Considering that most methods are black boxes, making HG embedding reliable is an important future work.
Fair HG embedding. The embeddings learned by methods are sometimes highly related to certain attributes, e.g., age or gender, which may amplify the societal stereotypes in the prediction results [147], [148]. Therefore, learning fair or de-biased embeddings is an important research direction. There are some researches on the fairness of homogeneous graph embedding [147], [149]. However, the fairness of HG is still an unsolved problem, which is an important research direction in the further.
Robust HG embedding. Also, the robustness of HG embedding, especially the adversarial attacking, is always an important problem [150]. Since many real world applications are built based on HG, the robustness of HG embedding becomes an urgent yet unsolved problem. What is the weakness of HG embedding and how to enhance it to improve the robustness need to be further studied.
Explainable HG embedding. Moreover, in some risk aware scenarios, e.g., fraud detection [6] and bio-medicine [25] , the explanation of models or embeddings is important. A significant advantage of HG is that it contains rich semantics, which may provide eminent insight to promote the explanation of heterogeneous GNNs. Besides, the emerging disentangled learning [151], [152], which divides the embedding into different latent spaces to improve the interpretability, can also be considered.

Technique Deployment in Real-world Applications
Many HG-based applications have stepped into the era of graph embedding. This survey has demonstrated the strong performance of heterogeneous graph embedding methods on E-commerce and cybersecurity. Exploring more capacity of heterogeneous graph embedding on other areas holds great potential in the future. For example, in software engineering area, there are complex relations among test sample, requisition form, and problem form, which can be naturally modeled as HG. Therefore, heterogeneous graph embedding is expected to open up broad prospects for these new areas and become promising analytical tool. Another area is the biological systems, which can also be naturally modeled as a HG. A typical biological system contains many types of objects, e.g., Gene Expression, Chemical, Phenotype, and Microbe. There are also multiple relations between Gene Expression and Phenotype [153]. HG structure has been applied to biological system as an analytical tool, implying that heterogeneous graph embedding is expected to provide more promising results.
In addition, since the complexity of HGNNs are relatively large and the techniques are difficult to parallelize, it is difficult to apply the existing HGNNs to large-scale industrial scenarios. For example, the number of nodes in E-commerce recommendation may reach one billion [20]. Therefore, successful technique deployment in various applications while resolving the scalability and efficiency challenges will be very promising.

Others
Last but not least, there are also some important future work that cannot be summarized in the previous sections. Therefore, we carefully discuss them in this subsection.
Hyperbolic heterogeneous graph embedding. Some recent researches point out that the underlying latent space of graph may be non-Euclidean, but in hyperbolic space [113]. Some attempts have been made towards hyperbolic graph/heterogeneous graph embedding, and the results are rather promising [114], [115], [62]. However, how to design an effective hyperbolic heterogeneous GNNs is still challenging, which can be another research direction.
Heterogeneous graph structure learning. Under the current heterogeneous graph embedding framework, HG is usually constructed beforehand, which is independent on the heterogeneous graph embedding. This may result in that the input HG is not suitable for the final task. HG structure learning can be further integrated with heterogeneous graph embedding, so that they can promote each other.
Connections with knowledge graph. Knowledge graph embedding has great potential on knowledge reasoning [154]. However, knowledge graph embedding and heterogeneous graph embedding are usually investigated separately. Recently, knowledge graph embedding has been successfully applied to other areas, e.g., recommender system [155], [156]. It is worth studying that how to combine knowledge graph embedding with heterogeneous graph embedding, and incorporate knowledge into heterogeneous graph embedding.

CONCLUSION
Heterogeneous graph embedding has significantly facilitated the HG analysis and related applications. This survey conducts a comprehensive study of the state-of-theart heterogeneous graph embedding methods. Thorough discussions and summarization of the reviewed methods, along with the widely used benchmarks and resources, are systematically presented. We hope that this survey can provide a clean sketch on heterogeneous graph embedding, which could help both the interested readers as well as the researchers that wish to continue working in this area.