Part I: Set Constructs. RDF Schema (RDFS) RDF does not provide mechanisms to define domain classes...

26
Part I: Set Constructs

Transcript of Part I: Set Constructs. RDF Schema (RDFS) RDF does not provide mechanisms to define domain classes...

Part I: Set Constructs

RDF Schema (RDFS)RDF does not provide mechanisms to define

domain classes and properties

RDFS is a vocabulary that provides many constructs in addition to those of RDFRDFS has the same syntax as RDF

The prefix for RDF Schema is rdfs, and its URIref is:

http://www.w3.org/2000/01/rdf-schema#

RDFS: RDF SchemaSet constructs are defined in the RDF

Schema Compared to RDF which defines graphs

As a schema for RDF, RDFS (which is written in RDF triples) provides information, i.e., meaning, about the data through inference (i.e., deriving inferred triples from those asserted)

RDFS Constructs RDFS offers constructs for:

Type (rdfs : Class) Subsumption (rdfs : subClassOf) Properties (rdfs : propertyOf) Relationships between properties (rdfs :

subPropertyOf) How a property is used with respect to classes

and datatypes (i.e., rdfs : domain and rdfs : range) For supplemental information and annotation of

resources, it provides:rdfs : seeAlso

rdfs : isDefinedBy

rdfs : comment

rdfs: Class Class is the basic building block of RDFS

rdfs : Class allows us to structure the knowledge based on type

An RDFS class is a resource whose rdf : type property value is the rdfs : Class of the RDFS vocabulary

This triple is constructed through the rdf : type predicate and the rdfs : class object

Here are some examples in the default namespace:

: Fault rdf : type rdfs : Class.: Lake rdf : type rdfs : Class.

The rdf : type and rdfs : class refer to the membership to a set and the set itself, respectively, i.e., class is a set!

rdfs : subClassOfWe can define a class B to be a rdfs : subClass of class A by

using the rdfs:subClassOf property and rdfs : Class

This construct allows building vocabularies through hierarchies<rdfs : Class rdf : about=":Foliation"/>

<rdfs : Class rdf : about=":GneissicBanding">

<rdfs : subClassOf rdf : resource=":Foliation"/>

</rdfs:Class>

Or in N3 format:: GneissicBanding rdfs : subClassOf : Foliation.

rdfs : subClassOf allows inference through the type propagation rule

As in sets, if x is a member of A, and A is a subclass of B, then x is a member of B

rdfs : subClassOf – another exampleWe can define a class B to be a rdfs : subClass of class A

by using the rdfs:subClassOf property and rdfs : Class

This construct allows building vocabularies through hierarchies<rdfs : Class rdf : about=":Aquifer"/>

<rdfs : Class rdf : about=":KarstAquifer">

<rdfs : subClassOf rdf : resource=":Aquifer"/>

</rdfs:Class>

Or in N3 format:

: KarstAquifer rdfs : subClassOf : Aquifer.

NormalFault subClassOf Fault<?xml version="1.0" encoding="UTF-8"?><rdf:RDF xml:base="http://www.StructuralGeology.org/structure/"

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#" xmlns:struc="http://www.StructuralGeology.org/structure/">

<rdfs:Class rdf:about="struc:NormalFault"><rdfs:subClassOf rdf:resource="struc:Fault"/>

</rdfs:Class><rdfs:Class rdf:about="struc:Fault"/>

</rdf:RDF>

Alternative 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:Description rdf:about="struc:NormalFault"> <! - - describe the class - - > <rdf:type> <! - - make it an OWL class - - > <rdf:Description rdf:about="http://www.w3.org/2002/07/owl#Class"/> </rdf:type> <rdfs:subClassOf> <! - - make it a subclass of the Fault class - - > <rdf:Description rdf:about="struc:Fault"/> </rdfs:subClassOf> </rdf:Description>

<! - - now describe the Fault class - - > <rdf:Description rdf:about="struc:Fault"> <rdf:type> <! - - and make it an OWL class - - >

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

</rdf:RDF>

rdfs : domain and rdfs : rangerdfs:domain assigns a property to a subject

class

rdfs : range assigns the value of property either to an object class or a datatype

If we want the range to have several objects, we can use the rdf : Alt container as the range

