TopQuadrant Semantic Web Technology Training
                        Series

          TopQuadrant in collaboration with J...
The Semantic Wave is NOT one thing … there are
                         differing major streams within it



             ...
Philosophy of Semantics
       What is Semantics = “meaning of meaning”
       Logical Positivism (with a vengeance!) =
  ...
Semantic Web: Make web content machine-readable!


   “The Semantic Web is a vision: the idea of having data on the Web de...
What could the Web do?




           Web page interaction –
           uses people as its medium!




© Copyright 2007-20...
What could the Web do? (cont.)


                                         Can this sort of
                               ...
How could the Web do it?


                      Built-in by the Webmaster




                                           ...
What about XML? Doesn’t it support semantics?

       HTML gave us formatting tags
       XML gave us custom tags
        ...
Gartner: All Tied Up with XML: 1999




  Unprecedented growth of standard development
© Copyright 2007-2009 TopQuadrant I...
Gartner: All Tied Up with XML: 2001




  From 2001 through 2004 enterprises spent $3 billion on modeling activities with ...
A new Web of terminology

                           What’s the Interlingua for the Interlingua?




                     ...
What about people? Don’t they make the world go
                                   round?


    computers and people…bette...
The Web: The World’s Largest
                                       Information System!




                   How did it ...
How the Web was Won – The Network Effect



                                         The “Network Effect” –
              ...
