SPARQL Exercise Most of this exercise has been copied from: INF3580/INF4580 – MANDATORY EXERCISE 3 http://www.uio.no/studier/emner/matnat/ifi/INF3580/v15/undervisningsmateriale/oblig3.pdf.

Slides:



Advertisements
Similar presentations
MY FAMILY.
Advertisements

Marina Šenjug, učiteljica razredne nastave PŠ Planina Donja.
RDF Tutorial.
SPARQL RDF Query.
let’s revise some words for this topic
…. ... Look at the following pictures of a family, and list five characteristics you can see.
CSCI 572 Project Presentation Mohsen Taheriyan Semantic Search on FOAF profiles.
Families. MaleFemale Both grandfather mother cousin daughterchildren grandparents parentsfather brother aunt wife grandmother sister grandson husband.
Semantic Web Bootcamp Dominic DiFranzo PhD Student/Research Assistant Rensselaer Polytechnic Institute Tetherless World Constellation.
© Laurent Jollet – extraTeacher.com HomerMarge Bart Lisa Maggie father mother brother sister son daughter wife husband parents children © Laurent Jollet.
© 2006 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice Publishing data on the Web (with.
Chapter 3 Querying RDF stores with SPARQL. Why an RDF Query Language? Why not use an XML query language? XML at a lower level of abstraction than RDF.
SPARQL W3C Simple Protocol And RDF Query Language
What names? These (1) the Simpsons. They are (2) traditional American family.
SPARQL AN RDF Query Language. SPARQL SPARQL is a recursive acronym for SPARQL Protocol And Rdf Query Language SPARQL is the SQL for RDF Example: PREFIX.
Worksheet Part 3 Lisa: My family is big. Bart is my brother. Marge is my mother. Homer is my mother. Maggie is my sister. Abe and.
Possessive Adjectives with The Simpsons
THREE TREE TURTLES Three tree turtles took turns talking tongue twisters. If three tree turtles took turns talking tongue twisters, where's the twisters.
ISO TC184/SC4 contribution to REACH and LCA David Leal CAESAR Systems Limited and the impact of the Semantic Web on the.
CS61A Lecture Colleen Lewis 1. Clicker poll Have you been reading the provided solutions? A)To labs and/or homework B)To projects C)To labs,
Dr. Lowell Vizenor Ontology and Semantic Technology Practice Lead Alion Science and Technology Semantic Technology: A Basic Introduction.
1 © The ATHENA Consortium. Resource Description Framework (RDF) A language for making simple statements about things (resources) Statements:
Logics for Data and Knowledge Representation Web Ontology Language (OWL) -- Exercises Feroz Farazi.
RDF Syntax and examples ดร. มารุต บูรณรัช : หัวข้อพิเศษด้านเทคโนโลยีสารสนเทศขั้นสูง - เทคโนโลยีเว็บเชิงความหมาย.
TO BE & HAVE GOT My name … Homer Simpson. I … a big family.
Families By miss Livia Cortes. Is your family big or small? How many brothers or sisters do you have?
CWM Closed World Machine. CWM Overview CWM is a simple Semantic Web program that can do the following tasks – Read and pretty-print several RDF formats.
SPARQL Query Andy Seaborne. Apache Jena he.org/jena ● Open source - Apache License ● Apache Incubator (accepted November 2010) ●
Family Members. This is Bart Simpson and this is his family.
What's New in RDF 1.1 Cambridge Semantic Web Gathering 9 April 2013
Knowledge Representation XI – IKT437 Part II OWL, SPARQL, …
Vincenzo Maltese, Fausto Giunchiglia University of Trento
Knowledge Representation Part V RDF
Vincenzo Maltese, Fausto Giunchiglia University of Trento
Are has got am is have got TO BE & HAVE GOT.
Mon père s’appelle Homer Possessive Adjectives Mon père s’appelle Homer.
SPARQL.
Reasoning with Rules SWRL as Example
Chapter 3 RDF Schema.
Knowledge Representation Part VII Protégé / RDFS / OWL / ++
Introduction to SPARQL
Mon père s’appelle Homer Possessive Adjectives Mon père s’appelle Homer.
Yaşar Tonta & Orçun Madran [yasartonta, Hacettepe University
Laurea Magistrale in Scienze di Internet
CWM Closed World Machine
THE SIMPSON FAMILY.
Knowledge Representation Part II
SPARQL: A query language for RDF
Jan Pettersen Nytun, UiA
SPARQL Exercise Much of this exercise has been copied from: INF3580/INF4580 – MANDATORY EXERCISE 3
Jena Sparql (for Mac) 9/22/2018.
Bus Routes.
Family.
Web Ontology Language: OWL
Sparql Examples.
IMPORTANT FAMILIES ChiaraSbarbada.
Linking Guide Michel Böhms.
Mon père s’appelle Homer Possessive Adjectives Mon père s’appelle Homer.
The simpsons’ family tree
How are we different?.
Whose… is it? Whose …are they?
Family tree. family tree Abraham and Mona are Bart’s … parents grandparents grandad.
© Laurent Jollet – extraTeacher.com
Logics for Data and Knowledge Representation
Sheet 10 RDF (2).
CWM Closed World Machine
Triple Stores.
ece 720 intelligent web: ontology and beyond
Family members.
This is my… Family Insert picture of your family here.
Presentation transcript:

SPARQL Exercise Most of this exercise has been copied from: INF3580/INF4580 – MANDATORY EXERCISE 3 http://www.uio.no/studier/emner/matnat/ifi/INF3580/v15/undervisningsmateriale/oblig3.pdf

Copy the Turtle defined ontology on next slide to an ” Copy the Turtle defined ontology on next slide to an ”.owl” file and load it into Protégé.

@prefix : <http://www. simpsons. no/simpsonsfamily#> @prefix : <http://www.simpsons.no/simpsonsfamily#> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix xml: <http://www.w3.org/XML/1998/namespace> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . <http://www.simpsons.no/simpsonsfamily> rdf:type owl:Ontology . ################################################################# # # Object Properties :hasBrother rdf:type owl:ObjectProperty . :hasParent rdf:type owl:ObjectProperty . :hasSister rdf:type owl:ObjectProperty . :hasUncle rdf:type owl:ObjectProperty . :hasFamilyMember rdf:type owl:ObjectProperty . :hasSpouse rdf:type owl:ObjectProperty . :hasFather rdf:type owl:ObjectProperty . :hasMother rdf:type owl:ObjectProperty . # Data properties :birthday rdf:type owl:DatatypeProperty ; rdfs:range xsd:dateTime . :diedOn rdf:type owl:DatatypeProperty ; :hasName rdf:type owl:DatatypeProperty ; rdfs:range xsd:string . # Classes :Family rdf:type owl:Class . :Man rdf:type owl:Class ; rdfs:subClassOf foaf:Person . :Woman rdf:type owl:Class ; #################################################################### :Homer a foaf:Person ; foaf:age "36"^^xsd:int ; foaf:name "Homer Simpson" . :Marge foaf:age "34"^^xsd:int ; foaf:name "Marge Simpson" . :Lisa foaf:age "8"^^xsd:int ; foaf:name "Lisa Simpson" . :Bart foaf:age "10"^^xsd:int ; foaf:name "Bart Simpson" . :Maggie foaf:age "1"^^xsd:int ; foaf:name "Maggie Simpson" . :Simpsons a :Family ; :hasFamilyMember :Maggie , :Homer , :Lisa , :Bart, :Marge . :hasSpouse :Marge . :hasSpouse :Homer . :hasFather :Homer ; :hasMother :Marge . :Abraham a foaf:Person . :hasParent [ a foaf:Person ; :hasFather :Abraham ] . :Mona a foaf:Person . :hasMother :Mona :hasSister :Patty , :Selma ] ; :hasBrother :Herb :Herb a foaf:Person . :Patty a foaf:Person ; :hasSister :Selma . :Selma :hasSister :Patty . :hasSpouse

Task 1 Query: Find all Persons and order them by identifier, list also optionally their name. Use the result variable names ?person, ?name . Tip: This is a simple query, where you will need to use SELECT, WHERE, OPTIONAL and ORDER BY . If you do not get any results, try the query SELECT ?s ?p ?o WHERE {?s ?p ?o} and see if your get the expected results and namespaces. This query lists all triples in the graph.

Task 2 Query: Find everyone who has a mother and list both the person and the mother. Order by mother.

Task 3 Query: Find everyone who has a mother or a father and list both the person and the mother or father. Order by mother/father.

Task 4 Query: Find all of Maggie’s grandmothers. Result variable name: ?grandmother .

Task 5 Query: Find everyone older than 10. Order by age, oldest first. Output name and age. Result variable names: ?person, ?age .

Task 6 Query: Is Herb the brother of Homer? (We know Homer has a brother named Herb, but here the question is: Do the ontology contain this information?) Tip: Use ASK .