0% found this document useful (0 votes)
98 views16 pages

RDF Schema: Basic Ideas: 1.1 Classes and Properties

This document describes the basic concepts of RDF Schema (RDFS), which provides a framework for describing classes and properties of resources in RDF. It defines core classes like rdfs:Resource, rdfs:Class, and properties like rdfs:subClassOf to define class hierarchies. RDFS allows imposing restrictions on RDF documents by defining domains and ranges of properties. Examples of RDFS definitions for a university domain and motor vehicles are also provided to illustrate how RDFS can be used.

Uploaded by

Dan Ţecu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
98 views16 pages

RDF Schema: Basic Ideas: 1.1 Classes and Properties

This document describes the basic concepts of RDF Schema (RDFS), which provides a framework for describing classes and properties of resources in RDF. It defines core classes like rdfs:Resource, rdfs:Class, and properties like rdfs:subClassOf to define class hierarchies. RDFS allows imposing restrictions on RDF documents by defining domains and ranges of properties. Examples of RDFS definitions for a university domain and motor vehicles are also provided to illustrate how RDFS can be used.

Uploaded by

Dan Ţecu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

1.

RDF Schema: Basic Ideas

RDF is a universal language that lets users describe resources using their own vocabularies.
RDF does not make assumptions aboutanyparticularapplicationdomain,nordoesitdefinethe
semantics of any domain. Is it up to the user to do so in RDF Schema (RDFS).
RDF Schema
doesnotprovideactualapplicationspecificclassesandproperties.
Instead RDF Schema provides the framework to describe applicationspecific classes and
properties.
Classes in RDF Schema are much like classes inobjectorientedprogramminglanguages.This
allowsresourcestobedefinedasinstancesofclasses,andsubclassesofclasses.

1.1 Classes and Properties

A class can be thought of as asetofelementssharingproperties.Individualobjectsthatbelong


to a class are referred to as instances of that class. We have already defined the relationship
betweeninstancesandclassesinRDFusingrdf:type.
An important useofclassesisto imposerestrictionsonwhatcan bestatedinanRDFdocument
using the schema. In programming languages, typing is used to prevent nonsense from being
written (such as A + 1, where A is an array we lay down that the arguments of + must be
numbers).ThesameisneededinRDF.

1.2 Class Hierarchies and Inheritance

Once we have classeswewouldalsoliketo establishrelationshipsbetweenthem.Forexample,


every professor is an academic staff member. We say that professor is a subclass of
academic staff member, or equivalently, that academic staff member is a superclass of
professor. The subclass relationship defines ahierarchyofclasses.Ingeneral,Aisasubclass
of B if every instance ofAisalsoan instanceofB.ThereisnorequirementinRDFSchemathat
the classes togetherformastricthierarchy.A classmayhavemultiplesuperclasses. IfaclassA
is a subclass of both B1 and B2, this simply means that everyinstanceofAisbothaninstance
ofB1andaninstanceofB2.
RDF Schema fixes the semantics of is a subclass of. Now it is not up to an application to
interpret is a subclass of instead its intended meaning must be used by all RDF processing
software. By making such semantic definitions RDFS is a(stilllimited)languagefordefiningthe
semantics of particular domains. Stated another way, RDF Schema is a primitive ontology
language.
In RDFS, properties are definedglobally,thatis, theyarenotencapsulatedasattributesinclass
definitions. Itispossibletodefinenewpropertiesthatapplytoanexistingclasswithoutchanging
thatclass.

Exampleofahierarchyofclasses

1.3 Property Hierarchies

The property
rdfs:subPropertyOfis
an instance of
rdf:Property
that is used to state
that all resources related by one property are also related by another.
For example, is taught
by is a subproperty of involves. If a course c istaughtbyanacademicstaffmembera,thenc
also involves a. The converse is not necessarily true. For example, a may be the convener of
thecourse,oratutorwhomarksstudenthomeworkbutdoesnotteachc.
PisasubpropertyofQ,ifQ(x,y)istruewheneverP(x,y)istrue.

