SlideShare uma empresa Scribd logo
1 de 73
Baixar para ler offline
Releasing
   Relational Data to
      the Semantic Web


                          Alex Miller
               amiller@revelytix.com

           1
Semantic web
Relational data
  Federation
    HREIW
   Analytics

       2
There are things we wish
      to describe.


           3
We need some way to
 identify each thing.


          4
A URI is abo ut
                  "identifying" things,
                                        not
                 "locating" things (a
                                      URL).




On the web, we identify
  things with a URI.


           5
dbp:Chicago_(band)




dbp:Wrigley_Field
                                                        dbp:The_Blues_Brothers_(film)



                              dbp:Chicago




dbp:Chicago_Cubs                                             dbp:Barack_Obama

                                dbp:Pizza

                    dbp: http://dbpedia.org/resource/

                                   6
Things are more
interesting if we relate
         them.

Relationships are also
 described by a URI.

           7
dbp:Chicago_(band)
                                                                                          dbp:The_Blues_Brothers_(film)
  dbp:Wrigley_Field


                                                                                      n
                       db                                                          tio
                         po                                                     oca
                            :lo
                                c                                             _l
                                                                             m
                                    at
                                       ion                               :fil
                                                                      ie
                                                                   ov
                                                                  m

dbpo:owner

                                                dbp:Chicago
                                                                    dbp
                                                                       o:r
                                                                          e si
                                                                              den
                                                                                 c       e
    dbp:Chicago_Cubs
                                                                                             dbp:Barack_Obama

                                                 dbp:Pizza


                                      dbp: http://dbpedia.org/resource/
                                     dbpo: http://dbpedia.org/ontology/

                                                     8
Triple
<subject> <predicate> <object>




              9
Subject                                       dbp:Chicago_(band)
                                                                                           dbp:The_Blues_Brothers_(film)
 dbp:Wrigley_Field


                       Predicate                                                       n
                       db                                                           tio
                         po                                                       ca
                              :lo                                                o
                                    ca                                         _l
                                                                              m
                                      tio                                  fil
                                                          Object
                                                                          :
                                          n                            ie
                                                                    ov
                                                                   m

dbpo:owner

                                                dbp:Chicago
                                                                     dbp
                                                                        o:r
                                                                           e si
                                                                               den
                                                                                  c       e
    dbp:Chicago_Cubs
                                                                                              dbp:Barack_Obama

                                                  dbp:Pizza


                                       dbp: http://dbpedia.org/resource/
                                      dbpo: http://dbpedia.org/ontology/

                                                     10
<subject> <predicate> <object>

dbp:Wrigley_Field dbpo:location dbp:Chicago

   resource        resource     resource
                                   or
                                  value


                     11
dbp:Chicago_(band)
                                                                                          dbp:The_Blues_Brothers_(film)
  dbp:Wrigley_Field


                                                                                      n
                       db                                                          tio
                         po                                                     oca
                            :lo
                                c                                             _l
                                                                             m
                                    at
                                       ion                               :fil
                                                                      ie
                                                                   ov
                                                                  m

dbpo:owner

                                                dbp:Chicago
                                                                    dbp
                                                                       o:r
                                                                          e si
                                                                              den
                                                                                 c       e
    dbp:Chicago_Cubs
                                                                                             dbp:Barack_Obama

                                                 dbp:Pizza


                                      dbp: http://dbpedia.org/resource/
                                     dbpo: http://dbpedia.org/ontology/

                                                    12
Congratulations!
 You now know
      RDF.


       13
If things and relationships
   can be defined by any
   URI, how do we know
what we're talking about?


             14
We need metadata.



        15
Specifically, we need a
vocabulary of common
 terms that describe
       our data.


           16
A class describes a
group of things that
  share common
    properties.


         17
ex:City



              is a                           is a                       is a




dbp:San_Francisco                    dbp:Chicago                           dbp:Saint_Louis


                     dbp: http://dbpedia.org/resource/
                     ex: http://example.org/ontology/
                     rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
                     rdfs: http://www.w3.org/2000/01/rdf-schema#

                                           18
ex:City


                                                                          rdf:type
            rdf:type                           rdf:type




dbp:San_Francisco                      dbp:Chicago                             dbp:Saint_Louis


                       dbp: http://dbpedia.org/resource/
                       ex: http://example.org/ontology/
                       rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
                       rdfs: http://www.w3.org/2000/01/rdf-schema#

                                             19
