Introduction to SemWeb Project 2016: Semantic Wiki Loki

This is a short introduction to Semantic Wiki 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 :-)

1 Loki - Introduction

  1. Loki is a Semantic Wiki. Semantic Wiki is a 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.
  2. Let's start with the Loki about page to get to know the system better (you can omit the „Rule-based Reasoning” section).
  3. Loki manuals are placed here: Loki Tutorial and Loki User manual. You can leave them open and refer to them if you will get into troubles.

2 Page edition

  1. With your username and password log in to SemWeb 2016 Loki installation.
  2. Create a page
    http://loki.ia.agh.edu.pl/ckexp/semweb2016/users:<your-login>

    e.g.

    http://loki.ia.agh.edu.pl/ckexp/semweb2016/users:kkutt
    1. Enter the link to the navigation bar
    2. 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 <enter here the full name of the faculty>.
      I am interested in math and philosophy.
      
      Now, I am sitting next to: Student X and Student Z.
  3. Save the page:
    • At the bottom you can see the form like this on the figure:
    • 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.

3 Categories

  1. Let's do some RDF triples!
  2. 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.
  3. Firstly we can state that we are users:
    1. in RDF it looks like that:
      http://loki.ia.agh.edu.pl/ckexp/semweb2016/users:kkutt   rdf:type   <User>.
    2. the equivalent in the Loki is User category.
    3. Based on the User manual, add your page to the User category.

4 Properties

  1. Based on the 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)

5 Inline queries

  1. Read the manual section on ASK queries.
  2. Using the ASK queries add to your page the list of the users whose favourite subject is the same as yours
    1. Format the output of the query as unordered list
  3. Build another query listing the users with the same favourite subject:
    1. Display it as a table
    2. Sort by age.
    3. Define a default value if a query returns no value.

6 Semantic Web Standards

  1. 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!).
    1. SELECT query
    2. ASK query
    3. DESCRIBE query
  2. Observe the results.
  3. There is also a possibility to ask these queries using SPARQL Endpoint: http://loki.ia.agh.edu.pl/ckexp/semweb2016/sparql/. Try them there.
  4. Export your page. Analyze the exported file. Find the category, relations and attributes that you entered - how are they represented?

7 Reasoning

In Loki it is possible to embed Prolog code within <pl>...</pl> 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”.

  1. Read the PlWiki 1.0 - Plugin API, section on Prolog.
  2. On your user page create a section Specific users
  3. 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.
  4. If you encounter problems, use the debug functionality of Loki.

8 Ontology inside Loki

  1. 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.
  2. There is no tool that will check if we are inserting annotations accordingly to the ontology, so we will do this by hand.
pl/dydaktyka/semweb/2016/labs/projects-intro.txt · ostatnio zmienione: 2019/06/27 15:50 (edycja zewnętrzna)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0