1.4 RDF versus RDFS Layers

WeillustratethedifferentlayersinvolvedinRDFandRDFSusingasimpleexample:
ConsidertheRDFstatement
DiscreteMathematicsistaughtbyDavidBillington
The schema forthisstatementmay containclasses,suchaslecturers,academicstaffmembers,
staff members, and properties such as is taught by, involves, phone, employee id Next figure
illustrates the layersofRDFandRDFSchema(blocksareproperties,ellipsesabovethedashed
lineareclasses,andellipsesbelowthedashedlineareinstances)
Theschemaofthefigureisitself writteninaformallanguage,RDF Schema,thatcanexpressits
ingredients:subClass,Property,subProperty,Resource,andsoon.

2. RDF Schema: The Language

The modeling primitives of RDF Schema aredefinedusingresourcesandproperties(RDFitself


is used!). RDF allows one to express any statement about any resource,andthat anythingwith
a URI can be a resource. So, if we wish to say that the class lecturer is a subclass of
academicstaffmember,wemay
1.definetherequiredresourcesforlecturer,academicStaffMember,andsubClassOf
2.definesubClassOftobeaproperty
3.writethetriple(lecturer,subClassOf,academicStaffMember).
All these steps are within the capabilities of RDF. So, an RDFS document (that is, an RDF
schema)isjustanRDFdocument,andweusetheXMLbasedsyntaxofRDF.

2.1 Core Classes

Thecoreclassesare
rdfs:Resource
,theclassofallresources
rdfs:Class
,theclassofallclasses
rdfs:Literal
,theclassofallliterals(strings)

rdf:Property
,theclassofallproperties
rdf:Statement
,theclassofallreifiedstatements

Forexample,aclasslecturercanbedefinedasfollows:
<rdfs:Classrdf:ID="lecturer">

</rdfs:Class>

2.2 Core Properties for Defining Relationships

Thecorepropertiesfordefiningrelationshipsare
rdf:type
,whichrelatesaresourcetoitsclass.
rdfs:subClassOf
,whichrelatesaclasstooneofitssuperclasses.Allinstancesofaclass
areinstancesofitssuperclass.Aclassmaybeasubclassofmorethanoneclass.Asan
example,theclassfemaleProfessormaybeasubclassofbothfemaleandprofessor.
rdfs:subPropertyOf
,whichrelatesapropertytooneofitssuperproperties.

Example:
<rdfs:Classrdf:about="lecturer">
<rdfs:subClassOfrdf:resource="staffMember"/>
</rdfs:Class>

rdfs:subClassOf
and
rdfs:subPropertyOf
aretransitive,bydefinition.
rdfs:Class
isasubclassof
rdfs:Resource
(everyclassisaresource)
rdfs:Resource is an instance of
rdfs:Class (
rdfs:Resource is the class of all
resources,soitisaclass!).Forthesamereason,everyclassisaninstanceof
rdfs:Class
.

2.3 Core Properties for Restricting Properties

Thecorepropertiesforrestrictingpropertiesare
rdfs:domain
, which specifies the domain of a property P and states that any resource that
hasagivenpropertyisaninstanceofthedomainclasses.
rdfs:range
, which specifies the range ofapropertyPandstatesthatthevaluesofaproperty
areinstancesoftherangeclasses.
Here is an example stating thatwheneveranyresourcehas aphonenumber,it is(byinference)
astaffmemberandthatitsvalueisaliteral:
<rdf:Propertyrdf:ID="phone">
<rdfs:domainrdf:resource="#staffMember"/>
<rdfs:rangerdf:resource="&rdfLiteral"/>
</rdf:Property>

2.4 Useful Properties for Reification


rdf:subject
,whichrelatesareifiedstatementtoitssubject
rdf:predicate
,whichrelatesareifiedstatementtoitspredicate
rdf:object
,whichrelatesareifiedstatementtoitsobject

