/// <summary> /// Creates the vertexType based on the VertexTypeName. /// /// The vertexType contains one Outgoing Edge Defintion, the edge /// is weighted and can't contain any other attributes. /// </summary> private void CreateVertexType() { #region create vertex type var vertexTypePreDef = new VertexTypePredefinition(_VertexTypeName); var outEdgePreDef = new OutgoingEdgePredefinition(_EdgeTypeName, vertexTypePreDef); #region create edge definition // weighted multi-edge outEdgePreDef.SetEdgeTypeAsWeighted(); // set inner edge type to weighted outEdgePreDef.SetMultiplicityAsMultiEdge("Weighted"); vertexTypePreDef.AddOutgoingEdge(outEdgePreDef); #endregion #region create id definition var idPreDefinition = new PropertyPredefinition(GraphMLTokens.VERTEX_ID_NAME , GraphMLTokens.VERTEX_ID_TYPE); idPreDefinition.SetDefaultValue(GraphMLTokens.VERTEX_ID_DEF_VAL); vertexTypePreDef.AddProperty(idPreDefinition); #endregion #region create vertex type var requestCreateVertexType = new RequestCreateVertexType(vertexTypePreDef); _GraphDB.CreateVertexType(_SecurityToken, _TransactionToken, requestCreateVertexType, (stats, vType) => vType); #endregion #endregion }
public TResult CreateVertexType <TResult>(sones.Library.Commons.Security.SecurityToken mySecurityToken, long myTransactionID, sones.GraphDB.Request.RequestCreateVertexType myRequestCreateVertexType, sones.GraphDB.Request.Converter.CreateVertexTypeResultConverter <TResult> myOutputconverter) { Stopwatch RunningTime = Stopwatch.StartNew(); var svcVertexType = _GraphDSService.CreateVertexType(mySecurityToken, myTransactionID, new ServiceVertexTypePredefinition(myRequestCreateVertexType.VertexTypeDefinition)); var vertexType = new RemoteVertexType(svcVertexType, this); RunningTime.Stop(); return(myOutputconverter(new RequestStatistics(new TimeSpan(RunningTime.ElapsedTicks)), vertexType)); }
/// <summary> /// Creates a new pipelineable create parentVertex type request /// </summary> /// <param name="myCreateVertexTypeRequest">The create parentVertex type request</param> /// <param name="mySecurity">The security token of the request initiator</param> /// <param name="myTransactionToken">The myOutgoingEdgeVertex transaction token</param> public PipelineableCreateVertexTypeRequest(RequestCreateVertexType myCreateVertexTypeRequest, SecurityToken mySecurity, Int64 myTransactionToken) : base(mySecurity, myTransactionToken) { _request = myCreateVertexTypeRequest; }