Ejemplo n.º 1
0
 public TResult AlterVertexType <TResult>(sones.Library.Commons.Security.SecurityToken mySecurityToken, Int64 myTransactionToken, RequestAlterVertexType myRequestAlterVertexType, Converter.AlterVertexTypeResultConverter <TResult> myOutputconverter)
 {
     return(_iGraphDB.AlterVertexType <TResult>(
                mySecurityToken,
                myTransactionToken,
                myRequestAlterVertexType,
                myOutputconverter));
 }
Ejemplo n.º 2
0
        public override IQueryResult Execute(IGraphDB myGraphDB, IGraphQL myGraphQL, GQLPluginManager myPluginManager, String myQuery, SecurityToken mySecurityToken, Int64 myTransactionToken)
        {
            _query = myQuery;

            return(myGraphDB.AlterVertexType <IQueryResult>(
                       mySecurityToken,
                       myTransactionToken,
                       CreateNewRequest(myGraphDB, myPluginManager, mySecurityToken, myTransactionToken),
                       CreateOutput));
        }
Ejemplo n.º 3
0
        public override QueryResult Execute(IGraphDB myGraphDB, IGraphQL myGraphQL, GQLPluginManager myPluginManager, String myQuery, SecurityToken mySecurityToken, Int64 myTransactionToken)
        {
            _query = myQuery;

            return myGraphDB.AlterVertexType<QueryResult>(
                mySecurityToken,
                myTransactionToken,
                CreateNewRequest(myGraphDB, myPluginManager, mySecurityToken, myTransactionToken),
                CreateOutput);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Reads an attribute definition from the GraphML File and stores
        /// it internal for later usage on vertex / edge reading.
        /// </summary>
        /// <param name='myReader'>
        /// XmlReader
        /// </param>
        private void ReadAttributeDefinition(XmlReader myReader)
        {
            #region data

            var attrId   = myReader.GetAttribute(GraphMLTokens.ID);
            var attrFor  = myReader.GetAttribute(GraphMLTokens.FOR);
            var attrName = myReader.GetAttribute(GraphMLTokens.ATTRIBUTE_NAME);
            var attrType = myReader.GetAttribute(GraphMLTokens.ATTRIBUTE_TYPE).ToLower();

            string attrDefault = null;

            using (var readerAttribute = myReader.ReadSubtree())
            {
                while (readerAttribute.Read())
                {
                    if (readerAttribute.Name == GraphMLTokens.DEFAULT)
                    {
                        attrDefault = readerAttribute.ReadElementContentAsString();
                    }
                }
            }

            // make attribute type DB conform (capitalize first letter)
            attrType = char.ToUpper(attrType[0]) + attrType.Substring(1).ToLower();
            // and store the whole definition
            _AttributeDefinitions.Add(attrId, new Tuple <string, string, string, string>(attrFor, attrName, attrType, attrDefault));
            // get GraphDB internal type
            attrType = GetInternalTypeName(attrType);

            #endregion

            #region alter vertex type with new attribute

            if (attrFor.Equals(GraphMLTokens.VERTEX))
            {
                var requestAlterVertexType = new RequestAlterVertexType(_VertexTypeName);

                var propertyPreDefinition = new PropertyPredefinition(attrName, attrType);

                propertyPreDefinition.SetDefaultValue(attrDefault);

                requestAlterVertexType.AddProperty(propertyPreDefinition);

                _GraphDB.AlterVertexType(_SecurityToken,
                                         _TransactionToken,
                                         requestAlterVertexType,
                                         (stats, vType) => vType);
            }

            #endregion
        }