2.5 Container Classes

rdf:Bag
,theclassofbags,
rdf:Seq
,theclassofsequences,
rdf:Alt
,theclassofalternatives,
rdfs:Container
,asuperclassofallcontainerclasses,includingthethreeprecedingones.

2.6 Utility Properties


rdfs:seeAlso
relatesaresourcetoanotherresourcethatexplainsit.
rdfs:isDefinedByis
a subproperty of
rdfs:seeAlso
and relates a resource totheplace
whereitsdefinition,typicallyanRDFschema,isfound.
rdfs:comment
.Comments,typicallylongertext,canbeassociatedwitharesource.
rdfs:label
. A humanfriendly label (name) is associated with a resource. Among other
purposes,itmayserveasthenameofanodeinagraphicrepresentationoftheRDFdocument.

2.7 Example: A University


<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22rdfsyntaxns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdfschema#">
<rdfs:Classrdf:ID="lecturer">
<rdfs:comment>
Theclassoflecturers
Alllecturersareacademicstaffmembers.
</rdfs:comment>
<rdfs:subClassOfrdf:resource="#academicStaffMember"/>
</rdfs:Class>
<rdfs:Classrdf:ID="academicStaffMember">
<rdfs:comment>
Theclassofacademicstaffmembers
</rdfs:comment>
<rdfs:subClassOfrdf:resource="#staffMember"/>
</rdfs:Class>

<rdfs:Classrdf:ID="staffMember">
<rdfs:comment>Theclassofstaffmembers</rdfs:comment>
</rdfs:Class>
<rdfs:Classrdf:ID="course">
<rdfs:comment>Theclassofcourses</rdfs:comment>
</rdfs:Class>
<rdf:Propertyrdf:ID="involves">
<rdfs:comment>
Itrelatesonlycoursestolecturers.
</rdfs:comment>
<rdfs:domainrdf:resource="#course"/>
<rdfs:rangerdf:resource="#lecturer"/>
</rdf:Property>
<rdf:Propertyrdf:ID="isTaughtBy">
<rdfs:comment>
Inheritsitsdomain("course")andrange("lecturer")
fromitssuperproperty"involves"
</rdfs:comment>
<rdfs:subPropertyOfrdf:resource="#involves"/>
</rdf:Property>
<rdf:Propertyrdf:ID="phone">
<rdfs:comment>
Itisapropertyofstaffmembers
andtakesliteralsasvalues.
</rdfs:comment>
<rdfs:domainrdf:resource="#staffMember"/>
<rdfs:rangerdf:resource="&rdfLiteral"/>
</rdf:Property>
</rdf:RDF>

2.8 Example: Motor Vehicles

<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22rdfsyntaxns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdfschema#">
<rdfs:Classrdf:ID="motorVehicle"/>
<rdfs:Classrdf:ID="van">
<rdfs:subClassOfrdf:resource="#motorVehicle"/>
</rdfs:Class>
<rdfs:Classrdf:ID="truck">
<rdfs:subClassOfrdf:resource="#motorVehicle"/>
</rdfs:Class>
<rdfs:Classrdf:ID="passengerVehicle">
<rdfs:subClassOfrdf:resource="#motorVehicle"/>
</rdfs:Class>
<rdfs:Classrdf:ID="miniVan">
<rdfs:subClassOfrdf:resource="#passengerVehicle"/>
<rdfs:subClassOfrdf:resource="#van"/>
</rdfs:Class>
</rdf:RDF>

3. RDF and RDF Schema in RDF Schema

3.1 RDF

<?xmlversion="1.0"encoding="UTF16"?>
<rdf:RDF

