protected Exceptional RemoveBackwardEdges(TypeUUID myTypeUUID, Dictionary<AttributeUUID, object> myUserdefinedAttributes, ObjectUUID myObjectUUIDReference, DBContext myDBContext)
        {
            #region get type that carries the attributes

            var aType = myDBContext.DBTypeManager.GetTypeByUUID(myTypeUUID);

            #endregion

            #region process attributes

            foreach (var aUserDefinedAttribute in myUserdefinedAttributes)
            {

                #region Data

                GraphDBType typeOFAttribute = null;
                TypeAttribute attributesOfType = null;

                #endregion

                #region get GraphType of Attribute

                attributesOfType = aType.Attributes[aUserDefinedAttribute.Key];

                typeOFAttribute = myDBContext.DBTypeManager.GetTypeByUUID(attributesOfType.DBTypeUUID);

                #endregion

                IEnumerable<Exceptional<DBObjectStream>> listOfObjects;

                if (aUserDefinedAttribute.Value is IReferenceEdge)
                {
                    listOfObjects = ((IReferenceEdge)aUserDefinedAttribute.Value).GetAllEdgeDestinations(myDBContext.DBObjectCache);
                }
                else
                {
                    listOfObjects = myDBContext.DBObjectCache.LoadListOfDBObjectStreams(typeOFAttribute, (HashSet<ObjectUUID>)aUserDefinedAttribute.Value);
                }

                foreach (var aDBObject in listOfObjects)
                {
                    if (aDBObject.Failed())
                    {
                        return new Exceptional(aDBObject);
                    }

                    var removeExcept = myDBContext.DBObjectManager.RemoveBackwardEdge(aDBObject.Value, myTypeUUID, aUserDefinedAttribute.Key, myObjectUUIDReference);

                    if (removeExcept.Failed())
                    {
                        return new Exceptional(removeExcept);
                    }
                }

            }

            #endregion

            return Exceptional.OK;
        }
 public override void Add(ObjectUUID myValue, TypeUUID typeOfDBObjects, params ADBBaseObject[] myParameters)
 {
     if (!_ObjectUUIDs.ContainsKey(myValue))
     {
         _ObjectUUIDs.Add(myValue, new Reference(myValue, typeOfDBObjects));
     }
 }
 public EdgeTypeSingleReference(ObjectUUID dbos, TypeUUID myTypeOfDBObject)
 {
     Debug.Assert(myTypeOfDBObject != null);
     if (dbos != null)
     {
         _ObjectUUID = new Tuple<ObjectUUID, Reference>(dbos, new Reference(dbos, myTypeOfDBObject));
     }
 }
Exemple #4
0
 public ADBSettingsBase(String myName, String myDescription, EntityUUID myOwnerID, TypeUUID myType, ADBBaseObject myDefault, ADBBaseObject myValue)
 {
     Name        = myName;
     Description = myDescription;
     OwnerID     = myOwnerID;
     Type        = myType;
     Default     = myDefault;
     _Value      = myValue;
 }
        public EdgeTypeSetOfReferences(IEnumerable<ObjectUUID> dbos, TypeUUID typeOfDBObjects)
        {
            Debug.Assert(typeOfDBObjects != null);

            _ObjectUUIDs = new Dictionary<ObjectUUID, Reference>();

            if (dbos != null)
            {
                foreach (var aUUID in dbos)
                {
                    _ObjectUUIDs.Add(aUUID, new Reference(aUUID, typeOfDBObjects));
                }
            }
        }
Exemple #6
0
 /// <summary>
 /// Loads a DBObject from internal cache structure or GraphFS (if it is not present in cache)
 /// </summary>
 /// <param name="myType">The type of the DBObject as TypeUUID.</param>
 /// <param name="myObjectUUID">The UUID of the DBObject.</param>
 /// <returns>A DBObject.</returns>
 public Exceptional<DBObjectStream> LoadDBObjectStream(TypeUUID myType, ObjectUUID myObjectUUID)
 {
     return LoadDBObjectStream(_typeManager.GetTypeByUUID(myType), myObjectUUID);
 }
        public override void Add(ObjectUUID myValue, TypeUUID typeOfDBObjects, params ADBBaseObject[] myParameters)
        {
            if (!_ObjectUUIDs.ContainsKey(myValue))
            {
                var aReference = new Reference(myValue, typeOfDBObjects);

                _estimatedSize += aReference.GetEstimatedSize() + EstimatedSizeConstants.CalcUUIDSize(myValue);

                _ObjectUUIDs.Add(myValue, aReference);
            }
        }
 public override IReferenceEdge GetNewInstance(IEnumerable<ObjectUUID> iEnumerable, TypeUUID typeOfObjects)
 {
     return new EdgeTypeSetOfReferences(iEnumerable, typeOfObjects);
 }
