1
00:00:00,950 --> 00:00:06,890
Hello, my name is Matthew Graham and this
is Module Two of two modules on Semantics.

2
00:00:06,890 --> 00:00:09,260
In the last module we discussed

3
00:00:10,740 --> 00:00:13,660
how to represent knowledge in
a machine processable way.

4
00:00:14,850 --> 00:00:18,830
We talked about the various
different representations of RDF,

5
00:00:18,830 --> 00:00:21,450
the technology that can
be used to do this.

6
00:00:21,450 --> 00:00:24,500
How to embed this information
into a web page, and

7
00:00:24,500 --> 00:00:29,960
also the linked data idea
that makes use of this

8
00:00:32,200 --> 00:00:37,370
to create a, a, web of linked information
that's accessible through browsers.

9
00:00:38,670 --> 00:00:43,820
In this module we're going
to be considering how to

10
00:00:43,820 --> 00:00:48,850
actually represent domain knowledge
in terms of machine processable

11
00:00:48,850 --> 00:00:53,190
form through concept schemes and
ontologies.

12
00:00:55,140 --> 00:00:59,340
So we have a hierarchy of
concept schemes that can be used

13
00:00:59,340 --> 00:01:01,560
to capture domain knowledge.

14
00:01:01,560 --> 00:01:07,420
The idea is in its simplest form
we have a controlled vocabulary.

15
00:01:07,420 --> 00:01:11,310
So this can just be a closed list of terms
that can be used for classification.

16
00:01:11,310 --> 00:01:16,400
So it can just be a certain list
of words or phrases that we

17
00:01:16,400 --> 00:01:22,447
are using for a set of labels, and we
will always make use of that closed list.

18
00:01:22,447 --> 00:01:26,180
But there's no notion of any sort
of relationship between them.

19
00:01:26,180 --> 00:01:30,680
There's no notion of a hierarchy
of definition within them.

20
00:01:30,680 --> 00:01:33,990
So the next level up from
a controlled vocabulary,

21
00:01:33,990 --> 00:01:38,510
which can just really regard as, as a bag
of terms, is what's called a taxonomy and

22
00:01:38,510 --> 00:01:42,990
then a taxonomy,
you have a controlled vocabulary but

23
00:01:42,990 --> 00:01:47,890
you have imposed a hierarchy on it
in terms of term and, and sub term.

24
00:01:49,470 --> 00:01:51,590
So for example, eh,

25
00:01:51,590 --> 00:01:55,980
when we were talking about anatomical
structure in the last lecture.

26
00:01:57,560 --> 00:02:00,940
We had this notion of looking
up the word Hindbrain and

27
00:02:00,940 --> 00:02:05,610
then their maybe in our,
taxonomy that we're using, a,

28
00:02:05,610 --> 00:02:09,830
a, a super term of that would
be central nervous system and

29
00:02:09,830 --> 00:02:15,870
a sub term of that would be an individual
structure that makes up hindbrain.

30
00:02:15,870 --> 00:02:20,540
So these hierarchies of,
meaning don't necessarily you need to be

31
00:02:20,540 --> 00:02:25,220
only in terms of obvious meaning,

32
00:02:25,220 --> 00:02:30,690
they can also be in terms of other
hierarchical notions whether it's

33
00:02:30,690 --> 00:02:35,760
anatomical development or
geographical location or things like that.

34
00:02:37,640 --> 00:02:43,450
About the taxonomy we then have this
more advanced concept of a thesaurus

35
00:02:44,640 --> 00:02:49,090
and in a thesaurus we have a taxonomy but

36
00:02:49,090 --> 00:02:54,580
there are then notions of not
only hierarchical relationships

37
00:02:54,580 --> 00:02:59,580
between the individual terms, there
are notions that you have broader and

38
00:02:59,580 --> 00:03:03,440
narrower terms,
that you can have synonymous terms.

39
00:03:03,440 --> 00:03:05,820
So these are terms that you can use at a,