xmlns:rdf="http://www.w3.org/1999/02/22rdfsyntaxns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdfschema#">
<rdfs:Classrdf:ID="Statement"
rdfs:comment="Theclassoftriplesconsistingofa
predicate,asubjectandanobject
(thatis,areifiedstatement)"/>
<rdfs:Classrdf:ID="Property"
rdfs:comment="Theclassofproperties"/>
<rdfs:Classrdf:ID="Bag"
rdfs:comment="Theclassofunorderedcollections"/>
<rdfs:Classrdf:ID="Seq"
rdfs:comment="Theclassoforderedcollections"/>
<rdfs:Classrdf:ID="Alt"
rdfs:comment="Theclassofcollectionsofalternatives"/>
<rdf:Propertyrdf:ID="predicate"
rdfs:comment="Identifiesthepropertyusedinastatement
whenrepresentingthestatement
inreifiedform">
<rdfs:domainrdf:resource="#Statement"/>
<rdfs:rangerdf:resource="#Property"/>
</rdf:Property>
<rdf:Propertyrdf:ID="subject"
rdfs:comment="Identifiestheresourcethatastatementis
describingwhenrepresentingthestatement
inreifiedform">
<rdfs:domainrdf:resource="#Statement"/>
</rdf:Property>
<rdf:Propertyrdf:ID="object"
rdfs:comment="Identifiestheobjectofastatement
whenrepresentingthestatement
inreifiedform"/>
<rdf:Propertyrdf:ID="type"
rdfs:comment="Identifiestheclassofaresource.
Theresourceisaninstance
ofthatclass."/>
</rdf:RDF>

3.2 RDF Schema

<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22rdfsyntaxns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdfschema#">

<rdfs:Classrdf:ID="Resource"
rdfs:comment="Themostgeneralclass"/>
<rdfs:Classrdf:ID="comment"
rdfs:comment="Usethisfordescriptions">
<rdfs:domainrdf:resource="#Resource"/>
<rdfs:rangerdf:resource="#Literal"/>
</rdfs:Class>
<rdfs:Classrdf:ID="Class"
rdfs:comment="Theconceptofclasses.
Allclassesareresources.">
<rdfs:subClassOfrdf:resource="#Resource"/>
</rdfs:Class>
<rdf:Propertyrdf:ID="subClassOf">
<rdfs:domainrdf:resource="#Class"/>
<rdfs:rangerdf:resource="#Class"/>
</rdf:Property>
<rdf:Propertyrdf:ID="subPropertyOf">
<rdfs:domainrdf:resource="&rdfProperty"/>
<rdfs:rangerdf:resource="&rdfProperty"/>
</rdf:Property>
</rdf:RDF>

The namespaces do not provide the full definition of RDF and RDF Schema. Consider, for
example,
rdfs:subClassOf
. The namespace specifies only thatitappliestoclassesandhas
a class as a value. The meaningofbeingasubclass,namely,thatall instancesofoneclassare
also instancesofitssuperclass,isnotexpressedanywhere.Infact,itcannotbeexpressedinan
RDFdocument.Ifitcould,therewouldbenoneedfordefiningRDFSchema.

4. RDF Serialization Formats


While the data model that RDF uses is very simple, the serialized representation tends to get
complicated when an RDFgraphissavedtoafileorsentoveranetworkbecauseofthevarious
methods usedtocompactthedata whilestillleaving itreadable.Thesecompactionmechanisms
generally take the form of shortcuts that identify multiple references to a graph node using a
shared but complex structure. Well be covering four serialization formats: NTriples, the
simplest of notations N3, a compaction of the NTriple format RDF/XML, one of the most
frequently used serialization formats and finally, RDF in attributes (known as RDFa), which
canbeembeddedinotherserializationformatssuchasXHTML.

4.1 A Graph of Friends

In order to compare the different serialization formats, we will build a simple graph that we can
use throughout the examples to observe how the various serializations fold relationships
together. For this example graph, wellmodelasmallpartofTobyssocialsphereinparticular,
how he knows the other authors of his book. This will include things like the home page of his
blog, his email address, his interests, and any other names he might use. These clues about
Tobys identity are important to help differentiate our Toby from the numerous other Tobys in
theworldandobtainastrongidentifier(URI)thatwecanuseforfutureinteraction.
The relationships expressed in these social graphs have settled into a collection of wellknown
predicates, forming a vocabulary of expression known as Friend of a Friend or simply FOAF.
While FOAF deals primarily with people, the formal definition of FOAF states that the
foaf:depictionpredicate