Exemple #9
0
        /// <summary>
        /// Adds the typeNode as an asterisk *, rhomb # or minus - or ad
        /// </summary>
        /// <param name="typeNode"></param>
        public Exceptional AddSelectionType(String myReference, GraphDBType myType, TypesOfSelect mySelType, TypeUUID myTypeID = null)
        {
            var selElem = new SelectionElement(mySelType, myTypeID);

            if (!_Selections.ContainsKey(myReference))
                _Selections.Add(myReference, new Dictionary<EdgeList, List<SelectionElement>>());

            var level = new EdgeList(new EdgeKey(myType.UUID, null));

            if (!_Selections[myReference].ContainsKey(level))
                _Selections[myReference].Add(level, new List<SelectionElement>());

            if (!_Selections[myReference][level].Exists(item => item.Selection == mySelType))
            {
                _Selections[myReference][level].Add(selElem);
            }

            return Exceptional.OK;

        }
Exemple #10
0
        private object Deserialize(ref SerializationReader mySerializationReader, ADBSettingsBase myValue)
        {
            #region Read Basics

            try
            {
                if (myValue != null)
                {
                    myValue.Name = mySerializationReader.ReadString();
                    myValue.Description = mySerializationReader.ReadString();
                    myValue.OwnerID = (EntityUUID)mySerializationReader.ReadObject();
                    myValue.Type = new TypeUUID(mySerializationReader.ReadByteArray());
                    myValue.Default.SetValue(mySerializationReader.ReadObject());
                    myValue._Value.SetValue(mySerializationReader.ReadObject());
                }
                else
                {
                    Name = mySerializationReader.ReadString();
                    Description = mySerializationReader.ReadString();
                    OwnerID = (EntityUUID)mySerializationReader.ReadObject();
                    Type = new TypeUUID(mySerializationReader.ReadByteArray());
                    Default.SetValue(mySerializationReader.ReadObject());
                    _Value.SetValue(mySerializationReader.ReadObject());
                }
            }
            catch (Exception e)
            {
                throw new GraphFSException_EntityCouldNotBeDeserialized("ADBSetting could not be deserialized!\n\n" + e);
            }

            #endregion
            return myValue;
        }
Exemple #11
0
        public GraphDBType GetTypeByUUID(TypeUUID myUUID)
        {
            #region Input Validation

            if (myUUID == null)
                throw new ArgumentNullException("The parameter myTypeName must not be null!");

            #endregion

            if (_SystemTypes.ContainsKey(myUUID))
            {
                return _SystemTypes[myUUID];
            }
            else
            {
                if (_BasicTypes.ContainsKey(myUUID))
                {
                    return _BasicTypes[myUUID];
                }
                else
                {
                    if (_UserDefinedTypes.ContainsKey(myUUID))
                    {
                        return _UserDefinedTypes[myUUID];
                    }
                }
            }

            return null;
        }
Exemple #12
0
 /// <summary>
 /// Internal method for loading a DBObject from GraphFS.
 /// </summary>
 /// <param name="myType">The Type of the DBObjects as TypeUUID.</param>
 /// <param name="myObjectUUID">The UUID of the DBObject.</param>
 /// <returns>An DBObject</returns>
 private Exceptional<DBObjectStream> LoadDBObjectInternal(TypeUUID myType, ObjectUUID myObjectUUID)
 {
     return LoadDBObjectInternal(_typeManager.GetTypeByUUID(myType), myObjectUUID);
 }
 /// <summary>
 /// Adds a set of ObjectUUID with parameters
 /// </summary>
 /// <param name="hashSet"></param>
 /// <param name="myParameters"></param>
 public abstract void AddRange(IEnumerable<ObjectUUID> hashSet, TypeUUID typeOfObjects, params ADBBaseObject[] myParameters);