rdfs:Class

                                               rdf:type



                                        ex:City


                                                                          rdf:type
            rdf:type                           rdf:type




dbp:San_Francisco                      dbp:Chicago                             dbp:Saint_Louis


                       dbp: http://dbpedia.org/resource/
                       ex: http://example.org/ontology/
                       rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
                       rdfs: http://www.w3.org/2000/01/rdf-schema#

                                             20
rdf:type
               ex:Location                         rdfs:Class

                        rdfs:subClassOf

                                      rdf:type
                  ex:City                          rdfs:Class




dbp: http://dbpedia.org/resource/
ex: http://example.org/ontology/
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
rdfs: http://www.w3.org/2000/01/rdf-schema#

                      21
Classes let us talk about
kinds of things. Now we
   need some way to
   describe attributes.


            22
ex:City



                                              rdf:type




                    ex:country                             ex:founded
dbp:United_States                                                        1837


                                      dbp:Chicago




                      dbp: http://dbpedia.org/resource/
                      ex: http://example.org/ontology/
                      rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
                      rdfs: http://www.w3.org/2000/01/rdf-schema#

                                            23
rdfs:do
ex:City                main
                                                    rdfs:range
                              rdf:Property                        xsd:gYear


    rdf:type
                        rdf:type



                      ex:founded
                                            1837


    dbp:Chicago




               dbp: http://dbpedia.org/resource/
               ex: http://example.org/ontology/
               rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
               rdfs: http://www.w3.org/2000/01/rdf-schema#

                                     24
Congratulations!
 You now know
  RDF Schema.


       25
How do we find stuff in
     this data?

       SPARQL


           26
ex:Baseball_Team                ex:Stadium                          ex:City


  rdf:type                    rdf:type                        rdf:type



                 dbpo:owner                        dbpo:location


                                                                   dbp:Chicago
  dbp:Chicago_Cubs
                               dbp:Wrigley_Field




                        dbp: http://dbpedia.org/resource/
                       dbpo: http://dbpedia.org/ontology/

                                         27
ex:Stadium                         ex:City


                      rdf:type                        rdf:type



         dbpo:owner                   dbpo:location
?owner                   ?stadium                           ?city




                                 28
ex:Stadium                                 ex:City

?stadium rdf:type ex:Stadium .                     ?city rdf:type ex:City .
                                 rdf:type                                rdf:type



                    dbpo:owner                           dbpo:location
   ?owner                            ?stadium                                     ?city

             ?owner dbpo:owner ?stadium .        ?stadium dbpo:location ?city .




                                            29
ex:Stadium                                 ex:City

  ?stadium rdf:type ex:Stadium .                     ?city rdf:type ex:City .
                                   rdf:type                                rdf:type



                      dbpo:owner                           dbpo:location
     ?owner                            ?stadium                                     ?city

               ?owner dbpo:owner ?stadium .        ?stadium dbpo:location ?city .



SELECT ?owner ?stadium ?city
WHERE {
  ?owner dbpo:owner ?stadium .
  ?stadium dbpo:location ?city .
  ?stadium rdf:type ex:Stadium .
  ?city rdf:type ex:City .
}
                                              30
Unions
Joins                   SPARQL
Outer joins
Filter with criteria
Project expressions
Sort
Duplicate removal
Slice (limit / offset)
Aggregates (grouping, etc)
Subqueries
               22
               31
Semantic web
Relational data
  Federation
    HREIW
   Analytics

       32
Sounds interesting.
 But my data is in a
relational database!


         33
Music Database
Musicians:
 MID         First       Last        Inst_ID
   1     Eddie         Van Halen       10
   2     Yo Yo            Ma           20
   3     Kenny            G            30




                      Instruments:     IID     Instrument     Type
                                       10        Guitar      String
                                       20        Cello       String
                                       30      Saxophone    Woodwind



                                      34
Musician Schema
    rdfs:Class                             rdf:Property

 rdf:type                                 rdf:type


                    rdfs:domain           music:firstName
 music:Musician         rdfs:doma
                                 in

                           rdfs           music:lastName
                                :dom
                                    ain

                   rdfs:range               music:plays
music:Instrument         rdfs:dom
                                 ain
                        rdfs
                             :do
                                          music:instName
                                mai
                                   n

                                          music:instType



                           35
