RDF and Relational Databases

Slides:



Advertisements
Similar presentations
Dr. Leo Obrst MITRE Information Semantics Information Discovery & Understanding Command & Control Center February 6, 2014February 6, 2014February 6, 2014.
Advertisements

XPointer and HTTP Range A possible design for a scalable and extensible RDF Data Access protocol. Bryan Thompson draft Presented to the RDF.
Digital Repositories – Linked Open Data – the possible Role of D4Science Workshop, December 2010, FAO use cases A tool to create Linked Data providers.
RDF and RDB 1 Some slides adapted from a presentation by Ivan Herman at the Semantic Technology & Business Conference, 2012.
© 2006 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice Use Case: Populating Business Objects.
ESDSWG2011 – Semantic Web session Semantic Web Sub-group Session ESDSWG 2011 Meeting – Semantic Web sub-group session Wednesday, November 2, 2011 Norfolk,
Semantic Web Introduction
RDF and RDB 1 Some slides adapted from a presentation by Ivan Herman at the Semantic Technology & Business Conference, 2012.
™ Suggestions for Semantic Web Interfaces to Relational Databases Mike Dean W3C Workshop on RDF Access to Relational Databases Cambridge,
Michael Povolotsky CMSC491s/691s. What is Virtuoso? Virtuoso, known as Virtuoso Universal Server, is a multi-protocol RDBMS Includes an object-relational.
Triple Stores
Semantic Web Tools Vagan Terziyan Department of Mathematical Information Technology, University of Jyvaskyla ;
An Open Source Linked Data Infrastructure for Publishing Geospatial Data Arif Shaon, Andrew Woolf, Shirley Crompton, Will Rogers, Mike Jackson, Robert.
1 Foundations of Software Design Lecture 27: Java Database Programming Marti Hearst Fall 2002.
DAT702.  Standard Query Language  Ability to access and manipulate databases ◦ Retrieve data ◦ Insert, delete, update records ◦ Create and set permissions.
ONTOLOGY ENGINEERING Lab #9 - November 3, Linking Relational Databases to Ontologies 2  Relational databases are still a common means of storing.
Introduction To Databases IDIA 618 Fall 2014 Bridget M. Blodgett.
Triple Stores.
© 2006 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice Publishing data on the Web (with.
RDF FOR DEVELOPERS Paul Groth Thanks to Eyal Oren, Stefan Schlobach for slides.
Information Integration Intelligence with TopBraid Suite SemTech, San Jose, Holger Knublauch
Rajashree Deka Tetherless World Constellation Rensselaer Polytechnic Institute.
1 Sunitha Ramanujam 1, Anubha Gupta 1, Latifur Khan 1, Steven Seida 2, Bhavani Thuraisingham 1 1 The University of Texas at Dallas 2 Raytheon Company *Funded.
1 HTML and CGI Scripting CSC8304 – Computing Environments for Bioinformatics - Lecture 10.
Workshop – 10, December 2014, Berlin ICCS / NTUA Greece Efthymios Chondrogiannis An Intelligent Ontology Alignment Tool Dealing with Complicated Mismatches.
Improve the way you create, manage and distribute information INNOVATION INSPIRATION Relational database integration with RDF/OWL.
The Semantic Web Web Science Systems Development Spring 2015.
Chapter 3 Querying RDF stores with SPARQL. Why an RDF Query Language? Why not use an XML query language? XML at a lower level of abstraction than RDF.
Dbwebsites 2.1 Making Database backed Websites Session 2 The SQL… Where do we put the data?
ONTOLOGY ENGINEERING Lab #1 - August 25, Lab Syllabus 2  Lab 1 – 8/25: Introduction and Overview of Protégé  Lab 2 – 9/8: Building an ontology.
1 Foundations V: Infrastructure and Architecture, Middleware Deborah McGuinness TA Weijing Chen Semantic eScience Week 10, November 7, 2011.
Open Data Protocol * Han Wang 11/30/2012 *
Relational Databases to RDF (a.k.a RDB2RDF) Juan F. Sequeda Dept of Computer Science University of Texas at Austin.
Master Informatique 1 Semantic Technologies Part 11Direct Mapping Werner Nutt.
Semantic Web State of SemWeb Promotes flexibility, software reuse. SOA Styled architecture that exposes business processes and rules regarding IT.
© 2012 IBM Corporation Best Practices for Publishing RDF Vocabularies Arthur Ryman,
Metadata. Generally speaking, metadata are data and information that describe and model data and information For example, a database schema is the metadata.
Steven Seida D2RQ Blog Integration Lab. Data to RDF Integration Approaches* 1 of 2 *Summarized from Ch 9 of Semantiic Web Programming, 2009, by Hebeler.
RDF and triplestores CMSC 461 Michael Wilson. Reasoning  Relational databases allow us to reason about data that is organized in a specific way  Data.
© Copyright 2008 STI INNSBRUCK RDF Best Practice Best Practice Recipes for Publishing RDF Vocabularies W3C Working.
Oracle Database 11g Semantics Overview Xavier Lopez, Ph.D., Dir. Of Product Mgt., Spatial & Semantic Technologies Souripriya Das, Ph.D., Consultant Member.
Efficient RDF Storage and Retrieval in Jena2 Written by: Kevin Wilkinson, Craig Sayers, Harumi Kuno, Dave Reynolds Presented by: Umer Fareed 파리드.
1 SPARQL A. Emrah Sanön. 2 RDF RDF is quite committed to Semantic Web. Data model Serialization by means of XML Formal semantics Still something is missing!
A Short Tutorial to Semantic Media Wiki (SMW) [[date:: July 21, 2009 ]] At [[part of:: Web Science Summer Research Week ]] By [[has speaker:: Jie Bao ]]
Web Information Systems Modeling Luxembourg, June VisAVis: An Approach to an Intermediate Layer between Ontologies and Relational Database Contents.
OWLED 2008 DC Use of OWL and SWRL for Semantic Relational Database Translation Matthew Fisher, Mike Dean, Greg Joiner {mdean, April 1.
Introduction to the Semantic Web and Linked Data Module 1 - Unit 2 The Semantic Web and Linked Data Concepts 1-1 Library of Congress BIBFRAME Pilot Training.
MyGrid/Taverna Provenance Daniele Turi University of Manchester OMII f2f Meeting, London, 19-20/4/06.
Database Basics BCIS 3680 Enterprise Programming.
Triple Stores. What is a triple store? A specialized database for RDF triples Can ingest RDF in a variety of formats Supports a query language – SPARQL.
Exposing caGrid Data Services as Linked Data Joshua Phillips Alejandra Gonzalez-Beltran Jyoti Pathak October 22, 2009.
Interface for Glyco Vault Functionality and requirements. Initial proposal. Maciej Janik.
RDF David R Newman 15 May 2009.
1 Open Ontology Repository initiative - Planning Meeting - Thu Co-conveners: PeterYim, LeoObrst & MikeDean ref.:
Sales Demo. Demo Overview RDF and Triples D2RQ Overview and Setup Ontology and Mappings Sales Demo Model Inferencing.
Chapter 04 Semantic Web Application Architecture 23 November 2015 A Team 오혜성, 조형헌, 권윤, 신동준, 이인용.
Linked Data Publishing on the Semantic Web Dr Nicholas Gibbins
Slug: A Semantic Web Crawler Leigh Dodds Engineering Manager, Ingenta Jena User Conference May 2006.
RDF and RDB 2 D2RQ.
Developing Linked Data Applications
Linked Data Web that can be processed by machines
Triple Stores.
RDF and RDB 1 Some slides adapted from a presentation by Ivan Herman at the Semantic Technology & Business Conference, 2012.
RDF and RDB 2 D2RQ.
Lifting Data Portals to the Web of Data
Triple Stores.
RDF and RDB 2 D2RQ.
RDF David R Newman 15 July 2009.
Triple Stores.
Semantic-Web, Triple-Strores, and SPARQL
Presentation transcript:

RDF and Relational Databases

Mapping Relational data to RDF Suppose we have data in a relational database that we want to export as RDF Choose an RDF vocabulary to represent the data Define a mapping from the relational tables to RDF Then either: Materialize the RDF triples from the database using the mappings Use a server to dynamically access the relational data given a SPARQL query Use a DBMS that directly supports RDF (e.g., Oracle 11g, DB2)

D2RQ D2RQ exposes relational data as RDF see http://d2rq.org/ D2RQ mapping language file describes the relation between ontology and RDB D2R server provides HTML and linked data views and a SPARQL 1.1 endpoint D2RQ engine uses map- pings to rewrite Jena & Sesame API calls to SQL queries and generates RDF dumps in various formats

D2RQ Features Browsing database contents: Web interface for navigation through the RDF contents for people Resolvable URIs: D2R Server assigns a resolvable URI to each entity in the database Content negotiation: HTML & RDF versions share URIs; HTTP content negotiation fixes version SPARQL: Both an endpoint & explorer provided BLOBs andCLOBs: Support for serving up values as files (e.g., PDFs, images) Not surprisingly, no inferencing

D2RQ Mapping Language The mapping is defined in RDF D2RQ can generate a default mapping using a standard heuristic Each database table has information about one type of thing Each row in a table represents one object The first column is the key => defines the object The other columns represent properties You can edit the default mapping or create your own by hand

A simple database mysql> use lab; show tables; +---------------+ | Tables_in_lab | | people | mysql> desc people; +--------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | | Name | varchar(50) | NO | PRI | | | | Age | int(11) | YES | | NULL | | | Mobile | varchar(50) | YES | | NULL | | mysql> select * from people; +---------------+------+--------------+ | Name | Age | Mobile | | Al Turing | 32 | 443-253-3863 | | Don Knuth | 25 | 410-228-6282 | | Chuck Babbage | 38 | 410-499-1282 |

The default model The people table has info of things of type people <http://ebiq.org/o/labvocab/resource/people> Each row in the table has information about one instance of a person The first column is the key and is used both As the identifier for a person instance <http://localhost/people/Chuck_Babbage> For the rdf:label for a person instance Properties of a person are: name, age & mobile <http://ebiq.org/o/labvocab/resource/people_Age>

The database table mysql> use lab; show tables; +---------------+ | Tables_in_lab | | people | mysql> desc people; +--------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | | Name | varchar(50) | NO | PRI | | | | Age | int(11) | YES | | NULL | | | Mobile | varchar(50) | YES | | NULL | | mysql> select * from people; +---------------+------+--------------+ | Name | Age | Mobile | | Al Turing | 32 | 443-253-3863 | | Don Knuth | 25 | 410-228-6282 | | Chuck Babbage | 38 | 410-499-1282 |

Generating RDF mappings D2RQ can generate a default mapping directly from the database % generate-mapping –u demo –p demo \ -b http://ebiq.org/o/lab \ 'jdbc:mysql://127.0.0.1/lab’ The –b arg is the base url for the RDF vocabulary used in publishing the table The last argument is the string that JDBC uses to reference he database table The resulting mapping can be edited as desired

The Default D2RQ mapping @prefix ... Map:database a d2rq:Database; d2rq:jdbcDriver "com.mysql.jdbc.Driver"; d2rq:jdbcDSN "jdbc:mysql://127.0.0.1/lab"; d2rq:username "demo"; d2rq:password "demo"; jdbc:autoReconnect "true"; jdbc:zeroDateTimeBehavior "convertToNull”; . map:people a d2rq:ClassMap; d2rq:dataStorage map:database; d2rq:uriPattern "people/@@people.Name|urlify@@"; d2rq:class vocab:people; d2rq:classDefinitionLabel "people”; . map:people__label a d2rq:PropertyBridge; d2rq:belongsToClassMap map:people; d2rq:property rdfs:label; d2rq:pattern "people #@@people.Name@@”;. map:people_Name a d2rq:PropertyBridge; d2rq:belongsToClassMap map:people; d2rq:property vocab:people_Name; d2rq:propertyDefinitionLabel "people Name"; d2rq:column "people.Name"; . map:people_Age a d2rq:PropertyBridge; d2rq:property vocab:people_Age; d2rq:propertyDefinitionLabel "people Age"; d2rq:column "people.Age"; d2rq:datatype xsd:int; . map:people_Mobile a d2rq:PropertyBridge; d2rq:property vocab:people_Mobile; d2rq:propertyDefinitionLabel "people Mobile"; d2rq:column "people.Mobile"; .

d2r-server -p 8080 ../mapping-lab.n3 Run the D2RQ Server d2r-server -p 8080 ../mapping-lab.n3

Access via D2R server Explore via HTML Via SPARQL endpoint

Access via D2R server Explore via HTML Via SPARQL endpoint

Access via D2R server Explore via HTML Via SPARQL endpoint

Access via D2R server Via SPARQL endpoint

Access via D2R server Via SPARQL endpoint

Access via D2R server Via SPARQL endpoint

Content Negotiation D2RQ automatically recognizes URIs for Entities (e.g., an RDF object like a class or instance) http://localhost:8080/resource/people/Al_Turing RDF representations http://localhost:8080/data/people/Al_Turing HTML representations http://localhost:8080/page/people/Al_Turing The HTTP protocol supports content negotiation A get request can specify what kind of content it wants, e.g., HTML or RDF

Resources and 303 redirects Asking for a raw resource doesn’t make sense – it’s just an identifier But we can specify in the HTTP header what kind of content we want, e.g. HTML or RDF If client gets a 303 (redirect) it knows where to go For example: % curl -H "Accept: text/html" http://localhost:8080/resource/people/Al_Turing 303 See Other: For a description of this item, see http://localhost:8080/page/people/Al_Turing % curl -H "Accept: application/rdf+xml" http://localhost:8080/resource/people/Al_Turing 303 See Other: For a description of this item, see http://localhost:8080/data/people/Al_Turing

URIs should be de-referenceable Linked Data best practice says that LOD URIs should be dereferenceable Doing a GET on one should always yield useful information

Asking for RDF data % curl http://localhost:8080/data/people/Al_Turing @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . … @prefix vocab: <http://ebiq.org/o/labvocab/resource/> . <http://localhost:8080/data/people/Al_Turing> rdfs:label "RDF Description of people #Al Turing" ; foaf:primaryTopic <http://localhost:8080/resource/people/Al_Turing> . vocab:people rdfs:seeAlso <http://localhost:8080/sparql?query=DESCRIBE+%3Chttp%3A%2F%2Febiq.org%2Fo%2Flabvocab%2Fresource%2Fpeople%3E> . <http://localhost:8080/resource/people/Al_Turing> a vocab:people ; rdfs:label "people #Al Turing" ; vocab:people_Age "32"^^xsd:int ; vocab:people_Mobile "443-253-3863" ; vocab:people_Name "Al Turing" .

Asking for HTML % curl http://localhost:8080/page/people/Al_Turing <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title> people #Al Turing | D2R Server </title> <link rel="stylesheet" type="text/css" href="http://localhost:8080/snorql/style.css" /> <link rel="alternate" type="application/rdf+xml" href="http://localhost:8080/data/people/Al_Turing?output=rdfxml" title="This page in RDF (XML)" /> <link rel="alternate" type="text/rdf+n3" href="http://localhost:8080/data/people/Al_Turing?output=n3" title="This page in RDF (N3)" /> </head> …

The iswc example D2RQ comes with a partial example database and mapping for information about ISWC Stop the server d2r-server -p 8080 ../mapping-iswc.n3 Visit http://localhist:8080/

ISWC Database mysql> use iswc; show tables; +-------------------------+ | Tables_in_iswc | | conferences | | organizations | | papers | | persons | | rel_paper_topic | | rel_person_organization | | rel_person_paper | | rel_person_topic | | topics | 9 rows in set (0.00 sec) The ISWC database has partial information about the 2002? Iswc conference It’s a richer schema going beyond the simple auto generated mapping http://sw.cs.technion.ac.il/d2rq/tutorial had detailed instructions on installing on your computer And sample queries you can run

Generating RDF dumps Once the mapping is defined, use dump-rdf to for RDF dumps in various formats For example: % dump-rdf -m ../mapping-iswc.n3 -f N3

Oracle Database Semantic Data Store Introduced in Oracle 10g, also in 11g An open and persisted RDF data model and analysis platform for semantic applications An RDF Data Model with inferencing (RDFS, OWL and user-defined rules) Performs SQL-based access to triples and inferred data Combines SQL query of relational data with RDF graphs and ontologies Scalable: supports large graphs (billion+ triples) Support for Special queries Oracle provides an open, persistent, analytic semantic data management platform.

RDB2RDF Working Group http://www.w3.org/2001/sw/rdb2rdf/ Mission: standardize languages for mapping relational data and schemas into RDF and OWL It is developing two languages: R2RML and Direct Mapping Direct mapping is like D2RQ’s automatic schema R2RML is the language for expressing custom mappings Preliminary recommendations for both were published in March, final recommended status expected in Summer 2012