canbeusedforgraphics portrayinganyresource(orthing)inthe
world.
TobysFOAFgraph

4.2 N-Triples
NTriples is a format for storing and transmitting data. It is a linebased, plain text
serialisation
format for
RDF (Resource Description Framework) graphs, and a subset of the
Turtle (Terse
RDF Triple Language) format. NTriples was designed to be easier for software to
parse and
generate.
ThereisverylittlevariationinhowanRDF

graph
canberepresentedinNTriples.

NTriple notation is a very simplebutverboseserializationthatmakestheNTripleformatuseful


when handcrafting datasets for application testing and debugging. Each line of output in
NTriple format represents a single statement containing a subject, predicate, and object
followed by a dot. Except for blank nodes and literals, subjects, predicates, and objects are
expressed as absolute URIs enclosed in angle brackets. Subjects and objects representing
anonymous nodes are represented as_:name, wherenameisanalphanumericnodenamethat
starts with a letter. Object literals are doublequoted strings that use the backslash to escape
doublequotes, tabs, newlines, and the backslash character itself. String literals in NTriple
notation can optionally specify their language when followed by @lang, where lang is an ISO
639 language code. Literals can also provide information abouttheirdatatypewhenfollowedby
^^type, where typeiscommonly anXSD(XMLSchemaDefinition)datatype.Theextension.ntis
typically used when NTriples are stored inafile,andwhentheyaretransmitted overHTTP,the
mimetypetext/plainisused.
OurFOAFgraphcanberepresentedinNTripleformatas:
<http://kiwitobes.com/toby.rdf#ts>
<http://xmlns.com/foaf/0.1/homepage>
<http://kiwitobes.com/>.
<http://kiwitobes.com/toby.rdf#ts> <http://xmlns.com/foaf/0.1/nick>
"kiwitobes".
<http://kiwitobes.com/toby.rdf#ts> <http://xmlns.com/foaf/0.1/name>
"TobySegaran".
<http://kiwitobes.com/toby.rdf#ts><http://xmlns.com/foaf/0.1/mbox>
<mailto:[email protected]>.
<http://kiwitobes.com/toby.rdf#ts>
<http://xmlns.com/foaf/0.1/interest>
<http://semprog.com>.
<http://kiwitobes.com/toby.rdf#ts>
<http://www.w3.org/1999/02/22rdfsyntaxns#type>
<http://xmlns.com/foaf/0.1/Person>.
<http://kiwitobes.com/toby.rdf#ts> <http://xmlns.com/foaf/0.1/knows>
_:jamie.
<http://kiwitobes.com/toby.rdf#ts><http://xmlns.com/foaf/0.1/knows>
<http://semprog.com/people/colin>.
_:jamie<http://xmlns.com/foaf/0.1/name>"JamieTaylor".
_:jamie<http://xmlns.com/foaf/0.1/mbox><mailto:[email protected]>.

_:jamie<http://www.w3.org/1999/02/22rdfsyntaxns#type>
<http://xmlns.com/foaf/0.1/Person>.
<http://semprog.com/people/colin>
<http://xmlns.com/foaf/0.1/name>
"ColinEvans".
<http://semprog.com/people/colin><http://xmlns.com/foaf/0.1/mbox>
<mailto:[email protected]>.
<http://semprog.com/people/colin>
<http://www.w3.org/1999/02/22rdfsyntaxns#type>
<http://xmlns.com/foaf/0.1/Person>.
<http://semprog.com><http://www.w3.org/2000/01/rdfschema#label>
"SemanticProgramming".
<http://semprog.com>
<http://www.w3.org/1999/02/22rdfsyntaxns#type>
<
http://xmlns.com/foaf/0.1/Document
>