40
00:03:05,820 --> 00:03:08,960
at an equal level in a hierarchy
instead of each other.

41
00:03:08,960 --> 00:03:13,360
There is some notion of a top term a,
a root term.

42
00:03:13,360 --> 00:03:17,820
There is a notion of a scope note, to,
to determine that, you know, this is when

43
00:03:17,820 --> 00:03:22,110
this particular term is relevant, this is
when this particular term is relevant and

44
00:03:22,110 --> 00:03:25,390
then there are also
notions of related terms.

45
00:03:25,390 --> 00:03:29,700
So, that this term is related to this term
over in this part of the hierarchy, or

46
00:03:29,700 --> 00:03:32,329
this term is related to this
term in this other thesaurus.

47
00:03:36,340 --> 00:03:39,770
Other ideas or concept schemes that you,
you could use when you're,

48
00:03:39,770 --> 00:03:44,970
you're programatically manipulating
knowledge and information, also things

49
00:03:44,970 --> 00:03:49,610
like subject heading list, or terminology,
glossaries, faceted classifications.

50
00:03:52,410 --> 00:03:58,910
So the idea is that you would employ
one of these when you are working with

51
00:04:00,520 --> 00:04:06,100
a knowledge base and, and trying to

52
00:04:06,100 --> 00:04:11,120
encapture a domain knowledge into a,
a programmatic fashion.

53
00:04:13,790 --> 00:04:18,480
Now the way you would represent
these sort of simple concept

54
00:04:18,480 --> 00:04:22,830
schemes is through yet
another W3C standard.

55
00:04:24,274 --> 00:04:28,320
This one is known as SKOS which stands for
the simple knowledge organization system.

56
00:04:31,878 --> 00:04:36,480
It's used for expressing knowledge concept
schemes in a machine-understandable way,

57
00:04:36,480 --> 00:04:42,400
and it's,
is itself expressed in terms of RDF

58
00:04:42,400 --> 00:04:48,050
statements and a thing called RDFS,
which is a, a simple schema language for

59
00:04:48,050 --> 00:04:51,810
RDF, which can be used for
defining RDF data structures.

60
00:04:51,810 --> 00:04:56,610
And the idea there is that you
express your entire concept scheme

61
00:04:56,610 --> 00:04:59,130
as an RDF graph with content and
structure.

62
00:04:59,130 --> 00:05:04,050
And there are various words
there you can see which identify

63
00:05:04,050 --> 00:05:08,010
specific terms within,
within the SKOS system

64
00:05:08,010 --> 00:05:12,300
relating to things that we've identified
in the particular type of data structure,

65
00:05:12,300 --> 00:05:15,030
particular type of knowledge
structure we may be interested in.

66
00:05:15,030 --> 00:05:18,840
So we have scopeNotes and narrower,
broader, related, hiddenLabels.

67
00:05:18,840 --> 00:05:20,480
Whether something's an OrderedCollection,

68
00:05:20,480 --> 00:05:23,570
it's a ConceptScheme that sort
of thing preferred labels.

69
00:05:23,570 --> 00:05:28,480
So the idea is that I could
take one of my vocabularies or

70
00:05:28,480 --> 00:05:34,650
taxonomy that I"m using and I can then
write it up formally in the form of a,

71
00:05:34,650 --> 00:05:37,130
a SKOS vocabulary, and

72
00:05:37,130 --> 00:05:40,870
then that there are programmatic tools
which I can then use that to ingest.

73
00:05:40,870 --> 00:05:47,300
And I could then start programmatically
manipulating RDF triples,

74
00:05:47,300 --> 00:05:52,070
which are expressed in terms
of that SKOS vocabulary,

75
00:05:52,070 --> 00:05:56,240
such that they may be the subject or
mainly the predicate

76
00:05:57,290 --> 00:06:02,590
are terms which are relevant or
that are parts of these SKOS vocabularies.