Exemple #14
0
        /// <summary>
        /// Sets the given setting for a given type within this session
        /// </summary>
        /// <param name="setting">The setting to be set</param>
        /// <param name="typeUUID">The name of the type</param>
        /// <returns>True for success</returns>
        public Exceptional SetTypeSetting(ADBSettingsBase setting, TypeUUID typeUUID)
        {
            lock (_SessionSettingsType)
            {
                if (_SessionSettingsType.ContainsKey(typeUUID))
                {
                    if (_SessionSettingsType[typeUUID].ContainsKey(setting.Name))
                    {
                        _SessionSettingsType[typeUUID][setting.Name] = setting;
                    }
                    else
                    {
                        _SessionSettingsType[typeUUID].Add(setting.Name, setting);
                    }
                }
                else
                {
                    _SessionSettingsType.Add(typeUUID, new Dictionary<string, ADBSettingsBase>());
                    _SessionSettingsType[typeUUID].Add(setting.Name, setting);
                }
            }

            return Exceptional.OK;
        }
Exemple #15
0
        internal Exceptional AddBackwardEdge(ObjectUUID uuid, TypeUUID typeOfBESource, EdgeKey beEdgeKey, ObjectUUID reference)
        {
            //load the backward edge
            var loadExcept = _DBContext.DBObjectCache.LoadDBBackwardEdgeStream(typeOfBESource, uuid); // LoadBackwardEdge(beLocation);

            if (loadExcept.Failed())
            {
                return new Exceptional(loadExcept);
            }

            loadExcept.Value.AddBackwardEdge(beEdgeKey, reference, this);
            if (loadExcept.Value.isNew)
            {
                return _IGraphFSSession.StoreFSObject(loadExcept.Value, true);
            }
            else
            {
                return loadExcept.Value.Save();
            }
        }
Exemple #16
0
 public override void Add(ObjectUUID myValue, TypeUUID typeOfDBObjects, params ADBBaseObject[] myParameters)
 {
     if (!myParameters.IsNullOrEmpty())
     {
         if (weightedSet.DefaultWeight.IsValidValue(myParameters[0].Value))
         {
             Add(new Reference(myValue, typeOfDBObjects), (DBNumber)weightedSet.DefaultWeight.Clone(myParameters[0].Value), true);//new DBNumber(myParameters[0].Value));
         }
         else
         {
             throw new GraphDBException(new Error_DataTypeDoesNotMatch(myParameters[0].Value.GetType().Name, weightedSet.DefaultWeight.ObjectName));
         }
     }
     else
     {
         Add(new Reference(myValue, typeOfDBObjects), weightedSet.DefaultWeight, true);
     }
 }
Exemple #17
0
        public override IReferenceEdge GetNewInstance(IEnumerable<ObjectUUID> iEnumerable, TypeUUID typeOfObjects)
        {
            var retEdge = new EdgeTypeWeighted();

            foreach (var uuid in iEnumerable)
            {
                var vals = weightedSet.Get(new Reference(uuid, typeOfObjects)); ;
                retEdge.Add(vals.Key, vals.Value);
            }

            CalcEstimatedSize(retEdge);

            return retEdge;
        }
Exemple #18
0
        public override void AddRange(IEnumerable<ObjectUUID> hashSet, TypeUUID typeOfDBObjects, params ADBBaseObject[] myParameters)
        {
            if (!myParameters.IsNullOrEmpty())
            {
                if (weightedSet.DefaultWeight.IsValidValue(myParameters[0].Value))
                {
                    weightedSet.AddRange(hashSet.Select(item => new Reference(item, typeOfDBObjects)), (DBNumber)weightedSet.DefaultWeight.Clone(myParameters[0].Value));
                }
                else
                {
                    throw new GraphDBException(new Error_DataTypeDoesNotMatch(myParameters[0].Value.GetType().Name, weightedSet.DefaultWeight.ObjectName));
                }
            }
            else
            {
                weightedSet.AddRange(hashSet.Select(item => new Reference(item, typeOfDBObjects)), weightedSet.DefaultWeight);
            }

            CalcEstimatedSize(this);
        }
