part ii. property domain and range restriction rdfs allows us to put restriction on the properties...

Post on 05-Jan-2016

217 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Part II

Property domain and range restrictionRDFS allows us to put restriction on the properties by

specifying their domain and range, providing the semantic links between classes and properties

The rdfs : domain and rdfs : range properties allow us to define the subject and object (both object type and datatype) of a property in a rdf triple, respectively

hydro:contaminate rdfs:domain petr:Lead.hydro:contaminate rdfs:range hydro:Groundwater.

Do you think the following leads to an error or it is a flaw?bio : cat hydro : contaminate sport : basketball

Answer: The reasoner assumes basketball is groundwater and that cat is lead; no error, but it is a wrong type matching!

We need to put restriction on the domain and range types!

Code in N3 and RDF/XML formatcontaminate rdfs:domain Lead.

contaminate rdfs:range Groundwater.

<rdfs:Class rdf:about=“Lead”/>

<rdfs:Class rdf:about=“Groundwater”/>

<rdf:Property rdf:about=“contaminate”>

<rdfs:domain rdf:resource=“Lead”/>

<rdfs:range rdf:resource=“GroundWater”/>

</rdf:Property>

Property Intersection in RDFSAgain, as is the case for classes, rdfs cannot directly model

logical intersection and union for properties, although we can use the rdfs:subPropertyOf

If we define property P to be the intersection of R and S (i.e., P RS), and two resources x and y are related by property P:

Semantics:

IF

x P y

THEN

x R y

x S y

x y

PA B

R S

Example

After precipitation, water infiltrates into the ground and/or runs off on the surface of the ground

:infiltrate rdfs:subPropertyOf :recharge

If water infiltrates the Floridan Aquifer (an instance); it recharges it:

hydro: Water hydro: infiltrate hydro: FloridanAquifer.hydro: Water hydro: recharge hydro: FloridanAquifer.

This is a one way inference, i.e., when water infiltrates an aquifer, it recharges it, but if an aquifer is recharged, it may not be because of infiltration

x y

infiltrateWater Aquifer

recharge

infiltrate subPropertyOf recharge

infiltrate and recharge properties<rdf:Description rdf:about="hydro:Aquifer"> <rdf:type>

<rdf:Description rdf:about="http://www.w3.org/2000/01/rdf-schema#Class"/> </rdf:type></rdf:Description>

<rdf:Description rdf:about="hydro:infiltrate"> <rdf:type>

<rdf:Description rdf:about="http://www.w3.org/2002/07/owl#ObjectProperty"/> </rdf:type>

<rdfs:domain> <rdf:Description rdf:about="hydro:Water"/> </rdfs:domain> <rdfs:range> <rdf:Description rdf:about="hydro:Aquifer"/> </rdfs:range> <rdfs:subPropertyOf> <rdf:Description rdf:about="hydro:recharge"/>

</rdfs:subPropertyOf></rdf:Description>

…<rdf:Description rdf:about="hydro:recharge"> <rdf:type>

<rdf:Description rdf:about="http://www.w3.org/2002/07/owl#ObjectProperty"/> </rdf:type></rdf:Description>

<rdf:Description rdf:about="hydro:FloridanAquifer"><rdf:type> <rdf:Description rdf:about="http://www.w3.org/2002/07/owl#Thing"/> </rdf:type>

</rdf:Description>

<rdf:Description rdf:about="hydro:ConfinedAquifer"><rdf:type> <rdf:Description rdf:about="http://www.w3.org/2000/01/rdf-schema#Class"/> </rdf:type><rdfs:subClassOf> <rdf:Description rdf:about="hydro:Aquifer"/> </rdfs:subClassOf>

</rdf:Description>

<rdf:Description rdf:about="hydro:Water"><rdf:type>

<rdf:Description rdf:about="http://www.w3.org/2000/01/rdf-schema#Class"/></rdf:type>

</rdf:Description

Combination of set union and rdfs:subClassOf

Recall that the union of set A and B (A B) contains elements that are contained only in A, only in B, or in both A and B