77
00:06:04,250 --> 00:06:11,150
And here's an example of, of SKOS,
of of of a skos vocabulary.

78
00:06:11,150 --> 00:06:15,100
This is actually defining
a temperature scale,

79
00:06:17,770 --> 00:06:22,800
and it's saying that I'm listing a whole
load of different temperature scales here.

80
00:06:23,980 --> 00:06:27,420
But the one I'm particularly describing
in this example is the absolute

81
00:06:27,420 --> 00:06:28,740
temperature scale.

82
00:06:28,740 --> 00:06:31,760
I'm saying that this has
a preferred label, which is abso,

83
00:06:31,760 --> 00:06:34,510
absolute temperature scale in lower case.

84
00:06:34,510 --> 00:06:38,010
The definition in my provider,
even readable definition here.

85
00:06:38,010 --> 00:06:43,010
There's a broader term of it in terms of
this concept which is temperature scales,

86
00:06:43,010 --> 00:06:46,710
there is a narrower term which is Kelvin,
and

87
00:06:46,710 --> 00:06:52,330
then we have related, concepts in
our scheme to this temperature,

88
00:06:52,330 --> 00:06:54,940
just because the absolute temperature
scale which is the Celsius temperature

89
00:06:54,940 --> 00:06:59,100
scale, and another related concept is,
is temperature itself.

90
00:06:59,100 --> 00:07:03,650
So we could define
an entire skos vocabulary

91
00:07:03,650 --> 00:07:07,710
devoted to the physical properties of
temperature and measuring temperature.

92
00:07:07,710 --> 00:07:10,590
Temperature scales,
how that information is encoded,

93
00:07:10,590 --> 00:07:13,910
how those different systems
are related to each other.

94
00:07:13,910 --> 00:07:17,760
And then we could have, a piece of code,

95
00:07:17,760 --> 00:07:21,770
which could use that to
programatically manipulate,

96
00:07:21,770 --> 00:07:26,410
temperature readings for
climate data models for example.

97
00:07:27,423 --> 00:07:30,930
There is,

98
00:07:30,930 --> 00:07:35,910
a query language for RDF called sparql.

99
00:07:35,910 --> 00:07:38,140
Again, it's a W3 standard.

100
00:07:38,140 --> 00:07:42,510
I'm not going to go into it in any great
detail here, just to show you though that

101
00:07:42,510 --> 00:07:47,460
there are particular keywords in there
which will look familiar to the sorts of

102
00:07:47,460 --> 00:07:52,340
keywords that we covered when, in the two
modules we did on SQL in the databases.

103
00:07:52,340 --> 00:07:57,130
So you will see select and
you will see aware and order by,

104
00:07:57,130 --> 00:08:00,870
distinct, limit, offset,
that sort of thing.

105
00:08:00,870 --> 00:08:03,260
This is an example of a Sparql query.

106
00:08:06,510 --> 00:08:12,000
In sparql variables are identified by
question marks at the start of it.

107
00:08:12,000 --> 00:08:18,190
What we're doing here is here is we are,
querying a database of elements,

108
00:08:18,190 --> 00:08:22,190
and we're asking for the, the name,
the chemical symbol, the weight,

109
00:08:22,190 --> 00:08:26,850
the atomic weight, the atomic number,
and the color from our

110
00:08:26,850 --> 00:08:31,630
data collection of linked data or whatever
expressed in a machine-readable way.

111
00:08:31,630 --> 00:08:36,470
And then we're saying where we have to
think we're looking specifically for

112
00:08:36,470 --> 00:08:37,380
uranium.

113
00:08:37,380 --> 00:08:42,820
And this is the way we would
identify the things which are,

114
00:08:42,820 --> 00:08:47,920
are transuranic and heavier than uranium
and then we order by, them by weight.

115
00:08:47,920 --> 00:08:50,650
So this is an example
of this sort of thing.

116
00:08:50,650 --> 00:08:53,750
We could write this as a similar
example if this data was expressed in