Exemple #19
0
        /// <summary>
        /// This will add all attributes of <paramref name="myDBObject"/> to the <paramref name="myAttributes"/> reference. Reference attributes will be resolved to the <paramref name="myDepth"/>
        /// </summary>
        /// <param name="myAttributes"></param>
        /// <param name="myType"></param>
        /// <param name="myDBObject"></param>
        /// <param name="myDepth"></param>
        /// <param name="myEdgeList"></param>
        /// <param name="myReference"></param>
        /// <param name="myUsingGraph"></param>
        /// <param name="mySelType"></param>
        /// <param name="myTypeID"></param>
        private void AddAttributesByDBO(ref Dictionary<String, Object> myAttributes, GraphDBType myType, DBObjectStream myDBObject, Int64 myDepth, EdgeList myEdgeList, String myReference, Boolean myUsingGraph, TypesOfSelect mySelType, TypeUUID myTypeID = null)
        {

            #region Get all attributes which are stored at the DBO

            foreach (var attr in myDBObject.GetAttributes())
            {

                #region Check whether the attribute is still exist in the type - if not, continue

                var typeAttr = myType.GetTypeAttributeByUUID(attr.Key);

                if (typeAttr == null)
                {
                    continue;
                }

                #endregion

                #region Only attributes of the selected myTypeID (TypesOfSelect.Ad)

                if (mySelType == TypesOfSelect.Ad)
                {
                    if (myTypeID != typeAttr.GetDBType(_DBContext.DBTypeManager).UUID)
                    {
                        continue;
                    }
                }

                #endregion

                if (attr.Value is ADBBaseObject)
                {

                    #region Single base object

                    if (mySelType != TypesOfSelect.Minus && mySelType != TypesOfSelect.Gt && mySelType != TypesOfSelect.Lt)
                    {
                        myAttributes.Add(typeAttr.Name, (attr.Value as ADBBaseObject).GetReadoutValue());
                    }

                    #endregion

                }
                else if (attr.Value is IBaseEdge)
                {

                    #region List of base objects

                    if (mySelType != TypesOfSelect.Minus && mySelType != TypesOfSelect.Gt && mySelType != TypesOfSelect.Lt)
                    {
                        myAttributes.Add(typeAttr.Name, (attr.Value as IBaseEdge).GetReadoutValues());
                    }

                    #endregion

                }
                else if (attr.Value is IReferenceEdge)
                {

                    #region Reference edge

                    if (mySelType == TypesOfSelect.Minus || mySelType == TypesOfSelect.Asterisk || mySelType == TypesOfSelect.Ad || mySelType == TypesOfSelect.Gt)
                    {
                        // Since we can define special depth (via setting) for attributes we need to check them now
                        myDepth = GetDepth(-1, myDepth, myType, typeAttr);
                        if ((myDepth > 0))
                        {
                            myAttributes.Add(typeAttr.Name, ResolveAttributeValue(typeAttr, attr.Value, myDepth, myEdgeList, myDBObject, myReference, myUsingGraph));
                        }
                        else
                        {
                            myAttributes.Add(typeAttr.Name, GetNotResolvedReferenceAttributeValue(myDBObject, typeAttr, myType, myEdgeList, myUsingGraph, _DBContext));
                        }
                    }

                    #endregion

                }
                else
                {
                    throw new GraphDBException(new Error_NotImplemented(new System.Diagnostics.StackTrace(true)));
                }

            }

            #endregion

            #region Get all backwardEdge attributes

            if (mySelType == TypesOfSelect.Minus || mySelType == TypesOfSelect.Asterisk || mySelType == TypesOfSelect.Ad || mySelType == TypesOfSelect.Lt)
            {
                foreach (var beAttr in GetBackwardEdgeAttributes(myType))
                {
                    if (myDepth > 0)
                    {
                        if (mySelType == TypesOfSelect.Ad)
                        {
                            if (beAttr.BackwardEdgeDefinition.TypeUUID != myTypeID)
                            {
                                continue;
                            }
                        }

                        var bes = myDBObject.GetBackwardEdges(beAttr.BackwardEdgeDefinition, _DBContext, _DBContext.DBObjectCache, beAttr.GetDBType(_DBContext.DBTypeManager));
                        
                        if (bes.Failed())
                            throw new GraphDBException(bes.IErrors);

                        if (bes.Value != null) // otherwise the DBO does not have any
                            myAttributes.Add(beAttr.Name, ResolveAttributeValue(beAttr, bes.Value, myDepth, myEdgeList, myDBObject, myReference, myUsingGraph));
                    }
                    else
                    {
                        if (mySelType == TypesOfSelect.Ad)
                        {
                            if (beAttr.BackwardEdgeDefinition.TypeUUID != myTypeID)
                            {
                                continue;
                            }
                        }
                        
                        var notResolvedBEs = GetNotResolvedBackwardEdgeReferenceAttributeValue(myDBObject, beAttr, beAttr.BackwardEdgeDefinition, myEdgeList, myUsingGraph, _DBContext);
                        if (notResolvedBEs != null)
                        {
                            myAttributes.Add(beAttr.Name, notResolvedBEs);
                        }
                    }
                }
            }
            #endregion

            #region Get all undefined attributes from DBO

            if (mySelType == TypesOfSelect.Asterisk || mySelType == TypesOfSelect.Rhomb)
            {
                var undefAttrException = myDBObject.GetUndefinedAttributes(_DBContext.DBObjectManager);

                if (undefAttrException.Failed())
                    throw new GraphDBException(undefAttrException.IErrors);

                foreach (var undefAttr in undefAttrException.Value)
                    myAttributes.Add(undefAttr.Key, undefAttr.Value.GetReadoutValue());
            }

            #endregion

            #region Add special attributes

            if (mySelType == TypesOfSelect.Asterisk)
            {
                foreach (var specialAttr in GetSpecialAttributes(myType))
                {
                    if (!myAttributes.ContainsKey(specialAttr.Name))
                    {
                        var result = (specialAttr as ASpecialTypeAttribute).ExtractValue(myDBObject, myType, _DBContext);
                        if (result.Failed())
                        {
                            throw new GraphDBException(result.IErrors);
                        }

                        myAttributes.Add(specialAttr.Name, result.Value.GetReadoutValue());
                    }
                }
            }

            #endregion
        
        }