Features of The Web
       Anyone can say Anything about Any topic (AAA)
          All names are global (so that anyone ca...
AAA Slogan -

             Anyone




                      can say
                         Anything




                ...
Non-unique naming

                                                       “Java”
        public String getContextPath() {
...
Open World Assumption
 There’s always something else over the horizon . . .




© Copyright 2007-2009 TopQuadrant Inc.    ...
Web of Ontologies


  Network Effect for
  Ontologies:




The more there are, the
easier and more valuable
it is to creat...
Semantic Solutions -
                                   Expectations we have encountered

 A solution is "Semantic" if it:...
W3C standards for semantic models
       W3C Semantic stack is built on XML
       XML-based Ontology languages are being
...
W3C standards evolution
       “Layer cake” has been modified a few times…


                                             ...
TopQuadrant Semantic Web Technology Training
                        Series

          TopQuadrant in collaboration with J...
The Tree of Knowledge Technologies

                                         Content
                                     ...
Semantic Web Standards Stack




© Copyright 2007-2008 TopQuadrant Inc.          Slide 3
How Semantic Languages Work
       Bring information together
       Draw inferences




            RDF                  ...
What is RDF? Distribution of data
         Model                                            Manufacture            In
 ID ...
Distribute by rows?
                           Manufacturing                Paper
  1       ZX-3                          ...
Distribute by columns?

 Model No.

 ZX-3

 ZX-3P                                     Needs to reference
 ZX-3S           ...
Distribute by cells!?


                                                        Division

                                ...
Distribute by cells!?

                                                                 Predicate
                        ...
Representing Data in Graphs
 Graph = nodes linked by labeled edges




© Copyright 2007-2009 TopQuadrant Inc.             ...
What is RDF?
       RDF (Resource Description Framework) is an
       infrastructure for:
          Encoding,
          Ex...
Why is RDF useful?
 After all, can’t we express semantics in XML?

       XML allows application-specific tags
          S...
What is RDFS?
 RDFS is the schema language for RDF
 Type inferences can be made, based on schema




© Copyright 2007-2009...
Why is RDFS useful?
       RDFS allows us to talk about classes of instances

       It provides inferences, e.g.,

      ...
How does it work?

                                     RDF – the Ultimate Mash-up
                                     La...
A little RDF(S) goes a long way

                                         gov: body
                                      ...
Ontologies are the means to separate “what is
                            common” from “what is different”


Semantic map:...
OWL (formerly DAML+OIL)

  What is OWL?
                                         DARPA              EU (various)


       ...
OWL can specify rich relationships: equivalence,
                               inverse, unique, …




© Copyright 2007-20...
What is OWL good for?
       OWL provides a flexible way to talk about sets of
       resources,
          e.g., “All plan...
SPARQL

             SPARQL Protocol and RDF Query Language

          Query Language (like SQL is for databases,
        ...
Find data in a graph




© Copyright 2007-2008 TopQuadrant Inc.                          Slide 22
TopQuadrant Semantic Web Technology Training
                        Series

          TopQuadrant in collaboration with J...
Semantic Technology, RDBMs and Object Models

       In this session we will compare Semantic
       Technology with
     ...
Semantic and OO Technologies



               Comparing Semantic Technology (ST)

                                       ...
Differing Intents of Semantic and Object
                                      Models
       Object Model
          A spec...
Specification (OO) vs. Knowledge Discovery (ST)

   OO: In an Object Model class membership and
   hierarchy are specified...
(ST) In OWL, Classes are inferred or computed

       OWL classes are interpreted as sets that contain
       individuals
...
OO Systems Define Acceptable Expectations for
                       Instances of Classes and Subclasses

       Informati...
Properties (ST) vs. Attributes and Relations (OO)

       OWL Properties represent relations between two
       individual...
Properties are first-class constructs
                                                          This allows relationships ...
In OWL, Properties may have Sub Properties

       It is possible to form hierarchies of properties
       (these are not ...
Properties may have Additional Characteristics

       OWL allows the meaning of properties to be enriched
       through ...
What does it mean to be a subclass in OWL?

       In OWL, subclass means necessary implication

          If A is a subcl...
Class Expressions and (Multiple) Inheritance


 Semantic Web Classes are (logically) sets, so you
 can do set logic on the...
(ST) Run-time vs. (OO) Design time semantics


       In semantic systems, ontologies are run-time
       models

       T...
OO Development – Progressive Design and
                           Transformation of Classes into Code

Requirements      ...
Summary Table: Understanding the “Lingo”

     OO
                      Object Technology             Semantic Technology ...
Semantic Web – OO Gotchas!


                In the Semantic Web, you infer the class of an object.
                The cl...
OWL / RDFS Preview (for Comparison)

       owl:inverseOf                     ‘child inverseOf parent’
            Elizabe...
Semantic vs Relational



                      Comparing Semantic Technology

                                           ...
Data in a spreadsheet

               Person                    Company

               Melli Annamalai           Oracle

...
Same data in a relational database

                                            Give each entity a
                       ...
Same data in a relational database

                                         Works For   Company Table
      Person Table
...
Suppose (as a simplification) that we know that
       people live in the country where their employer is
       based.

 ...
Same data in a graph
                           Melli Annimalai
                                                        Or...
Suppose (as a simplification) that we know that
       people live in the country where their employer is
       based.

 ...
RDFS and OWL are about Rich Relationships in Data


   Information Given
X-Ray Machine located in Room A2003
Room A2003 lo...
OWL has many Build-in Functions for modeling
                                    Relationships


Information Given
     X-...
Getting the same result with a relational database


       Equipment Table

 ID Equipment Name
                          ...
Change happens…

       Information Given
                                              Room A2003 located in ATA Building...
Accommodating change with RDB requires database
                        changes AND new queries

     Equipment Table
 ID ...
Accommodating change with RDB requires database
                        changes AND new queries

     Equipment Table
 ID ...
Comparing two approaches
                                                 RDB                   Semantic Model (Ontology)
...
Key differences in the representation of relationships

                                         RDB                      ...
Another Key Capability of Semantic Web Technology is
                        Managing Distributed Data

       Information...
Relational and Semantic Technology can work well
                 together: it is not necessarily one or the other!

     ...
TopQuadrant Semantic Web Technology Training Series


         TopQuadrant in collaboration with Jim Hendler presents:
   ...
Query Languages
       Familiar query languages:
          SQL
          XQuery


       SPARQL is similar to these in tha...
Extracting information from RDF
       RDF is a graph structure
       How do I get information from it?
          Where i...
Querying some sample data
                  Table: Play
                       ID                  Title          Written ...
Same data viewed as a graph
                                                 Play
                                        ...
Titles of plays written by Shakespeare



               The Tempest               Row 1             Shakespeare

        ...
Matching data with graph patterns

               The Tempest                Row1                            Shakespeare

...
A more complex graph pattern

              The Tempest                 Row 1        Shakespeare

        Romeo and Juliet...
Representing graph patterns
 Graph patterns are represented just like graphs
        – in triples!
 Variables allowed as w...
More graph patterns

                ?x                   ?y       ?z



                                               ?a...
More graph patterns
             “The names of two playwrights who wrote plays in the same
                year”
         ...
Building Queries from Data
             “The names of two playwrights who wrote plays in the same year”

                 ...
A more complex graph pattern
                                                   Play
                                     ...
Components of a Query
       Selection mode and variables
          SELECT ?place
          SELECT ?playwright1 ?playwrigh...
Query Syntax
 Bring it all together to form a real query:

 SELECT ?place
 WHERE { :Stratford :isIn ?place .}
            ...
Filters
 “Shakespearean plays written after 1600”

 You can only filter on values you have matched in the WHERE clause!

 ...
Optional Patterns
 “Titles and authors of all plays”
 Suppose we have some plays whose author is unknown:

               ...
Negation
 “Titles of anonymous plays”
                     ID                     title              writtenBy    year
   ...
Searching for Literals
         Previous queries matched a variable (e.g. ?title)
            find something with a specif...
Union
                                         Find all plays written by
                                         Shakespe...
Query Forms
       SELECT
          returns matches for specified variables
       CONSTRUCT
          returns a graph tha...
ASK
       ASK returns a Boolean value
          based on whether WHERE clause finds data

     Were any plays written aft...
CONSTRUCT
       SPARQL queries can build new sets of triples based on
       patterns
       WHERE clause exactly as befo...
Constructing new triples with SPARQL

                                         Play 1                       Shakespeare

 ...
TopQuadrant Semantic Web Technology Training Series


         TopQuadrant in collaboration with Jim Hendler presents:
   ...
What is a Knowledge Organization System?

       A means of organizing and communicating
       terminology about a domain...
Vocabulary Uses

       Tagging, e.g.:
          del.icio.us, Flickr
          West Key Number System
          Library of...
Agreeing on terms




                                         Why can’t everyone just
                                   ...
Simple Knowledge Organization System

       SKOS is the RDF standard for Knowledge Organization
       Systems
       All...
Mapping terms




                                               broader match

                                          ...
SKOS Resources


                          Qname                   label            Abbreviation
                         ...
Upcoming SlideShare
Loading in...5
×

Dean Allemang Semantic Web Basics

651

Published on

Monday Morning Tutorial

Published in: Technology, Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
651
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
45
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Dean Allemang Semantic Web Basics

  1. 1. TopQuadrant Semantic Web Technology Training Series TopQuadrant in collaboration with Jim Hendler presents: “Getting Ready for the Semantic Web with TopBraid Suite” Module I-2: Overview of Semantic Technologies and the Semantic Web What is Semantic Technology? What is it good for?
  2. 2. The Semantic Wave is NOT one thing … there are differing major streams within it The Semantic Web W3C Standards for sharing information on a world-wide scale Intranets vs. Internet Semantic Technology Enhanced knowledge access and search Semantic Interoperability Information syndication … and so forth © Copyright 2007-2009 TopQuadrant Inc. Slide 2
  3. 3. Philosophy of Semantics What is Semantics = “meaning of meaning” Logical Positivism (with a vengeance!) = “Everything is described by values of properties” Shirky: “Semantic Web is about tautologies. (…and tautologies aren’t interesting)” Intelligent Agents = AI on the web (it’s gotta be smart!) © Copyright 2007-2009 TopQuadrant Inc. Slide 3
  4. 4. Semantic Web: Make web content machine-readable! “The Semantic Web is a vision: the idea of having data on the Web defined and linked in a way that it can be used by machines not just for display purposes, but for automation, integration and reuse of data across various applications.[W3C 2001] ” “The Semantic Web is an extension of the current Web in which information is given well-defined meaning, better enabling computers and people to work in cooperation.” [Tim Berners-Lee et al 2001] © Copyright 2007-2009 TopQuadrant Inc. Slide 4
  5. 5. What could the Web do? Web page interaction – uses people as its medium! © Copyright 2007-2009 TopQuadrant Inc. Slide 5
  6. 6. What could the Web do? (cont.) Can this sort of interaction become part of the Web itself? © Copyright 2007-2009 TopQuadrant Inc. Slide 6
  7. 7. How could the Web do it? Built-in by the Webmaster Agree upon an “interlingua” © Copyright 2007-2009 TopQuadrant Inc. Slide 7
  8. 8. What about XML? Doesn’t it support semantics? HTML gave us formatting tags XML gave us custom tags You get to pick your tags/attributes Tags can have “meaning” specific to your application Many dialects have blossomed XML and XML Schema became W3C standards Standard dialects are being developed by many industry groups – XBRL.org, FpML.org, TaxML.org, … Every large organization has their own XML Schemas © Copyright 2007-2009 TopQuadrant Inc. Slide 8
  9. 9. Gartner: All Tied Up with XML: 1999 Unprecedented growth of standard development © Copyright 2007-2009 TopQuadrant Inc. Slide 9
  10. 10. Gartner: All Tied Up with XML: 2001 From 2001 through 2004 enterprises spent $3 billion on modeling activities with no return on investment from $ 2 billion of it. © Copyright 2007-2009 TopQuadrant Inc. Slide 10
  11. 11. A new Web of terminology What’s the Interlingua for the Interlingua? Use the same technology for mapping web pages to terminology to map terminology to one another © Copyright 2007-2009 TopQuadrant Inc. Slide 11
  12. 12. What about people? Don’t they make the world go round? computers and people…better cooperation Internet Ontology Ontology Ontology Annotated Agent Human Annotated Web Page Annotated Web Page Web Page Source:, Phil Windridge WSWS (2004) © Copyright 2007-2009 TopQuadrant Inc. Slide 12
  13. 13. The Web: The World’s Largest Information System! How did it get so big? What is special about The Web? © Copyright 2007-2009 TopQuadrant Inc. Slide 13
  14. 14. How the Web was Won – The Network Effect The “Network Effect” – The more participants, the more value in joining At first, there were few web pages Little value in joining in. But then there were more – more value in joining in A crowd is better yet! Lots of value in joining in © Copyright 2007-2009 TopQuadrant Inc. Slide 14
  15. 15. Features of The Web Anyone can say Anything about Any topic (AAA) All names are global (so that anyone can refer to them!) Two people might have different names for the same thing . . . (non-unique naming) . . . Or the same name for different things! You never know everything on the web (“Open World”) This isn’t what we want the web to be, it is how the web is (and how it supports the network effect!) © Copyright 2007-2009 TopQuadrant Inc. Slide 15
  16. 16. AAA Slogan - Anyone can say Anything about Any topic © Copyright 2007-2009 TopQuadrant Inc. Slide 16
  17. 17. Non-unique naming “Java” public String getContextPath() { try { Method getContextPathMethod = “Java”? delegate.getClass().getMethod("getContextPath", null); //$NON-NLS- 1$ return (String) getContextPathMethod.invoke(delegate, null); } catch (Exception e) { // ignore “Coffee”? } return null; } Hot Beverage? Programming language? © Copyright 2007-2009 TopQuadrant Inc. Slide 17
  18. 18. Open World Assumption There’s always something else over the horizon . . . © Copyright 2007-2009 TopQuadrant Inc. Slide 18
  19. 19. Web of Ontologies Network Effect for Ontologies: The more there are, the easier and more valuable it is to create a new one From Tim Berners-Lee, ISWC 2003 © Copyright 2007-2009 TopQuadrant Inc. Slide 19
  20. 20. Semantic Solutions - Expectations we have encountered A solution is "Semantic" if it: X understands the meaning of natural language X interprets perceptual input and forms usable representations X computes new statistical analyses of data X recognizes complex patterns in huge amounts of data X produces high-quality graphics of complex systems X replaces an intelligent human in a high-impact task X has a model of uncertainty in data X can come to correct conclusions despite faulty input. Companies provide (some of) these, but typically as “add-ons” or 3rd party solutions Not as part of core Semantic offerings © Copyright 2007-2009 TopQuadrant Inc. Slide 20
  21. 21. W3C standards for semantic models W3C Semantic stack is built on XML XML-based Ontology languages are being developed to support semantic interoperability. “Semantic Web is stimulating a whole new class of applications at individual, enterprise and web scales” – Eric Miller, W3C, Semantic Technologies for eGOV’2003 www.w3.org/ www.w3.org/2001/sw © Copyright 2007-2009 TopQuadrant Inc. Slide 21
  22. 22. W3C standards evolution “Layer cake” has been modified a few times… Significant changes: •Addition of a query language (SPARQL) •RDF not dependent on XML •OWL just one of many possible logic formalisms Not shown: emergence of n3 serialization (built for triples, unlike XML) © Copyright 2007-2009 TopQuadrant Inc. Slide 22
  23. 23. TopQuadrant Semantic Web Technology Training Series TopQuadrant in collaboration with Jim Hendler presents: “Getting Ready for the Semantic Web with TopBraid Suite” Module I-3: Overview of Semantic Technologies and the Semantic Web Mapping the Semantic Terrain: Standards and Languages from the W3C
  24. 24. The Tree of Knowledge Technologies Content Management Semantic Languages Technology Languages Process Knowledge Languages AI Knowledge Software Representation Modeling Languages © Copyright 2007-2008 TopQuadrant Inc. Slide 2
  25. 25. Semantic Web Standards Stack © Copyright 2007-2008 TopQuadrant Inc. Slide 3
  26. 26. How Semantic Languages Work Bring information together Draw inferences RDF OWL RDFS © Copyright 2007-2009 TopQuadrant Inc. Slide 4
  27. 27. What is RDF? Distribution of data Model Manufacture In ID Division Product Line SKU No. location Stock Manufacturing 1 ZX-3 Paper machine Sacramento FB3524 23 support Manufacturing 2 ZX-3P Paper machine Sacramento KD5243 4 support Manufacturing 3 ZX-3S Paper machine Sacramento IL4028 34 support Control 4 B-1430 Feedback Line Elizabeth KS4520 23 Engineering Control 5 B-1430X Feedback Line Elizabeth CL5934 14 Engineering Control 6 B-1431 Active Sensor Seoul KK3945 0 Engineering 7 DBB-12 Accessories Monitor Hong Kong ND5520 100 8 SP-1234 Safety Safety Valve Cleveland HI4554 4 9 SPX-1234 Safety Safety Valve Cleveland OP5333 14 © Copyright 2007-2009 TopQuadrant Inc. Slide 5
  28. 28. Distribute by rows? Manufacturing Paper 1 ZX-3 Sacramento FB3524 23 support machine Needs common schema Control - which column is which? B- Feedba Elizabet KS452 4 Engineerin 23 1430 ck Line h 0 g 7 DBB-12 Accessories Monitor Hong ND5520 100 Kong © Copyright 2007-2009 TopQuadrant Inc. Slide 6
  29. 29. Distribute by columns? Model No. ZX-3 ZX-3P Needs to reference ZX-3S entities – which thing are Division B-1430 we talking about? Manufacturing support B-1430X Manufacturing support B-1431 Manufacturing DBB-12 In Stock support SP-1234 23 Control Engineering SPX-1234 4 Control 34 Engineering 23 Control 14 Engineering 0 Accessories 100 Safety 4 Safety 14 © Copyright 2007-2009 TopQuadrant Inc. Slide 7
  30. 30. Distribute by cells!? Division 7 Accessories Needs to reference both Division schema and entities 7 Accessorie Most flexible – can distribute s data in any way at all! Product Line 4 Feedback Line Model 1 ZX-3 © Copyright 2007-2009 TopQuadrant Inc. Slide 8
  31. 31. Distribute by cells!? Predicate Division 7 Accessories Subject Object •Store, •Index, and •Federate these triples URI’s Triple Store © Copyright 2007-2009 TopQuadrant Inc. Slide 9
  32. 32. Representing Data in Graphs Graph = nodes linked by labeled edges © Copyright 2007-2009 TopQuadrant Inc. Slide 10
  33. 33. What is RDF? RDF (Resource Description Framework) is an infrastructure for: Encoding, Exchange and Distributing metadata A “Resource“ is anything that you want to describe RDF Triple: RDF Triple: Subject Object Object Subject Predicate Predicate © Copyright 2007-2009 TopQuadrant Inc. Slide 11
  34. 34. Why is RDF useful? After all, can’t we express semantics in XML? XML allows application-specific tags Semantic exchange can happen, as long as two parties agree on the use of these tags XML Represents a tree structure – no indication about what is a description, what denotes an object, what values relate to what objects, etc. RDF provides a way to integrate structured information from multiple sources © Copyright 2007-2009 TopQuadrant Inc. Slide 12
  35. 35. What is RDFS? RDFS is the schema language for RDF Type inferences can be made, based on schema © Copyright 2007-2009 TopQuadrant Inc. Slide 13
  36. 36. Why is RDFS useful? RDFS allows us to talk about classes of instances It provides inferences, e.g., Best Western is a Hotel (and hence, anything we know about Hotels applies to Best Western) RDFS is in RDF (it’s its own schema language!) © Copyright 2007-2009 TopQuadrant Inc. Slide 14
  37. 37. How does it work? RDF – the Ultimate Mash-up Language !! RDF RDF RDF RDF © Copyright 2007-2009 TopQuadrant Inc. Slide 15
  38. 38. A little RDF(S) goes a long way gov: body eGovOS: project gov: department eGOV: web gov: agency service eGOV:Service Spec eGOV: Remote Reporting gov: DoE gov: FERC gov: EPA eGOV: capability brm: s2citizens brm:Energy brm:Resource eGOV: Mgmt Standard brm: brm: Business Area brm: Line Of subfunction Business A model of government agencies and departments. Such models are called Ontologies. © Copyright 2007-2008 TopQuadrant Inc. Slide 16
  39. 39. Ontologies are the means to separate “what is common” from “what is different” Semantic map: Connecting silo domains From Tim Berners-Lee, ISWC 2003 © Copyright 2007-2008 TopQuadrant Inc. Slide 17
  40. 40. OWL (formerly DAML+OIL) What is OWL? DARPA EU (various) DAML OIL The “Web RDF Ontology Language” DAML+OIL W3C Standard OWL W3C Became a Recommendation in February 2004 © Copyright 2007-2008 TopQuadrant Inc. Slide 18
  41. 41. OWL can specify rich relationships: equivalence, inverse, unique, … © Copyright 2007-2008 TopQuadrant Inc. Slide 19
  42. 42. What is OWL good for? OWL provides a flexible way to talk about sets of resources, e.g., “All planets around the sun”, “The wives of Henry VIII”, “People who have visited Japan”, “Incidents of SIDS in which the mother is related to someone with epilepsy” A powerful way to relate information “people who have flown to Japan have been to Japan”, “a person with epilepsy has a neurological disorder”, “planets are astronomical bodies” Provides a robust way to re-use information Even if I didn’t expect someone to be interested in the planets around the sun when I built my database, you can define this set and draw conclusions about it (e.g., “there are 9 of them”) © Copyright 2007-2009 TopQuadrant Inc. Slide 20
  43. 43. SPARQL SPARQL Protocol and RDF Query Language Query Language (like SQL is for databases, XQuery is for XML, etc.) Extracts information from a graph using pattern matching “Four-star lodging in New York” © Copyright 2007-2008 TopQuadrant Inc. Slide 21
  44. 44. Find data in a graph © Copyright 2007-2008 TopQuadrant Inc. Slide 22
  45. 45. TopQuadrant Semantic Web Technology Training Series TopQuadrant in collaboration with Jim Hendler presents: “Getting Ready for the Semantic Web with TopBraid Suite” Module I-5: Overview of Semantic Technologies and the Semantic Web Comparing Semantic with Conventional Technologies
  46. 46. Semantic Technology, RDBMs and Object Models In this session we will compare Semantic Technology with Relational Database and Object Oriented Technology We will use as an example a simple application for managing and tracking medical equipment application will be asked to find an address compare semantic and relational database approaches We will then identify key differences and similarities between semantic and object models © Copyright 2007-2009 TopQuadrant Inc. Slide 2
  47. 47. Semantic and OO Technologies Comparing Semantic Technology (ST) and Object Oriented (OO) Technology © Copyright 2007-2009 TopQuadrant Inc. Slide 3
  48. 48. Differing Intents of Semantic and Object Models Object Model A specification of how a set of entities can encapsulate data and invoke behaviors on one another The intent of the model is to provide realizable software where object behaviors become fragments of code Semantic Model (Ontology) A specification of what is known in a region of interest Intent is to maintain consistency between what is known about a domain in general (expertise) and what is observed about a situation (data) © Copyright 2007-2009 TopQuadrant Inc. Slide 4
  49. 49. Specification (OO) vs. Knowledge Discovery (ST) OO: In an Object Model class membership and hierarchy are specified Classes are defined and express ‘constraints’ on the instances (individuals) that belong to classes ST: An Ontology model can serve either as a specification of class membership or as a means of knowledge discovery Sets of properties associated with individuals (instances) may allow them to be viewed as members of several classes at the same time Class membership is dynamic and depends on the value of the properties In OWL, classes are computed based on assertions about the © Copyrightindividuals that might belong to one or more classes 2007-2009 TopQuadrant Inc. Slide 5
  50. 50. (ST) In OWL, Classes are inferred or computed OWL classes are interpreted as sets that contain individuals A class is not a kind of template as in OO technology In OWL, classes are built up of descriptions that specify the conditions that must be satisfied by an individual to be a member of the class Subclasses are subsets of their parent classes. Superclass-subclass relationships can be computed automatically by a reasoner © Copyright 2007-2009 TopQuadrant Inc. Slide 6
  51. 51. OO Systems Define Acceptable Expectations for Instances of Classes and Subclasses Information Given Medical Equipment Class What can you do? method list_tests PW1729.list_tests(..) X-Ray Machine Class This call must be valid. extends Medical Equipment (and is done like it is for all Medical Equipment, unless stated otherwise) Instances Instance Class Relationships in the model PW1729 X-Ray Machine determine what can be done, and what it means to do it. © Copyright 2007-2009 TopQuadrant Inc. Slide 7
  52. 52. Properties (ST) vs. Attributes and Relations (OO) OWL Properties represent relations between two individuals (Not classes) OWL Property types: Object Properties link an individual to an individual Datatype Properties link an individual to simple values • integers, floats, strings, booleans, and so forth • an XML Schema Datatype primitive value or an RDF literal Those with OO experience/expertise must overcome the typical pre-conception that properties belong to the class! © Copyright 2007-2009 TopQuadrant Inc. Slide 8
  53. 53. Properties are first-class constructs This allows relationships between Properties In contrast to most OO paradigms, where properties are “owned” or “contained in” Classes hasParent This allows relationships between Properties hasMother hasFather This is not a class diagram! dc:creator … and for other modelers to my:author reuse properties “wherever I use the property ‘author’, tell the world that they can read ‘dc:creator’” © Copyright 2007-2009 TopQuadrant Inc. Slide 9
  54. 54. In OWL, Properties may have Sub Properties It is possible to form hierarchies of properties (these are not Class hierarchies) The rdfs:subPropertyOf construct allows relationships to be abstracted up the sub-property tree. © Copyright 2007-2009 TopQuadrant Inc. Slide 10
  55. 55. Properties may have Additional Characteristics OWL allows the meaning of properties to be enriched through the use of property descriptions: Sub-property: Relation between properties, that the pairs related by one property are included in the other. Domain and Range: Descriptions of a property that determines class membership of individuals related by that property. Inverse: Description of a property that exchanges the Subject and Object in their respective relationship in another property that it is an inverse-of. Transitive: Chains of relationships collapse into a single relationship. Symmetric: Description of a property that makes it a self-inverse property Functional and Inverse Functional … © Copyright 2007-2009 TopQuadrant Inc. Slide 11
  56. 56. What does it mean to be a subclass in OWL? In OWL, subclass means necessary implication If A is a subclass of B, then ALL instances of A are instances of B, without exception. If something is an A, then this implies that it is also a B OWL allows the use of class expressions in place of named classes restrictions describe an unnamed set that could contain some individuals these are anonymous, computed classes Properties are used to define and describe Classes Properties are used to create restrictions. Restrictions are used to restrict the individuals that belong to a class. When you define a restriction, it is the property that give rise to the class © Copyright 2007-2009 TopQuadrant Inc. Slide 12
  57. 57. Class Expressions and (Multiple) Inheritance Semantic Web Classes are (logically) sets, so you can do set logic on them: Person Parent Female Male Mother ∩ “A ‘Mother’ is a ‘Female’ who is also a ‘Parent’” © Copyright 2007-2009 TopQuadrant Inc. Slide 13
  58. 58. (ST) Run-time vs. (OO) Design time semantics In semantic systems, ontologies are run-time models There is no separation between the model and its technical implementation The model (ontology) is the OWL code Semantic web technology Model-driven applications vs. OO technology Model-developed applications © Copyright 2007-2009 TopQuadrant Inc. Slide 14
  59. 59. OO Development – Progressive Design and Transformation of Classes into Code Requirements Analysis Objects Design Objects Concepts Use Cases Class Code (ST) No behavior is VOPOS or CRC CRC described anywhere – only inferencing Scenarios Method Code Expected Object Responsibilities Object Services Method Code Behavior (public interface) (signatures) Natural Language Refactoring Write code that fulfills Contract Validation Add Signatures the defined signatures, Object Discovery Adapt to Constraints Adding private/helper Human Effort Pick Mechanisms Methods as needed © Copyright 2007-2009 TopQuadrant Inc. Slide 15
  60. 60. Summary Table: Understanding the “Lingo” OO Object Technology Semantic Technology ST Term Term Class A “Factory for instances” Definition of a set of Class Definition of behavior individuals. Uses open world (methods, values). approach – defines some, but Defines all the attributes not necessarily all possible and associations. properties of its members. Instance Member of one direct Member of one or more Individual or class, responds to all classes, as determined by the Instance methods defined in the instance property values and class class definition Attribute Data encapsulated with Data describing an individual DatatypeProperty an instance. Defined only (or instance). Defined globally. for the members of the Association class Reference pointer from Reference from one RDF ObjectProperty one object instance to resource to another. Defined another. Defined only for globally. the members of the class Inheritance Methods and properties Domains and ranges inherits Inference inherit down up. OWL constraints inherit © Copyright 2007-2009 TopQuadrant Inc. down. Slide 16
  61. 61. Semantic Web – OO Gotchas! In the Semantic Web, you infer the class of an object. The class of an object can change: over time with what you know/believe with whom you trust Properties are first-class objects (independent of classes!) Properties form hierarchies as well as classes No behavior is described anywhere – only inferencing Multiple set membership is commonplace No OO inheritance © Copyright 2007-2009 TopQuadrant Inc. Slide 17
  62. 62. OWL / RDFS Preview (for Comparison) owl:inverseOf ‘child inverseOf parent’ Elizabeth has child Charles, therefore Charles has parent Elizabeth owl:transitiveProperty Elizabeth has descendant Charles, Charles has descendant Andrew, therefore Elizabeth has descendant Andrew rdfs:subPropertyOf ‘child subPropertyOf descendant’ Elizabeth has child Charles, therefore has descendant Charles © Copyright 2007-2009 TopQuadrant Inc. Slide 18
  63. 63. Semantic vs Relational Comparing Semantic Technology and Relational Database Technology © Copyright 2007-2008 TopQuadrant Inc. Slide 19
  64. 64. Data in a spreadsheet Person Company Melli Annamalai Oracle Xavier Lopez Oracle Dean Allemang TopQuadrant Mike Uschold Boeing Ora Lassila Nokia © Copyright 2007-2009 TopQuadrant Inc. Slide 20
  65. 65. Same data in a relational database Give each entity a number (a ‘key’) so you Express Person Table have an unambiguous relationships by way to talk about it. associating these ID Name numbers together in another table. 1 Melli Annamalai Company Table Works For ID Name 2 Xavier Lopez 1 1 1 Oracle 3 Dean Allemang 2 1 2 TopQuadrant 3 2 4 Mike Uschold 3 Boeing 4 3 4 Nokia 5 4 5 Ora Lassila © Copyright 2007-2009 TopQuadrant Inc. Slide 21
  66. 66. Same data in a relational database Works For Company Table Person Table 1 1 ID Name ID Name 2 1 1 Oracle 1 Melli Annamalai 3 2 2 TopQuadrant 4 3 3 Boeing 2 Xavier Lopez 5 4 4 Nokia 3 Dean Allemang Country Based in ID Name 4 Mike Uschold 1 1 1 USA 2 1 2 Finland 5 Ora Lassila 3 1 4 2 © Copyright 2007-2009 TopQuadrant Inc. Slide 22
  67. 67. Suppose (as a simplification) that we know that people live in the country where their employer is based. Query:SELECT all the people and the countries where List p.name, s.name they FROM employment.person p, live Person p works for company c employment.company c, employment.country s, employment.basedIn bi, It is the ‘person’ field of the employment.worksFor wf worksFor table that WHERE corresponds to the person wf.person = p.id AND It is the ‘company’ field of wf.company = c.id AND the worksFor table that bi.company = c.id AND corresponds to the bi.country = s.id ; company © Copyright 2007-2009 TopQuadrant Inc. Slide 23
  68. 68. Same data in a graph Melli Annimalai Oracle Xavier Lopez USA TopQuadrant Dean Allemang Finland Boeing Mike Uschold label worksFor (person, company) basedIn (company, country) Ora Lassila Nokia © Copyright 2007-2009 TopQuadrant Inc. Slide 24
  69. 69. Suppose (as a simplification) that we know that people live in the country where their employer is based. Query:SELECT all the?sname and the countries where List ?pname people they WHERE live Person p works for company c { ?p :worksFor ?c. ?c :basedIn ?s. ?p rdfs:label ?pname . ?s rdfs?label ?sname .} It is the ‘person’ field of the The ?p that :worksFor worksFor table that something is a Person corresponds to the person (in the schema) © Copyright 2007-2009 TopQuadrant Inc. Slide 25
  70. 70. RDFS and OWL are about Rich Relationships in Data Information Given X-Ray Machine located in Room A2003 Room A2003 located in ATA Building Information Inferred Where are the relationships? X-Ray Machine located in ATA Building Relationship Model Question “located in” is a transitiveProperty Where is the X-Ray Machine located? Relationships are explicit in the Answer model and directly available to applications! In ATA Building © Copyright 2007-2008 TopQuadrant Inc. Slide 26
  71. 71. OWL has many Build-in Functions for modeling Relationships Information Given X-Ray Machine stored in Room A2003 Room A2003 located in ATA Building Information Inferred X-Ray Machine located in Room 2003 X-Ray Machine located in ATA Building Relationship Model Question Where is the X-Ray Machine “located in” is a transitiveProperty located? “stored in” is a subPropertyOf “located in” Answer Also inverse, functional, local In ATA Building contextual constraints, … Still works! © Copyright 2007-2009 TopQuadrant Inc. Slide 27
  72. 72. Getting the same result with a relational database Equipment Table ID Equipment Name Question Relationships are in Where is the X-Ray IDQ X-Ray Machine documents and in Machine located? collective memories - Building Table not available to applications! Develop a Query Room Building A2003 ATA Building SELECT Building FROM Equipment Table, Building Table, Room_Equipment Table Room_Equipment Table WHERE Equipment Name = “X- Room_ID EQ_ID Data Definition Statements? Applications do not use them, they are Ray Machine” and ID = EQ_ID not descriptive and their scope is a A2003 IDQ single database and Room = Room_ID Data Dictionary? Data Registry? Answer Where are the They are for human, not computer use In ATA Building relationships? © Copyright 2007-2009 TopQuadrant Inc. Slide 28
  73. 73. Change happens… Information Given Room A2003 located in ATA Building X-Ray Machine located in Room A2003 Information Inferred Room A2003 part of Dr Smith’s Office Room A2003 located in Dr. Smith’s Office located in ATA Building Dr. Smith’s Office Room A2003 located in ATA Building X-Ray Machine located in ATA Building Relationship Model Question “located in” is a transitiveProperty Where is the X-Ray “part of” is a subPropertyOf “located in” Machine located? Answer new In ATA Building © Copyright 2007-2009 TopQuadrant Inc. Slide 29
  74. 74. Accommodating change with RDB requires database changes AND new queries Equipment Table ID Equipment Name Equipment Table IDQ X-Ray Machine ID Equipment Name IDQ X-Ray Machine Building Table Business Name ID Building Building Table Dr Smith MDS ATA Building Room Building A2003 ATA Building Room_Equipment Table Room ID Equipment ID A2003 IDQ Room_Equipment Table Room_ID EQ_ID Room_Business Table A2003 IDQ Room_ID Bus_ID A2003 MDS © Copyright 2007-2009 TopQuadrant Inc. Slide 30
  75. 75. Accommodating change with RDB requires database changes AND new queries Equipment Table ID Equipment Name IDQ X-Ray Machine Question Where is the X-Ray Machine located? Building Table Business Name ID Building Using the same query: Dr Smith MDS ATA Building SELECT Building Room_Equipment Table FROM Equipment Table, Room ID Equipment ID Building Table, A2003 IDQ Room_Equipment Table WHERE Equipment Name = “X- Room_Business Table Ray Machine” and ID = EQ_ID and Room = Room_ID Room_ID Bus_ID Answer A2003 MDS ? © Copyright 2007-2009 TopQuadrant Inc. Slide 31
  76. 76. Comparing two approaches RDB Semantic Model (Ontology) Database must be designed Ontology must be designed to Ability to to answer the questions answer the questions Answer Specific, typically complex, Queries can be generic and Questions queries must be developed very simple Inflexible: Flexible: Ability to Database structure must be Ontology can be easily extended modified so it can continue so it can continue to answer new Accommoda to answer the questions questions te Change Queries must be re-written No data porting required Data must be ported Can be very fast with proper Not as fast, but improving, tuning – mature technology: tuning does not affect Known optimization flexibility: Processing approaches Adding more processing Speed Certain queries, such as multi power and distributed computation helps table joins and self joins are known to cause problems Performs better than RDBMS for certain query types © Copyright 2007-2009 TopQuadrant Inc. Slide 32
  77. 77. Key differences in the representation of relationships RDB Semantic Model (Ontology) Relationships are either 1:1, By default all relationships are many:1 or many:many many:many Many:many relationships must be Functional properties and Cardinality of broken into many:1 relationships cardinality restrictions are used to relationships by creating join tables specify 1:1, many:1 as well as other cardinalities It is possible to specify, for example, 1:4 or min 2, etc. Additional information about the Relationship is reified (made into a Information relationship is represented by the class) bearing extra columns in the join table Additional information is relationships represented as properties of the class Implicit Explicit Embedded in the name of the Care is taken to name a relationship join table or in the name of the in a way that its nature and The nature of column intentions are well understood relationships Typically these names are not designed for ease of understanding of the nature of © Copyright 2007-2009 TopQuadrantthe relationship Inc. Slide 33
  78. 78. Another Key Capability of Semantic Web Technology is Managing Distributed Data Information does not have to be in a single data source Information about equipment can be in one place Information about buildings, addresses and doctor offices in a different place RDF provides and infrastructure for merging and unifying data in a consistent way © Copyright 2007-2009 TopQuadrant Inc. Slide 34
  79. 79. Relational and Semantic Technology can work well together: it is not necessarily one or the other! Semantic Application Interaction Logic Application Logic Semantic Interface WS Semantic Hub Schema Enterprise Query Translation Ontology Ontology Models Models Models Mapping Mapping Mapping Mapping Legacy WS WS WS WS Systems SI SI SI SI IL IL ERP Data AL AL Warehouse BL CRM BL PLM © Copyright 2007-2009 TopQuadrant Inc. Slide 35
  80. 80. TopQuadrant Semantic Web Technology Training Series TopQuadrant in collaboration with Jim Hendler presents: “Getting Ready for the Semantic Web with TopBraid Suite” Module IIa-4: Using Semantic Standards, Languages and TopBraid Tools for Modeling and Querying Querying RDF with SPARQL
  81. 81. Query Languages Familiar query languages: SQL XQuery SPARQL is similar to these in that it allows one to specify patterns of data SPARQL differs in syntax, e.g., no notion of “JOIN” © Copyright 2007-2009 TopQuadrant Inc. Slide 2
  82. 82. Extracting information from RDF RDF is a graph structure How do I get information from it? Where is Stratford? Who married the person who wrote King Lear?? Did the person who wrote Hamlet live in a Hamlet? © Copyright 2007-2009 TopQuadrant Inc. Slide 3
  83. 83. Querying some sample data Table: Play ID Title Written By Year 1 The Tempest Shakespeare 1611 2 Romeo and Juliet Shakespeare 1595 3 As You Like It Shakespeare 1599 4 Edward II Marlowe 1592 5 Dido, Queen of Carthage Marlowe 1586 6 Eastward Ho Johnson 1605 7 A Game at Chess Middleton 1624 8 Sir Thomas More Munday 1592 The Tragical History of 9 Marlowe 1604 Doctor Faustus © Copyright 2007-2009 TopQuadrant Inc. Slide 4
  84. 84. Same data viewed as a graph Play … The Tempest Row1 Shakespeare Romeo and Juliet Row 2 Marlowe As You Like It Row 3 Johnson Edward II Row 4 Middleton Dido Row 5 Munday Eastward Ho Row 6 1586 writtenBy 1592 Game at Chess Row 7 1595 year 1599 Sir Thomas More Row 8 title 1604 1605 rdf:type Dr. Faustus Row 9 1611 1624 © Copyright 2007-2009 TopQuadrant Inc. Slide 5
  85. 85. Titles of plays written by Shakespeare The Tempest Row 1 Shakespeare Romeo and Juliet Row 2 Marlowe As You Like It Row 3 Johnson Edward II Row 4 Middleton Dido Row 5 Munday Eastward Ho Row 6 1586 writtenBy 1592 Game at Chess Row 7 1595 year 1599 Sir Thomas More Row 8 title 1604 1605 Dr. Faustus Row 9 1611 1624 © Copyright 2007-2009 TopQuadrant Inc. Slide 6
  86. 86. Matching data with graph patterns The Tempest Row1 Shakespeare Romeo and Juliet Row 2 As You Like It Row 3 ?x ?y Shakesepeare writtenBy ?x ?y How do we know that year The Tempest Row 1 these things are plays? title Romeo and Juliet Row 2 What is a better heading for column “?x”? As You Like It Row 3 © Copyright 2007-2009 TopQuadrant Inc. Slide 7
  87. 87. A more complex graph pattern The Tempest Row 1 Shakespeare Romeo and Juliet Row 2 Marlowe As You Like It Row 3 Johnson Edward II Row 4 Middleton Dido Row 5 Munday Eastward Ho Row 6 1586 writtenBy 1592 year Game at Chess Row 7 1595 1599 title Sir Thomas More Row 8 1604 1605 Dr. Faustus Row 9 1611 1624 ?x ?z ?a The Tempest Tempest Shakespeare 1611 ?x ?y ?z As You Like It Like Shakespeare 1599 Dido Dido Marlowe Marlowe 1586 ?a Thomas More Munday 1592 © Copyright 2007-2009 TopQuadrant Inc. etc. Slide 8
  88. 88. Representing graph patterns Graph patterns are represented just like graphs – in triples! Variables allowed as well as resources: ?x ?y :Shakespeare ?y :title ?x. ?y :writtenBy :Shakespeare . ?title ?play :Shakespeare ?play :title ?title. writtenBy ?play :writtenBy :Shakespeare . year title © Copyright 2007-2009 TopQuadrant Inc. Slide 9
  89. 89. More graph patterns ?x ?y ?z ?a writtenBy year ?y :title ?x. ?y :writtenBy ?z. title ?y :year ?a. ?title ?y ?playwright ?year writtenBy ?y :title ?title. year ?y :writtenBy ?playwright. title ?y :year ?year. © Copyright 2007-2009 TopQuadrant Inc. Slide 10
  90. 90. More graph patterns “The names of two playwrights who wrote plays in the same year” Play ?play2 ?playwright2 ?playwright1 ?play1 ?year ?play1 rdf:type :Play . writtenBy ?play2 rdf:type :Play . ?play1 :writtenBy ?playwright1 . year ?play2 :writtenBy ?playwright2 . title ?play1 :year ?year . ?play2 :year ?year . rdf:type This finds all plays, so need some way to state that ?playwright1 is different than ?playwright2 (FILTER) © Copyright 2007-2009 TopQuadrant Inc. Slide 11
  91. 91. Building Queries from Data “The names of two playwrights who wrote plays in the same year” Play Sir Thomas More Munday Marlowe Edward II 1592 ?play1 rdf:type :Play . writtenBy ?play2 rdf:type :Play . ?play1 :writtenBy ?playwright1 . year ?play2 :writtenBy ?playwright2 . title ?play1 :year ?year . ?play2 :year ?year . This is the basis of the rdf:type automatic query builder in TopBraid Composer and Ensemble © Copyright 2007-2009 TopQuadrant Inc. Slide 12
  92. 92. A more complex graph pattern Play … The Tempest Row 1 Shakespeare Romeo and Juliet Row 2 Marlowe As You Like It Row 3 Johnson Edward II Row 4 Middleton Dido Row 5 Munday Eastward Ho Row 6 1586 writtenBy 1592 Game at Chess Row 7 1595 year 1599 title Sir Thomas More Row 8 1604 1605 rdf:type Dr. Faustus Row 9 1611 1624 Play ?play2 ?playwright2 ?playwright1 ?play1 ?playwright1 ?playwright2 ?year Marlowe Munday © Copyright 2007-2009 TopQuadrant Inc. Slide 13
  93. 93. Components of a Query Selection mode and variables SELECT ?place SELECT ?playwright1 ?playwright2 CONSTRUCT {?playwright rdf:type :Person} Triple patterns – like a triple, but with named variables instead of some parts ?play :title ?title . ?play :playwright :Shakespeare . ?play :year ?year . SPARQL standard is written similar to N3 ?play1 rdf:type :Play . Filters ?play2 rdf:type :Play . ?play1 :writtenBy ?playwright1 . numerical comparisons, calculations ?play2 :writtenBy ?playwright2 . ?year > 1600 ?play1 :year ?year . ?play2 :year ?year . © Copyright 2007-2009 TopQuadrant Inc. FILTER (?playwright1 != Slide 14
  94. 94. Query Syntax Bring it all together to form a real query: SELECT ?place WHERE { :Stratford :isIn ?place .} Where is Stratford? SELECT ?spouse WHERE { ?spouse :married ?author . Who married the person who ?author :wrote :KingLear .} wrote King Lear? SELECT ?place WHERE Did the person who wrote { ?author :wrote :Hamlet . Hamlet live in a Hamlet? ?author :livedIn ?place . ?place rdf:type geo:Hamlet . } Separates graph triples Best practice: end every triple with a '.' © Copyright 2007-2009 TopQuadrant Inc. Slide 15
  95. 95. Filters “Shakespearean plays written after 1600” You can only filter on values you have matched in the WHERE clause! First, find Shakespearean plays and the years they were written: writtenBy ?title ?play Shakespeare year title ?year SELECT ?title ?year WHERE { ?play :title ?title . ?title ?year ?play :writtenBy :Shakespeare . The Tempest 1611 ?play :year ?year . Romeo and Juliet 1595 FILTER (?year > 1600) As You Like It 1599 } © Copyright 2007-2009 TopQuadrant Inc. Slide 16
  96. 96. Optional Patterns “Titles and authors of all plays” Suppose we have some plays whose author is unknown: ID title writtenBy year 101 Maid’s metamporphosis 1600 102 Revenger’s Tragedy 1607 4 Edward II Marlowe 1592 Must match… Optional match writtenBy ?title ?play ?author year title SELECT ?title ?author WHERE {?play :title ?title . ?title ?author OPTIONAL {?play :writtenBy ?author .} Maid’s metamporphosis } Revenger’s Tragedy Edward II Marlowe © Copyright 2007-2009 TopQuadrant Inc. Slide 17
  97. 97. Negation “Titles of anonymous plays” ID title writtenBy year 101 Maid’s metamporphosis 1600 102 Revenger’s Tragedy 1607 writtenBy ?title ?play ?author year title Filter out those for which the author was found using the filter function “bound”: The variable ?author was ?title SELECT ?title not bound to a value Maid’s metamporphosis WHERE {?play :title ?title . Revenger’s Tragedy OPTIONAL {?play :writtenBy ?author .} FILTER (!bound (?author)) } © Copyright 2007-2009 TopQuadrant Inc. Slide 18
  98. 98. Searching for Literals Previous queries matched a variable (e.g. ?title) find something with a specific literal (xsd) value Who wrote “A Game at SELECT ?author Chess”? Order matters: each graph WHERE { ?play :title "A Game at Chess" . pattern further restricts the ?play :writtenBy ?author . } overall match SELECT ?author WHERE { ?play :title "A Game at Chess"^^xsd:string . ?play :writtenBy ?author . } specify xsd type SELECT ?author WHERE {?play :title ?title . Regular expression defined by XQUERY FILTER (regex(?title, "a game", "i")) . 1.0 } regex(?title, "[a-zA-Z]{2}[aeiou]s{2}$”) matches when end of string is “Chess” (as © Copyright 2007-2009 TopQuadrant Inc. well as other string combinations) 19 Slide
  99. 99. Union Find all plays written by Shakespeare either in 1611 or 1595 SELECT ?play ?title ?year WHERE { { ?play :writtenBy :Shakespeare . ?play :title ?title . ?play :year "1611"^^xsd:string . The query matches two different graph patterns: } 1.Matches ?play and ?title with specified :year UNION 2.Matches ?play and ?year filtered by ?year { ?play :writtenBy :Shakespeare ; ?play has different binding in each of the graph :year ?year . patterns FILTER(regex(?year, "1595")) . } ?play ?title ?yea } :Play1 The Tempest r :Play2 1595 © Copyright 2007-2009 TopQuadrant Inc. Slide 20
  100. 100. Query Forms SELECT returns matches for specified variables CONSTRUCT returns a graph that includes triples constructed from specified variables ASK true if a match to the graph pattern is found DESCRIBE returns a graph (instead of selecting “columns”) – not supported by TBC © Copyright 2007-2009 TopQuadrant Inc. Slide 21
  101. 101. ASK ASK returns a Boolean value based on whether WHERE clause finds data Were any plays written after 1600? Most useful in programs Result displayed in status bar SPIN SPARQLMotion, JSP, etc. © Copyright 2007-2009 TopQuadrant Inc. Slide 22
  102. 102. CONSTRUCT SPARQL queries can build new sets of triples based on patterns WHERE clause exactly as before CONSTRUCT returns a triple pattern Subtly powerful: Under these conditions, add these triples Basically what reasoners do (datalog) plays are written by playwrights CONSTRUCT {?person rdf:type :playwright} WHERE { ?play :writtenBy ?person . ?play rdf:type :Play .} © Copyright 2007-2009 TopQuadrant Inc. Slide 23
  103. 103. Constructing new triples with SPARQL Play 1 Shakespeare Play 2 Marlowe Play 3 Johnson Playwright Play 4 Middleton Play Play 5 Munday Play 6 writtenBy rdf:type Play 7 Play 8 Play 9 SELECT CONSTRUCT Play ?pla ?person ?person Playwright y Same binding re-used from body to head © Copyright 2007-2009 TopQuadrant Inc. Slide 24
  104. 104. TopQuadrant Semantic Web Technology Training Series TopQuadrant in collaboration with Jim Hendler presents: “Getting Ready for the Semantic Web with TopBraid Suite” Module IIa-3: Using Semantic Standards, Languages and TopBraid Tools for Modeling and Querying SKOS – Simple Knowledge Organization System
  105. 105. What is a Knowledge Organization System? A means of organizing and communicating terminology about a domain Controlled Vocabulary Taxonomy Thesaurus Thesaurus standards NISO Z39.19, ISO 2788-1986(E), ISO 5964-1985(E) Provide for relationships between terms • BT, NT, RT • Preferred terms, alternate terms Monolingual, Multilingual, hierarchical © Copyright 2007-2009 TopQuadrant Inc. Slide 2
  106. 106. Vocabulary Uses Tagging, e.g.: del.icio.us, Flickr West Key Number System Library of Congress etc. Entity Extraction, e.g.: Calais Allow one set of expert users (‘catalogers’) to inform another set (information customers) to communicate about the content of information items (documents, photos, web pages, etc.) Data Modeling Data dictionaries, schemas Spreadsheet columns Supports consistency in data modeling, promoting interoperability. © Copyright 2007-2009 TopQuadrant Inc. Slide 3
  107. 107. Agreeing on terms Why can’t everyone just agree to use terms the same way? … Everyone has their own business processes and stakes. Disagreement is legitimate! © Copyright 2007-2009 TopQuadrant Inc. Slide 4
  108. 108. Simple Knowledge Organization System SKOS is the RDF standard for Knowledge Organization Systems Allows different groups to organize terminology… … while allowing them to link to one another “The St. Louis notion of ‘Customer’ is broader than the New York notion of ‘Customer’” You can’t even have this discussion, if you don’t recognize that there are actually two contexts for the word “Customer”! © Copyright 2007-2009 TopQuadrant Inc. Slide 5
  109. 109. Mapping terms broader match “Customer” “Customer” © Copyright 2007-2009 TopQuadrant Inc. Slide 6
  110. 110. SKOS Resources Qname label Abbreviation (where applicable) skos:broader “has broader term” BT skos:narrower “has narrower term” NT skos:related “has related term” RT skos:broadMatch “has broader match” skos:narrowMatch “has narrower match” skos:prefLabel “preferred label” skos:altLabel “alternative label” © Copyright 2007-2009 TopQuadrant Inc. Slide 7
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×