Triples From Tables
    Musicians:                                     Instruments:
      MID    First      Last       Inst_ID           IID    Instrument     Type
       1     Eddie   Van Halen       10               10      Guitar      String
       2     Yo Yo      Ma           20               20      Cello       String
       3     Kenny       G           30               30    Saxophone    Woodwind



  Turn each key into a resource and specify the proper
  type of each resource:

artist:1 rdf:type music:Musician             instrument:10 rdf:type music:Instrument
artist:2 rdf:type music:Musician             instrument:20 rdf:type music:Instrument
artist:3 rdf:type music:Musician             instrument:30 rdf:type music:Instrument



                                             36
Triples From Tables
     Musicians:                                        Instruments:
       MID         First     Last      Inst_ID           IID      Instrument     Type
           1       Eddie   Van Halen     10               10        Guitar      String
           2       Yo Yo      Ma         20               20        Cello       String
           3       Kenny      G          30               30      Saxophone    Woodwind



   Turn each cell into a triple based on the key, property
   (mapped per column), and value:
artist:1       music:firstName "Eddie"            instrument:10   music:instName "Guitar"
artist:1       music:lastName "Van Halen"        instrument:10   music:instType "String"
artist:2       music:firstName "Yo Yo"            instrument:20   music:instName "Cello"
artist:2       music:lastName "Ma"               instrument:20   music:instType "String"
artist:3       music:firstName "Kenny"            instrument:30   music:instName "Saxophone"
artist:3       music:lastName "G"                instrument:30   music:instType "Woodwind"


                                                 37
Triples From Tables
 Musicians:                                  Instruments:
  MID     First     Last      Inst_ID          IID    Instrument     Type
   1      Eddie   Van Halen     10             10       Guitar      String
   2      Yo Yo      Ma         20             20       Cello       String
   3      Kenny      G          30             30     Saxophone    Woodwind



Turn each foreign key reference into a relationship
between the foreign and primary resources.

                  artist:1 music:plays instrument:10
                  artist:1 music:plays instrument:20
                  artist:2 music:plays instrument:30




                                        38
R2RML

• "Relational to RDF Mapping Language"
• RDB2RDF Working Group at W3C
• ETL "data transformation" use case
• Dynamic "query translation" use case
  • SPARQL to SQL

                    39
R2RML Triple Mapping
                                    ain          music:instName
                            rdfs:dom
music:Instrument
                            rdfs:d
                                  omain

                                                   music:instType




           Instruments:
             IID     Instrument           Type
              10          Guitar          String

                              40
R2RML Triple Mapping
                                           ain          music:instName
                                   rdfs:dom
      music:Instrument
                                   rdfs:d
                                         omain

                                                          music:instType




Triples Map       rr:tableName

                 Instruments:
                   IID       Instrument          Type
                    10           Guitar          String

                                     40
R2RML Triple Mapping
                                                   ain          music:instName
                                           rdfs:dom
      music:Instrument
                                           rdfs:d
                                                 omain
                    rr:class                                      music:instType

              Subject Map
          "http://example.com/music/
                   Inst-{iid}"




Triples Map              rr:tableName

                        Instruments:
                           IID         Instrument        Type
                            10           Guitar          String

                                             40
R2RML Triple Mapping
                                                   ain          music:instName
                                           rdfs:dom
      music:Instrument
                                           rdfs:d
                                                 omain
                    rr:class                                      music:instType
                                                                                rr:predicate
              Subject Map
          "http://example.com/music/
                   Inst-{iid}"
                                                                            Predicate Map
                                            Predicate Object
                                                  Map
                                                                              Object Map
Triples Map              rr:tableName

                        Instruments:                                     rr:column

                           IID         Instrument        Type
                            10           Guitar          String

                                             40
@prefix rr: <http://www.w3.org/ns/r2rml#> .
@prefix music: <http://example.com/music/> .
@prefix mapping: <http://example.com/ont/> .

mapping:InstrumentMapping
    a rr:TriplesMapClass;
    rr:tableName "Instruments";
    rr:subjectMap [
       rr:template "http://example.com/music/Inst-{iid}";
       rr:class     music:Instrument
    ];
    rr:predicateObjectMap [
       rr:predicateMap [ rr:predicate music:instName ];
       rr:objectMap      [ rr:column "instrument" ];
    ];
    rr:predicateObjectMap [
       rr:predicateMap [ rr:predicate music:instType ];
       rr:objectMap      [ rr:column "type" ];
    ];