Exemple #20
0
 /// <summary>
 /// Loads an Enumaration of DBObjects (if possible from internal cache structure).
 /// </summary>
 /// <param name="myTypeUUID">The Type of the DBObjects as TypeUUID.</param>
 /// <param name="myListOfObjectUUID">The list of ObjectsUUIDs.</param>
 /// <returns>An Enumeratiuon of DBObjects.</returns>
 public IEnumerable<Exceptional<DBObjectStream>> LoadListOfDBObjectStreams(TypeUUID myTypeUUID, IEnumerable<ObjectUUID> myListOfObjectUUID)
 {
     return LoadListOfDBObjectStreams(_typeManager.GetTypeByUUID(myTypeUUID), myListOfObjectUUID);
 }
Exemple #21
0
 /// <summary>
 /// Internal method for loading a DBBackwardEdge from GraphFS. 
 /// </summary>
 /// <param name="myType">The Type of the DBObjects as TypeUUID.</param>
 /// <param name="myObjectUUID">The UUID of the corresponding DBObject.</param>
 /// <returns>A BackwardEdge</returns>
 private Exceptional<BackwardEdgeStream> LoadDBBackwardEdgeInternal(TypeUUID myType, ObjectUUID myObjectUUID)
 {
     return LoadDBBackwardEdgeInternal(_typeManager.GetTypeByUUID(myType), myObjectUUID);
 }
 public abstract IReferenceEdge GetNewInstance(IEnumerable<ObjectUUID> iEnumerable, TypeUUID typeOfObjects);
Exemple #23
0
        /// <summary>
        /// Returns true, if the type with myClassName baseTypeName is "a" base type to the type with 
        /// myClassName superTypeName.
        /// </summary>
        /// <param name="derivedTypeName">The name of the derived class.</param>
        /// <param name="superTypeName">The name of the super class.</param>
        /// <returns>True, if the super class is a supertype to derived type.</returns>
        public Exceptional<Boolean> HasParentType(TypeUUID derivedTypeUUID, TypeUUID superTypeUUID)
        {
            #region INPUT EXCEPTIONS

            if (derivedTypeUUID == null)
                return new Exceptional<bool>(new Error_ArgumentNullOrEmpty("UUID of derived type should not be null."));

            if (superTypeUUID == null)
                return new Exceptional<bool>(new Error_ArgumentNullOrEmpty("UUID of super type should not be null."));

            if (GetTypeByUUID(derivedTypeUUID) == null)
                return new Exceptional<bool>(new Error_TypeDoesNotExist(""));

            if (GetTypeByUUID(superTypeUUID) == null)
                return new Exceptional<bool>(new Error_TypeDoesNotExist(""));

            #endregion

            bool result = false;
            GraphDBType derivedType = GetTypeByUUID(derivedTypeUUID);

            while (derivedType.ParentTypeUUID != null && !derivedType.UUID.Equals(superTypeUUID))
            {
                derivedType = GetTypeByUUID(derivedType.ParentTypeUUID);
            }

            if (derivedType.UUID.Equals(superTypeUUID))
                result = true;

            return new Exceptional<Boolean>(result);
        }
