Beispiel #1
0
 /// <summary>
 /// Creates a new Indexed Triple Collection
 /// </summary>
 /// <param name="bias">Bias for core storage</param>
 /// <param name="indexBias">Bias for simple index storage (S, P and O)</param>
 /// <param name="compoundIndexBias">Bias for compound index storage (SP, PO and SO)</param>
 /// <param name="capacity">Initial Capacity of Index Slots</param>
 /// <remarks>
 /// <para>
 /// Bias is used to control the underlying data structures of the indices, you may wish to change the bias depending on your data or intended use of this class
 /// </para>
 /// <para>
 /// Indexes are stored using our <see cref="HashTable">HashTable</see> structure which is in effect a Dictionary where each Key can have multiple values.  The capacity is the initial number of value slots assigned to each Key, value slots grow automatically as desired but setting an appropriate capacity will allow you to tailor memory usage to your data and may make it possible to store data which would cause <see cref="OutOfMemoryException">OutOfMemoryException</see>'s with the default settings.
 /// </para>
 /// <para>
 /// For example if you have 1 million triples where no Triples share any Nodes in common then the memory needing to be allocated would be 1,000,000 * 6 * 10 * 4 bytes just for the object references without taking into account all the overhead for the data structures themselves.  Whereas if you set the capacity to 1 you reduce your memory requirements by a factor of 10 instantly.
 /// </para>
 /// <para>
 /// <strong>Note:</strong> Always remember that if you have large quantities of triples (1 million plus) then you are often better not loading them directly into memory and there many be better ways of processing the RDF depending on your application.  For example if you just want to do simple things with the data like validate it, count it etc you may be better using a <see cref="IRdfHandler">IRdfHandler</see> to process your data.
 /// </para>
 /// </remarks>
 public IndexedTripleCollection(HashTableBias bias, HashTableBias indexBias, HashTableBias compoundIndexBias, int capacity)
 {
     this._triples   = new HashTable <int, Triple>(bias);
     this._subjIndex = new HashTable <INode, Triple>(indexBias, capacity);
     this._predIndex = new HashTable <INode, Triple>(indexBias, capacity);
     this._objIndex  = new HashTable <INode, Triple>(indexBias, capacity);
     if (Options.FullTripleIndexing)
     {
         this._fullyIndexed  = true;
         this._subjPredIndex = new HashTable <int, Triple>(compoundIndexBias, capacity);
         this._subjObjIndex  = new HashTable <int, Triple>(compoundIndexBias, capacity);
         this._predObjIndex  = new HashTable <int, Triple>(compoundIndexBias, capacity);
     }
 }
Beispiel #2
0
 /// <summary>
 /// Creates a new Indexed Triple Collection
 /// </summary>
 /// <param name="bias">Bias for core storage</param>
 /// <param name="indexBias">Bias for simple index storage (S, P and O)</param>
 /// <param name="compoundIndexBias">Bias for compound index storage (SP, PO and SO)</param>
 /// <remarks>
 /// <para>
 /// Biasese are used to control the underlying data structures of the indices, you may wish to change the bias depending on your data or intended use of this class
 /// </para>
 /// </remarks>
 public IndexedTripleCollection(HashTableBias bias, HashTableBias indexBias, HashTableBias compoundIndexBias)
     : this(bias, indexBias, compoundIndexBias, 10)
 {
 }
Beispiel #3
0
 /// <summary>
 /// Creates a new Indexed Triple Collection
 /// </summary>
 /// <param name="bias">Bias</param>
 /// <param name="capacity">Initial Capacity of Index Slots</param>
 /// <remarks>
 /// <para>
 /// Bias is used to control the underlying data structures of the indices, you may wish to change the bias depending on your data or intended use of this class
 /// </para>
 /// <para>
 /// Indexes are stored using our <see cref="HashTable">HashTable</see> structure which is in effect a Dictionary where each Key can have multiple values.  The capacity is the initial number of value slots assigned to each Key, value slots grow automatically as desired but setting an appropriate capacity will allow you to tailor memory usage to your data and may make it possible to store data which would cause <see cref="OutOfMemoryException">OutOfMemoryException</see>'s with the default settings.
 /// </para>
 /// <para>
 /// For example if you have 1 million triples where no Triples share any Nodes in common then the memory needing to be allocated would be 1,000,000 * 6 * 10 * 4 bytes just for the object references without taking into account all the overhead for the data structures themselves.  Whereas if you set the capacity to 1 you reduce your memory requirements by a factor of 10 instantly.
 /// </para>
 /// <para>
 /// <strong>Note:</strong> Always remember that if you have large quantities of triples (1 million plus) then you are often better not loading them directly into memory and there many be better ways of processing the RDF depending on your application.  For example if you just want to do simple things with the data like validate it, count it etc you may be better using a <see cref="IRdfHandler">IRdfHandler</see> to process your data.
 /// </para>
 /// </remarks>
 public IndexedTripleCollection(HashTableBias bias, int capacity)
     : this(bias, bias, bias, capacity)
 {
 }
Beispiel #4
0
 /// <summary>
 /// Creates a new Hash Table with the given bias
 /// </summary>
 /// <param name="bias">Bias</param>
 /// <param name="capacity">Initial Capacity at each Key</param>
 /// <param name="emptyKeys">Whether keys are allowed to have no values associated with them</param>
 /// <remarks>
 /// <para>
 /// Use this if you expect to use this as a true Hash Table i.e. there is a 1:Many mapping of keys to values.  Choose a capcity value that seems reasonable for the data you expect to store.
 /// </para>
 /// <para>
 /// The bias controls what the underlying storage of the table is, different biases have different performance characteristics and allow you to tailor the table to your intended usage
 /// </para>
 /// </remarks>
 public HashTable(HashTableBias bias, int capacity, bool emptyKeys)
     : this(capacity, emptyKeys)
 {
     this._bias = bias;
 }
Beispiel #5
0
 /// <summary>
 /// Creates a new Hash Table with the given bias
 /// </summary>
 /// <param name="bias">Bias</param>
 /// <param name="capacity">Initial Capacity at each Key</param>
 /// <remarks>
 /// <para>
 /// Use this if you expect to use this as a true Hash Table i.e. there is a 1:Many mapping of keys to values.  Choose a capcity value that seems reasonable for the data you expect to store.
 /// </para>
 /// <para>
 /// The bias controls what the underlying storage of the table is, different biases have different performance characteristics and allow you to tailor the table to your intended usage
 /// </para>
 /// </remarks>
 public HashTable(HashTableBias bias, int capacity)
     : this(capacity)
 {
     this._bias = bias;
 }
Beispiel #6
0
 /// <summary>
 /// Creates a new Hash Table with the given bias
 /// </summary>
 /// <param name="bias">Bias</param>
 /// <param name="emptyKeys">Whether Keys are allowed to have no values associated with them</param>
 /// <remarks>
 /// The bias controls what the underlying storage of the table is, different biases have different performance characteristics and allow you to tailor the table to your intended usage
 /// </remarks>
 public HashTable(HashTableBias bias, bool emptyKeys)
     : this(emptyKeys)
 {
     this._bias = bias;
 }
Beispiel #7
0
 /// <summary>
 /// Creates a new Hash Table with the given bias
 /// </summary>
 /// <param name="bias">Bias</param>
 /// <remarks>
 /// The bias controls what the underlying storage of the table is, different biases have different performance characteristics and allow you to tailor the table to your intended usage
 /// </remarks>
 public HashTable(HashTableBias bias)
 {
     this._bias = bias;
 }