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. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
Logics for Data and Knowledge Representation Resource Description Framework (RDF) -- Exercises Feroz Farazi
Exercise 1 Table: Product • Produce an RDF triple representation of the product, manufacturer and stock information provided in the following table.
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?
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. :Researcher rdfs:subClassOf :Analyst
Exercise 3 • Given that there is considerable overlap between the two concepts researcherand 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?
Solution • In this case we can take the union of this two classes as they overlap (partially). We define a new class suppose Investigatoras both the Researcher and Analyst can be treated so. Finally, we assert that the class Investigator is the union of the overlapping classes. :Researcher rdfs:subClassOf :Investigator :Analyst rdfs:subClassOf :Investigator
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?
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. :Analyst rdfs:subClassOf :Researcher :Researcher rdfs:subClassOf:Analyst Suppose we have following axioms: :John rdf:type :Researcher :Enrico rdf:type :Analyst We can infer that: :John rdf:type :Analyst :Enrico rdf:type :Researcher
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.
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
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?
Solution • We can define each of the properties as the as a subproperty of rdfs:label personNamerdfs:subPropertyOfrdfs:label movieTitlerdfs:subPropertyOfrdfs:label
Exercise 7 Table: Ships • 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
Exercise 7 • Following axioms represent partial information of the ships: ship:MV16 ship:nextDeparture “November 29, 2013” ship:MV22 ship:maidenVoyage “June 8, 1970” ship:Titanicship: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?
Solution Using rdfs:domain we can achieve the automatic classification • 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
Exercise 8 Table: Ships • 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?
Solution • Ranks of the officers can be classified as follows: ship:Captainrdfs:subClassOfship:Officer ship:Lieutenantrdfs:subClassOfship:Officer ship:Ensignrdfs:subClassOfship:Officer It can be expressed that the commander of a ship has rank Captain with rdfs:range: ship:hasCommanderrdfs:rangeship:Captain