Hi,
I'm searching for a database backend for a .NET project that involves a
semantic database backend. The problem is that I want to store any generic
kind of custom .NET datatype and not only SQL-primitives.
First, the Database should have a triple store for the semantic relations
that is built of three 32-bit integer columns. This is easy to implement.
CREATE TABLE Triples
(
Subject INT,
Predicate INT,
Object INT
)
But next to this I want to have some additional tables for storing literals,
data, and files. The Tables should consist of a row storing an integer that
gives the ID and an additional column that is storing the generic data. I
might use BLOBs for this issue, but its more efficient to use separate
tables. There should be a separate table for each datatype.
@TableName = '_' + typeof( @Datatype ).ToString()
CREATE TABLE @TableName
(
Object INT,
Data @Datatype
)
The @Datatype Parameter is a special object that implements something like a
"ISQLiteDatatype" Interface that provides information about the class that
is needed for getting information about the used datatype. This includes:
- how to serialize (use also ISerializeable)
- how to sort (use also ICompareable)
- is it possible to do byte ordering with the serialized data?
- minimal and maximal Datasize and -lenght?
- etc.
SQL is not capable to handle this issue, but I think it should be possible
using the API. At least in MS SQL Server it is possible, but you can't
create new datatypes on the fly, but you have to upload and register the
datatype's class to the server as DLL.
SQLite might be better suited for this issue, because as part of the
application it can access the sorting and serialisation functions directly
rather than importing DLLs. But the question is how I can do that.
ys, MovGP0