Documentation for the relational model?

2 views
Skip to first unread message

Thomas Steinmaurer

unread,
Dec 14, 2009, 7:46:42 AM12/14/09
to ontopia
Hello,

* Is there a documentation on the relational model (the 16 entities)
used by Ontopia?
* Why aren't FK-constraint for MSSQL2005 created by default? Is it due
to MSSQL not supporting DEFERRED constraints?

Thanks,
Thomas

Lars Marius Garshol

unread,
Dec 18, 2009, 7:37:55 AM12/18/09
to ont...@googlegroups.com

* Thomas Steinmaurer

>
> * Is there a documentation on the relational model (the 16 entities)
> used by Ontopia?

I'm afraid not. If you have specific questions about them we'd be happy to answer those.

Please note that we discourage users from accessing these tables without going via Ontopia, for a number of reasons. Doing so can cause problems with the software because of the caching (and if you violate the software's expectations for what should go in the tables).

> * Why aren't FK-constraint for MSSQL2005 created by default? Is it due
> to MSSQL not supporting DEFERRED constraints?

I have to admit I don't know the answer to this. Geir Ove?

--Lars M.
http://www.garshol.priv.no/tmphoto/
http://www.garshol.priv.no/blog/

Geir Ove Grønmo

unread,
Dec 22, 2009, 1:42:04 AM12/22/09
to ont...@googlegroups.com
On Fri, Dec 18, 2009 at 1:37 PM, Lars Marius Garshol
<lar...@garshol.priv.no> wrote:
>
> * Thomas Steinmaurer
>>
>> * Is there a documentation on the relational model (the 16 entities)
>> used by Ontopia?
>
> I'm afraid not. If you have specific questions about them we'd be happy to answer those.
>
> Please note that we discourage users from accessing these tables without going via Ontopia, for a number of reasons. Doing so can cause problems with the software because of the caching (and if you violate the software's expectations for what should go in the tables).

This is intentional. We have some old documentation for the tables
written in a tool called Druid, but this was never updated as the
structure of the database is pretty self-documenting as it follows the
TMDM model pretty closely. The database tables are normalized.

>> * Why aren't FK-constraint for MSSQL2005 created by default? Is it due
>> to MSSQL not supporting DEFERRED constraints?
>
> I have to admit I don't know the answer to this. Geir Ove?

Yes, that's the reason. The way the object-relational mapper in
Ontopia works mandates that if foreign keys are to be enabled
constraint checking will have to be deferred to the end of the
transaction. The reason for this is the way the object API works. The
API allows for partially created object while at the same time
guaranteeing that all queries are consistent with all changes made to
the current transaction.

It could be that more modern releases of SQL Server supports deferred
contraints. Does anyone know?

--
Geir O.

Geir Ove Grønmo

unread,
Dec 22, 2009, 1:46:34 AM12/22/09
to ont...@googlegroups.com
2009/12/22 Geir Ove Grønmo <indiap...@gmail.com>:

>>> * Why aren't FK-constraint for MSSQL2005 created by default? Is it due
>>> to MSSQL not supporting DEFERRED constraints?
>>
>> I have to admit I don't know the answer to this. Geir Ove?
>
> Yes, that's the reason. The way the object-relational mapper in
> Ontopia works mandates that if foreign keys are to be enabled
> constraint checking will have to be deferred to the end of the
> transaction. The reason for this is the way the object API works. The
> API allows for partially created object while at the same time
> guaranteeing that all queries are consistent with all changes made to
> the current transaction.

To be a little more precise: dirty changes in the transaction will be
flushed to the database before any SQL queries are issued against the
database, so that the result of the query can take the modifications
into account. Note that the modifications can at a given point in time
not be conformant to the TMDM model and may violate foreign
constraints (though this will not be true at the end of the
transaction).

--
Geir O.

Thomas Steinmaurer

unread,
Dec 22, 2009, 3:04:11 AM12/22/09
to ont...@googlegroups.com
Hello,

thanks Lars and Geir. See my comments "inline" ...

>> * Thomas Steinmaurer
>>> * Is there a documentation on the relational model (the 16 entities)
>>> used by Ontopia?
>> I'm afraid not. If you have specific questions about them we'd be happy to answer those.
>>
>> Please note that we discourage users from accessing these tables without going via Ontopia, for a number of reasons. Doing so can cause problems with the software because of the caching (and if you violate the software's expectations for what should go in the tables).
>
> This is intentional. We have some old documentation for the tables
> written in a tool called Druid, but this was never updated as the
> structure of the database is pretty self-documenting as it follows the
> TMDM model pretty closely. The database tables are normalized.

Is the TMDM model documented somewhere?

I understand the risk of editing these tables directly and it isn't our
first choice. The reason why I asked was that with a CRUD framework
(e.g. Django, ...) we might have been able to get data into our database
more quickly and comfortable.

If there is another way to allow a technical experienced end-user to
fill an Ontopia relational backend with life, I would be interested to
know more about it. ;-)

>>> * Why aren't FK-constraint for MSSQL2005 created by default? Is it due
>>> to MSSQL not supporting DEFERRED constraints?
>> I have to admit I don't know the answer to this. Geir Ove?
>
> Yes, that's the reason. The way the object-relational mapper in
> Ontopia works mandates that if foreign keys are to be enabled
> constraint checking will have to be deferred to the end of the
> transaction. The reason for this is the way the object API works. The
> API allows for partially created object while at the same time
> guaranteeing that all queries are consistent with all changes made to
> the current transaction.

Thought so. I had installed an DML audit trail mechanism in our MSSQL
database and the sequence of inserted data into various tables needs
deferred constraint checking for being valid in respect to foreign key
relationship.

> It could be that more modern releases of SQL Server supports deferred
> contraints. Does anyone know?

MSSQL 2005 doesn't support them and I'm not aware that things have
changed in 2008.


Thanks,
Thomas

Lars Marius Garshol

unread,
Dec 22, 2009, 4:27:28 AM12/22/09
to ont...@googlegroups.com

* Thomas Steinmaurer

>
> Is the TMDM model documented somewhere?

Yes. :) It's better known as ISO/IEC 13250-2:2006. You can buy it on paper from ISO in Geneva, or read it for free here:
http://www.isotopicmaps.org/sam/sam-model/

> I understand the risk of editing these tables directly and it isn't our
> first choice. The reason why I asked was that with a CRUD framework
> (e.g. Django, ...) we might have been able to get data into our database
> more quickly and comfortable.
>
> If there is another way to allow a technical experienced end-user to
> fill an Ontopia relational backend with life, I would be interested to
> know more about it. ;-)

What is your datasource? If it's a relational database you can use the DB2TM module. The main documentation index for Ontopia has a link to the DB2TM developer guide.

Reply all
Reply to author
Forward
0 new messages