Upload
others
View
6
Download
0
Embed Size (px)
Citation preview
INF3580/4580v17
1/19
FrontPage
UNIVERSITYOFOSLOFacultyofMathematicsandNaturalSciencesExaminationinINF3580/INF4580Dayofexamination:15.June2017Examinationhours:9:00–13:00Place:SalDSilurveien2Permittedaids:AnyprintedorwrittencoursematerialTheexamconsistsof5sectionswithequalweight.
Section1:RDFandR2RML
Section1:RDFandR2RML
1 RDF,triplesandprefixesHerearesometripleswithlong,hardtoreadURIs.WritethesametriplesinTurtlenotation,introducingsomeprefixes.(Youcanusestandardprefixes,orinventyourown.)<http://dbpedia.org/ontology/TelevisionShow><http://www.w3.org/2000/01/rdf-schema#subClassOf><http://dbpedia.org/ontology/Work>.
<http://dbpedia.org/resource/How_I_Met_Your_Mother><http://www.w3.org/1999/02/22-rdf-syntax-ns#type><http://dbpedia.org/ontology/TelevisionShow>.
<http://dbpedia.org/resource/How_I_Met_Your_Mother><http://www.w3.org/2000/01/rdf-schema#label>"HowIMetYourMother"^^<http://www.w3.org/2001/XMLSchema#string>.
<http://dbpedia.org/resource/How_I_Met_Your_Mother><http://www.w3.org/2002/07/owl#sameAs><http://yago-knowledge.org/resource/How_I_Met_Your_Mother>.
<http://dbpedia.org/resource/How_I_Met_Your_Mother><http://dbpedia.org/ontology/starring><http://yago-knowledge.org/resource/Alyson_Hannigan>.
<http://dbpedia.org/resource/How_I_Met_Your_Mother><http://xmlns.com/foaf/name>"HowIMetYourMother"^^<http://www.w3.org/2001/XMLSchema#string>.
Fillinyouranswerhere
INF3580/4580v17
2/19
Fillinyouranswerhere
Maximummarks:4
2 TriplesforR2RMLmappingGiventhefollowingtableinarelationaldatabase:
Title Genre Seasons EpisodesTableSERIES
How_I_Met_Your_MotherRomantic_Comedy9 208Modern_Family Sitcom 7 159
Andthefollowingmappingdefinition(weassumemissingprefixeshavebeenalreadydefined):<TriplesMap1>arr:TriplesMap;rr:logicalTable[rr:SQLQuery"Select*fromSERIES"];rr:subjectMap[rr:template"http://dbpedia.org/resource/{Title}";rr:class<http://dbpedia.org/ontology/TelevisionShow>;];rr:predicateObjectMap[rr:predicate<http://dbpedia.org/ontology/numberOfEpisodes>;rr:objectMap[rr:column"Episodes";rr:datatypexsd:integer;]].rr:predicateObjectMap[rr:predicate<http://dbpedia.org/ontology/numberOfSeasons>;rr:objectMap[rr:column"Seasons";rr:datatypexsd:integer;]].rr:predicateObjectMap[rr:predicate<http://dbpedia.org/ontology/genre>;rr:objectMap[rr:template"http://dbpedia.org/resource/{Genre}"]].Writedownthetriplesgeneratedbythemappingappliedtothetable"SERIES".
Fillinyouranswerhere
1
INF3580/4580v17
3/19
Fillinyouranswerhere
Maximummarks:6
3 R2RMLmappingfromtriplesGivethefollowingdatabasetable:
Actor RoleTablePLAYED-ROLE
Alyson_Hannigan Lily_AldrinJoshua_Radnor Ted_MosbyDefineanR2RMLmappingthatgeneratesthefollowingtriples:<http://dbpedia.org/resource/Alyson_Hannigan><http://dbpedia.org/ontology/playRole><http://dbpedia.org/resource/Lily_Aldrin>.<http://dbpedia.org/resource/Joshua_Radnor><http://dbpedia.org/ontology/playRole><http://dbpedia.org/resource/Ted_Mosby>.
Fillinyouranswerhere
1
INF3580/4580v17
4/19
Fillinyouranswerhere
Maximummarks:6
4 BlanknodesInthisquestion,wronganswerswillgive0points.Whichofthesearetrueandwhichfalse?
False True
Blanknodescanbeusedinthepredicateposition
Blanknodescanbeusedonlyinthesubjectposition
BlanknodeshaveURIs
Blanknodesrepresentresources
Blanknodesdonothaveaglobalidentifier
Maximummarks:4
Section2:SPARQL
Section2:SPARQL
1
INF3580/4580v17
5/19
Assumewehavethefollowingprefixes:dbo-http://dbpedia.org/ontology/dbr-http://dbpedia.org/resource/xsd-http://www.w3.org/2001/XMLSchemafoaf-http://xmlns.com/foaf/andthefollowingRDFSclassesandpropertiesbasedondbpedia:dbo:Actor-Theclassofallactorsdbo:Person-Theclassofallpeopledbo:TelevisionShow-TheclassofallTVshowsdbo:TelevisionEpisode-TheclassofallTVepisodesdbo:showName-RelationshipbetweenaTVshowandastringdenotingtheTVshownamedbo:title-RelationshipbetweenaTVepisodeandastringdenotingtheepisode'stitlefoaf:name-Relationshipbetweenapersonandastringdenotingthepersonnamedbo:starring-RelationshipbetweenaTVshoworfilmandanactordbo:guest-RelationshipbetweenaTVepisodeandapersondbo:releaseDate-RelationshipbetweenaTVshoworTVepisodeandadate(xsd:date)representingthedatetheTVshow/episodewasfirstaireddbo:completionDate-RelationshipbetweenaTVshowandadate(xsd:date)representingthedatetheTVshowwaslastaireddbo:numSeasons-RelationshipbetweenaTVshowandaintegerliteraldenotingthenumberofseasonsoftheTVshowdbo:numEpisodes-RelationshipbetweenaTVshowandaintegerliteraldenotingthenumberofepisodesoftheTVshowBelowaresomeexampletriples:dbr:How_I_Met_Your_Mother a dbo:TelevisionShow;
dbo:showName "HowIMetYourMother"^^xsd:string;
dbo:releaseDate "2005-09-19"^^xsd:date; dbo:starring dbr:Josh_Radnor; dbo:numSeasons 9^^xsd:integer; dbo:numEpisodes208^^xsd:integer.dbr:Josh_Radnor a dbo:Actor; foaf:name JoshRadnor.
dbr:The_Stamp_Tramp a dbo:TelevisionEpisode; dbo:series dbr:How_I_Met_Your_Mother; dbo:guest dbr:Joe_Manganiello.dbr:Joe_Manganiello a dbo:Actor; foaf:name JoeManganiello.
5 TVShowsin2016WriteaSPARQLquerythatliststhenamesofTVshowswithepisodesduring2016.
INF3580/4580v17
6/19
Fillinyouranswerhere
Maximummarks:4
6 ShowswithmanyguestsWriteaSPARQLquerythatliststheTVepisodesandnumberofguests,fortheepisodeswithmorethan10guests.Fillinyouranswerhere
Maximummarks:4
7 OngoingTVShows
1
1
INF3580/4580v17
7/19
WriteaSPARQLquerythatconstructsanRDF-graphwithtriplesoftheform<xrdf:typedbo:OngoingTVShow>foreveryTVshow"x"thatdoesnothaveacompletiondate.Fillinyouranswerhere
Maximummarks:4
8 LongrunningshowsWriteaSPARQLquerythatliststheTVshowsthateitherhavemorethan200episodesorwereonairformorethan15years.Youcanusethefunctionyear(…)inaFILTERtogettheyearfromaxsd:date.Fillinyouranswerhere
Maximummarks:4
1
1
INF3580/4580v17
8/19
9 SPARQLEntailmentregimesConsiderthefollowingsubgraphfromdbpedia:dbr:Josh_Radnorowl:sameAsfreebase:JoshRadnor.dbo:Actorrdfs:subClassOfdbo:Person.dbo:starringrdfs:rangedbo:Actor.dbo:guestrdfs:rangedbo:Person.dbr:How_I_Met_Your_Motherdbo:starringdbr:Alyson_Hannigan.dbr:How_I_Met_Your_Motherdbo:guestdbr:Joe_Manganiello.WritetheresultofrunningthefollowingSPARQLqueryovertheabovegraphusing:(a)Simpleentailment,(b)RDFentailment,(c)RDFSchemaentailment,and(d)OWL2DirectSemanticsentailment.SELECT?personWHERE{?personrdf:typedbo:Person}Fillinyouranswerhere
Words:0
Maximummarks:4
Section3:RDFSinference
Section3:RDFSinferenceAssumewehavethefollowingprefixes@prefixrdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>.@prefixrdfs:<http://www.w3.org/2000/01/rdf-schema#>.@prefix:<http://www.ifi.uio.no/banking#>.andlet bethefollowingsetoftriples:(1) :Account rdfs:subClassOf :BankService.(2) :SavingsAccount rdfs:subClassOf :Account.(3) :DebitAccount rdfs:subClassOf :Account.(4) :hasAccount rdfs:domain :Customer.(5) :hasAccount rdfs:range :Account.(6) :hasAccount rdfs:subPropertyOf:hasService.(7) :hasSavingsAccountrdfs:subPropertyOf:hasAccount.
INF3580/4580v17
9/19
(8) :hasDebitAccountrdfs:subPropertyOf:hasAccount.
(9) :sa rdf:type :SavingsAccount.
(10) :sandra :hasSavingsAccount:sa.(11) :peter :hasAccount :ba.(12) _:x :hasService :service.Youcanusethenumbersintheleft-mostcolumntoreferencethetriplesinyourderivationsinthefollowingexercises.
10 Typeof:saForthetriple:sa rdf:type :BankService.eithergiveaderivationfrom usingtherulesofRDFSandsimpleentailmentorexplainwhythisisnotpossibleifnosuchderivationexists.Alsoindicatewhetherthetripleisentailedby ornot.Fillinyouranswerhere
Words:0
Maximummarks:3
11 Typeof:peterForthetriple:peter rdf:type :Customer.eithergiveaderivationfrom usingtherulesofRDFSandsimpleentailmentorexplainwhythisisnotpossibleifnosuchderivationexists.Alsoindicatewhetherthetripleisentailedby ornot.
Fillinyouranswerhere
INF3580/4580v17
10/19
Fillinyouranswerhere
Words:0
Maximummarks:3
12 _:yhasserviceForthetriple_:y :hasService _:y.eithergiveaderivationfrom usingtherulesofRDFSandsimpleentailmentorexplainwhythisisnotpossibleifnosuchderivationexists.Alsoindicatewhetherthetripleisentailedby ornot.Fillinyouranswerhere
Words:0
Maximummarks:4
INF3580/4580v17
11/19
13 EntailedbutnotderivableWritedownatriplethatisentailedby butwhichisimpossibletoderiveusingtherulesofRDFSandsimpleentailmentandexplainwhyitisentailedbutnotderivable.Fillinyouranswerhere
Words:0
Maximummarks:5
14 :sandrahasaccountAssumewehavethesameprefixesasbefore,andlet bethesetoftriples(1) :hasPrivateLoan rdfs:subPropertyOf _:r.(2) :hasCorporateLoan rdfs:subPropertyOf _:r.(3) _:r rdfs:subPropertyOf :hasService.(4) :sandra :hasPrivateLoan :loan.Forthetriple:sandra :hasService :loan.eithergiveaderivationfrom usingtherulesofRDFSandsimpleentailmentorexplainwhythisisnotpossibleifnosuchderivationexists.
Fillinyouranswerhere
INF3580/4580v17
12/19
Fillinyouranswerhere
Words:0
Maximummarks:5
Section4:DescriptionLogicandOWL
Section4:DescriptionLogicandOWLInthefollowingexercisesyoucanuseManchestersyntaxtowriteDL-axioms.TheconversionbetweenDL-syntaxandManchestersyntaxisgiveninthefollowingtable:
Classes,propertiesandindividualsInthefollowingexercises,usethisvocabulary:
INF3580/4580v17
13/19
Classes:
ComputerSuperComputerCPUCoreRAMMotherboard
Properties:
hasParthasCoreisConnectedTo
Individuals:
superCPU
Acomputercane.g.haveaCPUaspart,andaCPUcanhavecores.ACPUcane.g.beconnectedtoamotherboard.ButCPUsarenotpartsofmotherboards,theyareconnectedtomotherboards.
15 Computer,CPUWriteaDL-axiomstatingthatacomputerispreciselysomethingthathasaCPU.Fillinyouranswerhere
Words:0
Maximummarks:2
16 PartsofcomputerWriteaDL-axiomstatingthatallpartsofacomputerareeithermotherboardsorthingsconnectedtomotherboards.
Fillinyouranswerhere
INF3580/4580v17
14/19
Fillinyouranswerhere
Words:0
Maximummarks:4
17 Super-computerWriteaDL-axiomstatingthatifacomputereitherhasmorethan2CPUsoraCPUwithmorethan8cores,thenitisasuper-computer.Fillinyouranswerhere
Words:0
Maximummarks:4
18 myCPUWriteaDL-axiomassertingthatmyCPUisaCPUthatispartofasuper-computer.
Fillinyouranswerhere
INF3580/4580v17
15/19
Fillinyouranswerhere
Words:0
Maximummarks:3
19 ConnectedtoitselfWriteaDL-axiomstatingthatnothingisconnectedtoitself.Fillinyouranswerhere
Words:0
Maximummarks:3
20 NothavingpartsWriteaDL-axiomstatingthatifathing hasaCPUwithacore ,then has asacore.
Fillinyouranswerhere
INF3580/4580v17
16/19
Fillinyouranswerhere
Words:0
Maximummarks:4
Section5:RDFandOWLsemantics
Section5:RDFandOWLsemanticsForwritingOWLorDLexpressions,pleaseusetheManchestersyntax,seethetableinSection4.
21 BlanknodesemanticsLetIbethefollowinginterpretation:
ΔI={robert,cersei,jaime,joffrey}
ManI={robert,jaime,joffrey}
WomanI={cersei}
KingI={robert}
marriedToI={<cersei,robert>}
hasFatherI={<joffrey,jaime>}
hasMotherI={<joffrey,cersei>}LetAbethesetoftriples{_:b:hasFather_:c,_:crdf:typeKing}orinDLnotation:{hasFather(_:b,_:c),King(_:c)}Isitthecasethat ,i.e.AistrueinI?Pleaseexplainyouranswer,usingthesimplifiedRDFSmodelsemanticsfromthecourse.
Fillinyouranswerhere
INF3580/4580v17
17/19
Fillinyouranswerhere
Words:0
Maximummarks:7
22 OWLConceptsemanticsLetIbethesameinterpretationasbefore,repeatedhereforconvenience.
ΔI={robert,cersei,jaime,joffrey}
ManI={robert,jaime,joffrey}
WomanI={cersei}
KingI={robert}
marriedToI={<cersei,robert>,<robert,cersei>}
hasFatherI={<joffrey,jaime>}
hasMotherI={<joffrey,cersei>}PleasegivetheinterpretationoftheOWLconceptsa)KingormarriedTosomeKing(InDLsyntax: )b)KingormarriedToonlyKing(InDLsyntax: )Pleaseexplainyouranswer,usingtheOWLmodelsemanticsfromthecourse.
Fillinyouranswerhere
INF3580/4580v17
18/19
Fillinyouranswerhere
Words:0
Maximummarks:6
23 OWLAxiomsemanticsLetIbethesameinterpretationasbefore,repeatedhereforconvenience.
ΔI={robert,cersei,jaime,joffrey}
ManI={robert,jaime,joffrey}
WomanI={cersei}
KingI={robert}
marriedToI={<cersei,robert>,<robert,cersei>}
hasFatherI={<joffrey,jaime>}
hasMotherI={<joffrey,cersei>}DothefollowingOWLaxiomsholdinI?a)KingsubClassOfmarriedToonlyWomanDLSyntax:b)KingsubClassOfmarriedToonlyowl:ThingDLSyntax:IseachoftheseanOWLtautology,i.e.doesitholdinanyinterpretation?
Fillinyouranswerhere
INF3580/4580v17
19/19
Fillinyouranswerhere
Words:0
Maximummarks:7