Różnice

Różnice między wybraną wersją a wersją aktualną.

Odnośnik do tego porównania

Both sides previous revision Poprzednia wersja
pl:dydaktyka:semweb:2016:labs:rdfmodel [2017/10/14 23:21]
kkutt usunięto
— (aktualna)
Linia 1: Linia 1:
-====== Modeling knowledge with Resource Description Framework (RDF) ====== 
  
-^  Last verification:​ | 20160924 | 
-^  Tools required for this lab: | Pens and paper | 
- 
- 
-===== Before the lab ===== 
-Reading: 
-  * [[http://​www.w3.org/​TR/​rdf11-primer/​|RDF Primer]]: general ideas about RDF; we will use only Turtle syntax so you can simply omit sections 5.2-5.4 
-  * [[http://​haystack.csail.mit.edu/​blog/​2008/​11/​06/​a-quick-tutorial-on-the-tutrle-rdf-serialization/​|A Quick Tutorial on the Turtle RDF Serialization]] 
-  * [[#​if_you_want_to_know_more|If you want to know more...]] 
- 
- 
-===== Lab instructions ===== 
- 
-<WRAP center round important 100%> 
-During this lab we will use [[http://​any23.org/​|Anything to Triples]] website. If it is down, there is also a possibility to download any23 service and run it on your own computer: 
-  * download **Apache Any23 Service (Standalone server embedded) 1.1** file from https://​any23.apache.org/​download.html (mirror: {{http://​home.agh.edu.pl/​~kkutt/​semweb/​apache-any23-service-1.1-server-embedded.tar.gz|apache-any23-service-1.1-server-embedded.tar.gz}}) and unpack the zip somewhere 
-  * execute command to start server with any23 service: <​code>​[PATH-to-unpacked-archieve]/​apache-any23-service-1.1-server-embedded/​bin/​any23server </​code>​ 
-    * Note: use the any23server.bat file if you are using Windows OS 
-    * Change ''<​nowiki>"​$REPO"</​nowiki>''​ into ''​%REPO%''​ twice (line #79 in any23server.bat file) if ''​Error:​ Unable to access jarfile $REPO/​jetty-runner-8.1.4.v20120524.jar.''​ message appears 
-  * after few seconds any23 service will appear on [[http://​localhost:​8080/​apache-any23-service/​]] address :) 
-</​WRAP>​ 
-==== - RDF model (and Mona Lisa) [15 minutes] ==== 
-  * 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// 
- 
-  - Let's consider a simple knowledge graph (//taken from [[http://​www.w3.org/​TR/​rdf11-primer/​|RDF 1.1 Primer]]//​):​ \\ {{:​pl:​dydaktyka:​semweb:​rdf-primer-graph1.jpg?​500|}} 
-  - It is very informal and vague... So we can make it more concrete using URIs for every element in the graph. Note that we are using existing vocabularies that were described in previous lab: [[http://​www.foaf-project.org/​|FOAF]] (''​foaf:''​) and [[http://​dublincore.org/​metadata-basics/​|Dublin Core]] (''​dcterms:''​). \\ {{:​pl:​dydaktyka:​semweb:​rdf-primer-graph4.jpg?​500|}} 
-  - Every arrow represents now a simple RDF Statement (RDF triple) so we can write it down using [[http://​www.w3.org/​TR/​turtle/​|Turtle notation]]: <code | example.ttl>​BASE ​  <​http://​example.org/>​ 
-PREFIX foaf: <​http://​xmlns.com/​foaf/​0.1/>​ 
-PREFIX xsd: <​http://​www.w3.org/​2001/​XMLSchema#>​ 
-PREFIX schema: <​http://​schema.org/>​ 
-PREFIX dcterms: <​http://​purl.org/​dc/​terms/>​ 
-PREFIX wd: <​http://​www.wikidata.org/​entity/>​ 
- 
-<​bob#​me>​ 
-    a foaf:Person ; 
-    foaf:knows <​alice#​me>​ ; 
-    schema:​birthDate "​1990-07-04"​^^xsd:​date ; 
-    foaf:​topic_interest wd:Q12418 . 
- 
-wd:Q12418 
-    dcterms:​title "Mona Lisa" ; 
-    dcterms:​creator <​http://​dbpedia.org/​resource/​Leonardo_da_Vinci>​ . 
- 
-<​http://​data.europeana.eu/​item/​04802/​243FA8618938F4117025F17A8B813C5F9AA4D619>​ 
-    dcterms:​subject wd:Q12418 .</​code>​ 
-  - If you then visualize this code using simple RDF visualization you will get graph like that (you can click on graph to enlarge it): \\ {{:​pl:​dydaktyka:​semweb:​rdf-primer-validator-graph.png?​direct&​600|}} ​ 
-    * 8-) Why is the node for "​http://​example.org/​bob#​me"​ __oval__ and the node for "Mona Lisa" __rectangular__?​ What's the difference between these two resources? 
- 
- 
-==== - RDF model (and Friend-of-a-Friend) [5 minutes] ==== 
- 
-In this section we will convert FOAF files from previous lab to Turtle notation. Do you have your FOAF file? ;) 
- 
-  - Go to the <wrap caution>​[[http://​any23.org/​|Anything to Triples]]</​wrap>​ webpage and in section "​Convert document at URI": 
-    * select: **turtle** from drop-down list (default is best) 
-    * change URL from ''​http://​twitter.com/​cygri''​ to ''​http://​home.agh.edu.pl/​~kkutt/​foaf.rdf''​ 
-    * validation: **validate** 
-    * report: **checked** 
-    * annotate: **unchecked** 
-    * click "​Convert"​ button 
-  - You will get an XML with a lot of empty tags and Turtle code inside ''<​data><​![CDATA[ ... ]]></​data>''​ 
-  - Analyze returned model. Especially look at last five statements:<​code><​http://​home.agh.edu.pl/​~kkutt/​foaf.rdf#​me>​ foaf:knows _:​node1a07qklgvx22181 . 
- 
-_:​node1a07qklgvx22181 a foaf:Person ; 
- foaf:name "​Weronika T. Adrian"​ ; 
- foaf:​mbox_sha1sum "​fdaa9a764e8c1a218e814a043995d41a3f248ddd"​ ; 
- rdfs:​seeAlso <​http://​home.agh.edu.pl/​wta/​foaf.rdf>​ .</​code>​ 
-    * 8-) What's the meaning of the ''​_:​node1a07qklgvx22181''​ object (numbers may differ in your results)? 
-  - Convert your own FOAF file generated during previos lab into Turtle notation and compare both versions: 
-    * 8-) Which notation you find more clear and easier to understand? RDF/XML or Turtle? 
-    * 8-) Include your converted FOAF file in the report archive. 
-==== - Modeling knowledge with RDF graphs [35 minutes] ==== 
-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. 
- 
-  - Open the wikipedia article about [[wp>​The_Bold_and_the_Beautiful]] (or the polish version [[http://​pl.wikipedia.org/​wiki/​Moda_na_sukces|here]]). 
-  - Read the [[wp>​The_Bold_and_the_Beautiful#​Premise]] section (or [[http://​pl.wikipedia.org/​wiki/​Moda_na_sukces#​Historia_rodziny_Forrester.C3.B3w|polish one]]) and extract as much information as you can. 
-  - **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"//. 
-    - 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. ​ 
-    - You don't need to write long URIs, simply identify the resources with names and surnames etc. 
-  - 8-) Put the sketch (a scan/​picture) of the graph in your report. 
- 
-==== - Modeling knowledge with RDF triples [30 minutes] ==== 
-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. 
- 
-  - Create a new document with a ''​*.ttl''​ extension. 
-  - Create a document describing the graph created in the [[#Modeling knowledge with RDF graphs|previous section]]. Use the [[http://​www.w3.org/​TR/​turtle/​|RDF Turtle]] for reference. 
-    - Define namespaces for your document URIs, e.g., a standard RDF namespace and one "your own" for this specific topic: ​ <​code>​@prefix rdf: <​http://​www.w3.org/​1999/​02/​22-rdf-syntax-ns#>​. 
-@prefix bb: <​http://​yourname/​b-and-b#>​.</​code>​ 
-    - Write down ~14 selected triples from your graph. Make sure you include each of the following at least once: 
-      - resources, ​ 
-      - datatype values. 
-    - Go to the <wrap caution>​[[http://​any23.org/​|Anything to Triples]]</​wrap>​ webpage: 
-      * Validate your document using this tool (section "​Convert copy&​pasted document"​):​ 
-        * input format: **Turtle (text/​turtle)** 
-        * output format: **turtle** 
-        * validation: **validate** 
-        * report: **checked** 
-        * annotate: **unchecked** 
-        * paste your code and click "​Convert"​ button 
-      * if something is wrong, you can see details in report (in web browser), e.g.: \\ {{:​pl:​dydaktyka:​semweb:​any23_some_problems_web.png?​400|}} 
-      * if code was successfully validated then you get an XML with a lot of empty tags and your Turtle code inside ''<​data><​![CDATA[ ... ]]></​data>''​ (indentation may be changed) 
-    - 8-) Include model (''​.ttl''​ file) 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? 
- 
-===== If you want to know more ===== 
- 
-Lecture: 
-  * {{pl:​dydaktyka:​semweb:​2015:​eis2015semweb-metadata.pdf|Semantic Web: Metadata & RDF}} (2015) 
-  * {{pl:​dydaktyka:​semweb:​2015:​eis2015semweb-rdfsinuse.pdf|Semantic Web: RDF/S in use}} (2015) 
- 
-Reading: 
-  * [[https://​github.com/​JoshData/​rdfabout/​blob/​gh-pages/​intro-to-rdf.md|What is RDF and what is it good for?]] 
-  * [[http://​www.w3.org/​TR/​turtle/​|Turtle syntax for RDF]] 
-  * [[http://​www.w3.org/​TR/​rdf11-concepts/​|RDF Abstract Syntax]] 
-  * [[http://​www.w3.org/​2000/​10/​swap/​Primer.html|Primer:​ Getting into RDF & Semantic Web using N3]] 
- 
-RDF serialization in XML: 
-  * [[http://​www.w3schools.com/​xml/​xml_rdf.asp|RDF at W3Schools (part of Web Services Tutorial)]] 
- 
-Tools: 
-  * [[http://​semweb.salzburgresearch.at/​apps/​rdf-gravity/​|RDF Gravity]] 
-  * [[http://​jena.apache.org/​tutorials/​rdf_api.html|Apache Jena]] 
-  * RDF Visualizers summary: [[pl:​dydaktyka:​semweb:​2014:​projects:​rdfviz]] (in Polish) 
- 
-Articles: 
-  * [[https://​opensource.com/​life/​15/​11/​segrada-open-source-semantic-graph-database|Historians and detectives keep track of data with open source tool]] 
- 
-Others: 
-  * [[http://​prefix.cc/​|prefix.cc - namespace lookup for RDF developers]] 
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