예제 #1
0
파일: GraphDS_API.cs 프로젝트: cosh/sones
 public ServiceEdgeType AlterEdgeType(SecurityToken mySecurityToken, Int64 myTransactionToken,
     ServiceEdgeType myEdgeType, ServiceAlterEdgeChangeset myChangeset)
 {
     var Request = ServiceRequestFactory.MakeRequestAlterEdgeType(myEdgeType, myChangeset);
     var Response = this.GraphDS.AlterEdgeType<IEdgeType>(mySecurityToken, myTransactionToken, Request,
        ServiceReturnConverter.ConvertOnlyEdgeType);
     return new ServiceEdgeType(Response);
 }
 public ServiceOutgoingEdgeDefinition(IOutgoingEdgeDefinition myOutgoingEdgeDefinition)
     : base(myOutgoingEdgeDefinition)
 {
     this.EdgeType = new ServiceEdgeType(myOutgoingEdgeDefinition.EdgeType);
     this.InnerEdgeType = new ServiceEdgeType(myOutgoingEdgeDefinition.InnerEdgeType);
     this.SourceVertexType = new ServiceVertexType(myOutgoingEdgeDefinition.SourceVertexType);
     this.TargetVertexType = new ServiceVertexType(myOutgoingEdgeDefinition.TargetVertexType);
     this.Multiplicity = ConvertHelper.ToServiceEdgeMultiplicity(myOutgoingEdgeDefinition.Multiplicity);
 }
예제 #3
0
 public static ServiceBaseType ToServiceBaseType(IBaseType myBaseType)
 {
     ServiceBaseType svcBaseType = null;
     if (myBaseType is IVertexType)
     {
         svcBaseType = new ServiceVertexType((IVertexType)myBaseType);
     }
     else if (myBaseType is IEdgeType)
     {
         svcBaseType = new ServiceEdgeType((IEdgeType)myBaseType);
     }
     return svcBaseType;
 }
예제 #4
0
        public static RequestAlterEdgeType MakeRequestAlterEdgeType(ServiceEdgeType myEdgeType, ServiceAlterEdgeChangeset myChangeset)
        {
            var Request = new RequestAlterEdgeType(myEdgeType.Name);

            #region Add Attributes

            if (myChangeset.ToBeAddedProperties != null)
            {
                foreach (var toAdd in myChangeset.ToBeAddedProperties)
                {
                    Request.AddProperty(toAdd.ToPropertyPredefinition());
                }
            }

            #endregion

            #region Remove Attributes

            if (myChangeset.ToBeRemovedProperties != null)
            {
                foreach (var toDel in myChangeset.ToBeRemovedProperties)
                {
                    Request.RemoveProperty(toDel);
                }
            }

            #endregion

            #region Rename Task

            if (myChangeset.ToBeRenamedProperties != null)
            {
                foreach(var item in myChangeset.ToBeRenamedProperties)
                {
                    Request.RenameAttribute(item.Key, item.Value);
                }
            }

            #endregion

            if (myChangeset.Comment != null)
                Request.SetComment(myChangeset.Comment);

            if (myChangeset.NewTypeName != null)
                Request.RenameType(myChangeset.NewTypeName);

            //todo add unknown attribute

            return Request;
        }
예제 #5
0
 public static RequestDropEdgeType MakeRequestDropEdgeType(ServiceEdgeType myEdgeType)
 {
     RequestDropEdgeType Request = new RequestDropEdgeType(myEdgeType.Name);
     return Request;
 }
예제 #6
0
 public List<ServiceEdgeType> GetDescendantEdgeTypesAndSelf(SecurityToken mySecurityToken, Int64 myTransToken, ServiceEdgeType myServiceEdgeType)
 {
     var Request = ServiceRequestFactory.MakeRequestGetEdgeType(myServiceEdgeType.Name);
     var Response = this.GraphDS.GetEdgeType<IEdgeType>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyEdgeType);
     return Response.GetDescendantEdgeTypesAndSelf().Select(x => new ServiceEdgeType(x)).ToList();
 }
