1Chapter 3RDF Schema Introductionz RDF has a very simple data modelz RDF Schema (RDFS) enriches the data model, adding vocabulary and associated semantics for– Classes and subclasses– Properties and sub-properties– Typing of propertiesz Support for describing simple ontologiesz Adds an object-oriented flavorz But with a logic-oriented approach and using “open world” semanticsRDF Schema (RDFS)zRDFS adds taxonomies forclasses & properties– subClass and subPropertyzand some metadata.– domain and rangeconstraints on propertieszSeveral widely usedKB tools can importand export in RDFSStanford Protégé KB editor• Java, open sourced• extensible, lots of plug-ins• provides reasoning & server capabilitiesRDFS Vocabularyz Terms for classes– rdfs:Class– rdfs:subClassOfz Terms for properties– rdfs:domain– rdfs:range– rdfs:subPropertyOfz Special classes– rdfs:Resource– rdfs:Literal– rdfs:Datatypez Terms for collections– rdfs:member– rdfs:Container– rdfs:ContainerMem-bershipPropertyz Special properties– rdfs:comment– rdfs:seeAlso– rdfs:isDefinedBy– rdfs:labelRDFS introduces the following terms, giving each a meaning w.r.t. the rdf data model2RDF and RDF Schema<rdf:RDFxmlns:g=“http://schema.org/gen”xmlns:u=“http://schema.org/univ”><u:Chair rdf:ID=“john”><g:name>John Smith</g:name></u:Chair></rdf:RDF><rdfs:Property rdf:ID=“name”><rdfs:domain rdf:resource=“Person”></rdfs:Property><rdfs:Class rdf:ID=“Chair”><rdfs:subclassOf rdf:resource=“http://schema.org/gen#Person”></rdfs:Class>u:ChairJohn Smithrdf:typeg:nameg:Persong:namerdfs:Class rdfs:Propertyrdf:typerdf:typerdf:typerdfs:subclassOfrdfs:domainRDFS supports simple inferencesz An RDF ontology plus some RDF statements may imply additional RDF statements.z This is not true of XML.z Note that this is part of the data model and not of the accessing or processing code.@prefix rdfs: <http://www.....>.@prefix : <genesis.n3>.parent rdfs:domain person;rdfs:range person.mother rdfs:subProperty parent;rdfs:domain woman;rdfs:range person.eve mother cain.parent a property.person a class.woman subClass person.mother a property.eve a person;a woman;parent cain.cain a person.New and Improved!100% Betterthan XML!!New and Improved!100% Betterthan XML!!N3 example@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>. @prefix : <#> .<> rdfs:comment “This is an N3 example”.:Person a rdfs:Class.:Woman a rdfs:Class; rdfs:subClassOf :Person.:eve a :Woman; :age “100”.:sister a rdf:Property; rdfs:domain :Person; rdfs:range :Woman.:eve :sister [a :Woman; :age 98].:eve :believe {:eve :age “100”}.[is :spouse of [is :sister of :eve]] :age 99.:eve.:sister.:spouse :age 99.This defines the “empty prefix” as refering to “this document”Here’s how you declare a namespace.<> Is an alias for the URI of this document.“person is a class”. The “a” syntax is sugar for rdf:type property.“Woman is a class and a subclass of person”. Note the ; syntax.“eve is a woman whose age is 100.”“sister is a property from person to woman”“eve has a sister who is a 98 year old woman”. The brackets introduce an anonymous resource.“eve believes that her age is 100”. The braces introduce a reified triple. “the spouse of the sister of eve is 99”. “the spouse of the sister of eve is 99”. Ex: University Lecturers – Prefix<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs=http://www.w3.org/2000/01/rdf-schema#>3Ex: University Lecturers -- Classes<rdfs:Class rdf:ID="staffMember"><rdfs:comment>The class of staff members </rdfs:comment></rdfs:Class><rdfs:Class rdf:ID="academicStaffMember"><rdfs:comment>The class of academic staff members </rdfs:comment><rdfs:subClassOf rdf:resource="#staffMember"/></rdfs:Class><rdfs:Class rdf:ID="lecturer"><rdfs:comment> The class of lecturers. All lecturers are academic staff members.</rdfs:comment><rdfs:subClassOf rdf:resource="#academicStaffMember"/></rdfs:Class><rdfs:Class rdf:ID="course"><rdfs:comment>The class of courses</rdfs:comment></rdfs:Class>Ex: University Lecturers -- Properties<rdf:Property rdf:ID="isTaughtBy"><rdfs:comment>Assigns lecturers to courses. </rdfs:comment><rdfs:domain rdf:resource="#course"/><rdfs:range rdf:resource="#lecturer"/></rdf:Property><rdf:Property rdf:ID="teaches"><rdfs:comment>Assigns courses to lecturers. </rdfs:comment><rdfs:domain rdf:resource="#lecturer"/><rdfs:range rdf:resource="#course"/></rdf:Property>Ex: University Lecturers -- Instances<uni:lecturer rdf:ID="949318"uni:name="David Billington"uni:title="Associate Professor"><uni:teaches rdf:resource="#CIT1111"/><uni:teaches rdf:resource="#CIT3112"/></uni:lecturer><uni:lecturer rdf:ID="949352"uni:name="Grigoris Antoniou"uni:title="Professor"><uni:teaches rdf:resource="#CIT1112"/><uni:teaches rdf:resource="#CIT1113"/></uni:lecturer><uni:course rdf:ID="CIT1111"uni:courseName="Discrete Mathematics"><uni:isTaughtBy rdf:resource="#949318"/></uni:course><uni:course rdf:ID="CIT1112"uni:courseName="Concrete Mathematics"><uni:isTaughtBy rdf:resource="#949352"/></uni:course>RDFS vs. OO Modelsz In OO models, an object class defines the properties that apply to it– Adding a new property means to modify the classz In RDF, properties are defined globally and aren’t encapsulated as attributes in the class definition– One can define new properties without changing the class– Properties can have properties:mother rdfs:subPropertyOf :parent; rdf:type :FamilyRelation.– You can’t narrow the domain and range of properties in a subclass4Example@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .@prefix bio: <http://example.com/biology#> .bio:Animal a rdfs:Class.Bio:offspring a rdfs:Property;rdfs:domain bio:Animal;rdfs:range bio:Animal.bio:Human rdfs:subClassOf bio:Animal.bio:Dog rdfs:subClassOf bio:Animal.:fido a bio:Dog.:john a bio:Human;bio:offspring :fido.There is no way to say that the offspring of humans are humans and the offspring of dogs are dogs. ExampleBio:child rdfs:subPropertyOf bio:offspring;rdfs:domain bio:Human;rdfs:range bio:Human.Bio:puppy rdfs:subPropertyOf bio:offspring;rdfs:domain bio:Dog;rdfs:range bio:Dog.:john bio:child :mary.:fido bio:puppy :rover.What do we know after each of the last two triples are asserted? Suppose we also assert:• :john bio:puppy :rover• :john bio:child
View Full Document