117
00:08:55,590 --> 00:08:58,540
in a relational database
form with the SQL statement.

118
00:08:58,540 --> 00:09:02,620
The advantage of sparql however is
that the idea is that the data doesn't

119
00:09:02,620 --> 00:09:06,940
necessarily reside in a single database.

120
00:09:06,940 --> 00:09:09,970
It already has this notion that
the data is all linked together out

121
00:09:09,970 --> 00:09:12,450
there somewhere, so
there's already a notion when you're,

122
00:09:12,450 --> 00:09:16,300
you're constructing a sparkle query that
it's going to be a distributed query

123
00:09:16,300 --> 00:09:21,210
hitting multiple data sources where
the data is identifiable and, and resided.

124
00:09:21,210 --> 00:09:24,810
And that's given by those URIs in the RDF
statements that you're working with.

125
00:09:27,350 --> 00:09:31,340
Now, the most elaborate, or

126
00:09:31,340 --> 00:09:36,900
the most powerful concept scheme that you
can use, is a thing called an ontology.

127
00:09:38,590 --> 00:09:42,390
And the formal definition of ontology is,

128
00:09:42,390 --> 00:09:45,660
is that a formal specification
of a shared conceptualization.

129
00:09:45,660 --> 00:09:52,540
What that means is that you have an agreed

130
00:09:52,540 --> 00:09:58,040
set of ideas of what the domain knowledge
base for a particular de, subdomain or

131
00:09:58,040 --> 00:10:02,340
domain is, the particular knowledge
base for that is, and that's how you

132
00:10:02,340 --> 00:10:06,530
are expressing it in a machine processable
way and that's called an ontology.

133
00:10:06,530 --> 00:10:10,180
So it is essentially a data model that
represents a set of concepts within

134
00:10:10,180 --> 00:10:13,610
the domain and all the relationships
between those concepts.

135
00:10:14,712 --> 00:10:18,824
An ontology allows you to
define arbitrary relationships,

136
00:10:18,824 --> 00:10:23,580
arbitrary properties, arbitrary
concepts so you're not limited to

137
00:10:23,580 --> 00:10:29,220
the types of the relationships you can
have to just hierarchical or whatever.

138
00:10:29,220 --> 00:10:31,330
You can have any type of relationship and

139
00:10:31,330 --> 00:10:34,940
you can identify those and,
and encode those.

140
00:10:34,940 --> 00:10:39,840
So ontology is generally describe
individuals which are the ground

141
00:10:39,840 --> 00:10:43,930
level objects, the, the individual facts
that you may be trying to represent.

142
00:10:43,930 --> 00:10:48,940
They will describe classes and
if you're familiar with object oriented

143
00:10:48,940 --> 00:10:52,250
programming then, then that should make
some degree of sense for you to have.

144
00:10:52,250 --> 00:10:54,830
You have classes and instances in
object oriented programming and

145
00:10:54,830 --> 00:10:57,210
in ontology you have
individuals in classes.

146
00:10:57,210 --> 00:11:00,780
You have attributes that the classes and
the individuals have, properties,

147
00:11:00,780 --> 00:11:04,030
features, characteristics, those sort of
things and then you have relationships

148
00:11:04,030 --> 00:11:09,020
which you you use to associate
all of those together.

149
00:11:10,120 --> 00:11:14,350
And then there can be events which
define how those attributes or

150
00:11:14,350 --> 00:11:17,120
relationships can change
in pre-described ways.

151
00:11:20,470 --> 00:11:24,790
Yet again, there is a W3C standard for
authoring ontologists for

152
00:11:24,790 --> 00:11:26,030
representing ontologists.

153
00:11:26,030 --> 00:11:29,470
This is the web ontology language or
OWL, as its called.

154
00:11:31,140 --> 00:11:34,878
It's again, based on RDF so

155
00:11:34,878 --> 00:11:39,720
an ontology is expressed
in terms of RDF structures.