4.3 N3
Notation3
, or
N3 as it is more commonly known, is a shorthand non
XML serialization of
Resource Description Framework models, designed with humanreadabilityinmind:N3ismuch
more compact and readable than XML RDF notation. N3 has severalfeaturesthatgobeyonda
serializationforRDFmodels,suchassupportforRDFbasedrules.
In an RDF graph, every connection between nodes represents a triple. Since each node may
participate in a large number of relationships, we could significantly reduce the number of
characters used in NTriples if we used a short symbol to represent repeated nodes. We could
go further, recognizing that many of the URIs used in a specific model frequently come from
related URIs.Inmuch thesamewaythatXMLprovidesanamespacemechanismforgenerating
short Qualified Name (qnames) for nodes, N3allowsustodefineaURIprefixandidentifyentity
URIsrelativetoasetofprefixesdeclaredatthebeginningofthedocument.

N3 reduces this repetition by allowing you to combine multiple statements about the same
subject byusingasemicolon(

)afterthe firststatement,soyouonlyneedtostatethepredicate
andobjectforotherstatementsusingthesamesubject.

Example:

ThisRDFmodelinstandardXMLnotation
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22rdfsyntaxns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
>
<rdf:Description
rdf:about="http://en.wikipedia.org/wiki/Tony_Benn"
>


<dc:title>
TonyBenn
</dc:title>

<dc:publisher>
Wikipedia
</dc:publisher>

</rdf:Description>
</rdf:RDF>
maybewritteninNotation3likethis:
@prefixdc:<http://purl.org/dc/elements/1.1/>.
<http://en.wikipedia.org/wiki/Tony_Benn>
dc:title"TonyBenn"
dc:publisher"Wikipedia".

4.4 RDF/XML

[1]
[2]
RDF/XML is a syntax,
defined by the
W3C
, to express (i.e.
serialize
) an
RDF graph as an
XML document. RDF/XML is sometimes misleading called simply RDF because it was
introduced among the other W3C specifications defining RDF and it was historically the first
W3C standard RDF serialization format. Although the RDF/XMLformatisstillinuse,otherRDF
serializations are now preferred by many RDF users, both because they are more
[3]
humanfriendly,
and because some RDF graphs are not representable in RDF/XML due to
restrictionsonthesyntaxofXML
QNames
.
Conceptually, RDF/XML is built up from a series of smaller descriptions,eachofwhichtracesa
path through an RDF graph.Thesepathsaredescribed intermsofthenodes(subjects)andthe
links(predicates)thatconnectthemtoothernodes(objects).

AstripefromTobysFOAFgraph

If there is more than one path described inanRDF/XMLdocument,allthedescriptionsmustbe


children of a single RDF element if there is only one path described, the rdf:RDFelementmay
beomitted.

TheFOAFgraphwerepresentedinNTriplesandN3cannowberepresentedinRDF/XMLas:

<rdf:RDF
xmlns:foaf='http://xmlns.com/foaf/0.1/'
xmlns:rdf='http://www.w3.org/1999/02/22rdfsyntaxns#'
xmlns:rdfs='http://www.w3.org/2000/01/rdfschema#'>
<foaf:Personrdf:about="http://kiwitobes.com/toby.rdf#ts">
<foaf:name>TobySegaran</foaf:name>
<foaf:homepagerdf:resource="http://kiwitobes.com/"/>
<foaf:nick>kiwitobes</foaf:nick>
<foaf:mboxrdf:resource="mailto:[email protected]"/>
<foaf:interest>
<foaf:Documentrdf:about="http://semprog.com">
<rdfs:label>SemanticProgramming</rdfs:label>
</foaf:Document>
</foaf:interest>
<foaf:knows>
<foaf:Personrdf:about="http://semprog.com/people/colin">
<foaf:name>ColinEvans</foaf:name>
<foaf:mboxrdf:resource="mailto:[email protected]"/>
</foaf:Person>
</foaf:knows>
<foaf:knows>
<foaf:Person>
<foaf:name>JamieTaylor</foaf:name>
<foaf:mboxrdf:resource="mailto:[email protected]"/>
</foaf:Person>
</foaf:knows>

