Il modello E-R del DataBase
From Giona
(Difference between revisions)
(→Tavola Object) |
(→Tavola Object) |
||
(One intermediate revision not shown) | |||
Line 11: | Line 11: | ||
ObjectName TEXT PRIMARY KEY, | ObjectName TEXT PRIMARY KEY, | ||
ObjectDescription TEXT | ObjectDescription TEXT | ||
- | + | ) | |
== Tavola Attribute == | == Tavola Attribute == | ||
Line 19: | Line 19: | ||
* '''AttributeValue''' (varchar(256), REQ, IDX): Valore dell'attributo | * '''AttributeValue''' (varchar(256), REQ, IDX): Valore dell'attributo | ||
* '''AttributeDescription''' (text): Descrizione facoltativa dell'attributo. | * '''AttributeDescription''' (text): Descrizione facoltativa dell'attributo. | ||
+ | |||
+ | Lo script per SQLite: | ||
+ | |||
+ | CREATE TABLE IF NOT EXISTS Attribute ( | ||
+ | AttributeName TEXT , | ||
+ | ObjectName TEXT , | ||
+ | AttributeValue TEXT NOT NULL, | ||
+ | AttributeDescription TEXT, | ||
+ | PRIMARY KEY (AttributeName,ObjectName) | ||
+ | ) | ||
== Legenda == | == Legenda == |
Current revision as of 20:21, 16 December 2007
Segue la definizione del modello Entity-Relationship per l'implementazione del database ad oggetti generico.
Tavola Object
Questa tavola conterrà tutti gli oggetti dell'ontologia. I campi:
- ObjectName (PK varchar(256)): nome dell'oggetto
- ObjectDescription (Text): Descrizione facoltativa dell'oggetto
Lo script per SQLite:
CREATE TABLE IF NOT EXISTS Object ( ObjectName TEXT PRIMARY KEY, ObjectDescription TEXT )
Tavola Attribute
Questa tavola conterrà tutti gli attributi degli oggetti dell'ontologia. I campi:
- AttributeName (PK, varchar(256)): nome dell'attributo univoco per l'oggetto
- ObjectName (PK, varchar(256), FK Object.ObjectName): identificatore dell'oggetto a cui l'attributo appartiene
- AttributeValue (varchar(256), REQ, IDX): Valore dell'attributo
- AttributeDescription (text): Descrizione facoltativa dell'attributo.
Lo script per SQLite:
CREATE TABLE IF NOT EXISTS Attribute ( AttributeName TEXT , ObjectName TEXT , AttributeValue TEXT NOT NULL, AttributeDescription TEXT, PRIMARY KEY (AttributeName,ObjectName) )
Legenda
PK: primary key
FK: foreign key
REQ: required field
IDX: campo indicizzato