156
00:11:39,720 --> 00:11:43,380
And this is largely regarded as one of
the fundamental technologies underpinning

157
00:11:43,380 --> 00:11:48,313
the semantic web because it gives you
the richness of expression to offer

158
00:11:48,313 --> 00:11:54,380
arbitrarily encode any set of concepts,

159
00:11:54,380 --> 00:11:58,060
any piece of domain knowledge into
a machine processible fashion.

160
00:11:59,650 --> 00:12:04,090
As I said OWL allows descriptions
of relations between classes

161
00:12:04,090 --> 00:12:06,750
particularly disjointedness and
that sort of thing.

162
00:12:06,750 --> 00:12:10,170
It allows you to express cardinality
constraints on particular things, so

163
00:12:10,170 --> 00:12:11,590
you have exactly one.

164
00:12:11,590 --> 00:12:16,078
Characteristic of properties and
numerator classes, and all sorts of, of,

165
00:12:16,078 --> 00:12:17,440
very powerful things.

166
00:12:18,740 --> 00:12:24,489
So, owl regards data as being interpreted
as a set of individuals which it describes

167
00:12:25,490 --> 00:12:30,000
a set of property assertions relating
the individuals to each other and

168
00:12:30,000 --> 00:12:34,270
a set of axioms placing constraints on,
on sets of individuals,

169
00:12:34,270 --> 00:12:38,660
on, on classes and the types of
relationships allowed between them.

170
00:12:38,660 --> 00:12:44,730
So, for example, we may have a family
ontology which is defining this notion of

171
00:12:45,840 --> 00:12:50,810
what a family is and the concepts that
that contains that may have for, example,

172
00:12:50,810 --> 00:12:56,320
a, a hasMother relation which is only

173
00:12:56,320 --> 00:13:01,580
present between two individuals when one
of them, has a parent, is also present.

174
00:13:03,810 --> 00:13:05,840
And in our notion of family ontology,

175
00:13:05,840 --> 00:13:10,170
we may also have this relationship
called HasTypeOBlood.

176
00:13:12,190 --> 00:13:16,790
And members of the class
of that relationship,

177
00:13:16,790 --> 00:13:21,510
HasTypeOBlood, are never
related via the hasParent

178
00:13:21,510 --> 00:13:26,640
constraint two members of HasTypeABBlood.

179
00:13:26,640 --> 00:13:31,810
So in that particular example, we can
put biological constraints on our notion

180
00:13:31,810 --> 00:13:36,210
of family into this knowledge base and
have that as a machine processable form.

181
00:13:37,310 --> 00:13:41,250
So it's showing that these are not
just simple relationships, there are,

182
00:13:41,250 --> 00:13:43,680
there are ways we can encode any

183
00:13:43,680 --> 00:13:46,100
sort of information we want
into something like that.

184
00:13:48,030 --> 00:13:53,650
We can also, make inferences, or
say that if Ada has mother Ann,

185
00:13:53,650 --> 00:13:58,640
and Ann is, has type O blood,
then Ann is not a member of

186
00:13:58,640 --> 00:14:03,370
the HasTypeABlood relationship.

187
00:14:03,370 --> 00:14:07,530
And one of the powers of things that
are represented through ontology is

188
00:14:07,530 --> 00:14:13,580
particularly is that we can use logical
inferencing to identify statements

189
00:14:13,580 --> 00:14:17,466
that are not consistent with the knowledge
base that we're, we're using.

190
00:14:17,466 --> 00:14:23,330
This is done but
using reasoning surfaces, services.

191
00:14:23,330 --> 00:14:29,767
This is done using reasoning services.

192
00:14:31,010 --> 00:14:34,480
And, what's called first
order predicate logic and,

193
00:14:34,480 --> 00:14:39,920
the idea is because we've expressed our,
our, our knowledge base, in a for most,

194
00:14:39,920 --> 00:14:46,010
and rigorous way then we can use
mathematical logic to either make

