8ul uaLa Model ln Cracle

nlcole Alexanderţ xavler Lopezţ Slva 8avadaţ Susle SLephensţ !ack Wang
Cracle CorporaLlon
1Ŧ lnLroducLlon
1he 8esource uescrlpLlon lramework (8ul) ls a language for represenLlng lnformaLlon abouL resources
ln Lhe World
Wlde WebŦ 1o descrlbe lnformaLlon ln 8ulţ sLaLemenLs are essenLlally broken lnLo Lrlplesť
žsub[ecL/resourceţ
predlcaLe/properLyţ ob[ecL/valueſŦ Lach Lrlple ls a compleLe and unlque facLţ ln a speclflc domalnţ
and can be
represenLed by a llnk ln a dlrecLed graphŦ 1he proposed daLa model sLores 8ul Lrlples ln Lhe Cracle
daLabase as a
loglcal neLwork (uslng Cracle SpaLlal neLwork uaLa Model)Ŧ 1hls documenL descrlbes Lhe proposed
sLorage and query
model for 8ul ln CracleŦ lnlLlallyţ Lhls pro[ecL wlll provlde supporL for key 8ul concepLsť graph daLa
modelţ u8lbased vocabularyţ daLaLypesţ and relflcaLlonŦ lL wlll also supporL a subseL of Lyplcal 8ul
querles ln SCLŦ
2Ŧ 8ul uaLa Model ln Lhe uaLabase
8ul sLaLemenLs are expressed ln Lrlplesť žsub[ecL or resourceţ predlcaLe or properLyţ ob[ecL or
valueſŦ ln Lhls
documenL žsub[ecLţ properLyţ ob[ecLſ wlll be used Lo descrlbe a Lrlpleţ and Lhe Lerms sLaLemenL and
Lrlple may aL
Llmes be used lnLerchangeablyŦ Lach Lrlple ls a compleLe and unlque facL abouL a speclflc
domalnţ and can be
represenLed by a llnk ln a dlrecLed graphŦ Cracle 10g supporLs a dlrecLed and unŴdlrecLed loglcal graphs
(neLworks)
as parL of Cracle SpaLlal neLwork uaLa Model (nuM)Ŧ 1he proposed 8ul daLa model maps 8ul
Lrlples Lo a
loglcal neLwork managed by nuMŦ ln addlLlon Lo Lhe core daLaţ a caLalogue servlce ls provldedť by
malnLalnlng
lnformaLlon abouL dlfferenL 8ul modelsţ lncludlng Lhe namespaces used ln Lhese modelsŦ 8ul
Lrlple daLa ls
mapped onLo a graph by sLorlng sub[ecLs and ob[ecLs as nodesţ and properLles as llnksŦ 1he sLorage for
8ul daLa ls
managed by Cracleť all Lhe 8ul daLa ls managed ln a cenLral schemaţ and userŴlevel access
funcLlons and
consLrucLors are provlded Lo query and updaLe Lhe 8ul daLaŦ 1here ls one unlverse for all 8ul daLa
sLored ln Lhe
daLabaseŦ Lach 8ul Lrlpleť žsub[ecLţ properLyţ ob[ecLſ ls LreaLed as one unlque daLabase ob[ecLŦ As a
resulLţ a slngle
8ul documenL comprlslng a number of Lrlples wlll resulL ln mulLlple daLabase ob[ecLsŦ
MeLadaLa for 8ul Models
A sysLem level Lable ls creaLed Lo sLore lnformaLlon on all models deflned ln Lhe daLabaseŦ When a new
8ul model
ls creaLedţ an enLry ls made Lo Lhls LableŦ 1o creaLe a modelţ Lhe user speclfles a name for Lhe model and
Lhe sysLem
auLomaLlcally generaLes a model luŦ 1hls model lu may Lhen be used lnsLead of Lhe model name
Lo refer Lo a
parLlcular modelŦ uslng Lhe model lu lnsLead of Lhe model name wlll reduce space overheadŦ
8ul namespaces
namespaces are used ln 8ul/xML documenLs Lo make Lhe documenLs readableŦ ln Cracle's 8ul daLa
modelţ
namespaces are sLored dlrecLly wlLh Lhelr sub[ecLsţ properLlesţ and ob[ecLsŦ Poweverţ an addlLlonal
namespaces
Lable ls provlded so LhaL a caLalog of all Lhe namespaces used ln an 8ul unlverse can be opLlonally
sLoredŦ
When a new namespace ls lnserLed lnLo Lhe daLabaseţ a namespace lu ls auLomaLlcally generaLed for
Lhe namespaceŦ
1hls namespace lu can Lhen be used as a forelgn key Lo refer Lo Lhe namespaceŦ CurrenLlyţ
namespaces are only
used for caLaloglng purposesŦ 8ul SLaLemenLs
8ul sLaLemenLs are represenLed ln Lrlplesť sub[ecLţ properLyţ and ob[ecLŦ ln Cracle's 8ul daLa modelţ
Lhe Lable LhaL
sLores Lhe LexL values (u8lsţ llLeralsţ eLc) for Lhese Lhree pleces of lnformaLlon ls called 8ul_vALuL$ and
has Lhe
followlng columnsť
SCLƽ desc 8ul_vALuL$Ť
name 1ype
ŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴ
vALuL_lu nuM8L8
vALuL_nAML u8l1?ÞL
vALuL_1?ÞL vA8CPA82(10)
Ll1L8AL_1?ÞL xML1?ÞL
When a new sLaLemenL ls lnserLed lnLo an 8ul modelţ a record ls creaLed ln Lhe 8ul_vALuL$ Lable for
each parL
of Lhe LrlpleŦ 1he LexL value for each parL of Lhe Lrlple ls enLered lnLo Lhe vALuL_nAML columnŦ Lach
LexL value
ls asslgned a unlque vALuL_luŦ lf a LexL value for a parLlcular sub[ecLţ properLyţ or ob[ecL already exlsLs
ln Lhe
8ul_vALuL$ Lableţ no new enLry ls made (and Lhe exlsLlng enLry ls reused)Ŧ 1he vALuL_1?ÞL
column
descrlbes Lhe Lype of LexL lnformaLlon sLored ln Lhe vALuL_nAML columnŦ Þosslble values for
vALuL_1?ÞL
areť
vALuL_1?ÞLƹ'u8'ť LexL value ls a u8l
vALuL_1?ÞLƹ'ÞL'ť LexL value ls a plaln llLeral
vALuL_1?ÞLƹ'1L'ť LexL value ls a Lyped llLeral
vALuL_1?ÞLƹ'1C_8AC'ť LexL value ls Lhe blank node for a Lyped collecLlonť rdfť8ag
vALuL_1?ÞLƹ'1C_AL1'ť LexL value ls Lhe blank node for a Lyped collecLlonť rdfťAlL
vALuL_1?ÞLƹ'1C_SLC'ť LexL value ls Lhe blank node for a Lyped collecLlonť rdfťSeq
vALuL_1?ÞLƹ'8n'ť LexL value ls a blank nodeŦ
lf Lhe ob[ecL of a sLaLemenL ls a llLeralţ lL ls posslble LhaL Lhe llLeral ls a Lyped llLeralŦ ln Lhls
caseţ Lhe Lype
lnformaLlon ls sLored ln Lhe Ll1L8AL_1?ÞL column (oLherwlseţ Lhe Ll1L8AL_1?ÞL aLLrlbuLe ls nuLL)Ŧ 1he
8ul_vALuL$ Lable Lherefore sLores all Lhe valuesť blank nodesţ u8l sţ plaln llLeralsţ Lyped llLerals and
L y p e d
collecLlons for Lhe nodes (sub[ecLs and ob[ecLs) and llnks (properLles) LhaL are presenL ln Lhe enLlre 8ul
neLworkŦ
1yped LlLerals
1yped llLerals are handled by sLorlng Lhe Lype lnformaLlon ln Lhe Ll1L8AL_1?ÞL xML1ype column of Lhe
8ul_vALuL$ LableŦ Conslder Lhls exampleţ whlch descrlbes Lhe creaLlon daLe ż8ulŴÞ8lML8Žťż8ulŴ
Þ8lML8Ž
When an enLry ls made for Lhe ob[ecL of Lhls sLaLemenLţ Lhe characLer sLrlng '1999Ŵ08Ŵ16' goes
lnLo Lhe
vALuL_nAML column and Lhe sLrlng Lype 'hLLpť//wwwŦw3Ŧorg/2001/xMLSchema#daLe' goes lnLo
Lhe
Ll1L8AL_1?ÞL column (afLer addlng ƼdaLaLypeƽ Ƽ/daLaLypeƽ Lags Lo make lL valld xML)Ŧ 1he
vALuL_1?ÞL
aLLrlbuLe ls '1L'Ŧ
8ul Sub[ecLs and Cb[ecLs
Sub[ecLs and ob[ecLs ln Cracle's 8ul daLa model are mapped Lo nodes ln Lhe neLwork daLa modelŦ
Sub[ecL nodes
are Lhe sLarL nodes of llnksţ and ob[ecL nodes are Lhe end nodes of llnksŦ nonŴllLeral nodes can be boLh
sub[ecL and
ob[ecL nodesŦ 1here ls a nCuL_lu column whlch ls a unlque lu and ls Lhe same as Lhe vALuL_lu ln Lhe
8ul_vALuL$ LableŦ 1he 8ul_nCuL$ Lable sLores only Lhe vALuL_lus LhaL belong Lo nodes (lŦeŦ sub[ecLs
and
ob[ecLs) of sLaLemenLs ln Lhe daLabaseŦ
8lank nodes
ln 8ulţ Lrlples may have unknown sub[ecL nodes and unknown ob[ecL nodesŦ 8lank nodes are used Lo
represenL
Lhese unknown nodesŦ 8lank nodes are also used when Lhe relaLlonshlp beLween a sub[ecL node and an
ob[ecL node
ls nŴary (as ls Lhe case wlLh collecLlons)Ŧ ln Cracle's 8ul daLa modelţ a new enLry ls made for each blank
node
encounLered ln an 8ul LrlpleŦ 8y defaulLţ no Lwo blank nodes correspondlng Lo Lwo dlfferenL
ob[ecLs wlll be
mapped Lo Lhe same neLwork nodeŦ A user has Lhe opLlonţ howeverţ Lo reuse a parLlcular blank node ln
a modelŦ lf
Lhe user chooses Lo reuse a blank node ln a modelţ an enLry ls made Lo a blank node LableŦ 1he Lable
LhaL sLores Lhe
blank node lnformaLlon ls called 8ul_8LAnk_nCuL$ and has Lhe followlng columnsť
SCLƽ desc 8ul_8LAnk_nCuL$Ť
name 1ype
ŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴ
nCuL_lu nuM8L8
nCuL_vALuL vA8CPA82
C8lC_nAML vA8CPA82
MCuLL_lu nuM8L8
A blank node's nCuL_vALuL or vALuL_nAML ls derlved by appendlng Lhe unlque vALuL_lu for Lhe
node
Lo Lhe blankŴnode ldenLlfler _ťblanknodeŦ 1hls forms a vALuL_nAML of _ťblanknodenode_ldŦ 1o reuse
blank
nodesţ Lhe blank node consLrucLor (secLlon 4Ŧ1) musL be used Lo lnpuL Lhe 8ul LrlpleŦ When Lhe
blank nodeconsLrucLor ls usedţ Lhe 8ul_8LAnk_nCuL$ Lable ls searched for a blank node wlLh Lhe
same MCuLL_lu and
C8lC_nAML or nCuL_vALuL as Lhe blank node belng enLeredŦ lf none ls foundţ a new blank node
enLry ls
made Lo Lhe 8ul_vALuL$ Lable and lLs luţ value name and orlglnal name copled Lo Lhe
8ul_8LAnk_nCuL$
Lable Lo be subsequenLly reused when speclfledŦ ueleLlng blank nodes from Lhe 8ul_8LAnk_nCuL$
Lable wlll
noL remove Lhe correspondlng values from Lhe 8ul_vALuL$ and 8ul_nCuL$ LableŦ Poweverţ lL wlll
prevenL
Lhese blank nodes from belng reused when Lhe blank node consLrucLor ls uLlllzed ln Lhe fuLureŦ
8ul ÞroperLles (or ÞredlcaLes)
8ul properLles are mapped Lo llnksŦ When a Lrlple ls lnserLed lnLo an 8ul modelţ Lhe sub[ecLţ properLyţ
and ob[ecL
are flrsL checked agalnsL Lhe 8ul_vALuL$ Lableţ Lo see lf enLrles for Lhelr LexL values already exlsL ln Lhe
modelŦ lf
Lhey already exlsL (due Lo prevlous sLaLemenLs ln oLher models) no new enLrles are madeŤ lf Lhey do noL
exlsLţ Lhree
new records are lnserLed lnLo Lhe 8ul_vALuL$ LableŦ lf Lhe sub[ecLţ properLyţ and ob[ecL LexL values
already exlsL
ln Lhe 8ul_vALuL$ Lableţ anoLher check ls lssued Lo deLermlne lf Lhe acLual Lrlple exlsLsŦ 1hls second
check ls
lssued agalnsL Lhe 8ul_Llnk$ LableŦ 1he 8ul_Llnk$ Lable sLores Lhe properLles and Lrlple lnformaLlonţ
and has
Lhe followlng columnsť
SCLƽ desc 8ul_Llnk$Ť
name 1ype
ŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴŴ
Llnk_lu nuM8L8
vALuL_lu nuM8L8
S1A81_nCuL_lu nuM8L8
Lnu_nCuL_lu nuM8L8
Llnk_1?ÞL vA8CPA82(10)
AC1lvL vA8CPA82(1)
Llnk_LLvLL nuM8L8
ÞA8Ln1_Llnk_lu nuM8L8
MCuLL_lu nuM8L8
lf Lhe Lrlple for Lhe parLlcular model already exlsLsţ no new Lrlple ls lnserLedŦ CLherwlseţ a unlque lu ls
generaLed for
Lhe new LrlpleŦ 1hls lu ls sLored as Lhe Llnk_lu (also known as Lhe 8ul_1_lu)Ŧ 1he vALuL_lu ln
Lhe
8ul_vALuL$ Lable correspondlng Lo Lhe sub[ecL becomes Lhe S1A81_nCuL_luŤ and Lhe vALuL_lu
correspondlng Lo Lhe ob[ecL becomes Lhe Lnu_nCuL_lu for Lhls llnkŦ 1he vALuL_lu ls Lhe same
as Lhe
vALuL_lu ln Lhe 8ul_vALuL$ LableŦ 1he MCuLL_lu column loglcally parLlLlons Lhe 8ul_Llnk$
LableŦ
SelecLlng all Lhe llnks for a speclflc MCuLL_luţ reLurns Lhe 8ul neLwork for LhaL speclfled modelŦ
8elflcaLlon ln 8ul
A relflcaLlon of a sLaLemenL ln 8ul ls a descrlpLlon of Lhe sLaLemenL uslng an 8ul sLaLemenLŦ ln Cracle's
8ul daLa
modelţ a hlerarchlcal llnk model ls used Lo represenL sLaLemenLs made abouL oLher sLaLemenLsŦ 1he
Llnk_1?ÞL ln
Lhe 8ul_Llnk$ Lable can be one of Lwo valuesť (l) SSţ whlch represenLs a sLaLemenL LhaL ls a slmple
sLaLemenLŤ and
(ll) 8Sţ whlch represenLs a sLaLemenL LhaL ls a relflcaLlon sLaLemenLŦ ln Lhe 8S caseţ Lhe llnk Lype
represenLs Lhe facL
LhaL Lhe currenL sLaLemenL makes a sLaLemenL abouL some oLher sLaLemenL already ln Lhe daLabase
(lŦeŦ Lhe currenL
sLaLemenL ls noL Lhe relfled sLaLemenL)Ŧ1o process a relflcaLlon sLaLemenLţ Lhe sub[ecL nodeţ whlch ls a
u8l for Lhe creaLor of Lhe relflcaLlon sLaLemenLţ Lhe
properLy rdfťSLaLemenLţ and a blank ob[ecL node are flrsL lnserLed lnLo Lhe 8ul_vALuL$ Lable wlLh
Lhe usual
checksŦ An enLry ls Lhen made Lo Lhe 8ul_Llnk$ Lable wlLh a new Llnk_luţ Lhe vALuL_lu for
rdfťSLaLemenLţ
sub[ecL vALuL_lu as S1A81_nCuLţ and blank node vALuL_lu as Lnu_nCuLŦ 1he Llnk_lu of Lhe relfled
sLaLemenL ls Lhen ldenLlfled ln Lhe daLabase and Lhe ÞA8Ln1_Llnk_lu of Lhe currenL relflcaLlon
sLaLemenL ls seL Lo
Lhe Llnk_lu of Lhe relfled sLaLemenLŦ 1he relflcaLlon sLaLemenL ls Lherefore Lhe chlld of Lhe relfled
sLaLemenLŦ 1here
ls a manyŴLoŴone polnLer ln Lhls caseť Lhe relflcaLlon sLaLemenL polnLs Lo Lhe relfled sLaLemenLŦ
MulLlple 8ul
sLaLemenLs can make asserLlons abouL oLher sLaLemenLsŦ 1hls ls represenLed ln Lhe daLa model as llnks
wlLh mulLlple
chlld llnksŦ 1he MCuLL_lu for a relflcaLlon sLaLemenL should maLch Lhe MCuLL_lu of Lhe relfled
sLaLemenLŦ
1yped CollecLlons (8ul ConLalners)
1here ls ofLen a need Lo descrlbe groups of Lhlngsť for exampleţ Lo say LhaL a book was creaLed by
several auLhorsţ
or Lo llsL Lhe sLudenLs ln a course or sofLware modules ln a packageŦ 8ul provldes several predeflned
(bullLŴln)
Lypes and properLles LhaL can be used Lo descrlbe such groupsŦ A conLalner ls a resource LhaL conLalns
LhlngsŦ 1he
conLalned Lhlngs are called membersŦ 1he members of a conLalner may be resources (lncludlng
blank nodes) or
llLeralsŦ 8ul deflnes Lhree Lypes of conLalnersť
- rdfť8ag
- rdfťSeq
- rdfťAlL
A 8ag (a resource havlng Lype rdfť8ag) represenLs a group of resources or llLeralsţ posslbly lncludlng
dupllcaLe
membersţ where Lhere ls no slgnlflcance ln Lhe order of Lhe membersŦ A Sequence or Seq (a resource
havlng Lype
rdfťSeq) represenLs a group of resources or llLeralsţ posslbly lncludlng dupllcaLe membersţ where Lhe
order of Lhe
members ls slgnlflcanLŦ An AlLernaLlve or AlL (a resource havlng Lype rdfťAlL) represenLs a group of
resources or
llLerals LhaL are alLernaLlves (Lyplcally for a slngle value of a properLy)Ŧ lor exampleţ an AlL mlghL
be used Lo
descrlbe alLernaLlve language LranslaLlons for Lhe LlLle of a bookţ or Lo descrlbe a llsL of alLernaLlve
lnLerneL slLes aL
whlch a resource mlghL be foundŦ An appllcaLlon uslng a properLy whose value ls an AlL conLalner should
be aware
LhaL any one of Lhe members of Lhe group can be chosen as approprlaLe ż8ulŴÞ8lML8ŽŦ llgure 1ţ
represenLs Lhe
senLence ºCourse 6Ŧ001 has Lhe sLudenLs Amyţ Mohamedţ !ohannţ Marlaţ and Þhuong"ţ uslng a
slmple bag
conLalnerŦż8ulŴÞ8lML8Ž
llgure 1ť A Slmple 8ag ConLalner uescrlpLlon
Ƽ?xml verslonƹƍ1Ŧ0ƍ?ƽ
Ƽrdfť8ul xmlnsťrdfƹƍhLLpť//wwwŦw3Ŧorg/1999/02/22ŴrdfŴsynLaxŴns#ƍ
xmlnsťsƹƍhLLpť//exampleŦorg/sLudenLs/vocab#ƍƽ
ƼrdfťuescrlpLlon rdfťabouLƹƍhLLpť//exampleŦorg/courses/6Ŧ001ƍƽ
ƼsťsLudenLsƽ
Ƽrdfť8agƽ
Ƽrdfťll rdfťresourceƹƍhLLpť//exampleŦorg/sLudenLs/Amyƍ/ƽ
Ƽrdfťll
rdfťresourceƹƍhLLpť//exampleŦorg/sLudenLs/Mohamedƍ/ƽ
Ƽrdfťll
rdfťresourceƹƍhLLpť//exampleŦorg/sLudenLs/!ohannƍ/ƽ
Ƽrdfťll
rdfťresourceƹƍhLLpť//exampleŦorg/sLudenLs/Marlaƍ/ƽ
Ƽrdfťll
rdfťresourceƹƍhLLpť//exampleŦorg/sLudenLs/Þhuongƍ/ƽ
Ƽ/rdfť8agƽ
Ƽ/sťsLudenLsƽ
Ƽ/rdfťuescrlpLlonƽ
Ƽ/rdfť8ulƽ
ż8ulŴÞ8lML8Ž
Lxample 1ť 8ul/xML for Lhe 8ag of SLudenLs
ln Cracle's 8ul daLa modelţ Lhese conLalner Lypes are handled followlng Lhe general prlnclples of Lrlple
creaLlonţ
wlLh a few exLra sLepsť a blank node ls flrsL creaLed wlLh a vALuL_nAML _ťblanknodenode_ l dţ
and
v A L u L _ 1 ? Þ L ƹ 1 C _C o l l e c L l o n 1 y p e Ŧ 1rlples ž_ťblanknodenode_ldţ
rdfťblanknodenode_ld_coll#ţ
collecLlon_valueſ are Lhen lnserLed for each collecLlon memberŦ As wlLh oLher Lrlplesţ Lhe
collecLlon_value ob[ecLwlll be reused lf Lhls node already exlsLs ln Lhe daLabaseŦ 1he properLy llnk
for collecLlon members has lLs
ÞA8Ln1_Llnk_lu seL Lo Lhe Llnk_lu of Lhe orlglnaLlng relaLlonshlp llnkţ lŦeŦ Lhe llnk whose ob[ecL (or
end
node) ls Lhe collecLlon's blank nodeŦ 1he collecLlon's blank node has a Ll1L8AL_1?ÞL conLalnlng Lhe
8ul/xML
for Lhe collecLlon (see Lxample 1)Ŧ Lxample 2ţ shows how Lhe rdfť8ag descrlbed ln Lxample 1ţ ls handledŦ
ŦŦŦ/courses/6Ŧ001
_ťblanknode29
/Mohamed
/Amy
Llnk Level 2
Llnk Level 1 ť
ÞA8Ln1_Llnk_lu
ƹ 999
sťsLudenLs
rdfťblanknode29_2
rdfťblanknode29_1
vALuL_1?ÞL ƹ 1C_8AC
Lxample 2ť 8epresenLlng CollecLlons ln nuM 8ul uaLa Model
Llnk_lu ƹ
999
/!ohann
/Marla
/Þhuong
rdfťblanknode29_3
rdfťblanknode29_4
rdfťblanknode29_3
ConslsLency beLween Llnks and nodes
ln Cracle's 8ul daLa modelţ a new llnk ls always creaLed whenever a new 8ul Lrlple ls lnserLed lnLo Lhe
daLabaseŦ
Poweverţ new nodes may noL always be creaLedţ slnce some nodes represenL u8lsţ whlch are reused lf
Lhey already
exlsL ln Lhe daLabaseŦ 8ul Lrlples can Lherefore be consldered unlque parenLs of Lhe llnks ln a neLworkţ
buL Lhe
nodes may have mulLlple parenLsŦ When an 8ul Lrlple ls deleLed from Lhe daLabaseţ Lhe correspondlng
llnk can be
safely removedŦ Poweverţ Lhls does noL necessarlly LranslaLe Lo removlng nodes aL Lhe same LlmeŦ A
node cannoL be
removed lf Lhere ls aL leasL one llnk polnLlng Lo lLŦ SupporL for 8ul Cuerles
AL Lhe SCL levelţ a new Lable funcLlon called 8ul_MA1CP ls used Lo provlde Lhe query lnLerface for Lhe
8ul
modelŦ 1hls Lable funcLlon 8ul_MA1CP can be used Lo query Lhe 8ul daLa sLored ln Lhe daLabase and lL
can
supporL searchlng for an arblLrary paLLern agalnsL Lhe 8ul daLaŦ
A SCL query Lo search agalnsL Lhe 8ul daLa looks llke Lhlsť
SLLLC1 LŦCeLSub[ecL
l8CM 1A8LL (8ul_MA1CP (
8ulModels('8evlewers')ţ
8ulÞaLLern (
8ul_1rlple('?r'ţ '8evlewerCf'ţ '?c')ţ
8ul_1rlple('?r'ţ 'rdfťLype'ţ 'ÞhŦ uŦ SLudenL')ţ
8ul_1rlple('?r'ţ 'age'ţ '?a'))ţ '?a Ƽ 23')) LŤ
Assumlng Lhere ls a model called º8evlewers" LhaL has daLa for all Lhe revlewers for a conferenceţ Lhls
query can
flnd all Lhe revlewers who are ÞhŦuŦ sLudenLs and have age less Lhan 23 yearsŦ

% @ ½½¾  ff¯ ¯f½¾ ½ ¾f –nf °  ¯f°f–     -. %   @¾ n¯ ° ¾n ¾   ½½¾  ¾f– f°   ¯ €°fn °f ¾½© n½ ¾½½€ n°n ½¾ –f½ ff ¯   D f¾  nf f  ff½ ¾  f°   €nf°    f¾ ¾½½ f ¾ ¾  € ½nf    ¾°. ° ff f¾  ¾f ¯ °¾f  ½ ¾¾ °½ ¾  ¾ © n ¾n ½ nf ½½   © n f °¾ n¯ ° ¾ © n  ½½    © n    ¾   ¾n  f ½  f°     ¯¾ ¾f ¯ ° f°  ½ ¯ff ¯ ¾    ¾   ° nf°– f    fn  ½   ¾  f  n¯½    f°   °   €fn  f   f  ¾½ n€n ¯f° f° nf°   ½ ¾ °  f°°f  n –f½ fn –¾½½¾f  n f° °  n –nf–f½¾ %° ¾% f¾½f€fn ½ff- ff. f ff€. %-.½f°  ° n° @  ¾n  ¾n½°f¯ %%¾ff°–f– € ½ ¾ °°–°€¯f°f  ¾n ¾ ° J  J   J   @  ¾n   °€¯f°  °     ¾f ¯ °¾  f   ¾¾ °f   °  °  ½ ¾  ¾ © n$ ¾n  ½ nf $½½   © n$f fn½ ¾fn¯½  f° ° €fn °f¾½ n€n ¯f°  f° nf°   ½ ¾ °  f°°f  n –f½ @ ½½¾  ff¯ ¾ ¾½ ¾° fn  ff f¾ f¾f –nf °  %¾°– fn  ½ff -  ff . ¾ .   ° f °    n  ff  f nff–  ¾ n  ¾ ½   ¯f°f°°– °€¯f°f  €€  °¯ ¾ °n °– °f¯ ¾½fn ¾¾ ° ¾ ¯ ¾  ½  ff¾ ¯f½½ °f–f½ ¾°–¾ © n¾f°  © n¾f¾° ¾ f° ½½  ¾f¾°¾ @ ¾f– €  ff¾ ¯f°f–  fn f  ff¾¯f°f– °fn °f¾n ¯f f° ¾    fnn ¾¾ €°n°¾f°  n°¾n¾ f  ½     f°  ½ f     ff  @   ¾ °  ° ¾  € f  ff ¾ °  ff f¾   fn  ½  ¾ © n  ½½    © n  ¾  f  f¾ °  °  ff f¾   © n  ¾ f  ¾ f¾°–   n¯ °n¯½¾°–f°¯ €½ ¾ ¾°¯½  ff f¾  © n¾  .   ff.

¾¾ ¯  f  ¾n f ¾ °€¯f°°f¯ ¾ €° °  ff f¾ J °f°  ¯  ¾n f f° °¾¯f ¾f  @n f f¯   ¾ ¾½ n€ ¾f°f¯ € ¯ f°   ¾¾ ¯ f¯fnf– ° f ¾f¯  @¾¯ ¯f ° ¾ °¾ f € ¯ °f¯   € f ½fnf¯  D¾°– ¯ °¾ f € ¯ °f¯  n ¾½fn   f  -f¯ ¾½fn ¾ -f¯ ¾½fn ¾ f  ¾  ° $O. n¯ °¾  ¯f    n¯ °¾  f f   ° fn #¾  ff ¯   °f¯ ¾½fn ¾ f  ¾   n    ¾ © n¾  ½½  ¾  f°   © n¾      f° f °f °f¯ ¾½fn ¾ f   ¾ ½  ¾ f f nff– € f   °f¯ ¾½fn ¾ ¾  ° f°  ° ¾  nf°  ½°f ¾  J ° f °  °f¯ ¾½fn ¾ °¾  °   ff f¾  f °f¯ ¾½fn   ¾ f¯fnf– ° f  €  °f¯ ¾½fn  @¾ °f¯ ¾½fn    nf°  °  ¾  f¾ f  € –°      €     °f¯ ¾½fn  .

  ¾n%ID  -f¯ @½   ID%-D.D@9 ID%@9I.  ID%-. °  °f¯ ¾½fn ¾f ° ¾ €nff–°–½½¾ ¾ f ¯ °¾  ¾f ¯ °¾ f   ½ ¾ °  ° ½ ¾  ¾ © n  ½½   f°   © n   ° fn #¾  ff¯    f  f ¾ ¾  f ¾%D¾  f¾  n%€ ¾  ½ n ¾€°€¯f°¾nf %IDf°  f¾  €°–n¯°¾  .

@9 J °f° ¾f ¯ °¾°¾  °f°¯  f n ¾n f ° %IDf  € fn½f €   ½  @    f  € fn ½f €   ½  ¾ °  °   ID%-. n¯°  9¾¾   f ¾  € ID%@9 f  . n¯°  fn  f  ¾f¾¾–° f° ID% €f f €f½fnf¾ © n ½½   © nf f  ¾¾ °  %IDf  °°  °¾¯f %f°   ¾°– °¾ ¾ % @ ID%@9 n¯° ¾n ¾   ½  €   °€¯f° ¾  °   ID%-.%% @%@9O.

ID%@9 #D#  f ¾fD ID%@9 #9#  f ¾f½f° f ID%@9 #@#  f ¾f½  f ID%@9 #@.

% #  f ¾  f°° €f½ n n°  € f– ID%@9 #@.

%@#  f ¾  f°° €f½ n n°  €  ID%@9 #@.

@½ n¯°€  %ID f   .#  f ¾  f°° €f½ n n°  €   ID%@9 # -#  f ¾f f°°  €  © n€f¾f ¯ °¾f f ¾½¾¾  f  f¾f½  f °¾ nf¾  ½  °€¯f°¾¾ ° @%@9n¯°% ¾  @%@9f  ¾-D% @  %IDf    € ¾ ¾f f ¾  f°° ¾ D¾ ½f° f¾ ½  f¾f°  ½   n n°¾€ ° ¾%¾ © n¾f°  © n¾%f° °¾%½½  ¾%ff ½ ¾ °°  °  °   @½  f¾ @½  f¾f f°   ¾°– ½ °€¯f°° @%@9O.%.

n¯°f°  ¾°–½ #½ $$  –$$O.  J °f° °¾¯f €  © n€¾¾f ¯ °  nffn ¾°–#  #– ¾ °  ID%-.n ¯f f #– ¾°   @%@9 n¯° %f€  f °– ff½  $ ff½  f–¾  ¯f   f  O.°¾  ¾ f¯½  n ¾n ¾   n f° f   9.  9.%  @  ID%@9 f  ¾#@#   © n¾f°  © n¾  © n¾ f°   © n¾ ° fn #¾  ff ¯  f  ¯f½½   ° ¾ °   °  ff ¯    © n° ¾ f  ¾f° ¾€°¾ f°  © n° ¾f   ° ° ¾€°¾ -°  f° ¾nf°   ¾ © nf°   © n° ¾ @  ¾f-%n¯°n¾f° f° ¾ ¾f¯ f¾ ID%°  %IDf  @ %-f  ¾ ¾° ID%¾f °–° ¾% ¾ © n¾ f°   © n¾%€¾f ¯ °¾°  ff f¾   f°- ¾ ° ½ ¾¯ff °°°¾ © n° ¾f° °°° © n° ¾  f°° ¾f  ¾   ½ ¾ °  ¾ °°°° ¾  f°° ¾f f¾¾  °  f°¾½  °f¾ © n° f° f°  © n°  ¾° f%f¾¾ nf¾ n n°¾% °fn #¾ ff¯  f°  °¾¯f € fn f° °  .

  ¾n% -%-  -f¯ @½   -%-D.  -%IDI. °n°  °f°½   €f ° f°° ¾n ¾½° °– €€  °  © n¾  ¯f½½  ¾f¯ ° ° ¾ f¾ ½°     ¾ f½fnf f°° ° f¯  €  ¾ n¾ ¾ ¾ f f°° °f¯  f° °¾¯f f f°° f  @ f   f¾ ¾  f°° °€¯f°¾nf % -%-f° f¾ €°–n¯°¾  .

I. %-.

€% f°- ° % @ ¾  f° ° ¾   f°° n°¾n%¾ n° %¯¾ ¾ °½ ½ J °  f°  ° n°¾n ¾ ¾    % -%- f   ¾ ¾ fn  € f f° °     ¾f¯ .-%IDf¾  f°°  °– °  €°° ¾€° f°  f°°  °¾ ¯f     %ID f   f°  ¾   f  °f¯  f°  –°f °f¯  n½     % -%- f     ¾ ¾  °  ¾   ° ¾½ n€    °– f° ° ¾ €¯   % -%- f   °   ¯    n ¾½° °– f ¾  €¯   %ID f°  %- f        ½  °  ¾  f°° ¾€¯ °– ¾  °  f°° n°¾n¾ ° €  9½  ¾%9 nf ¾% ½½  ¾f ¯f½½ °¾ J °f½ ¾°¾  °f°¯   ¾ © n ½½   f°  © n f €¾n n f–f°¾ %IDf  ¾ € ° ¾€  f ¾f f  ¾°  ¯  €  f f  ¾%  ½ ¾¾f ¯ °¾° ¯ ¾%°°  ° ¾f ¯f €  ° ¾   °   n ¾ f  °¾   °   %ID f   €   ¾ © n  ½½   f°   © n   f ¾ f f  ¾ °   %ID f   f°  n n ¾ ¾¾    ¯°  €   fnf ½  ¾¾  @¾ ¾ n°  n n¾ .   f° ° #¾ -%ID  ID%-. ¾    f½½ ° °–   °  ID% €   °    f° °  °€ % f°- @¾€¯¾fID%-.%-D. .%f°  %-.

 @@%-%-D.  ¾n%-  -f¯ @½   -%-D.  -%@9I.  ID%-D.¾¾ f–f°¾ %-f  @ %-f  ¾ ¾ ½½  ¾f° ½ °€¯f°  f° f¾  €°–n¯°¾  .  -%-%-D.

%% .

@II.

%% -%I-D.  € ½ € ½fnf¯ f f  ¾¾ °° ½ ¾°¾   ¾ f° ¾ – ° f €  ° ½ @¾¾¾ f¾ -%%f¾°°f¾ %@%% @ ID%°   %IDf  n ¾½° °– ¾ © n n¯ ¾ @@%-% f°  ID% n ¾½° °–  © n n¯ ¾ -%-%€¾° @ ID%¾ ¾f¯  f¾  ID%° %IDf  @ .  9-@%-%-D.  .%  °¾ ° €f¾½ n€ ¯    €nf°°  €nf°€f¾f ¯ °°¾f ¾n½°€ ¾f ¯ °¾°–f°¾f ¯ ° °fn #¾  ff ¯   f  fnnf ° ¯  ¾ ¾    ½ ¾ ° ¾f ¯ °¾ ¯f  f    ¾f ¯ °¾  @  -%@9°   %- f   nf°  °  €  f ¾  %%   n  ½ ¾ °¾ f ¾f ¯ ° f ¾ f ¾¯½  ¾f ¯ ° f°  %%   n  ½ ¾ °¾ f ¾f ¯ ° f ¾ f  €nf° ¾f ¯ °  °    nf¾    ° ½   ½ ¾ °¾ €fn f   n ° ¾f ¯ ° ¯f ¾ f ¾f ¯ ° f  ¾¯    ¾f ¯ ° f f  °   ff f¾  %  n ° ¾f ¯ °¾°  € ¾f ¯ °% @½n ¾¾f €nf°¾f ¯ °  ¾ © n° n¾f D€ n f€  €nf°¾f ¯ °   ½½  € f ¯ ° f° f f° © n° f €¾°¾  ° %IDf    ¾f n n¾  ° ° ¾  ° ¯f     %- f    f °  -%    ID% €  € f ¯ °  .%-D.%n¯°–nf½f°¾ %- f     n°–f °¾€f¾½ n€n.

% € f  €nf° ¾f ¯ ° ¾  ¯fn   .½  ¾f ¯ °¾nf°¯f f¾¾ °¾f  ¾f ¯ °¾ @¾¾ ½ ¾ ° °  ff¯ f¾°¾ ¯½  n  °¾  @  .% €    €  ¾f ¯ °  @½ .¾ © nID%f¾@@%- f°  f°° ID%f¾-%- @ -%€  €  ¾f ¯ ° ¾  °  °€  °   ff f¾  f°    9-@%-% €   n °  €nf° ¾f ¯ °¾¾    -% €    €  ¾f ¯ °  @   €nf° ¾f ¯ ° ¾   €    n  €    €  ¾f ¯ ° @   ¾f¯f°  ° ½° °¾nf¾   €nf°¾f ¯ °½°¾  € ¾f ¯ °  .

 n°¾%.

°f° ¾% @   ¾ € ° f °   ¾n  –½¾ € °–¾  € f¯½   ¾f f f  f¾ n f   ¾  ff¾  ¾ ¾ °¾°fn¾ ¾€f ¯  ¾°f½fnf– ½ ¾¾  f½ €°  %  °% ½ ¾f° ½½  ¾fnf° ¾  ¾n ¾n–½¾ n°f° ¾f ¾n fn°f°¾ °–¾ @  n°f°  °–¾  f   nf   ¯ ¯ ¾  @  ¯ ¯ ¾  € f n°f°  ¯f     ¾n ¾  %°n °– f°° ¾%  f¾  €° ¾ ½ ¾€n°f° ¾  % € f– % €   % €   f–%f ¾n f°–½  € f–% ½ ¾ °¾f–½€ ¾n ¾ f¾ ½¾¾ °n °– ½nf  ¯ ¯ ¾     ¾°¾–°€nf°n °  € ¯ ¯ ¾   °n  %f ¾n  f°–½   €  %  ½ ¾ °¾ f –½ €  ¾n ¾   f¾  ½¾¾  °n °– ½nf  ¯ ¯ ¾        €  ¯ ¯ ¾ ¾ ¾–°€nf°  °  °f    %f   ¾n   f°– ½    € %  ½ ¾ °¾ f –½ €  ¾n ¾  f¾ff f °f ¾%½nf€f¾°– f €f½½ %  f¯½ f°¯– ¾  ¾n  f °f  f°–f–  f°¾f°¾ €     € f     ¾n  f ¾ € f °f  ° ° ¾ ¾f nf ¾n ¯– €° °f½½nf°¾°–f½½ ¾ f ¾f°n°f° ¾  ff  f f° °  €   ¯ ¯ ¾ €   –½ nf°  n¾ ° f¾ f½½½f   9.  –     ½ ¾ °¾  ¾ ° °n #.

f¯ f°° .ff f° 9°–# ¾°–f ¾¯½  f– .¾  f¾ ¾ °¾¯ .

  –  ¯½  f–.n°f°   9.

°f°  ¾n½° "¯ ¾°   "   € ¯°¾  € ½ $$  –$$$  € ¾°f °¾  ¯°¾ ¾ ½ $$ f¯½ –$¾ °¾$nf     €  ¾n½° € f  ½ $$ f¯½ –$n¾ ¾$    ¾ ¾ °¾    € f–    €  €  ¾n ½ $$ f¯½ –$¾ °¾$¯ $    €   €  ¾n ½ $$ f¯½ –$¾ °¾$.ff $    €   €  ¾n ½ $$ f¯½ –$¾ °¾$9°– $   $ € f–   $¾ ¾ °¾   $ €  ¾n½°  $ €    9.€  f–€ °¾ °fn #¾ ff¯   ¾ n°f° ½ ¾f f°  €°– – ° f½°n½ ¾€½  n f°  f€  f¾ ½¾ f f°° ¾€¾n f fID%-.  f¯½  $O.f¯ $    €   €  ¾n ½ $$ f¯½ –$¾ °¾$f°° $    €   €  ¾n ½ $$ f¯½ –$¾ °¾$.% f°- - %  f°  I   D  % @  9       @ .

 %.

     n    ° @  ½    @½ ¾  % f°- - %   € f°- - % %n  n n°%f  f   ° °¾   € fn n n° ¯ ¯   ¾    ½ ¾    n n°%f  © n  ¾ €¾° f f  ¾¾°  ff f¾ @ ½½ ° €n n°¯ ¯ ¾f¾¾ 9-@%-%¾  -%€ –°f°– f°¾½°   °¾  © n% °  ° % ¾   n n°#¾ f° °  @  n n°#¾ f° °  f¾ f @%@9 n°f°°–   $O.f¯  $¯ °   . € n n°%¾ f¯½ % f¯½  ¾¾  € f– ¾n °f¯½  ¾f°   $n¾ ¾$  % f°-  $.

°    9-@%-%  ¾ ¾ °¾  € f°- %  € f°- % ID%@9 @.

%  f¯½   ½ ¾ °°–.

  -%   $f°° $.ff.ff $9°–  € f°- %  € f°- %  € f°- % . n°¾°-.

°¾¾ °n  °°¾f° - ¾ °fn #¾ ff¯  f° °¾ff¾n f  °  f° ½ ¾°¾  °  ff f¾     ° ° ¾¯f°ff¾ n f ¾°n ¾¯ ° ¾ ½ ¾ °D¾ nf  ¾ €  f f  ¾°  ff f¾ ½ ¾nf°  €  n°¾  ° ½f °¾€ °¾°f°     ° ¾¯ff ¯½ ½f °¾ J °f°½ ¾   €¯  ff f¾  n ¾½° °– °nf°  ¾f€   ¯      ¾  ¾ ° ° n ¾¾f f°¾f    ¯°– ° ¾ f   ¾f¯  ¯   ° nf°°   ¯ €  ¾f f¾° °½°°– ½½€.@.  ¾  .   f° f  €°n°nf %.

@.¾¾ ½   ° €fn €   ¯  @¾f  €°n°%.

 ¾ fnf–f°¾  ff¾ ¾  .nf° ¾    ff¾ °  ff f¾ f°  nf° ¾½½¾ fn°–€f°f f½f °f–f°¾  ff  .

@.@ %%.@   © n .

% . ¾%#   ¾#%  9f °% %@½ %#"# #   €# #"n#%  %@½ %#"# # € ½ # #9   °#%  %@½ %#"# #f– # #"f#%% #"f #%%  .

¾¾¯°–  ¾f¯ nf #   ¾#ff¾ ff€f    ¾€fn°€  °n ¾  nf° €° f    ¾f 9  ¾ °¾f° f f–  ¾¾f° f¾  .

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master Your Semester with a Special Offer from Scribd & The New York Times

Cancel anytime.