RQL: RDF Query language - PowerPoint PPT Presentation

About This Presentation
Title:

RQL: RDF Query language

Description:

Here we restrict the domain of phone to lecturers. A dot . denotes the implicit join ... Schema variables have a name with prefix $ (for classes) or _at_ (for properties) ... – PowerPoint PPT presentation

Number of Views:116
Avg rating:3.0/5.0
Slides: 14
Provided by: jiang79
Category:

less

Transcript and Presenter's Notes

Title: RQL: RDF Query language


1
RQL RDF Query language
  • Jianguo Lu
  • University of Windsor
  • The following slides are from Grigoris Antoniou,
    Frank van Harmelen, A Semantic Web Primer

2
Lecture outline
  • Ontology
  • Syntax of RDF and RDFS
  • Basic Ideas of RDF
  • Three representations of RDF
  • Basic Concepts of RDF Schema
  • ?he Language of RDF Schema
  • Axiomatic Semantics for RDF and RDFS
  • Applications of RDF and RDFS
  • Querying of RDF/RDFS Documents using RQL

The following slides are from Grigoris Antoniou,
Frank van Harmelen, A Semantic Web Primer
3
Why RDF Querydifferent XML representation
  • XML at a lower level of abstraction than RDF
  • There are various ways of syntactically
    representing an RDF statement in XML
  • Thus we would require several XQuery queries,
    e.g.
  • //unilecturer/unititle if unititle element
  • //unilecturer/_at_unititle if unititle attribute
  • Both XML representations equivalent!

4
Why RDF Queryunderstanding semantics
  • ltunilecturer rdfID"949352"gt
  • ltuninamegtGrigoris Antonioult/uninamegt
  • lt/unilecturergt
  • ltuniprofessor rdfID"949318"gt
  • ltuninamegtDavid Billingtonlt/uninamegt
  • lt/uniprofessorgt
  • ltrdfsClass rdfabout"professor"gt
  • ltrdfssubClassOf rdfresource"lecturer"/gt
  • lt/rdfsClassgt
  • A query for the names of all lecturers should
    return both Grigoris Antoniou and David
    Billington

5
RQL Basic Queries
  • The query Class retrieves all classes
  • The query Property retrieves all properties
  • To retrieve the instances of a class (e.g.
    course) we write
  • course
  • If we do not wish to retrieve inherited
    instances, then we have to write
  • course
  • The resources and values of triples with a
    specific property (e.g. involves) are retrieved
    using the query
  • involves
  • The result includes all subproperties of involves
  • If we do not want these additional results, then
    we have to write
  • involves

6
Using select-from-where
  • As in SQL
  • select specifies the number and order of
    retrieved data
  • from is used to navigate through the data model
  • where imposes constraints on possible solutions
  • Retrieve all phone numbers of staff members
  • select X,Y
  • from XphoneY
  • Here X and Y are variables, and XphoneY
    represents a resource-property-value triple

7
Using implicit join
  • Retrieve all lecturers and their phone numbers
  • select X,Y
  • from lecturerX.phoneY
  • Implicit join We restrict the second query only
    to those triples, the resource of which is in the
    variable X
  • Here we restrict the domain of phone to
    lecturers
  • A dot . denotes the implicit join

8
Explicit join
  • Retrieve the name of all courses taught by the
    lecturer with ID 949352
  • select N
  • from courseX.isTaughtByY, CnameN
  • where Y"949352" and XC

9
Query schema
  • Schema variables have a name with prefix (for
    classes) or _at_ (for properties)
  • Retrieve all resources and values of triples with
    property phone, or any of its subproperties, and
    their classes
  • select X,X,Y,Y
  • from XXphoneYY
  • The domain and range of a property can be
    retrieved as follows
  • select domain(_at_P),range(_at_P)
  • from _at_P
  • where _at_Pphone

10
Summary of RDF
  • RDF provides a foundation for representing and
    processing metadata
  • RDF has a graph-based data model
  • RDF has an XML-based syntax to support syntactic
    interoperability.
  • XML and RDF complement each other because RDF
    supports semantic interoperability
  • RDF has a decentralized philosophy and allows
    incremental building of knowledge, and its
    sharing and reuse.

11
Summary of RDFS
  • RDF Schema provides a mechanism for describing
    specific domains
  • RDF Schema is a primitive ontology language
  • It offers certain modelling primitives with fixed
    meaning
  • Key concepts of RDF Schema are class, subclass
    relations, property, subproperty relations, and
    domain and range restrictions
  • There exist query languages for RDF and RDFS

12
RDF Schema vs XML Schema
  • XML Schemas is all about syntax.
  • An XML Schema tool is intended to validate that
    an XML instance conforms to the syntax specified
    by the XML Schema.
  • RDF Schema is all about semantics.
  • An RDF Schema tool is intended to provide
    additional facts to supplement the facts in
    RDF/XML instances.

13
RDF Schema vs OO
  • In OO, properties (attributes) are defined within
    classes.
  • In RDFS, classes and properties are defined
    separately.
Write a Comment
User Comments (0)
About PowerShow.com