Download presentation
Presentation is loading. Please wait.
Published byPhillip Gibbs Modified over 9 years ago
1
Logics for Data and Knowledge Representation Resource Description Framework (RDF) -- Exercises Feroz Farazi
2
Exercise 1 Produce an RDF triple representation of the product, manufacturer and stock information provided in the following table. Table: Product IDModel Number DivisionProduct Line Manufacturi ng Location SKUAvailable 1RT-11SafetySafety valve TrentoLM564770 2RTX-56SafetySafety valve TrentoDK385230 3MBB-32AccessoriesMonitorHong KongCM782350 4DR-43Control Engineering SensorMalaysiaSN264330
3
Solution SubjectPredicateObject product:Product1product:id1 product:Product1product:modelNumberRT-11 product:Product1product:divisionSafety product:Product1product:productLineSafety Valve product:Product1product:manufacturing Location Trento product:Product1product:skuLM5647 product:Product1product:available70 product:Product2product:id2 product:Product2product:modelNumberRTX-56
4
Exercise 2 applications that use RDF data from multiple sources need to overcome the issue of managing terminology. For example, one source uses the term analyst and another uses the term researcher. A set of relations can hold between these two terms depending on the types of usages. It might be the case that a researcher is treated as a special case of an analyst. How can we represent that?
5
Solution We examine the inferences we want to draw with the provided information. If a researcher is a special case of analyst, then all researchers are also analysts. This kind of “if/then” relationship can be represented with a single rdfs:subClassOf relation. :Researcherrdfs:subClassOf:Analyst
6
Exercise 3 Given that there is considerable overlap between the two concepts researcher and analyst. Also consider that there could be some analysts who are not researchers, and vice versa. How can we treat the entities of this two concepts as the same?
7
Solution In this case we can take the union of this two classes as they overlap (partially). We define a new class suppose Investigator as both the Researcher and Analyst can be treated so. Finally, we assert that the class Investigator is the union of the overlapping classes. :Researcherrdfs:subClassOf:Investigator :Analystrdfs:subClassOf:Investigator
8
Exercise 4 Given that the concepts researcher and analyst are identical in every way the fact that they are two terms for the same thing. How can it be inferred that any member of one class is a member of the other, and vice versa?
9
Solution In this case, the classes are equivalent. RDFS does not provide a primitive construct for expressing class equivalence. However, the same task can be done using rdfs:subClassOf. :Analystrdfs:subClassOf:Researcher :Researcher rdfs:subClassOf:Analyst Suppose we have following axioms: :Johnrdf:type :Researcher :Enricordf:type :Analyst We can infer that: :Johnrdf:type :Analyst :Enricordf:type :Researcher
10
Exercise 5 Given that a military mission planner wants to determine where weapons can be targeted. There are many sources of information contributing to the decision. One source provides a list of targets and their types, some of which such as civilian facilities including churches, schools and hospitals must never be targeted. Another source provides descriptions of airspaces including off-limits such as politically defined no-fly zones. A target is determined to be off-limits if it is excluded on the grounds of either of these data sources.
11
Solution A class that will include all the entities of the civilian facility and no-fly zone can be defined. We can define OffLimit, CivilianFacility and NoFlyZone as classes and make the first as the union of the other two. cf:CivilianFacilityrdfs:subClassOfmmp:OffLimits cf:NoFlyZonerdfs:subClassOfmmp:OffLimits
12
Exercise 6 Suppose an application imported RDF data from an excel file. There are two classes of entities, Person and Movie, defined by the import. For Person a property called personName is defined that gives the name by which that person is known. For Movie, the property called movieTitle gives the title under which the movie was released. How to use the standard property rdfs:label to develop a generic display mechanism for showing both the names of the persons and titles of the movies?
13
Solution We can define each of the properties as the as a subproperty of rdfs:label personNamerdfs:subPropertyOfrdfs:label movieTitlerdfs:subPropertyOfrdfs:label
14
Exercise 7 Consider that a shipping company has a fleet of vessels including new ones that are under construction old ones that are being repaired the ones that are currently in service the ones that have been retired from service NameMaiden Voyage Next Departure Decommission Date Destruction Date TitanicApril 10, 1912 April 14, 1912 MV 16May 23, 2001 November 29, 2013 MV 22June 8, 1970 February 10, 1998 Table: Ships
15
Exercise 7 Following axioms represent partial information of the ships: ship:MV16ship:nextDeparture“November 29, 2013” ship:MV22ship:maidenVoyage“June 8, 1970” ship:Titanic ship:destructionDate“April 14, 1912” following axioms hold between classes: ship:DeployedVesselrdfs:subClassOfship:Vessel ship:InServiceVesselrdfs:subClassOfship:Vessel ship:OutOfServiceVesselrdfs:subClassOfship:Vessel Does RDFS support automatic classification of each of the ships provided in the corresponding table?
16
Solution We need to infer that: if a vessel has a maiden voyage, then it is a ship:DeployedVessel if next departure date is set, then it is a ship:InserviceVessel if it has decommission date or destruction date, then it is a ship:OutOfService ship:maidenVoyagerdfs:domainship:DeployedVessel ship:nextDeparturerdfs:domainship:InServiceVessel ship:decommisionDaterdfs:domainship:OutOfServiceVessel ship:destructionDaterdfs:domainship:OutOfServiceVessel Using rdfs:domain we can achieve the automatic classification
17
Exercise 8 In the table below we can see that the ships have commanders. How can we assert that the commander of a ship is a Captain? NameMaiden Voyage Next Departure Commander MV 16May 23, 2001 November 29, 2013 John MV 22June 8, 1970 Alessandro Table: Ships
18
Solution Ranks of the officers can be classified as follows: ship:Captain rdfs:subClassOfship:Officer ship:Lieutenant rdfs:subClassOfship:Officer ship:Ensign rdfs:subClassOfship:Officer It can be expressed that the commander of a ship has rank Captain with rdfs:range: ship:hasCommander rdfs:rangeship:Captain
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.