.

                             41
SPARQL translation
    SPARQL        Solutions




          R2RML

    SQL               Results



          Database




             42
Semantic web
Relational data
  Federation
    HREIW
   Analytics

       43
SPARQL Protocol

• Standard HTTP API for calling a SPARQL
  processor

• Supported by all major triple stores and
  query processors



                      44
SPARQL Federation
SELECT ?artist ?song ?buyLink              Return Federated data
WHERE {
 SERVICE <http://listening> {
  ?listened rdf:type listen:event .        Call SPARQL endpoint that tracks
  ?listened listen:artist ?artist .        your listening (like last.fm)
  ?listened listen:song ?song }
 OPTIONAL {
  SERVICE <http://amazon> {                Call Amazon endpoint to get info
    ?isbn rdf:type amaz:mp3 .
                                           on where to download the song.
    ?isbn amaz:artist ?artist .
    ?isbn amaz:song ?song .
    ?isbn amaz:link ?buyLink } } }


                                      45
Service Descriptions




         46
Federator
           SPARQL Endpoint

                                         Ontology and
             Federator                  service registry


 R2RML          Web          SPARQL
Endpoint      Endpoint       Endpoint


  Data           Db           Triple
  base          pedia         Store




                         47
Named graph mapping


• Services can provide named graphs,
  described in their service description

• Federator lets you create federated
  named graphs that map to service
  named graphs


                     48
Data integration


• Performance - data volume from sources
  is key

• Source capabilities
• Source statistics


                      49
Performance concerns:
        data volume
                         SELECT ...
                         FILTER (?age >= 24) ...
Reduction factors:
 •criteria                   Domain
 •minimal projection




                                                           Results
                                                   Query
 •aggregation
 •joins (sometimes)
 •dup removal
                       WHERE Person.age >= 24



                        50
Performance concerns:
    federated joins




          51
Data source capabilities

• SQL support
• Function support
• Function translation
• Inverse functions
• Data type mappings and translations

                      52
Data source statistics


• Table cardinality
• Column selectivity
• Column null density
• Join selectivity


                       53
Semantic web
Relational data
  Federation
    HREIW
   Analytics

       54
HREIW - HR Analysis




         55
“Which Marines that speak French and/
 or French Creole have had at least six
 months since their last deployment?”




                   56
“How many discharges were the
result of the Don’t Ask Don’t Tell
         policy per year?”




                57
“What is the average length of service for
soldiers deployed in Afghanistan vs Iraq?”




                    58
Where’s the data?




        59
Ontologies
                        HR Standards
            HR Domain



Mapping

Sources




                60
Technologies
                                                cs
                                         Analyti


                      y
                                                     HR Standards
             Ontolog
                     ment
            develo p
                        HR Domain
                             SPARQL
                            Federation



Mapping
                                                             Rule
                                                                    s

Sources
          SPARQL to
           database




                                 61
Collaborative Ontologies
                    model




              Domain
              ontology
             wiki      discuss
Ontologist                       Subject Matter
                                    Experts
                diagram


                    discuss




                         62
Ontology Visualization




          63
Semantic web
Relational data
  Federation
    HREIW
   Analytics

       64
RIF
• Rule Interchange Format, W3C recommendation
• Rule = IF - THEN statement
• Used to derive new triples from existing triples
• Dialects
   • Core
   • Framework for Logic Dialects (FLD)
   • Basic Logic Dialect (BLD)
   • Production Rules Dialect (PRD)
• Rex - Revelytix RIF Core implementation

                                 65
Dashboards




    66
Dashboards




    67
Dashboards




    68
Enterprise Semantic Web
• Knoodl - collaborative ontology creation
• OntVis - ontology visualization (OWL)
• Spyder - SPARQL to SQL (RDF, R2RML)
• Federator - SPARQL federation (SPARQL 1.1,
  SPARQL Federation extensions)

• Rex - entailment with rules (RIF)
• Dashboards - analytics, visualization
                        69
More information
• Revelytix - http://revelytix.com
• Knoodl - http://knoodl.com
• OntVis - http://bit.ly/hLm3sd
• Spyder - http://revelytix.com/content/spyder
• Federator - beta coming soon...
• Rex - beta coming soon...


                          70

