An Axiomatic Semantics for RDF and RDF Schema

Một phần của tài liệu A semantic web primer (Trang 115 - 120)

In this section we formalize the meaning of the modeling primitives of RDF and RDF Schema. Thus we capture thesemanticsof RDF and RDFS.

The formal language we use ispredicate logic, universally accepted as the foundation of all (symbolic) knowledge representation. Formulas used in the formalization are referred to asaxioms.

By describing the semantics of RDF and RDFS in a formal language like logic we make the semantics unambiguous and machine accessible. Also, we provide a basis for reasoning support by automated reasoners manipulating logical formulas.

3.7.1 The Approach

All language primitives in RDF and RDF Schema are represented by con- stants:Resource, Class, P roperty, subClassOf, and so on. A few predefined predicates are used as a foundation for expressing relationships between the constants.

An auxiliary theory of lists is used. It has function symbols nil (empty list)

cons(x, l) (adds an element to the front of the list) f irst(l) (returns the first element)

rest(l) (returns the rest of the list) and predicate symbols

item(x, l) (tests if an element occurs in the list) list(l) (tests whetherlis a list)

Lists are used to represent containers in RDF. They are also needed to capture the meaning of certain constructs (such as cardinality constraints) in richer ontology languages.

Most axioms provide typing information. For example, T ype(subClassOf, P roperty)

says thatsubClassOf is a property. We use predicate logic with equality.

Variable names begin with?. All axioms are implicitly universally quanti- fied.

3.7 An Axiomatic Semantics for RDF and RDF Schema 95

Here we show the definition of most elements of RDF and RDF Schema.

The axiomatic semantics of the full languages is found in an online docu- ment; see reference (Fikes and McGuinness 2001).

3.7.2 Basic Predicates The basic precicates are

P ropV al(P, R, V), a predicate with three arguments, which is used to rep- resent an RDF statement with resourceR, propertyPand valueV T ype(R, T), short forP ropV al(type, R, T), which specifies that the resource

Rhas the typeT

T ype(?r,?t)←→P ropV al(type,?r,?t)

3.7.3 RDF

An RDF statement (triple)(P, R, V)is represented asP ropV al(P, R, V).

Classes

In our language we have constantsClass, Resource, P roperty, Literal. All classes are instances ofClass, that is, they have the typeClass:

T ype(Class, Class) T ype(Resource, Class) T ype(P roperty, Class) T ype(Literal, Class)

Resource is the most general class: every object is a resource. Therefore, every class and every property is a resource:

T ype(?p, P roperty)−→T ype(?p, Resource) T ype(?c, Class)−→T ype(?c, Resource)

Finally, the predicate in an RDF statement must be a property:

P ropV al(?p,?r,?v)−→T ype(?p, P roperty)

ThetypeProperty typeis a property:

T ype(type, P roperty)

Note that it is equivalent toP ropV al(type, type, P roperty): the type oftype isP roperty.typecan be applied to resources and has a class as its value:

T ype(?r,?c)−→(T ype(?r, Resource)∧T ype(?c, Class)) The AuxiliaryFuncPropProperty

A functional property is a property that is a function: it relates a resource to at most one value. Functional properties are not a concept of RDF but are used in the axiomatization of other primitives.

The constantF uncP roprepresents the class of all functional properties.P is a functional property if, and only if, it is a property, and there are nox,y1, andy2such thatP(x, y1),P(x, y2), andy1=y2.

T ype(?p, F uncP rop)←→

(T ype(?p, P roperty)∧ ∀?r∀?v1∀?v2

(P ropV al(?p,?r,?v1)∧P ropV al(?p,?r,?v2)−→?v1 =?v2)) Reified Statements

The constant Statement represents the class of all reified statements. All reified statements are resources, andStatementis an instance ofClass:

T ype(?s, Statement)−→T ype(?s, Resource) T ype(Statement, Class)

A reified statement can be decomposed into the three parts of an RDF triple:

T ype(?st, Statement)−→

∃?p∃?r∃?v(P ropV al(P redicate,?st,?p)∧

P ropV al(Subject,?st,?r)∧P ropV al(Object,?st,?v))

Subject, P redicate, andObjectare functional properties, that is, every state- ment has exactly one subject, one predicate and one object:

3.7 An Axiomatic Semantics for RDF and RDF Schema 97

T ype(Subject, F uncP rop) T ype(P redicate, F uncP rop) T ype(Object, F uncP rop) Their typing information is

P ropV al(Subject,?st,?r)−→

(T ype(?st, Statement)∧T ype(?r, Resource)) P ropV al(P redicate,?st,?p)−→

(T ype(?st, Statement)∧T ype(?p, P roperty)) P ropV al(Object,?st,?v)−→

(T ype(?st, Statement)∧(T ype(?v, Resource)∨T ype(?v, Literal))) The last axiom says, ifObjectappears as the property in an RDF statement, then it must apply to a reified statement and have as value either a resource or a literal.

Containers

All containers are resources:

T ype(?c, Container)−→T ype(?c, Resource) Containers are lists:

T ype(?c, Container)−→list(?c)

Containers are bags or sequences or alternatives:

T ype(?c, Container)←→

(T ype(?c, Bag)∨T ype(?c, Seq)∨T ype(?c, Alt)) Bags and sequences are disjoint:

ơ(T ype(?x, Bag)∧T ype(?x, Seq))

For every natural numbern > 0, there is the selector _n, which selects the nth element of a container. It is a functional property

T ype(_n, F uncP rop) and applies to containers only:

P ropV al(_n,?c,?o)−→T ype(?c, Container)

3.7.4 RDF Schema

Subclasses and Subproperties subClassOfis a property:

T ype(subClassOf, P roperty)

If a classCis a subclass of a classC′, then all instances ofCare also instances ofC′:

P ropV al(subClassOf,?c,?c′)←−

(T ype(?c, Class)∧T ype(?c′, Class)∧

∀?x(T ype(?x,?c)−→T ype(?x,?c′)))

Similarly forsubPropertyOf:Pis a subproperty ofP′ifP′(x, y)whenever P(x, y):

T ype(subP ropertyOf, P roperty) P ropV al(subP ropertyOf,?p,?p′)←→

(T ype(?p, P roperty)∧T ype(?p′, P roperty)∧

∀?r∀?v(P ropV al(?p,?r,?v)−→P ropV al(?p′,?r,?v))) Constraints

Every constraint resource is a resource:

P ropV al(subClassOf, ConstraintResource, Resource)

Constraint properties are all properties that are also constraint resources:

T ype(?cp, ConstraintP roperty)←→

(T ype(?cp, ConstraintResource)∧T ype(?cp, P roperty)) domainandrangeare constraint properties:

T ype(domain, ConstraintP roperty) T ype(range, ConstraintP roperty)

domain and range define the domain, respectively range, of a property.

Recall that the domain of a propertyP is the set of all objects to whichP applies. If the domain ofPisD, then for everyP(x, y),x∈D.

Một phần của tài liệu A semantic web primer (Trang 115 - 120)

Tải bản đầy đủ (PDF)

(259 trang)