title: Vertex Property Inheritance - Graphx Scala Spark
body: <p>--- Edit ---</p>
  
  <p>My main issue is that I do not understand this paragraph given in the Graphx documentation:</p>
  
  <p><strong>In some cases it may be desirable to have vertices with different property types in the same graph. This can be accomplished through inheritance. For example to model users and products as a bipartite graph we might do the following:</strong></p>
  
  <pre><code>class VertexProperty()
  case class UserProperty(val name: String) extends VertexProperty
  case class ProductProperty(val name: String, val price: Double) extends VertexProperty
  // The graph might then have the type:
  var graph: Graph[VertexProperty, String] = null
  </code></pre>
  
  <p>In the above case given RDD's of each UserProperty and ProductProperty and a RDD of EdgeProperty, how does one create a graph of type Graph[VertexProperty, String].
  I am looking for an example.</p>
  
  <hr>