Exemple #24
0
        internal Exceptional AddBackwardEdge(ObjectUUID uuid, TypeUUID typeOfBESource, EdgeKey beEdgeKey, ObjectUUID reference)
        {
            //var beLocation = DBObjectStream.GetObjectLocation(_DBContext.DBTypeManager.GetTypeByUUID(typeOfBESource), uuid);
            var loadExcept = _DBContext.DBObjectCache.LoadDBBackwardEdgeStream(typeOfBESource, uuid); // LoadBackwardEdge(beLocation);

            if (loadExcept.Failed())
            {
                return new Exceptional(loadExcept);
            }

            //EdgeKey tempKey = new EdgeKey(typeUUID, attributeUUID);
            loadExcept.Value.AddBackwardEdge(beEdgeKey, reference, this);
            if (loadExcept.Value.isNew)
            {
                return _IGraphFSSession.StoreFSObject(loadExcept.Value, true);
            }
            else
            {
                return loadExcept.Value.Save();
            }
        }
Exemple #25
0
        public void Deserialize(byte[] mySerializedData)
        {
            #region Data
            SerializationReader reader;

            reader = new SerializationReader(mySerializedData);

            #endregion

            #region Read Basics
            try
            {
                Name                = reader.ReadString();
                Description         = reader.ReadString();
                OwnerID             = new EntityUUID(reader.ReadByteArray());
                Type                = new TypeUUID(reader.ReadByteArray());
                Default.SetValue(reader.ReadObject());
                _Value.SetValue(reader.ReadObject());
            }
            catch (Exception e)
            {
                throw new GraphFSException_EntityCouldNotBeDeserialized("ADBSetting could not be deserialized!\n\n" + e);
            }
            #endregion
        }
        public override void AddRange(IEnumerable<ObjectUUID> hashSet, TypeUUID typeOfDBObjects, params ADBBaseObject[] myParameters)
        {
            foreach (var aUUID in hashSet)
            {
                if (!_ObjectUUIDs.ContainsKey(aUUID))
                {
                    _ObjectUUIDs.Add(aUUID, new Reference(aUUID, typeOfDBObjects));
                }
            }

            CalcEstimatedSize(this);
        }
 /// <summary>
 /// Set the value with some optional parameters
 /// </summary>
 /// <param name="myValue">A ObjectUUID</param>
 /// <param name="myParameters">Some optional parameters</param>
 public abstract void Set(ObjectUUID myValue, TypeUUID typeOfObjects, params ADBBaseObject[] myParameters);
Exemple #28
0
 public override void Deserialize(ref Lib.NewFastSerializer.SerializationReader mySerializationReader)
 {
     FileSystemLocation = new ObjectLocation(mySerializationReader.ReadString());
     IndexEdition = mySerializationReader.ReadString();
     IndexName = mySerializationReader.ReadString();
     _IsUUIDIndex = mySerializationReader.ReadBoolean();
     IndexRelatedTypeUUID = new TypeUUID(ref mySerializationReader);
 }
Exemple #29
0
 public Exceptional<Boolean> AddBackwardEdge(DBObjectStream aDBObject, TypeUUID uUIDofType, AttributeUUID uUIDofAttribute, ObjectUUID reference)
 {
     return aDBObject.AddBackwardEdge(uUIDofType, uUIDofAttribute, reference, _DBContext.DBObjectManager);
 }
Exemple #30
0
        public static ADBBaseObject GetADBBaseObjectFromUUID(TypeUUID myUUID)
        {
            if (myUUID == DBDouble.UUID)
                return new DBDouble();

            if (myUUID == DBUInt64.UUID)
                return new DBUInt64();

            if (myUUID == DBInt64.UUID)
                return new DBInt64();

            if (myUUID == DBInt32.UUID)
                return new DBInt32();

            if (myUUID == DBString.UUID)
                return new DBString();

            if (myUUID == DBDateTime.UUID)
                return new DBDateTime();

            if (myUUID == DBBoolean.UUID)
                return new DBBoolean();

            if (myUUID == DBEdge.UUID)
                return new DBEdge();

            if (myUUID == DBReference.UUID)
                return new DBReference();

            if (myUUID == DBBaseObject.UUID)
                return new DBBaseObject();

            throw new GraphDBException(new Error_TypeDoesNotExist(myUUID.ToString()));
        }