</foaf:Person>
</rdf:RDF>

4.5 RDFa
[1]
RDFa (or
Resource Description Framework in Attributes
) is a
W3C Recommendation that
adds a set of attributelevel extensions to
HTML
,
XHTML and various XMLbased document
types for embedding rich
metadata within Web documents. The RDF datamodel mapping

enables its use for embedding


RDF
subjectpredicateobject expressions within XHTML
documents.ItalsoenablestheextractionofRDFmodeltriplesbycompliant
useragents
.
The essence of RDFa is to provide a set of attributes that can be used to carry metadatainan
XMLlanguage(hencethe'a'inRDFa).
Theseattributesare:

about
a
URI
or
CURIE
specifyingtheresourcethemetadataisabout

rel and
rev specifying a relationship and reverserelationship with another
resource,respectively

src
,
href
and
resource
specifyingthepartnerresource

property specifying a property for the content of an element or the partner


resource

content optional attribute that overrides the content oftheelementwhenusingthe


propertyattribute

datatype optional attribute that specifies the datatype of textspecifiedforusewith


thepropertyattribute

typeof optional attribute thatspecifiestheRDFtype(s)ofthesubjectorthepartner


resource(theresourcethatthemetadataisabout).

Historically, RDFa 1.0 [


rdfasyntax
] was specified only for XHTML. RDFa 1.1 [
rdfacore
] is the
newer version and the one used in this document. RDFa 1.1 is specified for both XHTML
[
xhtmlrdfa
] and HTML5 [
htmlrdfa
]. In fact, RDFa 1.1 also works foranyXMLbasedlanguages
like SVG [
svg11
]. This document uses HTML in all of the examples for simplicity, we use the
term"HTML"throughoutthisdocumenttorefertoalloftheHTMLfamilylanguages.

Validation
RDFa is based on attributes. While some of the HTML attributes (e.g.,
href
,
src
) have been
reused, other RDFa attributes are new. This is important because some of the (X)HTML
validators may not properly validate the HTML codeuntiltheyareupdatedtorecognizethenew
RDFa attributes. This is rarely a probleminpracticesincebrowserssimplyignoreattributesthat
they donotrecognize.NoneoftheRDFaspecificattributeshaveanyeffecton thevisualdisplay
of the HTML content. Authors do not have to worry about pages marked up with RDFa looking
anydifferenttoahumanbeingfrompagesnotmarkedupwithRDFa.

Resources:
ASemanticWebPrimer,secondeditionGrigorisAntoniouandFrankvanHarmelen,2008
ProgrammingtheSemanticWebbyTobySegaran,ColinEvans,andJamieTaylor,2009

http://eapps.software.ucv.ro/ss15wiki/images/a/a6/Antoniou.pdf
3.43.6
http://eapps.software.ucv.ro/ss15wiki/images/a/ac/Segaran.pdf
RDFSerializationFormats
6880
http://www.cs.helsinki.fi/u/puustjar/soa15/SOC_RDF%20_OWL.pdf
http://www.w3schools.com/webservices/ws_rdf_schema.asp
http://www.obitko.com/tutorials/ontologiessemanticweb/rdfschemardfs.html
http://www.w3schools.com/webservices/ws_rdf_schema.asp
http://www.w3.org/TR/rdfschema/#ch_introduction
http://en.wikipedia.org/wiki/Notation3
http://en.wikipedia.org/wiki/RDF/XML
http://en.wikipedia.org/wiki/RDFa#cite_noterdfa_wiki2
http://www.w3.org/TR/rdfaprimer/

You might also like