Let the union of sets A and B be a member of set C (i.e., A B C), which means that each of the A and B sets is a subclass of C (i.e., C is the superclass of both A and B)

C

BA

A B C

x

UnionA rdfs : subClassOf C.B rdfs : subClassOf C.

• In this case, any member (object x) of A or of B is also a member of set C:

x rdf : type A.or

x rdf : type B.

impliesx rdf : type C.

A B C

x

C

BA

x

Example K-Ar age and Rb-Sr age are types of isotopic

age

x rdf : type A.

or

x rdf : type B.

implies

x rdf : type C.

: KArAge rdfs : subClassOf : IsotopicAge.

: RbSrAge: rdfs : subClassOf : IsotopicAge.

IsotopicAge

RbSrAge

KArAge

Example If we know:: Age-1 rdf : type : KArAge.: Age-2 rdf : type : RbSrAge.: KArAge rdfs : subClassOf : IsotopicAge.: RbSrAge: rdfs : subClassOf : IsotopicAge.

Then, we can infer that both ages are isotopic ages.

: Age-1 rdf : type : IsotopicAge.: Age-2 rdf : type : IsotopicAge.

This inference is uni-directional, i.e., every K-Ar or Rb-Sr age is an isotopic age, but an isotopic age may not be K-Ar or Rb-Sr (it could be U-Th, for example)

IsotopicAge

RbSrAge

KArAgeAge-

1Age-

2

<?xml version="1.0" encoding="UTF-8"?>

<rdf:RDF xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">

<rdf:Description rdf:about=":IsotopicAge">

<rdf:type> <rdf:Description rdf:about="http://www.w3.org/2002/07/owl#Class"/></rdf:type>

</rdf:Description>

<rdf:Description rdf:about=":KArAge">

<rdf:type><rdf:Description rdf:about="http://www.w3.org/2002/07/owl#Class"/></rdf:type>

<rdfs:subClassOf> <rdf:Description rdf:about=":IsotopicAge"/> </rdfs:subClassOf>

</rdf:Description>

<rdf:Description rdf:about=":RbSrAge">

<rdf:type><rdf:Description rdf:about="http://www.w3.org/2002/07/owl#Class"/></rdf:type>

<rdfs:subClassOf> <rdf:Description rdf:about=":IsotopicAge"/> </rdfs:subClassOf>

</rdf:Description>

</rdf:RDF>

Short format RDF/XML code<?xml version="1.0" encoding="UTF-8"?><rdf:RDF xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">

<rdfs:Class rdf:about=":IsotopicAge"/>

<rdfs:Class rdf:about=":KArAge"><rdfs:subClassOf rdf:resource=":IsotopicAge"/>

</rdfs:Class>

<rdfs:Class rdf:about=":RbSrAge"><rdfs:subClassOf rdf:resource=":IsotopicAge"/>

</rdfs:Class>

</rdf:RDF>

Property Union This is useful when we combine properties from two

different sources which may mean the same thing!

If two source classes use property P and T with same meaning (different names), then a combined property S can be defined using the rdfs:subPropertyOf

P rdfs : subPropertyOf S.

T rdfs : subPropertyOf S.

If there are two resources x and y, which are related either by P (shown) or T, then we can infer that they are related by S

x P y. or x T y. Then x S y.

x y

S

P or TA B

Making two Properties Equivalent

Two groups of geologists (e.g., Geochemistry and Tectonics groups) have knowledge bases, in which one group uses the property studies and the other one uses investigates for a job done by its geologists

Assuming that the ‘investigates’ and ‘studies’ properties mean the same thing, we make them equivalent the following way:

geochem : studies rdfs : subPropertyOf tect : investigates.tect : investigates rdfs : subPropertyOf geochem : studies.

This way, the two properties of the Geochemistry and Tectonics group become equivalent Note: we can also use owl:equivalentProperty

Union AlternativeThe second way of doing this is

by defining a super-property(the union pattern), such as ‘works’, for both properties

This way, different properties of the two groups (which actually mean the same thing) are combined under the same ‘works’ property, making it easy to merge the information from the two sources