rdfs: domain and rdfs:range of the heave property<?xml version="1.0" encoding="UTF-8"?><rdf:RDF xml:base="http://www.StructuralGeology.org/structure/" 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#"xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:struc="http://www.StructuralGeology.org/structure/">

<rdfs:Class rdf:about="struc:NormalFault"> <! - - define NormalFault class - - ><rdfs:subClassOf rdf:resource="struc:Fault"/> <! - - make it subclass of Fault - - >

</rdfs:Class><rdfs:Class rdf:about="struc:Fault"/> <! - - define the Fault class - - ><rdf:Description rdf:about="heave"> <! - - horizontal component of net slip - - > <rdf:type> <! - - make heave a property of the Fault class - - > <rdf:Description rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/> </rdf:type> <! - - Now define the domain and range for heave - - >

<rdfs:domain rdf:resource="struc:NormalFault"/> <! - -NormalFatuls has heave - - > <rdfs:range rdf:resource="xsd:string"/> <! - - value for heave is string - - ></rdf:Description>

</rdf:RDF>

rdfs: domain and rdfs:range of the pointBar property<?xml version="1.0" encoding="UTF-8"?><rdf:RDF xml:base="http://www.Streams.org/River/" 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#"xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:river="http://www.Streams.org.org/River/">

<rdfs:Class rdf:about=“river:MeanderingRiver"> <! - - define the MeanderingRiver class - - ><rdfs:subClassOf rdf:resource=“river:River"/> <! - - make it subclass of River - - >

</rdfs:Class><rdfs:Class rdf:about=“river:River"/> <! - - define the River class - - ><rdf:Description rdf:about=“pointBar"> <! - - inner side of meandering river - - > <rdf:type> <! - - make point bar a property of the meandering river- - > <rdf:Description rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/> </rdf:type> <! - - Now define the domain and range for heave - - >

<rdfs:domain rdf:resource=“river:MeanderingRiver"/> <! - -Meandering river’s cut bank - - > <rdfs:range rdf:resource="xsd:string"/> <! - - assume value for point bar is string - - ></rdf:Description>

</rdf:RDF>

Instance (individual)An instance is an individual

It may be an instance of one or more classes. Here is how an individual is declared:<NormalFault rdf:about=“BitterrootFault”/> or alternatively<rdf:Description rdf:about=“BitterrootFault"> <! -- an instance -- >

<rdf:type> <! -- define BitterrootFault as a NormalFault class -- ><rdf:Description rdf:about="NormalFault"/>

</rdf:type></rdf:Description>

Or, alternatively: <! – this code makes more sense -- ><rdf:Description rdf:about=“BitterrootFault">

<rdf:type rdf:resource ="NormalFault"/></rdf:Description>

Instance - another example

<River rdf:about=“Chattahoochie”/> or alternatively<rdf:Description rdf:about=“ChataahoochieRiver"> <! -- an instance -- >

<rdf:type> <! -- define ChattahoochieRiver as a River -- ><rdf:Description rdf:about=“River"/>

</rdf:type></rdf:Description>

Or, alternatively: <! – this code makes more sense -- ><rdf:Description rdf:about=“ChattahoochieRiver">

<rdf:type rdf:resource =“River"/><! – Chattahoochie is a River -- >

</rdf:Description>

rdf:Property and rdfs:subPropertyProperties are instances of the rdf:PropertyProperties are defined at the global scale, and do not belong to specific

classes

rdf:Property is a class, and its instances are properties

Properties relate sets of individual pairs, and as such can be conceived as classes that can be subclassed, i.e., specialized

The rdf:Property may have zero or more rdfs:subProperty subpropertiese.g., highlyAltered is a subproperty of the altered

propertye.g., mildlyFunny is a subproperty of the funny property

rdfs:subPropertyOfRelationship propagate through

This provides meaning to the properties (i.e., predicates) that link classes (resources)

The rdfs:subPropertyOf provides a mechanism to extend properties, from a more general type to more specifici.e., allow hierarchy (taxonomy) of properties

struc: displace rdfs:subPropertyOf struc:move

Inference of rdfs:subPropertyOfP is a subproperty of P’ if P’(x,y) whenever P(x,y)

This means that if a specific property holds for entities lower in the hierarchy, so does the general property above it. In other words:

P rdfs:subPropertyOf P’If x P y Then x P’ y

struc:displace rdfs:subPropertyOf struc:moveIf sanAndreasFault displace RockUnit1Then, SanAndreasFault move RockUnit1

P’

PA B

x y

move

displaceFault

RockUnit

rdfs:subPropertyOf – example

<rdf:Description rdf:about="move"> <! – describe move property -- ><rdf:type> <! – give it an object property type -- >

<rdf:Description rdf:about="http://www.w3.org/2002/07/owl#ObjectProperty"/></rdf:type> <! –object properties connect to objects -- >

</rdf:Description>

<rdf:Description rdf:about="displace"> <! – describe displace property -- ><rdf:type>

<rdf:Description <! – make it an object property -- > rdf:about="http://www.w3.org/2002/07/owl#ObjectProperty"/></rdf:type><rdfs:subPropertyOf> <! - - make displace subproperty of move -- >

<rdf:Description rdf:about="move"/></rdfs:subPropertyOf>

</rdf:Description>

Examples ‘shear’ and ‘extend’ are more specific types of

‘displace’ ‘brittlyDeform’ is more specific than ‘deform’ ‘rotate’ is more specific than ‘deform’

shear rdfs:subPropertyOf displaceIf:

Fault shear GrainThen:

Fault displace Grain

rotate rdfs:subPropertyOf deformIf:

Fault rotate FoldThen:

Fault deform Fold

displace

shearFault Grain

x y

deform

rotateFault Fold

x y

Set Intersection & Union in RDFSAlthough RDFS does not have explicit

mechanisms to define intersection and union, we can express these set logical statements through design patterns that use RDFS primitives

Recall that the intersection of set A and B (A B) contains all elements which are in both A and B

Multiple rdfs:subClassOf and IntersectionWe can construct intersection with two

subclasses! If we define set C to be the intersection of A and

B (i.e., C A B), that is, if x is in C, then it is also in both A and BThis means that C is a subclass of A and a

subclass of B.

C rdfs:subClassOf A.C rdfs:subClassOf B.

A

C

B

x

C

x

InferenceUsing the rdfs:subClassOf inference rule:

If:x rdf:type CThenx rdf:type Ax rdf:type B

Therefore, given x is in C A B, we can infer membership in A and B from membership in C, but not the other way around!

C

x

Example: Pyroclastic Rocks Pyroclastic rocks (e.g., tuff) have the properties of both

volcanic and sedimentary rocks.

: PyroclasticRock rdfs : subClassOf : VolcanicRock.: PyroclasticRock rdfs : subClassOf :

DepositionalRock.

: HuckleberryTuff rdf : type : PyroclasticRock.

We can infer that Huckleberry tuff in Wyoming is both depositional and volcanic. We infer the following two:

: HuckleberryTuff rdf :type : VolcanicRock.: HuckleberryTuff rdf :type : DepositionalRock.

Notice that the inference is uni-directional, i.e., pyroclastic rock is both volcanic and depositional, but every depositional sedimentary or volcanic rock is not pyroclastic!

<rdf:Description rdf:about="sed:DepositionalRock">

<rdf:type>

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

</rdf:type>

</rdf:Description>

<rdf:Description rdf:about="volc:VolcanicRock">

<rdf:type>

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

</rdf:type>

</rdf:Description>

<rdf:Description rdf:about="volc:PyroclasticRock">

<rdf:type>

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

</rdf:type>

<rdfs:subClassOf>

<rdf:Description rdf:about="sed:DepositionalRock"/>

</rdfs:subClassOf>

<rdfs:subClassOf>

<rdf:Description rdf:about="volc:VolcanicRock"/>

</rdfs:subClassOf>

</rdf:Description>

Pyroclastic rock subclass

PyroclasticRock

DepositionalRockVolcanicRock

x

Vein: Both mineral and filled fracture: Vein rdfs : subClassOf Mineral.: Vein rdfs : subClassOf FilledFracture.: aCalciteVein rdf : type :Vein.

We can infer the following:

: aCalciteVein rdf :type Mineral.: aCalciteVein rdf :type FilledFracture.

Notice that in this case, the instance of vein is both a mineral and a filled fracture, but any mineral or filled fracture is not a calcite vein!

Mineral

Vein

FilledFracture

aCalciteVein