195
00:14:47,730 --> 00:14:52,070
further inferences or look for statements
that are in congruence with each other.

196
00:14:52,070 --> 00:14:54,730
So we can say that sheep only eat grass.

197
00:14:54,730 --> 00:14:57,060
We can say that grass is a plant.

198
00:14:57,060 --> 00:15:02,050
We can identify plants and parts of
plants as disjoint from animals and

199
00:15:02,050 --> 00:15:03,670
parts of animals.

200
00:15:03,670 --> 00:15:07,480
We can say vegetarians only eat
things which are not animals or

201
00:15:07,480 --> 00:15:13,230
parts of animals and then having
encoded those statements up we can ask

202
00:15:13,230 --> 00:15:18,590
our logical inferencing action
to make some inferences and

203
00:15:18,590 --> 00:15:22,120
it can come up with that statement
that sheep are vegetarians.

204
00:15:22,120 --> 00:15:27,600
Which is a logically, consistent
statement based on the, the set of

205
00:15:27,600 --> 00:15:30,970
statements we've already given it,
a set of instances we've already given it,

206
00:15:30,970 --> 00:15:36,140
plus the relationship rules, and the
properties we've defined between those.

207
00:15:36,140 --> 00:15:40,540
So that gives a little toy example of
the kind of inferencing that you can do.

208
00:15:44,920 --> 00:15:48,750
Some of different things examples on one
of our smart applications might use.

209
00:15:48,750 --> 00:15:52,877
If you remember the,
the set of zebra fish, meta data,

210
00:15:52,877 --> 00:15:57,700
multimedias data that we talked about
as an example in, in the last module.

211
00:15:59,120 --> 00:16:02,960
Then we may have some inferences
that we're going to run,

212
00:16:02,960 --> 00:16:07,620
we have an ontology behind it, we have our
data marked up in terms of that ontology,

213
00:16:07,620 --> 00:16:10,608
and so we may want to look for and

214
00:16:10,608 --> 00:16:15,120
atomical terms which are relevent for
a particular stage of development.

215
00:16:15,120 --> 00:16:20,170
Or we may want to search for terms
which are related to a particular term

216
00:16:20,170 --> 00:16:22,560
in some way, from some class whatever.

217
00:16:22,560 --> 00:16:27,620
Or we may want to find,
two classes, and we're looking for

218
00:16:27,620 --> 00:16:32,070
the lowest common ancestor
in the hierarchy, because we

219
00:16:32,070 --> 00:16:36,130
want to use that as a single search term
which would then encompass both terms, in,

220
00:16:36,130 --> 00:16:38,770
in a hierarchical fashion that
we're interested in doing.

221
00:16:38,770 --> 00:16:42,430
And we can use logical inferencing for
all finding all those sort of problems.

222
00:16:45,430 --> 00:16:51,250
Finally, software that you may want to
look at for working with ontologies

223
00:16:51,250 --> 00:16:57,090
analysis, there's Jena and Protege- I
would highly recommend looking at Protege.

224
00:16:57,090 --> 00:17:01,570
It allows you to explore ontologies, it
allows you construct your own ontologies,

225
00:17:01,570 --> 00:17:04,060
it allows you to reason over ontologies.

226
00:17:04,060 --> 00:17:06,230
It's, it's a very powerful tool and

227
00:17:06,230 --> 00:17:10,548
then there's a, a, an instance of
an infrontention here which is come at,

228
00:17:10,548 --> 00:17:15,960
at the bottom, CWM,
which you may also want to have a look at.

229
00:17:15,960 --> 00:17:21,820
There are other like pellet and
hermit which have I think

230
00:17:21,820 --> 00:17:26,460
both Java and Python wrappers that you
can use in, in your code base as well

231
00:17:26,460 --> 00:17:29,950
if you are working with RDF and
ontological information.

232
00:17:29,950 --> 00:17:35,361
And that is the end of the module.

233
00:17:35,361 --> 00:17:35,861
Thank you.

