
IN3060/IN4060/INF3580/INF4580 v19 Front Page UNIVERSITY OF OSLO Faculty of Mathematics and Natural Sciences Examination in IN3060/IN4060 Day of examination: 7 June 2019 Examination hours: 9:00–13:00 Place: Sal 3D Silurveien 2 Permitted aids: All written material The exam consists of 5 sections with equal weight. In multiple choice questions 1b, 3h and 3i, you get a negative score for wrong answers, but never less than 0 for the whole question. In question 1c, you get 0 for a wrong answer. In questions 4g to 4k, you only obtain points if all answers in each question are correct. Section 1: RDF and SHACL Section 1: RDF and SHACL 1/31 IN3060/IN4060/INF3580/INF4580 v19 1(a) RDF and Turtle Consider the following triples in Turtle notation: @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix world: <http://world.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . world:Oslo a world:City ; world:hasMayor [foaf:name "Marianne Borgen"; foaf:gender "female"]; world:isCityInCountry world:Norway . world:Norway a world:Country ; world:hasCapital world:Oslo ; world:hasPopulation "5258000"^^xsd:int ; world:hasName "Norway"@en , "Norge"@no . How many triples are these? How many of these triples have a blank node as subject? How many of these triples have a blank node as object? How many of these triples have an IRI reference as object? How many of these triples have an object of datatype xsd:string? Maximum marks: 5 2/31 IN3060/IN4060/INF3580/INF4580 v19 1(b) RDF data model In this question, right answers give 0.5 points, wrong answers give -0.5 points, but with a minumim total score of 0. Assume we have the following defined prefixes: @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix geo: <http://geo.example.org/> . @prefix : <http://example.org/> . Is the statement a valid triple in the Turtle serialization? No Yes "Milano"@it . _:a _:a _:a . [ [] [] ] . :Paris, :Oslo rdf:type geo:City . :a :a :a . :NewYork :hasPopulation 8600000 . :Oslo rdf:type :Oslo . [ a :Box] . "Paris"^^geo:Place a geo:Place . :Oslo :sameAs "Oslo"^^geo:Place . Maximum marks: 5 3/31 IN3060/IN4060/INF3580/INF4580 v19 1(c) SHACL vs. OWL Can SHACL and a validator be used to detect (some) inconsistent information in an RDF graph? (e.g. detect if a dataset gives two different personal ID numbers for a person, more than two parents, etc.) Select one alternative: Yes No Can OWL and a reasoner be used to detect (some) inconsistent information in an RDF graph? (e.g. detect if a dataset gives two different personal ID numbers for a person, more than two parents, etc.) Select an alternative Yes No Can SHACL and a validator be used to detect (some) missing information in an RDF graph? (e.g. the personal ID number of a person in the dataset is missing) Select an alternative Yes No Can OWL and a reasoner be used to detect (some) missing information in an RDF graph? (e.g. the personal ID number of a person in the dataset is missing) Select an alternative Yes No Can SHACL and a validator be used to infer (some) implicit information in an RDF graph? (e.g. add information about a person’s uncles, based on information about brothers and parents) Select an alternative Yes No Can OWL and a reasoner be used to infer (some) implicit information in an RDF graph? (e.g. add information about a person’s uncles, based on information about brothers and parents) Select an alternative Yes No Maximum marks: 6 4/31 IN3060/IN4060/INF3580/INF4580 v19 1(d) SHACL validation Given the following SHACL shape @prefix world: <http://sws.ifi.uio.no/ont/world.owl#> . @prefix sh: <http://www.w3.org/ns/shacl#> . world:CityShape a sh:NodeShape; sh:targetClass world:City; sh:property [ sh:path world:isCityInCountry ; sh:minCount 1; sh:maxCount 1; sh:nodeKind sh:IRI ; sh:class world:Country ; ] . And the following data: :Paris a world:City ; world:hasName "Paris"@fr ; world:isCityInCountry :France . :France world:hasName "France"@fr . There will be an error when validating the RDF graph with respect to the SHACL shape. a) Explain why there is a validation error, and how the error can be fixed. Skriv tekst her b) Could it be fixed by adding an rdfs:range statement for world:isCityInCountry? Fill in your answer here Maximum marks: 4 Section 2: SPARQL Section 2: SPARQL In this section, you can use the following namespaces: bank - http://bank.example.org/ person - http://person.example.org/ xsd - http://www.w3.org/2001/XMLSchema# foaf - http://xmlns.com/foaf/ rdfs - http://www.w3.org/2000/01/rdf-schema# rdf - http://www.w3.org/1999/02/22-rdf-syntax-ns# and the following RDFS classes and properties: bank:Bank - The class of all banks. foaf:Person - The class of persons, e.g. bank customers. 5/31 IN3060/IN4060/INF3580/INF4580 v19 bank:Account - The class of all bank accounts bank:Balance - The class of all balances. A balance gives an amount of money for some bank account at a specific point in time. bank:Transaction - The class of all transactions. A transaction moves an amount of money from one account to another, and it is accompanied by a text describing the transaction bank:accountAtBank - relationship between an account and the bank managing it. bank:accountHolder - relationship between an account and the customer it belongs to. bank:accountNumber - the bank account number of an account. bank:hasBalance - relationship between an account and its balance at some point in time. This should have type xsd:decimal bank:amount - relationship between a balance or transaction, and the amount of money. bank:date - relationship between a balance or transaction, and its xsd:dateTime. bank:fromAccount - relationship between a transaction and the account money is coming from bank:toAccount - relationship between a transaction and the account money is going to bank:text - relationship betwee a transaction and it’s comment text foaf:name - Relationship between something/someone (customer, bank) and a string denoting its name Below are some example triples: bank:DLB a bank:Bank ; foaf:name "Drømmeland Banken" . person:peter a foaf:Person ; foaf:name "Peter Pan" . person:hook a foaf:Person ; foaf:name "Captain Hook" . bank:dsb10001 a bank:Account ; bank:accountAtBank bank:DSB ; bank:accountHolder person:peter ; bank:accountNumber 10001 ; bank:hasBalance [ a bank:Balance ; bank:amount "12345.67"^^xsd:decimal ; bank:date "2010-01-01T00:00:00"^^xsd:dateTime ] . bank:dsb10002 a bank:Account ; bank:accountAtBank bank:DSB ; bank:accountHolder person:hook ; bank:accountNumber 10002 ; bank:hasBalance [ a bank:Balance ; bank:amount "765432.10"^^xsd:decimal ; bank:date "2010-01-01T00:00:00"^^xsd:dateTime ] . [] a bank:Transaction ; bank:toAccount bank:dsb10002 ; bank:fromAccount bank:dsb10001 ; bank:date "2010-01-02T09:00:00"^^xsd:dateTime ; bank:amount "1000.00"^^xsd:decimal ; bank:text "For flying lessons" . [] a bank:Transaction ; bank:toAccount bank:dsb10001 ; bank:fromAccount bank:dsb10002 ; bank:date "2010-01-03T09:00:00"^^xsd:dateTime ; bank:amount "500.00"^^xsd:decimal ; bank:text "Loan of hook" . 6/31 IN3060/IN4060/INF3580/INF4580 v19 2(a) Accounts and Account holders Write a SPARQL query that lists the bank account number of every account in bank:DLB, and the name of its holder Fill in your answer here 1 Maximum marks: 4 7/31 IN3060/IN4060/INF3580/INF4580 v19 2(b) Conflicting Balances Write a SPARQL query that finds accounts that have balances giving different amounts of money at the same point in time. Print the account number and the dateTime. Fill in your answer here 1 Maximum marks: 4 8/31 IN3060/IN4060/INF3580/INF4580 v19 2(c) Account statement Write a SPARQL query that lists all transactions going in or out of the account dlb:10001. Your output should have three columns: the dateTime of the transaction the amount in (empty when the transaction goes out from the account) the amount out (empty when the transaction goes into the acount) when in out 2010-01-02T09:00:00 1000.00 2010-01-03T09:00:00 500.00 Fill in your answer here 1 Maximum marks: 4 9/31 IN3060/IN4060/INF3580/INF4580 v19 2(d) Accounts with high inflow Write a SPARQL query that lists the total amount going into any account in 2010, provided this total is over 100000. The output should have two columns, the account number and the sum of incoming amounts. You can assume that different accounts have different account numbers. Fill in your answer here 1 Maximum marks: 4 10/31 IN3060/IN4060/INF3580/INF4580 v19 2(e) Unused accounts Write a SPARL query that lists the number and account holder of every account that have not been involved in any transactions during 2018. Fill in your answer here 1 Maximum marks: 4 11/31 IN3060/IN4060/INF3580/INF4580 v19 Section 3: RDFS Inference Section 3: RDFS Inferences Assume we have the following prefixes: @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix : <http://www.ifi.uio.no/bicycles#> . and let be the following set of (turtle) triples describing bicycles and the main components a bicycle is made of: frame, wheels and so-called group, which includes brakes, bottom bracket, derailleurs, hubs and shifters. (1) :Frame rdfs:subClassOf :BicyclePart . (2) :Wheel rdfs:subClassOf :BicyclePart . (3) :Group rdfs:subClassOf :BicyclePart . (4) :Brake rdfs:subClassOf :BicyclePart . (5) :hasFrame rdfs:domain :Bicycle (6) :hasFrame rdfs:range :Frame (7) :hasGroup rdfs:domain :Bicycle (8) :hasGroup rdfs:range :Group (9) :hasFrame rdfs:subPropertyOf :hasPart (10) :hasGroup rdfs:subPropertyOf :hasPart (11) :isFrameOf rdfs:domain :Frame .
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages31 Page
-
File Size-