logic and knowledge representation

Logic and Knowledge Representation K n o w l e d g e r e - PowerPoint PPT Presentation

Logic and Knowledge Representation K n o w l e d g e r e p r e s e n t a t i o n , O n t o l o g i e s , S e m a n t i c We b 2 5 M a y 2 0 1 8 g s i l e n o @e n s t . f r G i


  1. Example of expert system if flower and seed then phanerogam if phanerogam and bare-seed then fir if phanerogam and 1-cotyledon then monocotyledonous if phanerogam and 2-cotyledon then dicotyledonous if monocotyledon and rhizome then thrush if dicotyledon then anemone if monocotyledon and ¬rhizome then lilac if leaf and flower then cryptogamous if cryptogamous and ¬root then foam if cryptogamous and root then fern if ¬leaf and plant then thallophyte if thallophyte and chlorophyll then algae if thallophyte and ¬ chlorophyll then fungus if ¬leaf and ¬flower and ¬plant then colibacille rhizome + flower + seed + 1-cotyledon ?

  2. From expert systems to KBS ● E x p e r t s y s t e m s S e p a r a t e k n o w l e d g e ( r u l e s ) f r o m t h e r e a s o n i n g e n g i n e

  3. From expert systems to KBS ● E x p e r t s y s t e m s S e p a r a t e k n o w l e d g e ( r u l e s ) f r o m t h e r e a s o n i n g e n g i n e ● K n o w l e d g e - b a s e d s y s t e m s S e p a r a t e k n o w l e d g e ( c o n c e p t s ) f r o m r u l e s a n d r e a s o n i n g – e x a m p l e : F r a m e s ● s t e r e o t y p e d s t r u c t u r e s o f k n o w l e d g e

  4. From expert systems to KBS ● E x p e r t s y s t e m s S e p a r a t e k n o w l e d g e ( r u l e s ) f r o m t h e r e a s o n i n g e n g i n e ● K n o w l e d g e - b a s e d s y s t e m s S e p a r a t e k n o w l e d g e ( c o n c e p t s ) f r o m r u l e s a n d r e a s o n i n g – e x a m p l e : F r a m e s ● s t e r e o t y p e d s t r u c t u r e s o f k n o w l e d g e – e x a m p l e : S e m a n t i c n e t w o r k s ● r e p r e s e n t a t i o n b y g r a p h - b a s e d f o r m a l i s m ● m o d e l e n t i t i e s a n d t h e i r r e l a t i o n s

  5. Frames ● F r a m e s a r e " s t e r e o t y p e d " k n o w l e d g e u n i t s r e p r e s e n t i n g s i t u a t i o n s , o b j e c t s o r e v e n t s o r ( c l a s s e s ) s e t s o f s u c h e n t i t i e s .

  6. Frames ● F r a m e s a r e " s t e r e o t y p e d " k n o w l e d g e u n i t s r e p r e s e n t i n g s i t u a t i o n s , o b j e c t s o r e v e n t s o r ( c l a s s e s ) s e t s o f s u c h e n t i t i e s . ● A f r a m e i s a c o l l e c t i o n o f a t t r i b u t e s ( ) , s p e c i fj e d b y s l o t s t h a t c o r r e s p o n d t o t h e t h e y a c q u i r e o r f a c e t s v a l u e s t h a t l a u n c h . p r o c e d u r e s

  7. Frames ● F r a m e s a r e " s t e r e o t y p e d " k n o w l e d g e u n i t s r e p r e s e n t i n g s i t u a t i o n s , o b j e c t s o r e v e n t s o r ( c l a s s e s ) s e t s o f s u c h e n t i t i e s . ● A f r a m e i s a c o l l e c t i o n o f a t t r i b u t e s ( ) , s p e c i fj e d b y s l o t s t h a t c o r r e s p o n d t o t h e t h e y a c q u i r e o r f a c e t s v a l u e s t h a t l a u n c h . p r o c e d u r e s

  8. Frames ● F r a m e s a r e " s t e r e o t y p e d " k n o w l e d g e u n i t s r e p r e s e n t i n g s i t u a t i o n s , o b j e c t s o r e v e n t s o r ( c l a s s e s ) s e t s o f s u c h e n t i t i e s . ● A f r a m e i s a c o l l e c t i o n o f a t t r i b u t e s ( ) , s p e c i fj e d b y s l o t s t h a t c o r r e s p o n d t o t h e t h e y a c q u i r e o r f a c e t s v a l u e s t h a t l a u n c h . p r o c e d u r e s

  9. Frames ● F r a m e s a r e " s t e r e o t y p e d " k n o w l e d g e u n i t s r e p r e s e n t i n g s i t u a t i o n s , o b j e c t s o r e v e n t s o r ( c l a s s e s ) s e t s o f s u c h e n t i t i e s . ● A f r a m e i s a c o l l e c t i o n o f a t t r i b u t e s ( ) , s p e c i fj e d b y s l o t s t h a t c o r r e s p o n d t o t h e t h e y a c q u i r e o r f a c e t s v a l u e s t h a t l a u n c h . p r o c e d u r e s

  10. Towards semantic networks ● R a t h e r t h e n f o c u s i n g o n t h e “ o b j e c t ” a s p e c t , w e c o u l d f o c u s o n t h e p r e d i c a t i o n a s p e c t , j u s t a s w e d o w i t h l a n g u a g e . ~ o b j e c t s c o n s t i t u t e d b y w h a t w e c a n s a y a b o u t t h e m

  11. “ Wi l l y t h r e w a b a l l t o M o r g a n . ”

  12. “ Wi l l y t h r e w a b a l l t o M o r g a n . ” n o d e s : e n t i t i e s a r c s : r e l a t i o n s h i p s

  13. “ Wi l l y t h r e w a b a l l t o M o r g a n . ” n o d e s : l a b e l s o n n o d e s : e n t i t y e n t i t i e s n a m e s l a b e l s o n a r c s : r e l a t i o n a r c s : n a m e s r e l a t i o n s h i p s

  14. “ Wi l l y t h r e w a b a l l t o M o r g a n . ” fact( throwing, actor, willy ). % or: throwing( actor, willy ). fact( throwing, receiver, morgan ). % or: throwing( receiver, morgan ). fact( throwing, object, ball ). % or: throwing( object, ball ). who_action_what( Who, Act, What) :- fact( Act, actor, Who ), ?- fact( throwing, X, willy). fact( Act, object, What ). ?- who_action_what(willy, throwing, ball).

  15. We n e e d m o r e k n o w l e d g e t o i n f e r s o m e t h i n g m o r e i n t e r e s t i n g ! “ Wi l l y t h r e w a b a l l t o M o r g a n . ” fact( throwing, actor, willy ). % or: throwing( actor, willy ). fact( throwing, receiver, morgan ). % or: throwing( receiver, morgan ). fact( throwing, object, ball ). % or: throwing( object, ball ). who_action_what( Who, Act, What) :- fact( Act, actor, Who ), ?- fact( throwing, X, willy). fact( Act, object, What ). ?- who_action_what(willy, throwing, ball).

  16. Semantic Networks K n o w l e d g e s y s t e m s , i n s p i r e d b y h u m a n c o g n i t i o n , a i m t o b e r e u s a b l e a n d e ffj c i e n t . . .

  17. Semantic Networks . . . b u t w h a t t h e m a c h i n e r e a d s i s n o t w h a t w e r e a d !

  18. Semantic Networks d i fg e r e n c e s i n i n t e n d e d p r o c e s s i n g s h o u l d A n n o t a t i o n p r i n c i p l e : b e r e fm e c t e d i n d i fg e r e n c e s i n t h e s y m b o l s t r u c t u r e s

  19. First encounter between semantic networks and logic: KL-ONE P r i m i t i v e c o n c e p t s ( * ) d o n o t h a v e s u ffj c i e n t c o n d i t i o n s , m a y h a v e n e c e s s a r y D e r i v e d c o n c e p t s s p e c i fj e d b y s u ffj c i e n t a n d n e c e s s a r y c o n d i t i o n s . B r a c h m a n , R . J . , & S c h m o l z e , J . ( 1 9 8 5 ) . A n O v e r v i e w o f t h e K L - O N E K n o w l e d g e R e p r e s e n t a t i o n S y s t e m . C o g n i t i v e S c i e n c e , 9 , 1 7 1 – 2 1 6 .

  20. First encounter between semantic networks and logic: KL-ONE v / r : v a l u e r e s t r i c t i o n n / r : n u m b e r r e s t r i c t i o n ∞ ( m i n , m a x ) , N I L = A MESSAGE is a THING with at least one Sender, all of which are PERSONs, at least one Recipient, all of which are PERSONs, exactly one Body, which is a TEXT, exactly one SendDate, which is a DATE, and exactly one ReceivedDate, which is a DATE. B r a c h m a n , R . J . , & S c h m o l z e , J . ( 1 9 8 5 ) . A n O v e r v i e w o f t h e K L - O N E K n o w l e d g e R e p r e s e n t a t i o n S y s t e m . C o g n i t i v e S c i e n c e , 9 , 1 7 1 – 2 1 6 .

  21. First encounter between semantic networks and logic: KL-ONE t h r o u g h v / r r o l e r e s t r i c t i o n A STARFLEET-MESSAGE is a MESSAGE, all of whose Senders are STARFLEET-COMMANDERS. B r a c h m a n , R . J . , & S c h m o l z e , J . ( 1 9 8 5 ) . A n O v e r v i e w o f t h e K L - O N E K n o w l e d g e R e p r e s e n t a t i o n S y s t e m . C o g n i t i v e S c i e n c e , 9 , 1 7 1 – 2 1 6 .

  22. First encounter between semantic networks and logic: KL-ONE ● K L - O N E i s a n a u t o m a t i c c l a s s i fj e r – t a k e s a n e w C o n c e p t a n d a u t o m a t i c a l l y d e t e r m i n e s a l l s u b s u m p t i o n r e l a t i o n s ( i s - a ) b e t w e e n i t a n d a l l o t h e r C o n c e p t s i n t h e n e t w o r k – a d d s n e w l i n k s w h e n n e w s u b s u m p t i o n r e l a t i o n s a r e d i s c o v e r e d – a u t o m a t e s t h e p l a c e m e n t o f n e w C o n c e p t s i n t h e t a x o n o m y – I t i s ( a l l f o u n d s u b s u m p t i o n r e l a t i o n s a r e l e g i t i m a t e ) b u t n o t s o u n d ( i t d o e s n o t fj n d a l l s u b s u m p t i o n r e l a t i o n s ) c o m p l e t e ● b a s i s f o r O WL ( g i v i n g s e m a n t i c s t o t h e S e m a n t i c We b )

  23. Differences K L - O N E a n d O WL P r o l o g g e n e r a l p u r p o s e s p e c i a l p u r p o s e k n o w l e d g e m a n i p u l a t i o n r e a s o n i n g e n g i n e – o – c p e n w o r l d a s s u m p t i o n l o s e d w o r l d a s s u m p t i o n – n – n e g a t i o n a s f a i l u r e ( N A F ) o o r s t r o n g n e g a t i o n – a – o t l e a s t n e c e s s a r y , n l y s u ffj c i e n t c o n d i t i o n s o p t i o n a l l y s u ffj c i e n t – n o t r u e e x i s t e n t i a l c o n d i t i o n s q u a n t i fj c a t i o n – i n fj n i t e l o o p s s h o u l d – p r o g r a m m e r p r e v e n t s n o t b e p o s s i b l e i n fj n i t e l o o p s

  24. Qualifications of KR

  25. Canonicity ● A K R f o r m a l i s m i s c a n o n i c i f o n e p i e c e o f k n o w l e d g e c a n o n l y b e r e p r e s e n t e d i n o n e w a y alive(Elvis). is(Elvis, alive). alive(elvis). alive(Elvis, true). vivant(Elvis). ● C a n o n i c i t y i s i m p r o v e d b y – r e s t r i c t i n g t h e f o r m a l i s m ( e . g . o n l y u n a r y p r e d i c a t e s ) – p r o v i d i n g g u i d e l i n e s ( e . g . p r o p e r n a m e i n u p p e r c a s e ) – u s i n g s t a n d a r d v o c a b u l a r i e s ( e . g . { a l i v e , d e a d } )

  26. Expressiveness ● A K R f o r m a l i s m i s m o r e e x p r e s s i v e t h a n a n o t h e r o n e i f w e c a n s a y t h i n g s i n t h e fj r s t f o r m a l i s m t h a t w e c a n n o t s a y i n t h e s e c o n d . F i r s t O r d e r L o g i c > P r o p o s i t i o n a l L o g i c ∀ x ⊃ : m a n ( x ) m o r t a l ( x ) ?

  27. Decidability ● A K R f o r m a l i s m i s d e c i d a b l e , i f t h e r e i s a n a l g o r i t h m t h a t c a n a n s w e r a n y q u e r y o n a k n o w l e d g e b a s e i n t h a t f o r m a l i s m . ● T y p i c a l l y , t h e m o r e e x p r e s s i v e a f o r m a l i s m , t h e m o r e l i k e l y i t i s u n d e c i d a b l e .

  28. Decidability ● A K R f o r m a l i s m i s d e c i d a b l e , i f t h e r e i s a n a l g o r i t h m t h a t c a n a n s w e r a n y q u e r y o n a k n o w l e d g e b a s e i n t h a t f o r m a l i s m . ● A f o r m a l i s m c a n b e m a d e d e c i d a b l e b y r e s t r i c t i n g i t . – p r o p o s i t i o n a l l o g i c i s d e c i d a b l e – F O L i s d e c i d a b l e i f a l l f o r m u l a s a r e i n t h i s f o r m : ∃ x ∀ , y , … . z , q , … : p ( x , y ) … = > … e x i s t e n t i a l u n i v e r s a l a r b i t r a r y f o r m u l a q u a n t i fj e r s q u a n t i fj e r s w i t h o u t q u a n t i fj e r s

  29. Closed and Open World Assumptions ● A K R f o r m a l i s m f o l l o w s t h e c l o s e d w o r l d a s s u m p t i o n ( C WA ) , i f a n y s t a t e m e n t t h a t c a n n o t b e p r o v e n i s a s s u m e d t o b e f a l s e . E x a m p l e , U F O s d o n o t e x i s t ! I f i t i s n o t t h e c a s e t h a t u f o s e x i s t , t h e n i t i s t h e c a s e t h a t u f o s d o n o t e x i s t .

  30. Closed and Open World Assumptions ● A K R f o r m a l i s m f o l l o w s t h e c l o s e d w o r l d a s s u m p t i o n ( C WA ) , i f a n y s t a t e m e n t t h a t c a n n o t b e p r o v e n i s a s s u m e d t o b e f a l s e . ● S o m e t i m e s t h e o p e n w o r l d a s s u m p t i o n ( O WA ) i s m o r e a p p r o p r i a t e . A s t a t e m e n t c a n t h e n b e : – p r o v a b l e f a l s e – p r o v a b l e t r u e – u n k n o w n

  31. Unique Name Assumption (UNA) ● A K R f o r m a l i s m f o l l o w s t h e u n i q u e n a m e a s s u m p t i o n ( U N A ) , i f d i fg e r e n t n a m e s a l w a y s r e f e r t o d i fg e r e n t o b j e c t s .

  32. Unique Name Assumption (UNA) ● A K R f o r m a l i s m f o l l o w s t h e u n i q u e n a m e a s s u m p t i o n ( U N A ) , i f d i fg e r e n t n a m e s a l w a y s r e f e r t o d i fg e r e n t o b j e c t s .

  33. Schemas ● A K R f o r m a l i s m i s s c h e m a - b o u n d , i f o n e h a s t o d e c i d e u p f r o n t w h i c h e n t i t i e s c a n h a v e w h i c h p r o p e r t i e s .

  34. Schemas ● A K R f o r m a l i s m i s s c h e m a - b o u n d , i f o n e h a s t o d e c i d e u p f r o n t w h i c h e n t i t i e s c a n h a v e w h i c h p r o p e r t i e s . ● I n s c h e m a - b o u n d f o r m a l i s m s , o n e h a s t o d e c i d e a p r i o r i f o r c l a s s e s o f t h i n g s a n d t h e i r p r o p e r t i e s : a s c h e m a - b o u n d f o r m a l i s m p u t s m o r e m o d e l i n g c o n s t r a i n t s , b u t c a n e x c l u d e n o n - s e n s i b l e s t a t e m e n t s . ● P r o l o g i s s c h e m a - f r e e , a n y e n t i t y c a n h a v e a n y p r o p e r t y .

  35. Schemas ● D a t a b a s e s a r e a p a r t i c u l a r s c h e m a - b o u n d K R f o r m a l i s m . ● A d a t a b a s e c a n b e s e e n a s a s e t o f t a b l e s . e a c h t a b l e c o r r e s p o n d s t o o n e c l a s s o f t h i n g s e a c h c o l u m n c o r r e s p o n d s t o a p r o p e r t y Name Profession Birth Name Resolution Brand Sony T300 4 MP Sony Elvis Singer 1935 Ixus700 12 MP Canon Obama President 1961 … … … … … … e a c h r o w c o r r e s p o n d s t o a t h i n g

  36. Inheritance ● A K R f o r m a l i s m s u p p o r t s i n h e r i t a n c e , i f p r o p e r t i e s s p e c i fj e d f o r o n e c l a s s o f t h i n g s c a n b e a u t o m a t i c a l l y t r a n s f e r r e d t o a m o r e s p e c i fj c c l a s s . ● A c l a s s i s a s e t o f e n t i t i e s w i t h t h e s a m e p r o p e r t i e s . P e r s o n m o r e g e n e r a l c l a s s , Name Profession Birth f e w p r o p e r t i e s i n h e r i t a n c e / s u b c l a s s r e l a t i o n s h i p S i n g e r m o r e s p e c i fj c c l a s s , Name Profession Birth Instrument m o r e p r o p e r t i e s , s o m e r e s t r i c t i o n s : = s i n g e r r e s t r i c t i o n a d d i t i o n a l i n h e r i t e d p r o p e r t i e s p r o p e r t i e s

  37. Monotonicity and non-monotonicity ● A K R f o r m a l i s m i s m o n o t o n i c , i f a d d i n g n e w k n o w l e d g e d o e s n o t u n d o d e d u c e d f a c t s .

  38. Monotonicity and non-monotonicity ● A K R f o r m a l i s m i s m o n o t o n i c , i f a d d i n g n e w k n o w l e d g e s u b s e t d o e s n o t u n d o d e d u c e d f a c t s . ● F i r s t o r d e r l o g i c a n d p r o p o s i t i o n a l l o g i c a r e m o n o t o n i c . elvis_is_person elvis_is_person ⊆ elvis_is_alive elvis_is_alive elvis_is_dead => ~ elvis_is_alive elvis_is_dead => ~ elvis_is_alive + elvis_is_dead => elvis_is_alive => elvis_is_alive ⊆ => elvis_is_dead => michael_jackson_alive ● M o n o t o n i c i t y c a n b e c o u n t e r - i n t u i t i v e . I t r e q u i r e s t o k n o w e v e r y t h i n g u p - f r o n t .

  39. Monotonicity and non-monotonicity ● A K R f o r m a l i s m i s m o n o t o n i c , i f a d d i n g n e w k n o w l e d g e d o e s n o t u n d o d e d u c e d f a c t s . ● D e f a u l t l o g i c i s n o t m o n o t o n i c . elvis_is_person justification if Elvis is dead elvis_is_dead prerequisite then he is not alive ~elvis_is_alive conclusion if Elvis is a person elvis_is_person: elvis_is_alive (and nothing says he’s not alive) elvis_is_alive then he is alive + elvis_is_dead => elvis_is_alive

  40. Distributedness ● A K R f o r m a l i s m i s d i s t r i b u t e d , i f i t e n c o u r a g e s u s e a n d c o - o p e r a t i o n – b y d i fg e r e n t p e o p l e – b y d i fg e r e n t s y s t e m s – a c r o s s d i fg e r e n t p l a c e s – a c r o s s d i fg e r e n t o r g a n i z a t i o n s .

  41. Semantic Web

  42. What's in a web page? ● T e x t u a l c o n t e n t , m a r k u p a n d e m b e d d e d m e d i a ● T h e t y p i c a l m a r k u p c o n s i s t s o f : – h y p e r - l i n k s t o r e l a t e d c o n t e n t , – r e n d e r i n g i n f o r m a t i o n ( p a g i n a t i o n , f o n t s i z e a n d c o l o u r , … ) ● T h e s e m a n t i c c o n t e n t i s a c c e s s i b l e t o h u m a n s b u t n o t d i r e c t l y t o c o m p u t e r s . . .

  43. The Web was designed as an information space , with the goal that it should be useful not only for human-human communication, but also that machines would be able to participate and help. One of the major obstacles to this has been the fact that most information on the Web is designed for human consumption , and even if it was derived from a database with well defined meanings (in at least some terms) for its columns, that the structure of the data is not evident to a robot browsing the Web. Leaving aside the artificial intelligence problem of training machines to behave like people , the Semantic Web approach instead develops languages for expressing information in a machine processable form . T i m B e r n e r s - L e e , T h e S e m a n t i c We b R o a d m a p .

  44. How to add meaning for machines? ● E x t e r n a l a g r e e m e n t o n m e a n i n g o f a n n o t a t i o n s – P r o b l e m s w i t h t h i s a p p r o a c h ● I n fm e x i b l e ● L i m i t e d n u m b e r o f t h i n g s c a n b e e x p r e s s e d

  45. How to add meaning for machines? ● E x t e r n a l a g r e e m e n t o n m e a n i n g o f a n n o t a t i o n s – P r o b l e m s w i t h t h i s a p p r o a c h ● I n fm e x i b l e ● L i m i t e d n u m b e r o f t h i n g s c a n b e e x p r e s s e d ● U s e f o r m a l v o c a b u l a r i e s o r o n t o l o g i e s t o s p e c i f y m e a n i n g o f a n n o t a t i o n s – o n t o l o g i e s p r o v i d e a v o c a b u l a r y o f t e r m s t h a t a r e m a c h i n e u n d e r s t a n d a b l e – n e w t e r m s c a n b e f o r m e d b y c o m b i n i n g e x i s t i n g o n e s a s a k i n d o f “ c o n c e p t u a l L e g o ” – m e a n i n g ( s e m a n t i c s ) o f s u c h t e r m s i s f o r m a l l y s p e c i fj e d

  46. Four principles towards a Semantic Web of Data ● P 1 : g i v e a l l t h i n g s a n a m e

  47. Four principles towards a Semantic Web of Data ● P 2 : r e l a t i o n s h i p s f o r m a g r a p h b e t w e e n t h i n g s ( a k n o w l e d g e g r a p h )

  48. Four principles towards a Semantic Web of Data ● P 3 : n a m e s a r e a d d r e s s e s o n t h e We b

  49. ● P 1 + P 2 + P 3 : a h u g e g l o b a l g r a p h L i n k i n g o p e n d a t a c l o u d d i a g r a m : h t t p : / / l o d - c l o u d . n e t /

  50. Four principles towards a Semantic Web of Data ● P 4 : g i v e e x p l i c i t , f o r m a l s e m a n t i c s – a s s i g n t y p e s t o t h i n g s – a s s i g n t y p e s t o r e l a t i o n s – o r g a n i z e t y p e s i n h i e r a r c h i e s – s p e c i f y c o n s t r a i n t s

  51. Semantic Web ● T h e S e m a n t i c We b i s a n e v o l v i n g e x t e n s i o n o f t h e Wo r l d Wi d e We b , p r o m o t i n g a d i s t r i b u t e d k n o w l e d g e r e p r e s e n t a t i o n . ● I t p r o v i d e s s t a n d a r d s t o – i d e n t i f y e n t i t i e s ( U R I s ) – e x p r e s s f a c t s ( R D F ) – e x p r e s s c o n c e p t s ( R D F S ) – s h a r e v o c a b u l a r i e s – r e a s o n o n f a c t s ( O WL ) ● T h e s e s t a n d a r d s a r e p r o d u c e d a n d e n d o r s e d b y t h e Wo r d Wi d e We b C o n s o r t i u m ( W3 C )

  52. The Semantic Web Tower

  53. URI and namespaces ● U R I = u n i f o r m r e s o u r c e s i d e n t i fj e r – u n i f o r m r e s o u r c e n a m e s ( U R N s ) : U R I s u s e d t o n a m e s o m e t h i n g , e v e n i f t h i s i s a n a b s t r a c t o b j e c t t h a t i s n o t a v a i l a b l e o n t h e We b . ● f o r i n s t a n c e , a p e r s o n m i g h t h a v e a U R I t h a t i s u s e d i n o n t o l o g i e s t o r e f e r t o t h a t p e r s o n . – u n i f o r m r e s o u r c e l o c a t o r s ( U R L s ) : U R I s u s e d t o s p e c i f y t h e l o c a t i o n o f s o m e t h i n g . t h e y s t a r t w i t h a p r o t o c o l i d e n t i fj e r , w i t h a w e l l - e s t a b l i s h e d t e c h n i c a l i n t e r p r e t a t i o n ( e . g . " h t t p " ) .

  54. URI and namespaces ● N a m e s p a c e s – D e r i v e d f r o m d o m a i n r e g i s t r a t i o n ( e . g . ) e p i t a . f r – E v e r y t h i n g u p t o # m a y b e n a m e s p a c e ● E x a m p l e s : u r n : m y a p p n a m e : s t u d e n t s # s t u d e n t 1 2 3 4 h t t p : / / m y s e r v e r . c o m / m y a p p / s t u d e n t s / s t u d e n t 1 2 3 4

  55. URI and namespaces ● N a m e s p a c e s – D e r i v e d f r o m d o m a i n r e g i s t r a t i o n ( e . g . ) e p i t a . f r – E v e r y t h i n g u p t o # m a y b e n a m e s p a c e ● E x a m p l e s : u r n : m y a p p n a m e : s t u d e n t s # s t u d e n t 1 2 3 4 h t t p : / / m y s e r v e r . c o m / m y a p p / s t u d e n t s / s t u d e n t 1 2 3 4 ● U R I a r e i f t h e r e s o u r c e i d e n t i fj e d b y d e r e f e r e n c i a b l e t h e U R I i s r e t r i e v a b l e f r o m t h a t U R I

  56. RDF ( resource description framework ) ● R D F i s a : d a t a m o d e l – a p p l i c a t i o n a n d d o m a i n i n d e p e n d e n t – b a s e d o n s i m p l e t r i p l e f o r m a t – ( l a b e l e d a n d d i r e c t e d ) g r a p h

  57. RDF ( resource description framework ) ● R D F i s a : d a t a m o d e l – a p p l i c a t i o n a n d d o m a i n i n d e p e n d e n t – b a s e d o n s i m p l e t r i p l e f o r m a t – ( l a b e l e d a n d d i r e c t e d ) g r a p h ● R D F “ s t a t e m e n t s ” c o n s i s t o f – r ( = n o d e s ) e s o u r c e s ● w h i c h h a v e p r o p e r t i e s – w h i c h h a v e ( = n o d e s , s t r i n g s , . . . ) v a l u e s

  58. RDF ( resource description framework ) ● R D F i s a : d a t a m o d e l – a p p l i c a t i o n a n d d o m a i n i n d e p e n d e n t – b a s e d o n s i m p l e t r i p l e f o r m a t – ( l a b e l e d a n d d i r e c t e d ) g r a p h s u b j e c t ● R D F “ s t a t e m e n t s ” c o n s i s t o f p r e d i c a t e – r ( = n o d e s ) e s o u r c e s o b j e c t ● w h i c h h a v e p r o p e r t i e s – w h i c h h a v e ( = n o d e s , s t r i n g s ) v a l u e s p r e d i c a t e ( s u b j e c t , o b j e c t )

  59. RDF ( resource description framework )

  60. RDF and XML ● B e i n g s o g e n e r a l , s y n t a c t i c d e t a i l s a r e r e l a t i v e l y i n s i g n i fj c a n t ; h o w e v e r X M L i s a n e x a m p l e o f c o m m o n l y u s e d s y n t a c t i c s t r u c t u r e . – N O T E : X M L i s j u s t a w a y t o w r i t e a n d t r a n s p o r t R D F , b u t i s n o t a c o m p o n e n t o f R D F ! R D F d a t a c a n a l s o b e s t o r e d v e r y d i fg e r e n t l y , f o r e x a m p l e i n a r e l a t i o n a l d a t a b a s e .

  61. RDF, a note on resources ● A g r a p h n o d e ( c o r r e s p o n d i n g t o a r e s o u r c e ) c a n b e – t h e v a l u e o f a p r o p e r t y – a r b i t r a r i l y c o m p l e x t r e e a n d g r a p h s t r u c t u r e s ● S y n t a c t i c a l l y , v a l u e s c a n b e – e m b e d d e d ( i . e . l e x i c a l l y i n - l i n e ) – o r r e f e r e n c e d ( l i n k e d )

  62. RDF Schema ● B a s e - l e v e l s p e c i fj c a t i o n o f s e m a n t i c s

  63. RDF Schema ● B a s e - l e v e l s p e c i fj c a t i o n o f s e m a n t i c s ● L a n g u a g e c o n s t r u c t s i n c l u d e : – c l a s s , – p r o p e r t y , – s u b c l a s s , – s u b p r o p e r t y ● C l a s s e s a n d p r o p e r t i e s a r e t h e m s e l v e s a l s o r e s o u r c e s : t h i s e n a b l e s a n n o t a t i o n s a b o u t a n n o t a t i o n s ● V o c a b u l a r y c a n b e u s e d t o d e fj n e o t h e r v o c a b u l a r i e s f o r y o u r a p p l i c a t i o n d o m a i n

  64. RDF(S) Terminology and Semantics ● C l a s s e s a n d c l a s s h i e r a r c h y – A l l c l a s s e s a r e i n s t a n c e s o f r d f s : C l a s s – A c l a s s h i e r a r c h y i s d e fj n e d b y r d f s : s u b C l a s s O f ● I n s t a n c e s ( i n d i v i d u a l s ) o f a c l a s s – d e fj n e d b y r d f : t y p e

  65. RDF(S) Terminology and Semantics ● P r o p e r t i e s – p r o p e r t i e s a r e g l o b a l : a p r o p e r t y n a m e i n o n e p l a c e i s t h e s a m e a s t h e p r o p e r t y n a m e i n a n o t h e r ( a s s u m i n g t h e s a m e n a m e s p a c e ) – p r o p e r t i e s f o r m a h i e r a r c h y , r d f s : s u b P r o p e r t y O f ● D o m a i n a n d R a n g e o f a p r o p e r t y – d o m a i n : t h e c l a s s ( o r c l a s s e s ) t h a t h a v e t h e p r o p e r t y – r a n g e : t h e c l a s s ( o r c l a s s e s ) t o w h i c h p r o p e r t y v a l u e s b e l o n g

  66. RDF(S) Terminology and Semantics

  67. RDF(S) Terminology and Semantics E x a m p l e : (ex:MotorVehicle, rdf:type, rdfs:Class) (ex:PassengerVehicle, rdf:type, rdfs:Class) (ex:Van, rdf:type, rdfs:Class) (ex:Truck, rdf:type, rdfs:Class) (ex:MiniVan, rdf:type, rdfs:Class) (ex:PassengerVehicle, rdfs:subClassOf, ex:MotorVehicle) (ex:Van, rdfs:subClassOf, ex:MotorVehicle) (ex:Truck, rdfs:subClassOf, ex:MotorVehicle) (ex:MiniVan, rdfs:subClassOf, ex:Van) (ex:MiniVan, rdfs:subClassOf, ex:PassengerVehicle)

  68. Querying RDF: SPARQL ● S i m p l e P r o t o c o l A n d R D F Q u e r y L a n g u a g e – W3 C s t a n d a r d i s a t i o n e fg o r t s i m i l a r t o t h e X q u e r y q u e r y l a n g u a g e f o r X M L d a t a – s u i t a b l e f o r r e m o t e u s e ( r e m o t e a c c e s s p r o t o c o l ) PREFIX abc: <http://mynamespace.com/exampleOntology#> SELECT ?capital ?country WHERE { ?x abc:cityname ?capital. ?y abc:countryname ?country. ?x abc:isCapitalOf ?y. ?y abc:isInContinent abc:africa. }

  69. OWL ( Web Ontology Language ) ● O WL a d d s e x p r e s s i v i t y t o R D F S c h e m a t o e n a b l e m o r e p o w e r f u l s e m a n t i c s : – c a r d i n a l i t y r e s t r i c t i o n s , – l o c a l r a n g e c o n s t r a i n t s , – e q u a l i t y o f r e s o u r c e s , – i n v e r s e , s y m m e t r i c a n d t r a n s i t i v e p r o p e r t i e s , – b o o l e a n c l a s s c o m b i n a t i o n s , – d i s j o i n t n e s s a n d c o m p l e t e n e s s , …

  70. OWL ( Web Ontology Language ) ● O WL a d d s e x p r e s s i v i t y t o R D F S c h e m a t o e n a b l e m o r e p o w e r f u l s e m a n t i c s : – c a r d i n a l i t y r e s t r i c t i o n s , – l o c a l r a n g e c o n s t r a i n t s , – e q u a l i t y o f r e s o u r c e s , – i n v e r s e , s y m m e t r i c a n d t r a n s i t i v e p r o p e r t i e s , – b o o l e a n c l a s s c o m b i n a t i o n s , – d i s j o i n t n e s s a n d c o m p l e t e n e s s , … ● O : s u b s e t o f f e a t u r e s t h a t i s e a s y t o WL L i t e i m p l e m e n t a n d u s e ● O : s u b s e t o f f e a t u r e s s u p p o r t i n g d e s c r i p t i o n - WL D L l o g i c r e a s o n i n g ( e . g . u s e f u l f o r o n t o l o g y c o n s t r u c t i o n )

  71. objects compositions hierarchies Instances, Taxonomies, Mereonomies

  72. Individuals (IS-INSTANCE-OF) ● T h e c o n c e p t o f c l a s s i n t u i t i v e l y r e f e r s t o s o m e e n t i t y t h a t b e l o n g s t o t h a t c l a s s . ● T h i s e n t i t y o r o b j e c t i s s a i d t o a n i n s t a n c e o f t h a t c l a s s .

  73. Individuals (IS-INSTANCE-OF) class Person { String name void setName(String newName) { name = newName } } p = new Person() p.setName("Plato")

  74. Individuals (IS-INSTANCE-OF) class Person { String name d e s c r i b e p r o p e r t i e s o f t h e s y s t e m void setName(String newName) { name = newName } } p = new Person() p.setName("Plato")

  75. Individuals (IS-INSTANCE-OF) class Person { String name void setName(String newName) { name = newName } } a c t u a l l y a l l o c a t e p = new Person() ( m e m o r y ) s p a c e f o r p.setName("Plato") t h e o b j e c t

  76. Individuals (IS-INSTANCE-OF) class Person { String name void setName(String newName) { name = newName } } p = new Person() a p p l y t h e r e q u i r e d p.setName("Plato") m e t h o d t o t h e o b j e c t

  77. Hierarchy as Taxonomy (IS-A) ● T h i n g s a n d c o n c e p t s a r e u s u a l l y h i e r a r c h i c a l l y c l a s s i fj e d b o t h i n c o m m o n a n d e x p e r t k n o w l e d g e .

  78. Hierarchy as Taxonomy (IS-A) ● T h i n g s a n d c o n c e p t s a r e u s u a l l y h i e r a r c h i c a l l y c l a s s i fj e d b o t h i n c o m m o n a n d e x p e r t k n o w l e d g e . ● G i v e n a c e r t a n c l a s s , a s u b c l a s s o r d e r i v e d c l a s s i n h e r i t s c e r t a i n p r o p e r t i e s ( a s a t t r i b u t e s a n d m e t h o d s ) f r o m t h e fj r s t . – F r o m t h e p e r s p e c t i v e o f t h e s e c o n d c l a s s , t h e fj r s t i s c a l l e d s u p e r c l a s s . – U s u a l l y , d e r i v a t i o n m i g h t b e . o v e r r i d d e n

  79. Hierarchy as Taxonomy (IS-A) class A { String salutation = "Ciao" void show() { print(salutation + "! My type is A.") } } class B extends A { @Override void show() { print(salutation + "! My type is B.") } } output o = new A() C i a o ! My t y p e i s A . o.show() o = new B() C i a o ! My t y p e i s B . o.show()

  80. Hierarchy as partonomy (HAS-A) ● G i v e n a n o b j e c t o f a c e r t a i n c l a s s , i f i t i s c o m p o s e d b y o t h e r o b j e c t s , t h e s e c o n d o n e s b e l o n g t o t h e fj r s t .

  81. Hierarchy as partonomy (HAS-A) ● G i v e n a n o b j e c t o f a c e r t a i n c l a s s , i f i t i s c o m p o s e d b y o t h e r o b j e c t s , t h e s e c o n d o n e s b e l o n g t o t h e fj r s t . – T h e c a r h a s f o u r w h e e l s . – T h o s e w h e e l s b e l o n g s t o t h e c a r .

  82. Hierarchy as partonomy (HAS-A) ● G i v e n a n o b j e c t o f a c e r t a i n c l a s s , i f i t i s c o m p o s e d b y o t h e r o b j e c t s , t h e s e c o n d o n e s b e l o n g t o t h e fj r s t . – T h e c a r h a s f o u r w h e e l s . – T h o s e w h e e l s b e l o n g s t o t h e c a r . . . . b u t t h i n g s a r e a b i t m o r e c o m p l i c a t e d !

  83. “Strict” composition class Car { T h e l i f e t i m e o f t h e Wheel frontLeftWheel Wheel frontRightWheel c o m p o n e n t s Wheel rearLeftWheel t h e d e p e n d s o n Wheel rearRightWheel c o m p o s e d o b j e c t . Car { frontLeftWheel = new Wheel() frontRightWheel = new Wheel() rearLeftWheel = new Wheel() rearRightWheel = new Wheel() } } car = new Car()

  84. Aggregation or weak composition class Car { T h e l i f e t i m e o f t h e Wheel frontLeftWheel Wheel frontRightWheel c o m p o n e n t s c a n Wheel rearLeftWheel o f t h a t o f t h e d i fge r Wheel rearRightWheel c o m p o s e d o b j e c t . Car { } void mountWheels(fLW, fRW, rLW, rRW) { frontLeftWheel = fLW frontRightWheel = fRW rearLeftWheel = rLW rearLeftWheel = rRW } } car = new Car() car.mountWheels(...)

Recommend


More recommend