コード例 #1
0
        public MongoDBGraphCentricIndexManager(MongoDBDocumentManager manager)
        {
            this._manager = manager;

            //Ensure Basic Indices
            foreach (String index in RequiredIndices)
            {
                Document indexDoc = new Document();
                indexDoc[index] = 1;
                this._manager.Database[this._manager.Collection].MetaData.CreateIndex(indexDoc, false);
            }

            //Ensure Compound Indices
            for (int i = 1; i < RequiredIndices.Length; i++)
            {
                for (int j = i; j < RequiredIndices.Length; j++)
                {
                    if (i == j) continue;
                    Document indexDoc = new Document();
                    indexDoc[RequiredIndices[i]] = 1;
                    indexDoc[RequiredIndices[j]] = 1;
                    this._manager.Database[this._manager.Collection].MetaData.CreateIndex(indexDoc, false);
                }
            }

            Document fullIndex = new Document();
            fullIndex["graph.subject"] = 1;
            fullIndex["graph.predicate"] = 1;
            fullIndex["graph.object"] = 1;
            this._manager.Database[this._manager.Collection].MetaData.CreateIndex(fullIndex, false);
        }
コード例 #2
0
        public MongoDBTripleCentricIndexManager(MongoDBDocumentManager manager)
        {
            this._manager = manager;

            //Ensure Basic Indices
            foreach (String index in RequiredIndices)
            {
                Document indexDoc = new Document();
                indexDoc[index] = 1;
                this._manager.Database[this._manager.Collection].MetaData.CreateIndex(indexDoc, false);
            }

            //Ensure Compound Indices
            for (int i = 3; i < RequiredIndices.Length; i++)
            {
                for (int j = i; j < RequiredIndices.Length; j++)
                {
                    if (i == j)
                    {
                        continue;
                    }
                    Document indexDoc = new Document();
                    indexDoc[RequiredIndices[i]] = 1;
                    indexDoc[RequiredIndices[j]] = 1;
                    this._manager.Database[this._manager.Collection].MetaData.CreateIndex(indexDoc, false);
                }
            }

            Document fullIndex = new Document();

            fullIndex["subject"]   = 1;
            fullIndex["predicate"] = 1;
            fullIndex["object"]    = 1;
            this._manager.Database[this._manager.Collection].MetaData.CreateIndex(fullIndex, false);
        }
コード例 #3
0
 public MongoDBGraphCentricEnumerator(MongoDBDocumentManager manager, Document query, Func <Triple, bool> selector)
 {
     this._manager    = manager;
     this._collection = this._manager.Database[this._manager.Collection];
     this._query      = query;
     this._selector   = selector;
 }
コード例 #4
0
 public static IIndexManager GetIndexManager(MongoDBDocumentManager manager)
 {
     switch (manager.Schema)
     {
         case MongoDBSchemas.GraphCentric:
             return new MongoDBGraphCentricIndexManager(manager);
         case MongoDBSchemas.TripleCentric:
             return new MongoDBTripleCentricIndexManager(manager);
         default:
             throw new NotSupportedException("Unknown MongoDB Schema not supported");
     }
 }
コード例 #5
0
        public static IIndexManager GetIndexManager(MongoDBDocumentManager manager)
        {
            switch (manager.Schema)
            {
            case MongoDBSchemas.GraphCentric:
                return(new MongoDBGraphCentricIndexManager(manager));

            case MongoDBSchemas.TripleCentric:
                return(new MongoDBTripleCentricIndexManager(manager));

            default:
                throw new NotSupportedException("Unknown MongoDB Schema not supported");
            }
        }
コード例 #6
0
 public MongoDBTripleCentricGraphRegistry(MongoDBDocumentManager manager)
 {
     this._manager = manager;
 }
コード例 #7
0
 public MongoDBTripleCentricAdaptor(MongoDBDocumentManager manager)
 {
     this._manager = manager;
 }
コード例 #8
0
 public MongoDBTripleCentricEnumerator(MongoDBDocumentManager manager, Document query)
 {
     this._manager = manager;
     this._query   = query;
 }
コード例 #9
0
 public MongoDBTripleCentricGraphRegistry(MongoDBDocumentManager manager)
 {
     this._manager = manager;
 }
コード例 #10
0
 public AlexandriaMongoDBManager(MongoDBDocumentManager manager)
     : base(manager, MongoDBHelper.GetIndexManager(manager))
 {
 }
コード例 #11
0
 public MongoDBGraphCentricEnumerable(MongoDBDocumentManager manager, Document query, Func <Triple, bool> selector)
 {
     this._manager  = manager;
     this._query    = query;
     this._selector = selector;
 }