====== Introduction to SemWeb Project 2016: Semantic Wiki Loki ======
This is a short introduction to Semantic Wiki [[http://loki.ia.agh.edu.pl/wiki/start|Loki]]. There is no report after this lab, but it is important to know how wiki works because we will be using it during the project :-)
==== - Loki - Introduction ====
- Loki is a Semantic Wiki. Semantic Wiki is a [[wp>wiki|wiki]] system with an underlying model of knowledge. To make it simple: Loki is a wiki with a possibility to add specific RDF triples to the wiki pages. This lab will present main Loki concepts.
- Let's start with the [[http://loki.ia.agh.edu.pl/wiki/docs:loki-about|Loki about]] page to get to know the system better (you can omit the "Rule-based Reasoning" section).
- Loki manuals are placed here: [[http://loki.ia.agh.edu.pl/wiki/docs:loki-tutorial|Loki Tutorial]] and [[http://loki.ia.agh.edu.pl/wiki/docs:userman|Loki User manual]]. You can leave them open and refer to them if you will get into troubles.
==== - Page edition ====
- With your //username and password// log in to [[http://loki.ia.agh.edu.pl/ckexp/semweb2016/|SemWeb 2016 Loki installation]].
- Create a page http://loki.ia.agh.edu.pl/ckexp/semweb2016/users:
e.g. http://loki.ia.agh.edu.pl/ckexp/semweb2016/users:kkutt
- Enter the link to the navigation bar
- If the page doesn't exist (and it shouldn't exist yet ;-) ) click ''edit this page'' and shortly describe yourself, e.g.
My name is Example student. I am 12 years old.
Currently I study at AGH-UST, faculty of .
I am interested in math and philosophy.
Now, I am sitting next to: Student X and Student Z.
- Save the page:
* At the bottom you can see the form like this on the figure: \\ {{http://loki.ia.agh.edu.pl/wiki/_media/docs:prov-forms.png}}
* **URIs/URLs for used resources (put one URI in one line)** field (red frame on figure) -- here enter all URIs that you have used during current page edition; e.g. now it could be http://www.agh.edu.pl/en/agh-ust-faculties/
if you were looking for the full faculty name,
* if your edition is based on other page from the wiki (e.g. you have used the http://loki.ia.agh.edu.pl/ckexp/semweb2016/users:kkutt
to get the name of the man next to you) you can enter this URI as other pages or you can simply select it (and double-click on it) from the second field (green frame); this page will appear in the left field with the ''lokipage:'' prefix (''lokipage:'' is the prefix for ''http://loki.ia.agh.edu.pl/ckexp/semweb2016/''),
* if there are a lot of pages in your wiki, you can use a filter field (blue frame).
* There is also 'Edit summary' field (black frame) for comments about changes in wiki page.
==== - Categories ====
- Let's do some RDF triples!
- In Loki the subject (the first element in the triple) is the page that you are editing. So, if you are putting an annotation on ''http://loki.ia.agh.edu.pl/ckexp/semweb2016/users:kkutt'' page, this will the URI of the subject for all triples.
- Firstly we can state that we are users:
- in RDF it looks like that: http://loki.ia.agh.edu.pl/ckexp/semweb2016/users:kkutt rdf:type .
- the equivalent in the Loki is ''User'' **category**.
- Based on the [[http://loki.ia.agh.edu.pl/wiki/docs:userman|User manual]], add your page to the **User** category.
==== - Properties ====
- Based on the [[http://loki.ia.agh.edu.pl/wiki/docs:userman|User manual]], annotate the content of your //User// page so that it contains the following semantic information about you:
* Name (first + last name)
* Age
* People that are sitting next to you
* You favourite subject on EIS during current term (use one of three names: ''BIM'', ''Rules'', ''SemWeb'')
==== - Inline queries ====
- Read the manual section on [[http://loki.ia.agh.edu.pl/wiki/docs:userman#searching_interfaces|ASK queries]].
- Using the **ASK queries** add to your page the list of the users whose favourite subject is the same as yours
- Format the output of the query as unordered list
- Build another query listing the users with the same favourite subject:
- Display it as a table
- Sort by age.
- Define a default value if a query returns no value.
==== - Semantic Web Standards ====
- Read the [[http://loki.ia.agh.edu.pl/wiki/docs:userman#sparql_queries|manual section on SPARQL]].
- On your page, build 3 example SPARQL queries which asks for specific kinds of information about other users (you decide what criteria to use in the query!).
- SELECT query
- ASK query
- DESCRIBE query
- Observe the results.
- There is also a possibility to ask these queries using SPARQL Endpoint: http://loki.ia.agh.edu.pl/ckexp/semweb2016/sparql/. Try them there.
- Read the [[http://loki.ia.agh.edu.pl/wiki/docs:userman#export_to_rdf|manual section on RDF export]].
- Export your page. Analyze the exported file. Find the category, relations and attributes that you entered - how are they represented?
==== - Reasoning ====
In Loki it is possible to embed Prolog code within ''...'' tags. E.g. using Prolog code we can create a set of custom recommendations, e.g. in wiki with movies: "Movies, where the leading lady is X and the movie was made before 1940" or in wiki with countries: "City which is located in a country which is by a sea and is not listed as a member of the EU".
- Read the [[http://loki.ia.agh.edu.pl/wiki/docs:plwiki1api|PlWiki 1.0 - Plugin API]], section on Prolog.
- On your **user** page create a section ''Specific users''
- Create a Prolog goal to select users according to some criteria (it's up to you). Optionally, you can define some interesting users with a Prolog rule and use it directly in the goal.
- If you encounter problems, use the [[http://loki.ia.agh.edu.pl/wiki/docs:userman#debug_functions|debug functionality]] of Loki.
==== - Ontology inside Loki ====
- In current version of Loki, ontology will be placed in the ''special:ontologies:'' namespace (main ontology will be available at ''special:ontologies:default''). Your instructor will show you how it works when it will be useful.
- There is no tool that will check if we are inserting annotations accordingly to the ontology, so we will do this by hand.