Mais conteúdo relacionado

Destaque

Collections In Java
Collections In JavaCollections In Java
Collections In Java
Binoj T E
 
Marshmallow Test
Marshmallow TestMarshmallow Test
Marshmallow Test
Alex Miller
 
Java Collections
Java CollectionsJava Collections
Java Collections
parag
 

Destaque (20)

Groovy concurrency
Groovy concurrencyGroovy concurrency
Groovy concurrency
 
Scaling Hibernate with Terracotta
Scaling Hibernate with TerracottaScaling Hibernate with Terracotta
Scaling Hibernate with Terracotta
 
Java Concurrency Gotchas
Java Concurrency GotchasJava Concurrency Gotchas
Java Concurrency Gotchas
 
Cracking clojure
Cracking clojureCracking clojure
Cracking clojure
 
Clojure: The Art of Abstraction
Clojure: The Art of AbstractionClojure: The Art of Abstraction
Clojure: The Art of Abstraction
 
Visualising Data on Interactive Maps
Visualising Data on Interactive MapsVisualising Data on Interactive Maps
Visualising Data on Interactive Maps
 
Concurrent Stream Processing
Concurrent Stream ProcessingConcurrent Stream Processing
Concurrent Stream Processing
 
Tree Editing with Zippers
Tree Editing with ZippersTree Editing with Zippers
Tree Editing with Zippers
 
Strange Loop Conference 2009
Strange Loop Conference 2009Strange Loop Conference 2009
Strange Loop Conference 2009
 
Clojure/West Overview (12/1/11)
Clojure/West Overview (12/1/11)Clojure/West Overview (12/1/11)
Clojure/West Overview (12/1/11)
 
Java collection
Java collectionJava collection
Java collection
 
Scaling Your Cache And Caching At Scale
Scaling Your Cache And Caching At ScaleScaling Your Cache And Caching At Scale
Scaling Your Cache And Caching At Scale
 
07 java collection
07 java collection07 java collection
07 java collection
 
Collections In Java
Collections In JavaCollections In Java
Collections In Java
 
Collection Framework in java
Collection Framework in javaCollection Framework in java
Collection Framework in java
 
Marshmallow Test
Marshmallow TestMarshmallow Test
Marshmallow Test
 
Java Collection framework
Java Collection frameworkJava Collection framework
Java Collection framework
 
Java Collections
Java CollectionsJava Collections
Java Collections
 
Java Collections API
Java Collections APIJava Collections API
Java Collections API
 
Java - Collections framework
Java - Collections frameworkJava - Collections framework
Java - Collections framework
 

Mais de Alex Miller (6)

Java Concurrency Idioms
Java Concurrency IdiomsJava Concurrency Idioms
Java Concurrency Idioms
 
Design Patterns Reconsidered
Design Patterns ReconsideredDesign Patterns Reconsidered
Design Patterns Reconsidered
 
Java 7 Preview
Java 7 PreviewJava 7 Preview
Java 7 Preview
 
Exploring Terracotta
Exploring TerracottaExploring Terracotta
Exploring Terracotta
 
Actor Concurrency
Actor ConcurrencyActor Concurrency
Actor Concurrency
 
Java Concurrency Gotchas
Java Concurrency GotchasJava Concurrency Gotchas
Java Concurrency Gotchas
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