geochem : studies rdfs : subPropertyOf : works.

tect : investigates rdfs : subPropertyOf : works.

works

studies investigates

Same for ‘investigates’

RDF/XML code<?xml version="1.0" encoding="UTF-8"?><rdf:RDF xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">

<rdf:Property rdf:about=":works"/>

<rdf:Property rdf:about=":studies"> <rdfs:subPropertyOf rdf:resource=":works"/> </rdf:Property> <rdf:Property rdf:about=":investigates"> <rdfs:subPropertyOf rdf:resource=":works"/> </rdf:Property>

</rdf:RDF>

Properties From Different Sources Importing and equating properties from different

sources can be done with the use of the rdfs:subPropertyOf

For example, if hydrogeology knowledge base calls ‘flow’ for what structural geology knowledge base calls ‘transport, we can use the rdfs:subPropertyOf as long as the domain and range of these various properties are the same

That is, we want to say that all uses of ‘transport’ and ‘move’ properties are the same:

hydro : transport rdfs : subPropertyOf struc : move

Example

If we have a triple: ‘x hydro:transport y’ in hydrogeologywe can infer ‘x struc:move y’ in structural geology as long as x and y are of related types(e.g., water transport ion, fluid move ion)

hydro : Water hydro : transport geochem : Ion.

struc : Fluid struc : move geochem : Ion.

struc : move

hydro : transport

xA

yA

<?xml version="1.0" encoding="UTF-8"?><rdf:RDF xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> <rdfs:Class rdf:about="hydro:Water"/> <rdfs:Class rdf:about="struc:Fluid"/> <rdf:Property rdf:about=“struc:move"/> <rdf:Property rdf:about=“hydro:transport">

<rdfs:subPropertyOf rdf:resource="struc:move"/> </rdf:Property>

</rdf:RDF>

RDFS ContainersThe qualified name rdfs:Container is the general

superclass of the rdf:Bag, rdf:Seq, and rdf:Alt, allowing us to mark a resource as a list without defining the specific type

The rdfs:ContainerMembershipProperty is a subclass of the rdfs:Property class, and is used to specify containedness of one resource in another

River has dissolved load, suspended load, and bed load:

hydro:hasLoad rdf:type rdfs:ContainerMembershipPropertyhydro:hasDissolvedLoad rdfs: subPropertyOf hydro:hasLoadRiverWater hasDissolvedLoad Ion

If cement is contained in a clastic rock, thenhasCement rdf:type rdfs:ContainerMembershipProperty

rdfs:memberAn instance of the

rdfs:ContainerMembershipProperty is a subproperty of the rdfs:member property

ConglomeratehasCement Cement

Conglomeraterdfs:member Cement

RiverWater hasDissolvedLoad Ion

RiverWater rdfs:member Ion

Note: We can also model these with the hasPart and partOf properties

rdfs : label property The rdfs:label offers a printable label for the name of a

resource (class, property, individual) for human consumption. The object of rdfs:label has to be a literal

rdfs : label rdfs : range xsd : string

Or in RDF/XML

<rdfs:label xml:lang=“en”> Gem </rdfs:label>

To achieve this, we need to define the properties, with string values, as a rdfs:subPropertyOf the rdfs:label

The labels can then be returned if queried.

: MapName rdfs:subPropertyOf rdfs:label.: InvestigatorName rdfs:subPropertyOf rdfs:label.

Other rdfs propertiesThe rdfs:seeAlso and rdfs:isDefinedBy provide extra

information and link to the primary source of information, respectively, for a resource

The object of the rdfs:isDefinedBy property defines the subject (i.e., provides more info about the subject)

The rdfs:isDefinedBy is a subproperty of the rdfs:seeAlso

More qnames (URI)rdfs:seeAlso

rdf:resource=“http://www.geology.org/mineral”/>

The rdfs:comment property offers a natural language comment for any triple, for example:

geochem : precision rdfs : Comment“Precision relates to the instrument.”

Or in RDF/XML:<rdfs:comment>Gems are minerals</rdfs:comment>

top related