Modeling knowledge with Resource Description Framework (RDF)

Before the lab

Lab instructions

1 RDF model

  • RDF model is a directed graph built from Statements a.k.a. triples
  • Each Statement consists of: subject, predicate and object
    • Subject can be an URI or an empty node
    • Predicate can be an URI
    • Object can be an URI, an empty node or a literal
  1. In section „Check by Direct Input” set Display Result Options to: Triples and Graph and click Parse RDF. Analyze the triples in the table, RDF/XML code and the graphical representation.
    • 8-) Why is the node for „http://www.w3.org/oval and the node for „World Wide Web Consortium” rectangular? What's the difference between these two resources?
  2. In section „Check by URI” paste the following URI: http://home.agh.edu.pl/~wta/foaf.rdf. Analyze the triples, RDF/XML code and the graphical representation.
    1. 8-) What's the meaning of the nodes for genid:A15816 and genid:A15815 objects?

2 Modeling knowledge with RDF graphs

RDF is a data model based on principle of representing relational information as labeled directed graphs. In this task, you will represent a piece of… well, knowledge… ;-) with use of the RDF graphs.

  1. Open the wikipedia article about The_Bold_and_the_Beautiful (or the polish version here).
  2. Read the The_Bold_and_the_Beautiful#Premise section (or polish one) and extract as much information as you can.
  3. Draw a graph (yes, with a pen and paper) representing the relations you identified in the fragment. Of course, „there's more than one way to do it”.
    1. Draw regular resources (i.e. representing persons, places etc.) as oval nodes. Draw datatype values (e.g. dates, numbers representing age etc.) as rectangular nodes.
    2. You don't need to write long URIs, simply identify the resources with names and surnames etc.
  4. Represent at least one container / collection, for example to represent all the children or all the sons of the family.
  5. 8-) Put the sketch (a scan/picture) of the graph in your report.

3 Modeling knowledge with RDF triples

RDF is a data model for which several syntaxes have been developed. RDF document is an RDF graph (describing some objects) serialized into chosen representation/syntax. In this task, you will convert the graph representation into so called Turtle syntax.

  1. Create a new document with a *.ttl extension.
  2. Create a document describing the graph created in the previous section. Use the RDF Primer (Turtle version) for reference.
    1. Define namespaces for your document URIs, e.g., a standard RDF namespace and one „your own” for this specific topic:
      @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
      @prefix bb: <http://yourname/b-and-b#>.
    2. Write down ~14 selected triples from your graph. Make sure you include each of the following at least once:
      1. resources,
      2. datatype values,
      3. containers/collections.
    3. Validate your document with an online RDF validator (it should yield something like this:
      )
    4. Convert it into the RDF/XML syntax (using the same tool).
    5. 8-) Analyze all versions of the model. Include both documents (.ttl and .rdf) in the report archive.

Control questions

  • What are:
    • resources,
    • properties,
    • statemets.
  • What does RDF use to identify resources?
  • What are the required elements of RDF file?
  • What are namespaces, how are they defined and what are they used for?
  • What the following tags are used for:
    • <rdf:Description>
    • <rdf:about>
    • <rdf:resource>
    • <rdf:type>
  • What container elements are available in RDF?
  • What is RDF Schema?
  • What are core RDFS Classes and properties?
  • How constraints on domain and range of properties are added?

Materials

Introduction

If you want to know more

pl/dydaktyka/semantic_web/new-semweb-rdfmodel.txt · ostatnio zmienione: 2017/07/17 08:08 (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