Releasing Relational Data to the Semantic Web

  • 1. Releasing Relational Data to the Semantic Web Alex Miller amiller@revelytix.com 1
  • 2. Semantic web Relational data Federation HREIW Analytics 2
  • 3. There are things we wish to describe. 3
  • 4. We need some way to identify each thing. 4
  • 5. A URI is abo ut "identifying" things, not "locating" things (a URL). On the web, we identify things with a URI. 5
  • 6. dbp:Chicago_(band) dbp:Wrigley_Field dbp:The_Blues_Brothers_(film) dbp:Chicago dbp:Chicago_Cubs dbp:Barack_Obama dbp:Pizza dbp: http://dbpedia.org/resource/ 6
  • 7. Things are more interesting if we relate them. Relationships are also described by a URI. 7
  • 8. dbp:Chicago_(band) dbp:The_Blues_Brothers_(film) dbp:Wrigley_Field n db tio po oca :lo c _l m at ion :fil ie ov m dbpo:owner dbp:Chicago dbp o:r e si den c e dbp:Chicago_Cubs dbp:Barack_Obama dbp:Pizza dbp: http://dbpedia.org/resource/ dbpo: http://dbpedia.org/ontology/ 8
  • 10. Subject dbp:Chicago_(band) dbp:The_Blues_Brothers_(film) dbp:Wrigley_Field Predicate n db tio po ca :lo o ca _l m tio fil Object : n ie ov m dbpo:owner dbp:Chicago dbp o:r e si den c e dbp:Chicago_Cubs dbp:Barack_Obama dbp:Pizza dbp: http://dbpedia.org/resource/ dbpo: http://dbpedia.org/ontology/ 10
  • 11. <subject> <predicate> <object> dbp:Wrigley_Field dbpo:location dbp:Chicago resource resource resource or value 11
  • 12. dbp:Chicago_(band) dbp:The_Blues_Brothers_(film) dbp:Wrigley_Field n db tio po oca :lo c _l m at ion :fil ie ov m dbpo:owner dbp:Chicago dbp o:r e si den c e dbp:Chicago_Cubs dbp:Barack_Obama dbp:Pizza dbp: http://dbpedia.org/resource/ dbpo: http://dbpedia.org/ontology/ 12
  • 13. Congratulations! You now know RDF. 13
  • 14. If things and relationships can be defined by any URI, how do we know what we're talking about? 14
  • 16. Specifically, we need a vocabulary of common terms that describe our data. 16
  • 17. A class describes a group of things that share common properties. 17
  • 18. ex:City is a is a is a dbp:San_Francisco dbp:Chicago dbp:Saint_Louis dbp: http://dbpedia.org/resource/ ex: http://example.org/ontology/ rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# rdfs: http://www.w3.org/2000/01/rdf-schema# 18
  • 19. ex:City rdf:type rdf:type rdf:type dbp:San_Francisco dbp:Chicago dbp:Saint_Louis dbp: http://dbpedia.org/resource/ ex: http://example.org/ontology/ rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# rdfs: http://www.w3.org/2000/01/rdf-schema# 19
  • 20. rdfs:Class rdf:type ex:City rdf:type rdf:type rdf:type dbp:San_Francisco dbp:Chicago dbp:Saint_Louis dbp: http://dbpedia.org/resource/ ex: http://example.org/ontology/ rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# rdfs: http://www.w3.org/2000/01/rdf-schema# 20
  • 21. rdf:type ex:Location rdfs:Class rdfs:subClassOf rdf:type ex:City rdfs:Class dbp: http://dbpedia.org/resource/ ex: http://example.org/ontology/ rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# rdfs: http://www.w3.org/2000/01/rdf-schema# 21
  • 22. Classes let us talk about kinds of things. Now we need some way to describe attributes. 22
  • 23. ex:City rdf:type ex:country ex:founded dbp:United_States 1837 dbp:Chicago dbp: http://dbpedia.org/resource/ ex: http://example.org/ontology/ rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# rdfs: http://www.w3.org/2000/01/rdf-schema# 23
  • 24. rdfs:do ex:City main rdfs:range rdf:Property xsd:gYear rdf:type rdf:type ex:founded 1837 dbp:Chicago dbp: http://dbpedia.org/resource/ ex: http://example.org/ontology/ rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# rdfs: http://www.w3.org/2000/01/rdf-schema# 24
  • 25. Congratulations! You now know RDF Schema. 25
  • 26. How do we find stuff in this data? SPARQL 26
  • 27. ex:Baseball_Team ex:Stadium ex:City rdf:type rdf:type rdf:type dbpo:owner dbpo:location dbp:Chicago dbp:Chicago_Cubs dbp:Wrigley_Field dbp: http://dbpedia.org/resource/ dbpo: http://dbpedia.org/ontology/ 27
  • 28. ex:Stadium ex:City rdf:type rdf:type dbpo:owner dbpo:location ?owner ?stadium ?city 28
  • 29. ex:Stadium ex:City ?stadium rdf:type ex:Stadium . ?city rdf:type ex:City . rdf:type rdf:type dbpo:owner dbpo:location ?owner ?stadium ?city ?owner dbpo:owner ?stadium . ?stadium dbpo:location ?city . 29
  • 30. ex:Stadium ex:City ?stadium rdf:type ex:Stadium . ?city rdf:type ex:City . rdf:type rdf:type dbpo:owner dbpo:location ?owner ?stadium ?city ?owner dbpo:owner ?stadium . ?stadium dbpo:location ?city . SELECT ?owner ?stadium ?city WHERE { ?owner dbpo:owner ?stadium . ?stadium dbpo:location ?city . ?stadium rdf:type ex:Stadium . ?city rdf:type ex:City . } 30
  • 31. Unions Joins SPARQL Outer joins Filter with criteria Project expressions Sort Duplicate removal Slice (limit / offset) Aggregates (grouping, etc) Subqueries 22 31
  • 32. Semantic web Relational data Federation HREIW Analytics 32
  • 33. Sounds interesting. But my data is in a relational database! 33
  • 34. Music Database Musicians: MID First Last Inst_ID 1 Eddie Van Halen 10 2 Yo Yo Ma 20 3 Kenny G 30 Instruments: IID Instrument Type 10 Guitar String 20 Cello String 30 Saxophone Woodwind 34
  • 35. Musician Schema rdfs:Class rdf:Property rdf:type rdf:type rdfs:domain music:firstName music:Musician rdfs:doma in rdfs music:lastName :dom ain rdfs:range music:plays music:Instrument rdfs:dom ain rdfs :do music:instName mai n music:instType 35
  • 36. Triples From Tables Musicians: Instruments: MID First Last Inst_ID IID Instrument Type 1 Eddie Van Halen 10 10 Guitar String 2 Yo Yo Ma 20 20 Cello String 3 Kenny G 30 30 Saxophone Woodwind Turn each key into a resource and specify the proper type of each resource: artist:1 rdf:type music:Musician instrument:10 rdf:type music:Instrument artist:2 rdf:type music:Musician instrument:20 rdf:type music:Instrument artist:3 rdf:type music:Musician instrument:30 rdf:type music:Instrument 36
  • 37. Triples From Tables Musicians: Instruments: MID First Last Inst_ID IID Instrument Type 1 Eddie Van Halen 10 10 Guitar String 2 Yo Yo Ma 20 20 Cello String 3 Kenny G 30 30 Saxophone Woodwind Turn each cell into a triple based on the key, property (mapped per column), and value: artist:1 music:firstName "Eddie" instrument:10 music:instName "Guitar" artist:1 music:lastName "Van Halen" instrument:10 music:instType "String" artist:2 music:firstName "Yo Yo" instrument:20 music:instName "Cello" artist:2 music:lastName "Ma" instrument:20 music:instType "String" artist:3 music:firstName "Kenny" instrument:30 music:instName "Saxophone" artist:3 music:lastName "G" instrument:30 music:instType "Woodwind" 37
  • 38. Triples From Tables Musicians: Instruments: MID First Last Inst_ID IID Instrument Type 1 Eddie Van Halen 10 10 Guitar String 2 Yo Yo Ma 20 20 Cello String 3 Kenny G 30 30 Saxophone Woodwind Turn each foreign key reference into a relationship between the foreign and primary resources. artist:1 music:plays instrument:10 artist:1 music:plays instrument:20 artist:2 music:plays instrument:30 38
  • 39. R2RML • "Relational to RDF Mapping Language" • RDB2RDF Working Group at W3C • ETL "data transformation" use case • Dynamic "query translation" use case • SPARQL to SQL 39
  • 40. R2RML Triple Mapping ain music:instName rdfs:dom music:Instrument rdfs:d omain music:instType Instruments: IID Instrument Type 10 Guitar String 40
  • 41. R2RML Triple Mapping ain music:instName rdfs:dom music:Instrument rdfs:d omain music:instType Triples Map rr:tableName Instruments: IID Instrument Type 10 Guitar String 40
  • 42. R2RML Triple Mapping ain music:instName rdfs:dom music:Instrument rdfs:d omain rr:class music:instType Subject Map "http://example.com/music/ Inst-{iid}" Triples Map rr:tableName Instruments: IID Instrument Type 10 Guitar String 40
  • 43. R2RML Triple Mapping ain music:instName rdfs:dom music:Instrument rdfs:d omain rr:class music:instType rr:predicate Subject Map "http://example.com/music/ Inst-{iid}" Predicate Map Predicate Object Map Object Map Triples Map rr:tableName Instruments: rr:column IID Instrument Type 10 Guitar String 40
  • 44. @prefix rr: <http://www.w3.org/ns/r2rml#> . @prefix music: <http://example.com/music/> . @prefix mapping: <http://example.com/ont/> . mapping:InstrumentMapping a rr:TriplesMapClass; rr:tableName "Instruments"; rr:subjectMap [ rr:template "http://example.com/music/Inst-{iid}"; rr:class music:Instrument ]; rr:predicateObjectMap [ rr:predicateMap [ rr:predicate music:instName ]; rr:objectMap [ rr:column "instrument" ]; ]; rr:predicateObjectMap [ rr:predicateMap [ rr:predicate music:instType ]; rr:objectMap [ rr:column "type" ]; ]; . 41
  • 45. SPARQL translation SPARQL Solutions R2RML SQL Results Database 42
  • 46. Semantic web Relational data Federation HREIW Analytics 43
  • 47. SPARQL Protocol • Standard HTTP API for calling a SPARQL processor • Supported by all major triple stores and query processors 44
  • 48. SPARQL Federation SELECT ?artist ?song ?buyLink Return Federated data WHERE { SERVICE <http://listening> { ?listened rdf:type listen:event . Call SPARQL endpoint that tracks ?listened listen:artist ?artist . your listening (like last.fm) ?listened listen:song ?song } OPTIONAL { SERVICE <http://amazon> { Call Amazon endpoint to get info ?isbn rdf:type amaz:mp3 . on where to download the song. ?isbn amaz:artist ?artist . ?isbn amaz:song ?song . ?isbn amaz:link ?buyLink } } } 45
  • 50. Federator SPARQL Endpoint Ontology and Federator service registry R2RML Web SPARQL Endpoint Endpoint Endpoint Data Db Triple base pedia Store 47
  • 51. Named graph mapping • Services can provide named graphs, described in their service description • Federator lets you create federated named graphs that map to service named graphs 48
  • 52. Data integration • Performance - data volume from sources is key • Source capabilities • Source statistics 49
  • 53. Performance concerns: data volume SELECT ... FILTER (?age >= 24) ... Reduction factors: •criteria Domain •minimal projection Results Query •aggregation •joins (sometimes) •dup removal WHERE Person.age >= 24 50
  • 54. Performance concerns: federated joins 51
  • 55. Data source capabilities • SQL support • Function support • Function translation • Inverse functions • Data type mappings and translations 52
  • 56. Data source statistics • Table cardinality • Column selectivity • Column null density • Join selectivity 53
  • 57. Semantic web Relational data Federation HREIW Analytics 54
  • 58. HREIW - HR Analysis 55
  • 59. “Which Marines that speak French and/ or French Creole have had at least six months since their last deployment?” 56
  • 60. “How many discharges were the result of the Don’t Ask Don’t Tell policy per year?” 57
  • 61. “What is the average length of service for soldiers deployed in Afghanistan vs Iraq?” 58
  • 63. Ontologies HR Standards HR Domain Mapping Sources 60
  • 64. Technologies cs Analyti y HR Standards Ontolog ment develo p HR Domain SPARQL Federation Mapping Rule s Sources SPARQL to database 61
  • 65. Collaborative Ontologies model Domain ontology wiki discuss Ontologist Subject Matter Experts diagram discuss 62
  • 67. Semantic web Relational data Federation HREIW Analytics 64
  • 68. RIF • Rule Interchange Format, W3C recommendation • Rule = IF - THEN statement • Used to derive new triples from existing triples • Dialects • Core • Framework for Logic Dialects (FLD) • Basic Logic Dialect (BLD) • Production Rules Dialect (PRD) • Rex - Revelytix RIF Core implementation 65
  • 72. Enterprise Semantic Web • Knoodl - collaborative ontology creation • OntVis - ontology visualization (OWL) • Spyder - SPARQL to SQL (RDF, R2RML) • Federator - SPARQL federation (SPARQL 1.1, SPARQL Federation extensions) • Rex - entailment with rules (RIF) • Dashboards - analytics, visualization 69
  • 73. More information • Revelytix - http://revelytix.com • Knoodl - http://knoodl.com • OntVis - http://bit.ly/hLm3sd • Spyder - http://revelytix.com/content/spyder • Federator - beta coming soon... • Rex - beta coming soon... 70