Exemplo n.º 1
0
 /// <summary>
 /// Creates a new Threaded SQL Store Writer Context
 /// </summary>
 /// <param name="store">Triple Store to save</param>
 /// <param name="manager">SQL IO Manager</param>
 /// <param name="threads">Number of threads to use</param>
 /// <param name="clearIfExists">Whether to clear graphs if they already exist</param>
 public ThreadedSqlStoreWriterContext(ITripleStore store, IThreadedSqlIOManager manager, int threads, bool clearIfExists)
 {
     this._store         = store;
     this._manager       = manager;
     this._writeThreads  = threads;
     this._clearIfExists = clearIfExists;
 }
 /// <summary>
 /// Creates a new Threaded SQL Store Writer Context
 /// </summary>
 /// <param name="store">Triple Store to save</param>
 /// <param name="manager">SQL IO Manager</param>
 /// <param name="threads">Number of threads to use</param>
 /// <param name="clearIfExists">Whether to clear graphs if they already exist</param>
 public ThreadedSqlStoreWriterContext(ITripleStore store, IThreadedSqlIOManager manager, int threads, bool clearIfExists)
 {
     this._store = store;
     this._manager = manager;
     this._writeThreads = threads;
     this._clearIfExists = clearIfExists;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Creates a new set of Parameters
 /// </summary>
 /// <param name="manager">Threaded SQL IO Manager</param>
 /// <param name="threads">Number of Threads to use</param>
 public ThreadedSqlIOParams(IThreadedSqlIOManager manager, int threads)
     : this(manager)
 {
     if (threads > 0)
     {
         this._threads = threads;
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// Opens a SQL Triple Store using the provided Store Manager, automatically loads all data contained in that Store
        /// </summary>
        /// <param name="manager">An <see cref="IThreadedSqlIOManager">IThreadedSqlIOManager</see> for your chosen backing SQL Store</param>
        /// <param name="threads">The Number of Threads to use for Loading (Default is 8)</param>
        /// <param name="isAsync">Whether loading should be done asynchronously</param>
        /// <remarks>
        /// If loading is set to Asynchronous then the Graphs will be loaded in a multi-threaded fashion without waiting for them to load before proceeding.  This means that code can start working immediately with the Triple Store but that the data contained in it may be incomplete.
        /// <br />
        /// The default behaviour is for Synchronous loading which means calling code must wait for the Triple Store to load before it can proceeed.
        /// </remarks>
        public ThreadedSqlTripleStore(IThreadedSqlIOManager manager, int threads, bool isAsync)
            : base()
        {
            this._manager     = manager;
            this._loadThreads = threads;
            this._async       = isAsync;

            if (this._async)
            {
                this._graphs = new ThreadSafeGraphCollection();
            }

            this.LoadInternal();
        }
Exemplo n.º 5
0
        /// <summary>
        /// Creates a new instance of a Graph which is automatically saved to the given SQL Store, if a Graph with the Uri exists in the store it will be automatically loaded
        /// </summary>
        /// <param name="graphUri">Uri of the Graph</param>
        /// <param name="manager">An <see cref="IThreadedSqlIOManager">IThreadedSqlIOManager</see> for your chosen underlying store</param>
        /// <remarks>The Store may be any database for which a working <see cref="IThreadedSqlIOManager">IThreadedSqlIOManager</see> has been defined</remarks>
        public ThreadSafeSqlGraph(Uri graphUri, IThreadedSqlIOManager manager) : base()
        {
            //Set Database Mananger
            this._manager = manager;
            this._manager.DisableTransactions = true;

            //Base Uri is the Graph Uri
            this.BaseUri = graphUri;

            //Get the Graph ID and then Load the Namespaces and Triples
            this._graphID = this._manager.GetGraphID(graphUri);
            this._manager.LoadNamespaces(this, this._graphID);
            this._suspendIO = true;
            this._manager.LoadTriples(this, this._graphID);
            this._suspendIO = false;

            //Subscribe to Namespace Map Events
            //This has to happen after we load from the Database as otherwise the Loading will fire off all the
            //Namespace Map events creating unecessary overhead
            this._nsmapper.NamespaceAdded    += this.HandleNamespaceAdded;
            this._nsmapper.NamespaceModified += this.HandleNamespaceModified;
            this._nsmapper.NamespaceRemoved  += this.HandleNamespaceRemoved;
        }
Exemplo n.º 6
0
 /// <summary>
 /// Opens a SQL Triple Store using the provided Store Manager, automatically loads all data contained in that Store
 /// </summary>
 /// <param name="manager">An <see cref="IThreadedSqlIOManager">IThreadedSqlIOManager</see> for your chosen backing SQL Store</param>
 /// <param name="async">Whether loading should be done asynchronously</param>
 /// <remarks>Uses the Default 8 Threads for Loading</remarks>
 public ThreadedSqlTripleStore(IThreadedSqlIOManager manager, bool async) : this(manager, 8, async) { }
Exemplo n.º 7
0
        /// <summary>
        /// Opens a SQL Triple Store using the provided Store Manager, automatically loads all data contained in that Store
        /// </summary>
        /// <param name="manager">An <see cref="IThreadedSqlIOManager">IThreadedSqlIOManager</see> for your chosen backing SQL Store</param>
        /// <param name="threads">The Number of Threads to use for Loading (Default is 8)</param>
        /// <param name="async">Whether loading should be done asynchronously</param>
        /// <remarks>
        /// If loading is set to Asynchronous then the Graphs will be loaded in a multi-threaded fashion without waiting for them to load before proceeding.  This means that code can start working immediately with the Triple Store but that the data contained in it may be incomplete.
        /// <br />
        /// The default behaviour is for Synchronous loading which means calling code must wait for the Triple Store to load before it can proceeed.
        /// </remarks>
        public ThreadedSqlTripleStore(IThreadedSqlIOManager manager, int threads, bool async) 
            : base() 
        {
            this._manager = manager;
            this._loadThreads = threads;
            this._async = async;

            if (this._async)
            {
                this._graphs = new ThreadSafeGraphCollection();
            }

            this.LoadInternal();
        }
 /// <summary>
 /// Creates a new Threaded SQL Store Writer Context
 /// </summary>
 /// <param name="store">Triple Store to save</param>
 /// <param name="manager">SQL IO Manager</param>
 public ThreadedSqlStoreWriterContext(ITripleStore store, IThreadedSqlIOManager manager)
     : this(store, manager, 8, false) { }
Exemplo n.º 9
0
 /// <summary>
 /// Opens a SQL Triple Store using the provided Store Manager, automatically loads all data contained in that Store
 /// </summary>
 /// <param name="manager">An <see cref="IThreadedSqlIOManager">IThreadedSqlIOManager</see> for your chosen backing SQL Store</param>
 /// <remarks>Uses the Default 8 Threads for Loading</remarks>
 public ThreadedSqlTripleStore(IThreadedSqlIOManager manager)
     : this(manager, 8)
 {
 }
Exemplo n.º 10
0
 /// <summary>
 /// Opens a SQL Triple Store using the provided Store Manager, automatically loads all data contained in that Store
 /// </summary>
 /// <param name="manager">An <see cref="IThreadedSqlIOManager">IThreadedSqlIOManager</see> for your chosen backing SQL Store</param>
 /// <param name="threads">The Number of Threads to use for Loading (Default is 8)</param>
 /// <remarks>Uses Synchronous Loading</remarks>
 public ThreadedSqlTripleStore(IThreadedSqlIOManager manager, int threads)
     : this(manager, threads, false)
 {
 }
Exemplo n.º 11
0
 /// <summary>
 /// Creates a new set of Parameters
 /// </summary>
 /// <param name="manager">Threaded SQL IO Manager</param>
 /// <param name="threads">Number of Threads to use</param>
 public ThreadedSqlIOParams(IThreadedSqlIOManager manager, int threads)
     : this(manager)
 {
     if (threads > 0) this._threads = threads;
 }
Exemplo n.º 12
0
 /// <summary>
 /// Creates a new set of Parameters
 /// </summary>
 /// <param name="manager">Threaded SQL IO Manager</param>
 public ThreadedSqlIOParams(IThreadedSqlIOManager manager)
     : base(manager)
 {
     this._threadedmanager = manager;
 }
Exemplo n.º 13
0
 /// <summary>
 /// Creates a new set of Parameters
 /// </summary>
 /// <param name="manager">Threaded SQL IO Manager</param>
 public ThreadedSqlIOParams(IThreadedSqlIOManager manager)
     : base(manager)
 {
     this._threadedmanager = manager;
 }
Exemplo n.º 14
0
        /// <summary>
        /// Creates a new instance of a Graph which is automatically saved to the given SQL Store, if a Graph with the Uri exists in the store it will be automatically loaded
        /// </summary>
        /// <param name="graphUri">Uri of the Graph</param>
        /// <param name="manager">An <see cref="IThreadedSqlIOManager">IThreadedSqlIOManager</see> for your chosen underlying store</param>
        /// <remarks>The Store may be any database for which a working <see cref="IThreadedSqlIOManager">IThreadedSqlIOManager</see> has been defined</remarks>
        public ThreadSafeSqlGraph(Uri graphUri, IThreadedSqlIOManager manager) : base()
        {
            //Set Database Mananger
            this._manager = manager;
            this._manager.DisableTransactions = true;

            //Base Uri is the Graph Uri
            this.BaseUri = graphUri;

            //Get the Graph ID and then Load the Namespaces and Triples
            this._graphID = this._manager.GetGraphID(graphUri);
            this._manager.LoadNamespaces(this, this._graphID);
            this._suspendIO = true;
            this._manager.LoadTriples(this, this._graphID);
            this._suspendIO = false;

            //Subscribe to Namespace Map Events
            //This has to happen after we load from the Database as otherwise the Loading will fire off all the
            //Namespace Map events creating unecessary overhead
            this._nsmapper.NamespaceAdded += this.HandleNamespaceAdded;
            this._nsmapper.NamespaceModified += this.HandleNamespaceModified;
            this._nsmapper.NamespaceRemoved += this.HandleNamespaceRemoved;
        }
Exemplo n.º 15
0
 /// <summary>
 /// Creates a new Threaded SQL Store Writer Context
 /// </summary>
 /// <param name="store">Triple Store to save</param>
 /// <param name="manager">SQL IO Manager</param>
 public ThreadedSqlStoreWriterContext(ITripleStore store, IThreadedSqlIOManager manager)
     : this(store, manager, 8, false)
 {
 }
Exemplo n.º 16
0
 /// <summary>
 /// Opens a SQL Triple Store using the provided Store Manager, automatically loads all data contained in that Store
 /// </summary>
 /// <param name="manager">An <see cref="IThreadedSqlIOManager">IThreadedSqlIOManager</see> for your chosen backing SQL Store</param>
 /// <param name="threads">The Number of Threads to use for Loading (Default is 8)</param>
 /// <remarks>Uses Synchronous Loading</remarks>
 public ThreadedSqlTripleStore(IThreadedSqlIOManager manager, int threads) : this(manager, threads, false) { }
Exemplo n.º 17
0
 /// <summary>
 /// Opens a SQL Triple Store using the provided Store Manager, automatically loads all data contained in that Store
 /// </summary>
 /// <param name="manager">An <see cref="IThreadedSqlIOManager">IThreadedSqlIOManager</see> for your chosen backing SQL Store</param>
 /// <remarks>Uses the Default 8 Threads for Loading</remarks>
 public ThreadedSqlTripleStore(IThreadedSqlIOManager manager) 
     : this(manager, 8) { }
Exemplo n.º 18
0
 /// <summary>
 /// Opens a SQL Triple Store using the provided Store Manager, automatically loads all data contained in that Store
 /// </summary>
 /// <param name="manager">An <see cref="IThreadedSqlIOManager">IThreadedSqlIOManager</see> for your chosen backing SQL Store</param>
 /// <param name="async">Whether loading should be done asynchronously</param>
 /// <remarks>Uses the Default 8 Threads for Loading</remarks>
 public ThreadedSqlTripleStore(IThreadedSqlIOManager manager, bool isAsync)
     : this(manager, 8, isAsync)
 {
 }