예제 #7
0
 public List<ServiceAttributeDefinition> GetAttributeDefinitions(SecurityToken mySecurityToken, Int64 myTransToken, ServiceEdgeType myServiceEdgeType, bool myIncludeAncestorDefinitions)
 {
     var Request = ServiceRequestFactory.MakeRequestGetEdgeType(myServiceEdgeType.Name);
     var Response = this.GraphDS.GetEdgeType<IEdgeType>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyEdgeType);
     return Response.GetAttributeDefinitions(myIncludeAncestorDefinitions).Select(x => ConvertHelper.ToServiceAttributeDefinition(x)).ToList();
 }
예제 #8
0
 public ServiceAttributeDefinition GetAttributeDefinitionByID(SecurityToken mySecurityToken, Int64 myTransToken, ServiceEdgeType myServiceEdgeType, long myAttributeID)
 {
     var Request = ServiceRequestFactory.MakeRequestGetEdgeType(myServiceEdgeType.Name);
     var Response = this.GraphDS.GetEdgeType<IEdgeType>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyEdgeType);
     return ConvertHelper.ToServiceAttributeDefinition(Response.GetAttributeDefinition(myAttributeID));
 }
예제 #9
0
 public ServiceEdgeType ParentEdgeType(SecurityToken mySecurityToken, Int64 myTransToken, ServiceEdgeType myServiceEdgeType)
 {
     var Request = ServiceRequestFactory.MakeRequestGetEdgeType(myServiceEdgeType.Name);
     var Response = this.GraphDS.GetEdgeType<IEdgeType>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyEdgeType);
     return new ServiceEdgeType(Response.ParentEdgeType);
 }
예제 #10
0
 public bool IsDescendantOrSelf(SecurityToken mySecurityToken, Int64 myTransToken, ServiceEdgeType myServiceEdgeType, ServiceEdgeType myOtherType)
 {
     var Request = ServiceRequestFactory.MakeRequestGetEdgeType(myOtherType.Name);
     var BaseType = this.GraphDS.GetEdgeType<IEdgeType>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyEdgeType);
     Request = ServiceRequestFactory.MakeRequestGetEdgeType(myServiceEdgeType.Name);
     var Response = this.GraphDS.GetEdgeType<IEdgeType>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyEdgeType);
     return Response.IsDescendantOrSelf(BaseType);
 }
예제 #11
0
 public bool HasProperty(SecurityToken mySecurityToken, Int64 myTransToken, ServiceEdgeType myServiceEdgeType, string myAttributeName)
 {
     var Request = ServiceRequestFactory.MakeRequestGetEdgeType(myServiceEdgeType.Name);
     var Response = this.GraphDS.GetEdgeType<IEdgeType>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyEdgeType);
     return Response.HasProperty(myAttributeName);
 }
예제 #12
0
 public bool HasProperties(SecurityToken mySecurityToken, Int64 myTransToken, ServiceEdgeType myServiceEdgeType, bool myIncludeAncestorDefinitions)
 {
     var Request = ServiceRequestFactory.MakeRequestGetEdgeType(myServiceEdgeType.Name);
     var Response = this.GraphDS.GetEdgeType<IEdgeType>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyEdgeType);
     return Response.HasProperties(myIncludeAncestorDefinitions);
 }
예제 #13
0
파일: GraphDS_API.cs 프로젝트: cosh/sones
 public Dictionary<Int64, String> DropEdgeType(SecurityToken mySecurityToken, Int64 myTransactionToken,
     ServiceEdgeType myEdgeType)
 {
     var Request = ServiceRequestFactory.MakeRequestDropEdgeType(myEdgeType);
     var Response = this.GraphDS.DropEdgeType<Dictionary<Int64, String>>(mySecurityToken, myTransactionToken, Request,
         ServiceReturnConverter.ConverteOnlyDeletedTypeIDs);
     return Response;
 }