Akademia Górniczo-Hutnicza
Wydział Elektrotechniki, Automatyki, Informatyki i Elektroniki Kierunek Informatyka Stosowana
Podstawy Inżynierii Wiedzy
Semantic Web Applications
Semantic Wikis
Łukasz Jaromi, Łukasz Krzyżek Środa 8:00
Kraków, 10 czerwca 2012 roku
1 Semantic MediaWiki - Categories
1.1 Paste the wiki page source (markup) in the report.
http://loki.ia.agh.edu.pl/smw/index.php/Piw2012/sroda0800/ljaromi [ [ C a t e g o r y : S t u d e n t ] ]
= L . Jaromi =
My name i s L . Jaromi . I am 23 y e a r s o l d .
C u r r e n t l y I s t u d y a t AGH UST, f a c u l t y o f e l e c t r i c a l e n g i n e e r i n g . I b e l o n g t o group 0 8 0 0 .
The o t h e r members o f my group a r e :
1.2 Paste the wiki page source (markup) in the report.
http://loki.ia.agh.edu.pl/smw/index.php/AGH-UST/Subjects/Podstawy-In%C5%BCynierii-Wiedzy [ [ c a t e g o r y : U n i v e r s i t y s u b j e c t ] ]
2 Semantic MediaWiki - Properties
2.1 include the updated wikipage source code (markup) in the report.
[ [ C a t e g o r y : S t u d e n t ] ]
= L . Jaromi =
My name i s [ [ name : : L . Jaromi ] ] . I am [ [ ag e : : 2 3 ] ] y e a r s o l d .
C u r r e n t l y I s t u d y a t AGH UST, f a c u l t y o f e l e c t r i c a l e n g i n e e r i n g . I b e l o n g t o group [ [ group : : 0 8 0 0 ] ] .
The o t h e r members o f my group a r e :
2.2 include the updated wikipage source code (markup) in the report.
[ [ c a t e g o r y : U n i v e r s i t y s u b j e c t ] ]
= Podstawy I n ż y n i e r i i Wiedzy =
l e a d by : [ [ l e a d by : : p r o f . Antoni L i g ę z a ] ] room : [ [ room : : B1 1 2 1 ] ]
d u r a t i o n : [ [ d u r a t i o n : : 9 0 ] ] min
3 Semantic MediaWiki - Inline queries
3.1 Put the query in the report.
[ [ C a t e g o r y : S t u d e n t ] ]
= L . Jaromi =
My name i s [ [ name : : L . Jaromi ] ] . I am [ [ ag e : : 2 3 ] ] y e a r s o l d .
C u r r e n t l y I s t u d y a t AGH UST, f a c u l t y o f e l e c t r i c a l e n g i n e e r i n g . I b e l o n g t o group [ [ group : : 0 8 0 0 ] ] .
The o t h e r members o f my group a r e :
{{#a s k : [ [ C a t e g o r y : S t u d e n t ] ] [ [ group : : 0 8 0 0 ] ]
| ?name
| f o r m a t=u l }}
3.2 Put the query in the report.
[ [ C a t e g o r y : S t u d e n t ] ]
= L . Jaromi =
My name i s [ [ name : : L . Jaromi ] ] . I am [ [ ag e : : 2 3 ] ] y e a r s o l d .
C u r r e n t l y I s t u d y a t AGH UST, f a c u l t y o f e l e c t r i c a l e n g i n e e r i n g . I b e l o n g t o group [ [ group : : 0 8 0 0 ] ] .
The o t h e r members o f my group a r e :
{{#a s k : [ [ C a t e g o r y : S t u d e n t ] ] [ [ group : : 0 8 0 0 ] ]
| ?name
| f o r m a t=u l }}
{{#a s k : [ [ C a t e g o r y : S t u d e n t ] ] [ [ group : : 0 8 0 0 ] ]
| ?Name
| ? Age
| f o r m a t=t a b l e
| d e f a u l t=n o t h i n g : ( i n group : 0 8 0 0
| o r d e r=d e s c e n d i n g }}
4 Loki - Use Cases
4.1 Copy the wiki pages sources and paste them into the report.
http://loki.ia.agh.edu.pl/lokidev/movie:game_of_thrones
= [ [ t i t l e :=Game o f Thrones ] ] =
== D e t a i l s ==
∗ Type : [ [ t y p e :=TV s e r i e s ] ]
∗ Genre : [ [ g e n r e := t h i l l e r ] ]
∗ S e a s o n s : [ [ s e a s o n s : = 3 ] ]
∗ Country : [ [ c o u n t r y : USA ] ]
∗ Language : [ [ l a n g u a g e : E n g l i s h ] ] | [ [ l a n g u a g e : French ] ]
∗ R e l e a s e Date : [ [ r e l e a s e d a t e :=17 A p r i l 2 0 1 1 ] ] (USA)
∗ P r o d u c t i o n y e a r : [ [ p r o d u c t i o n _ y e a r : = 2 0 1 1 ] ] i [ [ p r o d u c t i o n _ y e a r : = 2 0 1 2 ] ]
∗ Runtime : [ [ r u n t i m e : = 6 0 ] ] min
== S t o r y l i n e ==
Seven n o b l e f a m i l i e s f i g h t f o r c o n t r o l o f t h e [ [ a c t i o n p l a c e : m y t h i c a l l a n d o f W e s t e r o s | m y t h i c a l l a n d o f W e s t e r o s ] ] . P o l i t i c a l and s e x u a l i n t r i g u e i s p e r v a s i v e . [ [ p e r s o n : Robert Baratheon ] ] , King o f Westeros , a s k s h i s o l d f r i e n d [ [ p e r s o n : Eddard S t a r k | Eddard , Lord S t a r k ] ] , t o s e r v e a s Hand o f t h e King , o r h i g h e s t o f f i c i a l . S e c r e t l y warned t h a t t h e p r e v i o u s Hand
was a s s a s s i n a t e d , Eddard a c c e p t s i n o r d e r t o i n v e s t i g a t e f u r t h e r .
Meanwhile t h e Queen ’ s f a m i l y , t h e L a n n i s t e r s , may be h a t c h i n g a p l o t t o t a k e power . A c r o s s t h e s e a , t h e l a s t members o f t h e p r e v i o u s and d e p o s e d
r u l i n g f a m i l y , t h e [ [ Game o f Thrones h o u s e : Targaryen | T a r g e r y e n s ] ] , a r e a l s o s chem ing t o r e g a i n t h e t h r o n e . The f r i c t i o n between t h e h o u s e s [ [ Game o f Thrones h o u s e : S t a r k ] ] , [ [ Game o f Thrones h o u s e : L a n n i s t e r ] ] and
[ [ Game o f Thrones h o u s e : Baratheon ] ] , and w i t h t h e r e m a i n i n g g r e a t h o u s e s [ [ Game o f Thrones h o u s e : G r e y j o y ] ] , [ [ Game o f Thrones h o u s e : T u l l y ] ] , [ [ Game o f Thrones h o u s e : Arryn ] ] , and [ [ Game o f Thrones h o u s e : T y r e l l ] ] ,
l e a d s t o f u l l −s c a l e war . A l l w h i l e a v e r y a n c i e n t e v i l awakens i n t h e f a r t h e s t n o r t h . Amidst t h e war and p o l i t i c a l c o n f u s i o n , a n e g l e c t e d m i l i t a r y o r d e r o f m i s f i t s , t h e Night ’ s Watch , i s a l l t h a t s t a n d s between
t h e r e a l m s o f men and i c y h o r r o r s beyond . [ [ c a t e g o r y : movie ] ]
http://loki.ia.agh.edu.pl/lokidev/person:eddard_stark
= Eddard S t a r k =
Eddard S t a r k , i n f o r m a l l y c a l l e d Ned , p l a y e d by [ [ a c t o r : Sean Bean ] ] , i s Lord o f [ [ c i t y : W i n t e r f e l l ] ] and Warden o f t h e North . He s e r v e s a s t h e t h i r d − p e r s o n n a r r a t o r f o r f i f t e e n c h a p t e r s i n A [ [ movie : Game o f Thrones ] ] . Though h i s f a m i l y s e e s him a s f r i e n d l y , many o t h e r c h a r a c t e r s m i s t a k e h i s r e s e r v a t i o n f o r c o l d n e s s and d i s d a i n . He i s m a r r i e d t o [ [ Game o f Thrones c h a r a c t e r : C a t e l y n T u l l y ] ] .
[ [ c a t e g o r y : a c t o r ] ]
5 Loki - Semantic Web Standards
5.1 Observe the results. Put the query into the report.
http://loki.ia.agh.edu.pl/smw/index.php/User/ljaromi
Wyświetlanie posortowanej alfabetycznie listy filmów, które są thrillerami.
= L . Jaromi = [ [ c a t e g o r y : u s e r ] ]
=== Query ===
<p l f o r m a t=" s p a r q l ">
PREFIX w i k i : <>
SELECT ? t i t l e ? g e n r e ? prod_year WHERE {
? movie w i k i : t i t l e ? t i t l e .
? movie w i k i : g e n r e ? g e n r e .
? movie w i k i : p r o d u c t i o n _ y e a r
? prod_year .
FILTER ( ? g e n r e = " g e n r e s : t h r i l l e r " ) }
ORDER BY ASC( ? t i t l e )
</p l >
6 Loki - Reasoning
6.1 Put the goal in the report.
http://loki.ia.agh.edu.pl/smw/index.php/User/ljaromi
Wyświetlanie rekomendacji (tytuł oraz rok produkcji) dla filmów, które są z gatunku thriller oraz są to filmy różne od Gry o Tron.
=== Recommendations ===
<p l g o a l ="w i k i _ c a t e g o r y (X, ’ movie ’ ) ,
\+(X=’ movie : game_of_thrones ’ ) , w i k i _ a t t r i b u t e (X, ’ t i t l e ’ , T) ,
w i k i _ a t t r i b u t e (X, ’ p r o d u c t i o n _ y e a r ’ ,Y) ,
w i k i _ r e l a t i o n (X, ’ g e n r e ’ , ’ g e n r e s : t h r i l l e r ’ ) ,
w r i t e (T) , w r i t e ( ’ ( r o k p r o d u k c j i : ’ ) , w r i t e (Y) , w r i t e ( ’ ) ’ ) , n l , f a i l . " s c o p e ="∗"> </p l >