

{"id":5517,"date":"2018-01-19T11:23:52","date_gmt":"2018-01-19T11:23:52","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=5517"},"modified":"2018-09-17T16:26:24","modified_gmt":"2018-09-17T10:56:24","slug":"graphx-api-spark","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/graphx-api-spark\/","title":{"rendered":"GraphX API in Apache Spark: An Introductory Guide"},"content":{"rendered":"<h2>1. Objective &#8211; Spark GraphX API<\/h2>\n<p><span style=\"font-weight: 400\">For graphs and graph-parallel computation, <a href=\"https:\/\/data-flair.training\/blogs\/apache-spark-for-beginners\/\"><strong>Apache Spark<\/strong><\/a> has an additional API, GraphX. In this blog, we will learn the whole concept of GraphX API in Spark. We will also learn how to import Spark and GraphX into the project. Moreover, we will understand the concept of Property Graph. Also, we will cover graph operators and Pregel API in detail. In addition, we will also learn the features of GraphX. Furthermore, we will see the use cases of GraphX API.<\/span><\/p>\n<p>So, let&#8217;s start the Spark GraphX API tutorial.<\/p>\n<div id=\"attachment_5518\" style=\"width: 812px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/12\/Introduction-to-GraphX-API-in-Apache-Spark-01.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-5518\" class=\"wp-image-5518 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/12\/Introduction-to-GraphX-API-in-Apache-Spark-01.jpg\" alt=\"Spark GraphX API\" width=\"802\" height=\"420\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/12\/Introduction-to-GraphX-API-in-Apache-Spark-01.jpg 802w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/12\/Introduction-to-GraphX-API-in-Apache-Spark-01-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/12\/Introduction-to-GraphX-API-in-Apache-Spark-01-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/12\/Introduction-to-GraphX-API-in-Apache-Spark-01-768x402.jpg 768w\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" \/><\/a><p id=\"caption-attachment-5518\" class=\"wp-caption-text\">GraphX API in Apache Spark: An Introductory Guide<\/p><\/div>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/apache-spark-online-quiz-part-1\/\">Test how much you know about Spark\u00a0<\/a><\/strong><\/p>\n<h2>2. Introduction to Spark GraphX API<\/h2>\n<p><span style=\"font-weight: 400\">For graphs and graph-parallel computation, Apache Spark has an additional API, GraphX. To simplify graph analytics tasks it includes the collection of graph algorithms &amp; builders.<\/span><br \/>\n<span style=\"font-weight: 400\">In addition, it extends the <a href=\"https:\/\/data-flair.training\/blogs\/apache-spark-rdd-tutorial\/\"><strong>Spark RDD<\/strong><\/a> with a Resilient Distributed Property Graph. Basically, the property graph is a directed multigraph. It has multiple edges in parallel. Here, every vertex and edge have user-defined properties associated with it. Moreover, parallel edges allow multiple relationships between the same vertices.<\/span><\/p>\n<h2>3. Getting Started with GraphX<\/h2>\n<p><span style=\"font-weight: 400\">You first need to import Spark and GraphX into your project, To get started, code as Follows:<\/span><br \/>\n<b>import<\/b> <b>org.apache.spark._<\/b><br \/>\n<b>import<\/b> <b>org.apache.spark.graphx._<\/b><br \/>\n<i><span style=\"font-weight: 400\">\/\/ To make some of the examples work we will also need RDD<\/span><\/i><br \/>\n<b>import<\/b> <b>org.apache.spark.rdd.RDD<\/b><br \/>\n<span style=\"font-weight: 400\">Note: you will also need a SparkContext if you are not using the Spark shell.<\/span><\/p>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/structured-streaming-in-sparkr\/\">Let&#8217;s discuss Spark Structured Streaming<\/a><\/strong><\/p>\n<h2>4. The Property Graph<\/h2>\n<p><span style=\"font-weight: 400\">A directed multigraph with user-defined objects attached to each vertex and edge is a property graph. It is a graph with potentially multiple parallel edges. They are also sharing the same source and destination vertex. Where there can be multiple relationships between the same vertices, they are able to support parallel edges. It also simplifies modeling scenarios. By a unique 64-bit long identifier (VertexId) each vertex is keyed. It does not impose any ordering constraints on the vertex identifiers. Hence, edges have corresponding source and destination vertex identifiers.<\/span><br \/>\n<span style=\"font-weight: 400\">Basically, it is parameterized over the vertex (VD) and edge (ED) types. Ultimately, these are the types of the objects those are associated with each vertex and edge respectively.<\/span><br \/>\n<b>Some more Insights<\/b><br \/>\n<span style=\"font-weight: 400\">In addition, it optimizes the representation of vertex and edge types. While they are primitive data types it reduces the in memory footprint. Even by storing them in specialized arrays.<\/span><br \/>\n<span style=\"font-weight: 400\">As same as RDDs, property graphs are also immutable, distributed, and fault-tolerant. we can produce a new graph with the desired changes by changing the values or structure of the graph. \u00a0We can reuse substantial parts of the original graph in the new graph. It also reduces the cost of this inherently functional data structure. Using a range of vertex partitioning heuristics, a graph is partitioned across the executors. In the event of a failure, each partition of the graph can be recreated on a different machine.<\/span><\/p>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/spark-machine-learning-with-r\/\">Have a look at Spark machine Learning with R<\/a><\/strong><\/p>\n<h2>5. Spark Graph Operators<\/h2>\n<p><span style=\"font-weight: 400\">As same as RDDs basic operations like map, filter, property graphs also have a collection of basic operators. \u00a0Those operators take UDFs (user defined functions) and produce new graphs. \u00a0Moreover, these are produced with transformed properties and structure. In GraphX, there are some core operators defined that have optimized implementations. While in GraphOps there are some convenient operators that are expressed as compositions of the core operators. Although, Scala operators in GraphOps are automatically available as members of Graph.<\/span><br \/>\n<b>Example of Spark Graph Operators<\/b><br \/>\n<span style=\"font-weight: 400\">To compute in-degree of each vertex (defined in GraphOps):<\/span><br \/>\n<b>val<\/b><span style=\"font-weight: 400\"> graph1<\/span><b>:<\/b><span style=\"font-weight: 400\"> Graph[(String, String), String]<\/span><br \/>\n<i><span style=\"font-weight: 400\">\/\/ Use the implicit GraphOps.inDegrees operator<\/span><\/i><br \/>\n<b>val<\/b><span style=\"font-weight: 400\"> inDegrees1<\/span><b>:<\/b><span style=\"font-weight: 400\"> VertexRDD[Int] <\/span><b>=<\/b><span style=\"font-weight: 400\"> graph.inDegrees1<\/span><br \/>\n<span style=\"font-weight: 400\">The only difference between core graph operations and GraphOps is different graph representations. In addition, it is must that each graphical representation provides an implementation of the core operations. We can reuse many of the useful GraphOps operations.<\/span><br \/>\n<span style=\"font-weight: 400\">There is a set of fundamental operators. For example. Subgraph, joinVertices, and aggregateMessages. Let&#8217;s discuss all in detail:<\/span><\/p>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/sparkr\/\">Do you know about SparkR<\/a><\/strong><\/p>\n<h3>a. Structural Operators<\/h3>\n<p><span style=\"font-weight: 400\">It supports a simple set of commonly used structural operators. The following is a list of the basic structural operators in Spark.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">class Graph[VD, ED] {\r\ndef reverse: Graph[VD, ED]\r\ndef subgraph(epred: EdgeTriplet[VD,ED] =&gt; Boolean,\r\n             vpred: (VertexId, VD) =&gt; Boolean): Graph[VD, ED]\r\ndef mask[VD2, ED2](other: Graph[VD2, ED2]): Graph[VD, ED]\r\ndef groupEdges(merge: (ED, ED) =&gt; ED): Graph[VD,ED]\r\n}<\/pre>\n<h4>i. The reverse operator<\/h4>\n<p><span style=\"font-weight: 400\">With all the edge directions reversed, it returns a new graph. when trying to compute the inverse PageRank, this can be very useful.<\/span><\/p>\n<h4>ii. The subgraph operator<\/h4>\n<p><span style=\"font-weight: 400\">It returns the graph containing only the vertices, by taking vertex and edge predicates. We can use subgraph operator to restrict the graph to the vertices and edges of interest. Also to eliminate broken links.<\/span><\/p>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/spark-stage\/\">Have a look at Spark stage<\/a><\/strong><\/p>\n<h4>iii. The mask operator<\/h4>\n<p><span style=\"font-weight: 400\">It constructs a subgraph by returning a graph that contains the vertices and edges that are also found in the input graph. We can use it in conjunction with the subgraph operator to restrict a graph based on the properties in another related graph.<\/span><\/p>\n<h4>iv. The groupEdges operator<\/h4>\n<p>It merges parallel edges in the multigraph.<\/p>\n<h3>b. Join Operators<\/h3>\n<p><span style=\"font-weight: 400\">Sometimes it is the major requirement to join data from external collections (RDDs) with graphs. Like it is possible that we have extra user properties that we want to merge with an existing graph. Also, we might want to pull vertex properties from one graph into another. Hence, we can accomplish it by using the <\/span><i><span style=\"font-weight: 400\">join<\/span><\/i><span style=\"font-weight: 400\"> operators. In addition, there are two Join operators, joinvertices, and Outerjoinvertices.<\/span><\/p>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/spark-executor\/\">You must learn Spark executor<\/a><\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">class Graph[VD, ED] {\r\ndef joinVertices[U](table: RDD[(VertexId, U)])(map: (VertexId, VD, U) =&gt; VD)\r\n  : Graph[VD, ED]\r\ndef outerJoinVertices[U, VD2](table: RDD[(VertexId, U)])(map: (VertexId, VD, Option[U]) =&gt; VD2)\r\n  : Graph[VD2, ED]\r\n}<\/pre>\n<h3>c. Aggregate Messages (aggregateMessages)<\/h3>\n<p><span style=\"font-weight: 400\">In GraphX, the core aggregation operation is aggregateMessages. It applies a user-defined sendMsg function to each <\/span><i><span style=\"font-weight: 400\">edge triplet<\/span><\/i><span style=\"font-weight: 400\"> in the graph. Afterwards, it uses the mergeMsg function to aggregate those messages at their destination vertex.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">class Graph[VD, ED] {\r\ndef aggregateMessages[Msg: ClassTag](\r\n    sendMsg: EdgeContext[VD, ED, Msg] =&gt; Unit,\r\n    mergeMsg: (Msg, Msg) =&gt; Msg,\r\n    tripletFields: TripletFields = TripletFields.All)\r\n  : VertexRDD[Msg]\r\n}<\/pre>\n<h2>6. Pregel API<\/h2>\n<p><span style=\"font-weight: 400\">Since properties of vertices depend on properties of their neighbors, Graphs are inherently recursive data structures. That, in turn, depend on properties of <\/span><i><span style=\"font-weight: 400\">their<\/span><\/i><span style=\"font-weight: 400\"> neighbors. As a matter of fact, many important graph algorithms iteratively recompute the properties of each vertex. It recomputes until it reaches a fixed-point condition. Basically, To express these iterative algorithms it proposes a graph-parallel abstraction. Hence, there is a variant of the Pregel API, exposed by GraphX.<\/span><\/p>\n<h2>7. Spark GraphX Features<\/h2>\n<p><span style=\"font-weight: 400\">The <a href=\"https:\/\/data-flair.training\/blogs\/apache-spark-graphx-features\/\"><strong>features of Spark GraphX<\/strong><\/a> are as follows:<\/span><\/p>\n<h3>a. Flexibility<\/h3>\n<p><span style=\"font-weight: 400\">We can work with both graphs and computations with Spark GraphX. It includes exploratory analysis, ETL (Extract, Transform &amp; Load), the iterative graph in 1 system. It is possible to view the same data as both graphs, collections, transform and join graphs with RDDs. Also using the Pregel API it is possible to write custom iterative graph algorithms.<\/span><\/p>\n<h3>b. Speed<\/h3>\n<p><span style=\"font-weight: 400\">It offers comparable performance to the fastest specialized graph processing systems. Also comparable with the fastest graph systems. Even while retaining Spark\u2019s flexibility, fault tolerance and ease of use.<\/span><\/p>\n<h3>c. Growing Algorithm Library<\/h3>\n<p><span style=\"font-weight: 400\">Spark GraphX offers growing library of graph algorithms. Basically, We can choose from it. For example pagerank, connected components, SVD++, strongly connected components and triangle count.<\/span><\/p>\n<h2>8. Conclusion &#8211; GraphX API in Spark<\/h2>\n<p><span style=\"font-weight: 400\">As a result, we have learned the whole concept of GraphX API. Moreover, we have covered the brief introduction of Operators and Variant, Pregel API. Also, we have seen how GraphX API in Apache Spark: An Introductory Guide simplifies graph analytics tasks in Spark. Hence, GraphX API is very useful for graphs and graph-parallel computation in Spark.<\/span><\/p>\n<p><strong>See also &#8211;\u00a0<\/strong><\/p>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/spark-quiz-questions-part-2\/\">Spark Quiz<\/a><\/strong><\/p>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Apache_Spark\"><strong>Reference for Spark<\/strong><\/a><span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:1357,&quot;href&quot;:&quot;https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/Apache_Spark&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20250922221612\\\/https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/Apache_Spark&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-09 05:27:27&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-12 10:08:16&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-15 10:54:44&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-18 15:58:49&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-21 22:36:30&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-25 05:31:45&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-28 12:45:42&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-31 14:24:43&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-03 17:46:17&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-07 06:00:10&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-10 18:44:33&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-14 03:23:51&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-17 07:55:39&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-20 08:53:11&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-23 13:06:21&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-26 19:31:27&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-30 03:59:32&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-02 04:29:15&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-05 06:45:01&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-08 15:14:08&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-11 17:11:37&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-14 17:21:25&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-17 19:54:27&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-21 15:31:35&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-24 16:57:05&quot;,&quot;http_code&quot;:429},{&quot;date&quot;:&quot;2026-02-27 17:43:21&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-02 18:00:05&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-06 08:59:01&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-09 10:45:21&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-12 12:05:44&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-15 13:52:04&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-18 16:22:15&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-22 02:26:17&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-25 06:42:29&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-28 13:17:46&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-31 19:34:11&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-03 21:06:08&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-07 13:23:55&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-10 15:12:24&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-14 01:00:09&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-17 15:03:23&quot;,&quot;http_code&quot;:429},{&quot;date&quot;:&quot;2026-04-20 17:12:48&quot;,&quot;http_code&quot;:429},{&quot;date&quot;:&quot;2026-04-23 18:14:30&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-26 23:59:57&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-30 03:29:22&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-03 03:48:13&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-06 06:11:43&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-09 10:25:28&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-12 12:20:35&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-15 15:48:18&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-19 00:06:09&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-22 12:24:50&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-25 12:59:28&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-28 18:04:56&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-01 07:34:11&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-04 09:52:56&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-07 13:28:25&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-06-10 15:46:34&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-06-14 08:05:27&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-18 01:16:15&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-21 13:30:04&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-24 15:27:50&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-27 17:21:08&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-07-01 06:45:50&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-07-04 09:53:27&quot;,&quot;http_code&quot;:200}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-07-04 09:53:27&quot;,&quot;http_code&quot;:200},&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Objective &#8211; Spark GraphX API For graphs and graph-parallel computation, Apache Spark has an additional API, GraphX. In this blog, we will learn the whole concept of GraphX API in Spark. We will&#46;&#46;&#46;<\/p>\n","protected":false},"author":6,"featured_media":34387,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[5151,5152,13062],"class_list":["post-5517","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spark","tag-graphx-api","tag-graphx-api-in-apache-spark","tag-spark-graphx-api"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>GraphX API in Apache Spark: An Introductory Guide - DataFlair<\/title>\n<meta name=\"description\" content=\"Apache Spark GraphX API - What is GraphX API in spark, Property Graph, GraphX Operators in Spark, Features of Spark GraphX API, Pregel API,aggregatemessages\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/graphx-api-spark\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"GraphX API in Apache Spark: An Introductory Guide - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Apache Spark GraphX API - What is GraphX API in spark, Property Graph, GraphX Operators in Spark, Features of Spark GraphX API, Pregel API,aggregatemessages\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/graphx-api-spark\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-01-19T11:23:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-09-17T10:56:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Introduction-to-GraphX-API-in-Apache-Spark-01.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"802\" \/>\n\t<meta property=\"og:image:height\" content=\"420\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"GraphX API in Apache Spark: An Introductory Guide - DataFlair","description":"Apache Spark GraphX API - What is GraphX API in spark, Property Graph, GraphX Operators in Spark, Features of Spark GraphX API, Pregel API,aggregatemessages","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/graphx-api-spark\/","og_locale":"en_US","og_type":"article","og_title":"GraphX API in Apache Spark: An Introductory Guide - DataFlair","og_description":"Apache Spark GraphX API - What is GraphX API in spark, Property Graph, GraphX Operators in Spark, Features of Spark GraphX API, Pregel API,aggregatemessages","og_url":"https:\/\/data-flair.training\/blogs\/graphx-api-spark\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2018-01-19T11:23:52+00:00","article_modified_time":"2018-09-17T10:56:24+00:00","og_image":[{"width":802,"height":420,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Introduction-to-GraphX-API-in-Apache-Spark-01.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/graphx-api-spark\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/graphx-api-spark\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89"},"headline":"GraphX API in Apache Spark: An Introductory Guide","datePublished":"2018-01-19T11:23:52+00:00","dateModified":"2018-09-17T10:56:24+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/graphx-api-spark\/"},"wordCount":1243,"commentCount":1,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/graphx-api-spark\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Introduction-to-GraphX-API-in-Apache-Spark-01.jpg","keywords":["GraphX API","GraphX API in Apache Spark","Spark GraphX API"],"articleSection":["Apache Spark Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/graphx-api-spark\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/graphx-api-spark\/","url":"https:\/\/data-flair.training\/blogs\/graphx-api-spark\/","name":"GraphX API in Apache Spark: An Introductory Guide - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/graphx-api-spark\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/graphx-api-spark\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Introduction-to-GraphX-API-in-Apache-Spark-01.jpg","datePublished":"2018-01-19T11:23:52+00:00","dateModified":"2018-09-17T10:56:24+00:00","description":"Apache Spark GraphX API - What is GraphX API in spark, Property Graph, GraphX Operators in Spark, Features of Spark GraphX API, Pregel API,aggregatemessages","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/graphx-api-spark\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/graphx-api-spark\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/graphx-api-spark\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Introduction-to-GraphX-API-in-Apache-Spark-01.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Introduction-to-GraphX-API-in-Apache-Spark-01.jpg","width":802,"height":420,"caption":"GraphX API in Apache Spark: An Introductory Guide"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/graphx-api-spark\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Apache Spark Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/spark\/"},{"@type":"ListItem","position":3,"name":"GraphX API in Apache Spark: An Introductory Guide"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"The DataFlair Team provides industry-driven content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our expert educators focus on delivering value-packed, easy-to-follow resources for tech enthusiasts and professionals.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam2\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/5517","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=5517"}],"version-history":[{"count":5,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/5517\/revisions"}],"predecessor-version":[{"id":34401,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/5517\/revisions\/34401"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/34387"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=5517"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=5517"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=5517"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}