Vous êtes sur la page 1sur 9

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 undlrecLed 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 userlevel 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 rdf8ag
vALuL_1?L'1C_AL1' LexL value ls Lhe blank node for a Lyped collecLlon rdfAlL
vALuL_1?L'1C_SLC' LexL value ls Lhe blank node for a Lyped collecLlon rdfSeq
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 8ul8lML88ul
8lML8
When an enLry ls made for Lhe ob[ecL of Lhls sLaLemenL Lhe characLer sLrlng '19990816' goes
lnLo Lhe
vALuL_nAML column and Lhe sLrlng Lype 'hLLp//wwww3org/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 nonllLeral 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 (le 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 nary (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 blanknode ldenLlfler _blanknode 1hls forms a vALuL_nAML of _blanknodenode_ld 1o reuse
blank
nodes Lhe blank node consLrucLor (secLlon 41) 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
(le 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 rdfSLaLemenL 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
rdfSLaLemenL
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 manyLoone 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
(bullLln)
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
- rdf8ag
- rdfSeq
- rdfAlL
A 8ag (a resource havlng Lype rdf8ag) 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
rdfSeq) 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 rdfAlL) 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 8ul8lML8 llgure 1
represenLs Lhe
senLence Course 6001 has Lhe sLudenLs Amy Mohamed !ohann Marla and huong" uslng a
slmple bag
conLalner8ul8lML8
llgure 1 A Slmple 8ag ConLalner uescrlpLlon
?xml verslon10?
rdf8ul xmlnsrdfhLLp//wwww3org/1999/02/22rdfsynLaxns#
xmlnsshLLp//exampleorg/sLudenLs/vocab#
rdfuescrlpLlon rdfabouLhLLp//exampleorg/courses/6001
ssLudenLs
rdf8ag
rdfll rdfresourcehLLp//exampleorg/sLudenLs/Amy/
rdfll
rdfresourcehLLp//exampleorg/sLudenLs/Mohamed/
rdfll
rdfresourcehLLp//exampleorg/sLudenLs/!ohann/
rdfll
rdfresourcehLLp//exampleorg/sLudenLs/Marla/
rdfll
rdfresourcehLLp//exampleorg/sLudenLs/huong/
/rdf8ag
/ssLudenLs
/rdfuescrlpLlon
/rdf8ul
8ul8lML8
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
rdfblanknodenode_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 le 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 rdf8ag descrlbed ln Lxample 1 ls handled
/courses/6001
_blanknode29
/Mohamed
/Amy
Llnk Level 2
Llnk Level 1
A8Ln1_Llnk_lu
999
ssLudenLs
rdfblanknode29_2
rdfblanknode29_1
vALuL_1?L 1C_8AC
Lxample 2 8epresenLlng CollecLlons ln nuM 8ul uaLa Model
Llnk_lu
999
/!ohann
/Marla
/huong
rdfblanknode29_3
rdfblanknode29_4
rdfblanknode29_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 LCeLSub[ecL
l8CM 1A8LL (8ul_MA1CP (
8ulModels('8evlewers')
8ulaLLern (
8ul_1rlple('?r' '8evlewerCf' '?c')
8ul_1rlple('?r' 'rdfLype' '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 hu sLudenLs and have age less Lhan 23 years

Vous aimerez peut-être aussi