1 / 14

Sheet 11

Sheet 11. SPARQL. Organization. Exam next Tuesday 17.07.07 (10-12) --- A9 Register if you have not yet registered Evaluation Difficult or Too difficult (around 70%) Make sense to have tutorial hours (around 70%) Exercise helps to understand the lecture (100%)

asasia
Download Presentation

Sheet 11

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Sheet 11 SPARQL

  2. Organization • Exam next Tuesday 17.07.07 (10-12) --- A9 • Register if you have not yet registered • Evaluation • Difficult or Too difficult (around 70%) • Make sense to have tutorial hours (around 70%) • Exercise helps to understand the lecture (100%) • Tutor explanation clear (ok [30%]-good [60%]) • Size of room (not too important) • Other comments: • Exercises too difficult and take too much time • Group work • Mistakes in exercises • More examples in tutorial • Tutorial with PC

  3. @prefix xs: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://www.cgnm.de/rdf/family#> . :Anne :age "45"^^xs:integer; :marriedTo :Bert ; :motherOf :Clara, :Dennis . :Bert :age "49"^^xs:integer; :marriedTo :Anne ; :fatherOf :Clara, :Dennis . :Clara :age "24"^^xs:integer; :marriedTo :Emil; :motherOf :Fred, :Gisa . :Dennis :age "22"^^xs:integer. :Emil :age "27"^^xs:integer; :marriedTo :Clara; :fatherOf :Fred, :Gisa . :Fred :age "2"^^xs:integer. :Gisa :age "1"^^xs:integer.

  4. prefix : <http://www.cgnm.de/rdf/family#> select distinct ?x where { { ?x :fatherOf ?y, ?z } union { ?x :motherOf ?y, ?z } ---------- | x | ========== | :Clara | | :Anne | | :Emil | | :Bert | ---------- prefix : <http://www.cgnm.de/rdf/family#> select distinct ?x where { { {?x :motherOf ?y . ?x :motherOf ?z } union {?x :fatherOf ?y . ?x :fatherOf ?z } } FILTER (?y != ?z) }

  5. prefix : <http://www.cgnm.de/rdf/family#> select distinct ?person where { ?person :age ?age optional {?person :fatherOf ?child} optional {?person :motherOf ?child} filter ( !bound(?child) ) } xsd:boolean   bound (variable var) Returns true if var is bound to a value. Returns false otherwise. Variables with the value NaN or INF are considered bound.

  6. @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix xs: <http://www.w3.org/2001/XMLSchema#> @prefix : <http://www.ismll.de/rdf/teaching#> :ProfLars :teaches :XmlAndSemanticWeb ; :teaches :AdvancedAI ; :teaches :OntologyLearning ; :teaches :PredictiveModeling ; :teaches :RecommenderSystems . :XmlAndSemanticWeb rdf:type :Course ; :title "XML & Semantic Web" . :AdvancedAI rdf:type :Course ; :title "Advanced Artificial Intelligence" . :OntologyLearning rdf:type :Seminar ; :title "Ontology Learning" . :PredictiveModeling rdf:type :Seminar ; :title "Predictive Modeling" . :RecommenderSystems rdf:type :Seminar ; :title "Recommender Systems" .

  7. :xml :assignmentOf :XmlAndSemanticWeb . :rdf :assignmentOf :XmlAndSemanticWeb . :owl :assignmentOf :XmlAndSemanticWeb . :XmlAndSemanticWeb :assignmentNumber 3 . :textClassification :assignmentOf :OntologyLearning . :WordNet :assignmentOf :OntologyLearning . :OntologyLearning :assignmentNumber 2 . :Karen :attends :XmlAndSemanticWeb . :Leandro :attends :OntologyLearning . :Mary :attends :PredictiveModeling . :ProfLars :supervises :Karen, :Leandro, :John.

  8. prefix : <http://www.ismll.de/rdf/teaching#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> select ?x ?z where { :ProfLars :teaches ?x . ?x rdf:type ?z } prefix : < http://www.ismll.de/rdf/teaching#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> select ?module ?number where { ?module :assignmentNumber ?number }

  9. prefix : <http://www.ismll.de/rdf/teaching#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> select ?y ?x where { {?y :attends ?z . ?x :assignmentOf ?z} FILTER (?y = :Karen || ?y = :Leandro || ?y = :Mary) } prefix : < http://www.ismll.de/rdf/teaching#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> select ?student where { { :ProfLars :supervises ?student . ?student :attends ?module . ?module rdf:type :Seminar} UNION {:ProfLars :supervises ?student . ?student :attends ?module . ?module rdf:type :Course} }

  10. prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix xs: <http://www.w3.org/2001/XMLSchema#> prefix : <http://www.cgnm.de/spreadsheet#> CONSTRUCT { ?table :hasColumnName ?rowName . :hasRow :hasRowName ?columnName . :hasColumn :containsData ?Data. ?Data ?contains ?value; } WHERE { ?table :hasRow ?Row . ?Row :hasRowName ?rowName . ?Row :containsData ?Data. ?Data ?contains ?value. ?table :hasColumnNames ?n. ?n ?p ?columnName. }

  11. prefix : <http://www.cgnm.de/spreadsheet#> select ?_ ?2004 ?2005 ?2006 where { ?x1 :hasColumnNames ?y1 . ?y1 ?r ?_ . ?x2 :hasRowName "2004" { ?x2 :containsData ?y2 { ?y2 ?r ?2004 } } } { ?x3 :hasRowName "2005" { ?x3 :containsData ?y3 { ?y3 ?r ?2005 } } } { ?x4 :hasRowName "2006" { ?x4 :containsData ?y4 { ?y4 ?r ?2006 } } } }

More Related