SlideShare a Scribd company logo
International Journal of Computer Applications Technology and Research
Volume 6–Issue 3, 130-132, 2017, ISSN:-2319–8656
www.ijcat.com 130
Figure 1. RETRO Schema and Query Mapping
An Extension of RETRO Framework: Translating SQL
Insert, Update and Delete Queries to SPARQL UPDATE
Abatal Ahmed
University Hassan,
Faculty of Science
and Technologies,
Settat, Morocco
Alaoui Khadija
University Hassan,
Faculty of Science
and Technologies,
Settat, Morocco
Larbi Alaoui
International
University of Rabat,
Sala Al Jadida,
Morocco
Bahaj Mohamed
University Hassan,
Faculty of Science
and Technologies,
Settat, Morocco
Abstract—in this paper we propose a set of algorithms to improve the functioning of RETRO framework, these algorithms will
convert SQL queries like INSERT, UPDATE and DELETE to the equivalent queries SPARQL Update.
Keywords—RDB, RDF, SQL, SPARQL, Query Translation
1. INTRODUCTION
RDF (Resource Description Framework) which was
standardized by the W3C is a language for describing the
semantics of data that allows sharing of its meaning
between different applications. RDF provides a powerful
data model based on representing data in RDF graphs that
can be queried using SPARQL. SPARQL (SPARQL
Protocol and RDF Query Language) was proposed and
standardized by W3C as a query language for RDF.
2. RETRO FRAMEWORK
RETRO Framework is to conserve and translate SQL
queries into SPARQL. This framework is composed of
several algorithms.
The first schema-mapping () algorithm is to convert an
RDF store RDB, this algorithm uses the property table
method (for every single predicate it creates a table with
two columns (subject and object). This algorithm returns a
map P representing the relational schema for users, this
relational schema is generated by extracting each
predicate name from the map P, S and O are added to each
predicate.
Figure. 2 Example of an RDB Table
International Journal of Computer Applications Technology and Research
Volume 6–Issue 3, 130-132, 2017, ISSN:-2319–8656
www.ijcat.com 131
Before starting to translate queries, RETRO separates
SQL clauses, so that an algorithm as specified must
convert each clause.
The TransSqlFromClause () algorithm that will return
triple patterns in the SQL FROM clause. Then
TransSqlWhereClause () algorithm that will translate into
SPARQL WHERE clause WHERE clause, using pattern
returned by TransSqlFromClause (). After the algorithm
Trans SQL Select clause () also translate the SQL select
clause in select SPARQL.
Then a main algorithm query-mapping () that brings
together the outputs of these sub-programs, to combine
and give a query SPARQL Equivalent to the SQL.
3. RETRO UPDATE QUERIES
In this section we give an extension to the Framework
retro, our proposal is to convert SQL queries type
INSERT / DELETE / UPDATE to equivalent SPARQL
UPDATE queries.
Our algorithms are based on the query-mapping ()
algorithm [1] query-mapping () is to convert an RDF
STORE RDB, this algorithm property table method, for
every single predicate it creates a table with 2 columns
(subject and object).
SQL Query SPARQL Query
delete from name where
subject=‘S1’
DELETE DATA {
‘s1’ name o
}
delete from name where
object='Mohammed'
DELETE DATA {
s name
'mohammed'
}
3.1 Insert Query
To insert the table name in the query is executed
Insert into name (subject, object) values ('S1', 'Ali').
Our algorithm transSqlInsert (), receives the SQL
query string form, and it will extract the triple patterns to
generate an equivalent SPARQL INSERT
Therefore, the algorithm takes the table 'name' as a
predicate for the new triple pattern and the values
corresponding to the two columns (subject, object)
subject and object to have a triple subject predicate
object.
INSERT DATA {'S1' name 'Ali' }
 The algorithm uses the method splitQuery () to
cut the SQL query and extract the name of
the table matches the predicate, the values
of subject and object.
 Then do call the generate () method that will
deduct the triple pattern from the result
splitQuery () and creating an equivalent
SPARQL INSERT query.
Figure. 3 Example of an SQL Insert converted
3.2 Delete Query
To delete from the table name it executes the query
Delete from name Where subject = 'S1';
TransSqlDelete () receives the SQL query string form,
and it will extract the triple pattern to generate an
equivalent SPARQL DELETE.
ALGORITHM: TRANSSQLDELETE ()
Input Q an SQL Insert Query
Output Z a SPARQL Delete Query
1
2
3
4
5
6
7
8
p<= ''
tps<=null
o<= ''
q=splitQuery(Q) ;
p=q.getPredicatValue() ;
tps=q.getTriples() ;
Z =generateQuery(p,tps) ;
Return Z ;
This algorithm begins by extracting the name of the
table representing the predicate of GDI drawing propose,
and extract the Boolean condition in the WHERE clause
to build a triple pattern is using spliteQuery () method,
which receives as a parameter the SQL DELETE as a
International Journal of Computer Applications Technology and Research
Volume 6–Issue 3, 130-132, 2017, ISSN:-2319–8656
www.ijcat.com 132
string. After extracting the predicate for the request, the
method generateQuery (p, tps) reference SPARQL query
Delete, from the extracted variable (p predicate and list of
pattern triples).
Figure. 4 Example of an SQL Delete converted
3.3 Update Query
In the SPARQL language there is no equivalence of the
update query, so to execute an update query, you must
combine the two DELETE queries then INSERT, but you
must keep the delete values to re-insert them in the RDF
without loss of data
4. CONCLUSION
In this paper, we described an extension of RETRO
framework, this extension is in the form of n set of
algorithms to convert SQL queries INSERT, DELETE
and UPDATE to SPARQL Update, and these algorithms
are implemented and tested by java language. Another
promising avenue for future work is to implement a
framework for translating queries for other storing
methods.
4. REFERENCES
[1] Jyothsna Rachapalli, Vaibhav Khadilkar, Murat Kantarcioglu and
Bhavani Thuraisingham, “RETRO: A Framework for Semantics
Preserving SQL-to-SPARQL Translation”, EvoDyn Workshop,
2011.
[2] Bajda-Pawlikowski, K.: Querying RDF data stored in DBMS:
SPARQL to SQL Conversion. Technical Report TR-1409, Yale
Computer Science Department, USA
[3] A. Seaborne, G. Manjunath: SPARQL/Update: A language for
updating RDF graphs. External HPL-2007-102, HP Labs Bristol
(2007).
[4] W3C, Resource description framework (RDF): concepts and
abstract syntax, in: G. Klyne, J.J. Carroll, B. McBride (Eds.), and
W3C Recommendation [S], 10 February2004.
http://www.w3.org/TR/2004/REC-rdf-concepts- 20040210

More Related Content

What's hot

Data structure,abstraction,abstract data type,static and dynamic,time and spa...
Data structure,abstraction,abstract data type,static and dynamic,time and spa...Data structure,abstraction,abstract data type,static and dynamic,time and spa...
Data structure,abstraction,abstract data type,static and dynamic,time and spa...
Hassan Ahmed
 
Presentation1
Presentation1Presentation1
Presentation1
Jay Patel
 
Anchor data type,cursor data type,array data type
Anchor data type,cursor data type,array data typeAnchor data type,cursor data type,array data type
Anchor data type,cursor data type,array data type
dhruv patel
 
Combining and easing the access of the eswc semantic web data 0
Combining and easing the access of the eswc semantic web data 0Combining and easing the access of the eswc semantic web data 0
Combining and easing the access of the eswc semantic web data 0
STIinnsbruck
 
Introductiont To Aray,Tree,Stack, Queue
Introductiont To Aray,Tree,Stack, QueueIntroductiont To Aray,Tree,Stack, Queue
Introductiont To Aray,Tree,Stack, Queue
Ghaffar Khan
 

What's hot (20)

data structure
data structuredata structure
data structure
 
Bo4301369372
Bo4301369372Bo4301369372
Bo4301369372
 
Data structure,abstraction,abstract data type,static and dynamic,time and spa...
Data structure,abstraction,abstract data type,static and dynamic,time and spa...Data structure,abstraction,abstract data type,static and dynamic,time and spa...
Data structure,abstraction,abstract data type,static and dynamic,time and spa...
 
Chapter8 my sql revision tour
Chapter8 my sql revision tourChapter8 my sql revision tour
Chapter8 my sql revision tour
 
Aaa ped-8- Data manipulation: Data wrangling, aggregation, and group operations
Aaa ped-8- Data manipulation: Data wrangling, aggregation, and group operationsAaa ped-8- Data manipulation: Data wrangling, aggregation, and group operations
Aaa ped-8- Data manipulation: Data wrangling, aggregation, and group operations
 
Data structure and its types.
Data structure and its types.Data structure and its types.
Data structure and its types.
 
Presentation1
Presentation1Presentation1
Presentation1
 
Anchor data type,cursor data type,array data type
Anchor data type,cursor data type,array data typeAnchor data type,cursor data type,array data type
Anchor data type,cursor data type,array data type
 
Java Databse Connectvity- Alex Jose
Java Databse Connectvity- Alex JoseJava Databse Connectvity- Alex Jose
Java Databse Connectvity- Alex Jose
 
The Ultimate Guide to Oracle solaris 11 advanced system administration 1 z0 822
The Ultimate Guide to Oracle solaris 11 advanced system administration  1 z0 822The Ultimate Guide to Oracle solaris 11 advanced system administration  1 z0 822
The Ultimate Guide to Oracle solaris 11 advanced system administration 1 z0 822
 
Sql DML
Sql DMLSql DML
Sql DML
 
Combining and easing the access of the eswc semantic web data 0
Combining and easing the access of the eswc semantic web data 0Combining and easing the access of the eswc semantic web data 0
Combining and easing the access of the eswc semantic web data 0
 
Introductiont To Aray,Tree,Stack, Queue
Introductiont To Aray,Tree,Stack, QueueIntroductiont To Aray,Tree,Stack, Queue
Introductiont To Aray,Tree,Stack, Queue
 
Data structure & its types
Data structure & its typesData structure & its types
Data structure & its types
 
Horizontal aggregatios in sql to prepare dataset using split-spj metho
Horizontal aggregatios in sql to prepare dataset using split-spj methoHorizontal aggregatios in sql to prepare dataset using split-spj metho
Horizontal aggregatios in sql to prepare dataset using split-spj metho
 
Chapter9 more on database and sql
Chapter9 more on database and sqlChapter9 more on database and sql
Chapter9 more on database and sql
 
Abstract data types (adt) intro to data structure part 2
Abstract data types (adt)   intro to data structure part 2Abstract data types (adt)   intro to data structure part 2
Abstract data types (adt) intro to data structure part 2
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
 
Data Structure
Data Structure Data Structure
Data Structure
 
Data structures & algorithms lecture 3
Data structures & algorithms lecture 3Data structures & algorithms lecture 3
Data structures & algorithms lecture 3
 

Similar to An Extension of RETRO Framework: Translating SQL Insert, Update and Delete Queries to SPARQL UPDATE

final_copy_camera_ready_paper (7)
final_copy_camera_ready_paper (7)final_copy_camera_ready_paper (7)
final_copy_camera_ready_paper (7)
Ankit Rathi
 
Overview of query evaluation
Overview of query evaluationOverview of query evaluation
Overview of query evaluation
avniS
 
SQL select statement and functions
SQL select statement and functionsSQL select statement and functions
SQL select statement and functions
Vikas Gupta
 
Query optimization and processing for advanced database systems
Query optimization and processing for advanced database systemsQuery optimization and processing for advanced database systems
Query optimization and processing for advanced database systems
meharikiros2
 
A SAS&lt;sup>®&lt;/sup> Users Guide to Regular Expressions When the Data Resi...
A SAS&lt;sup>®&lt;/sup> Users Guide to Regular Expressions When the Data Resi...A SAS&lt;sup>®&lt;/sup> Users Guide to Regular Expressions When the Data Resi...
A SAS&lt;sup>®&lt;/sup> Users Guide to Regular Expressions When the Data Resi...
Ken Borowiak
 
Predictive performance analysis using sql pattern matching
Predictive performance analysis using sql pattern matchingPredictive performance analysis using sql pattern matching
Predictive performance analysis using sql pattern matching
Horia Berca
 

Similar to An Extension of RETRO Framework: Translating SQL Insert, Update and Delete Queries to SPARQL UPDATE (20)

Fdms 1st cycle exp.pdf
Fdms 1st cycle exp.pdfFdms 1st cycle exp.pdf
Fdms 1st cycle exp.pdf
 
Analysing Performance of Algorithmic SQL and PLSQL.pptx
Analysing Performance of Algorithmic SQL and PLSQL.pptxAnalysing Performance of Algorithmic SQL and PLSQL.pptx
Analysing Performance of Algorithmic SQL and PLSQL.pptx
 
final_copy_camera_ready_paper (7)
final_copy_camera_ready_paper (7)final_copy_camera_ready_paper (7)
final_copy_camera_ready_paper (7)
 
SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343
SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343
SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343
 
Overview of query evaluation
Overview of query evaluationOverview of query evaluation
Overview of query evaluation
 
JDBC – Java Database Connectivity
JDBC – Java Database ConnectivityJDBC – Java Database Connectivity
JDBC – Java Database Connectivity
 
SPARQL: SEMANTIC INFORMATION RETRIEVAL BY EMBEDDING PREPOSITIONS
SPARQL: SEMANTIC INFORMATION RETRIEVAL BY EMBEDDING PREPOSITIONSSPARQL: SEMANTIC INFORMATION RETRIEVAL BY EMBEDDING PREPOSITIONS
SPARQL: SEMANTIC INFORMATION RETRIEVAL BY EMBEDDING PREPOSITIONS
 
SQL Optimization With Trace Data And Dbms Xplan V6
SQL Optimization With Trace Data And Dbms Xplan V6SQL Optimization With Trace Data And Dbms Xplan V6
SQL Optimization With Trace Data And Dbms Xplan V6
 
SQL select statement and functions
SQL select statement and functionsSQL select statement and functions
SQL select statement and functions
 
Chapter15
Chapter15Chapter15
Chapter15
 
Postgresql
PostgresqlPostgresql
Postgresql
 
Interface Python with MySQL connectivity.pptx
Interface Python with MySQL connectivity.pptxInterface Python with MySQL connectivity.pptx
Interface Python with MySQL connectivity.pptx
 
Query optimization and processing for advanced database systems
Query optimization and processing for advanced database systemsQuery optimization and processing for advanced database systems
Query optimization and processing for advanced database systems
 
Oracle restful api & data live charting by Oracle Apex - داشبورد آنلاین (داده...
Oracle restful api & data live charting by Oracle Apex - داشبورد آنلاین (داده...Oracle restful api & data live charting by Oracle Apex - داشبورد آنلاین (داده...
Oracle restful api & data live charting by Oracle Apex - داشبورد آنلاین (داده...
 
A SAS&lt;sup>®&lt;/sup> Users Guide to Regular Expressions When the Data Resi...
A SAS&lt;sup>®&lt;/sup> Users Guide to Regular Expressions When the Data Resi...A SAS&lt;sup>®&lt;/sup> Users Guide to Regular Expressions When the Data Resi...
A SAS&lt;sup>®&lt;/sup> Users Guide to Regular Expressions When the Data Resi...
 
Sql scripting sorcerypaper
Sql scripting sorcerypaperSql scripting sorcerypaper
Sql scripting sorcerypaper
 
Web Spa
Web SpaWeb Spa
Web Spa
 
Arrays and lists in sql server 2008
Arrays and lists in sql server 2008Arrays and lists in sql server 2008
Arrays and lists in sql server 2008
 
Mysqlppt
MysqlpptMysqlppt
Mysqlppt
 
Predictive performance analysis using sql pattern matching
Predictive performance analysis using sql pattern matchingPredictive performance analysis using sql pattern matching
Predictive performance analysis using sql pattern matching
 

More from Editor IJCATR

Integrated System for Vehicle Clearance and Registration
Integrated System for Vehicle Clearance and RegistrationIntegrated System for Vehicle Clearance and Registration
Integrated System for Vehicle Clearance and Registration
Editor IJCATR
 
Energy-Aware Routing in Wireless Sensor Network Using Modified Bi-Directional A*
Energy-Aware Routing in Wireless Sensor Network Using Modified Bi-Directional A*Energy-Aware Routing in Wireless Sensor Network Using Modified Bi-Directional A*
Energy-Aware Routing in Wireless Sensor Network Using Modified Bi-Directional A*
Editor IJCATR
 
Hangul Recognition Using Support Vector Machine
Hangul Recognition Using Support Vector MachineHangul Recognition Using Support Vector Machine
Hangul Recognition Using Support Vector Machine
Editor IJCATR
 

More from Editor IJCATR (20)

Text Mining in Digital Libraries using OKAPI BM25 Model
 Text Mining in Digital Libraries using OKAPI BM25 Model Text Mining in Digital Libraries using OKAPI BM25 Model
Text Mining in Digital Libraries using OKAPI BM25 Model
 
Green Computing, eco trends, climate change, e-waste and eco-friendly
Green Computing, eco trends, climate change, e-waste and eco-friendlyGreen Computing, eco trends, climate change, e-waste and eco-friendly
Green Computing, eco trends, climate change, e-waste and eco-friendly
 
Policies for Green Computing and E-Waste in Nigeria
 Policies for Green Computing and E-Waste in Nigeria Policies for Green Computing and E-Waste in Nigeria
Policies for Green Computing and E-Waste in Nigeria
 
Performance Evaluation of VANETs for Evaluating Node Stability in Dynamic Sce...
Performance Evaluation of VANETs for Evaluating Node Stability in Dynamic Sce...Performance Evaluation of VANETs for Evaluating Node Stability in Dynamic Sce...
Performance Evaluation of VANETs for Evaluating Node Stability in Dynamic Sce...
 
Optimum Location of DG Units Considering Operation Conditions
Optimum Location of DG Units Considering Operation ConditionsOptimum Location of DG Units Considering Operation Conditions
Optimum Location of DG Units Considering Operation Conditions
 
Analysis of Comparison of Fuzzy Knn, C4.5 Algorithm, and Naïve Bayes Classifi...
Analysis of Comparison of Fuzzy Knn, C4.5 Algorithm, and Naïve Bayes Classifi...Analysis of Comparison of Fuzzy Knn, C4.5 Algorithm, and Naïve Bayes Classifi...
Analysis of Comparison of Fuzzy Knn, C4.5 Algorithm, and Naïve Bayes Classifi...
 
Web Scraping for Estimating new Record from Source Site
Web Scraping for Estimating new Record from Source SiteWeb Scraping for Estimating new Record from Source Site
Web Scraping for Estimating new Record from Source Site
 
Evaluating Semantic Similarity between Biomedical Concepts/Classes through S...
 Evaluating Semantic Similarity between Biomedical Concepts/Classes through S... Evaluating Semantic Similarity between Biomedical Concepts/Classes through S...
Evaluating Semantic Similarity between Biomedical Concepts/Classes through S...
 
Semantic Similarity Measures between Terms in the Biomedical Domain within f...
 Semantic Similarity Measures between Terms in the Biomedical Domain within f... Semantic Similarity Measures between Terms in the Biomedical Domain within f...
Semantic Similarity Measures between Terms in the Biomedical Domain within f...
 
A Strategy for Improving the Performance of Small Files in Openstack Swift
 A Strategy for Improving the Performance of Small Files in Openstack Swift  A Strategy for Improving the Performance of Small Files in Openstack Swift
A Strategy for Improving the Performance of Small Files in Openstack Swift
 
Integrated System for Vehicle Clearance and Registration
Integrated System for Vehicle Clearance and RegistrationIntegrated System for Vehicle Clearance and Registration
Integrated System for Vehicle Clearance and Registration
 
Assessment of the Efficiency of Customer Order Management System: A Case Stu...
 Assessment of the Efficiency of Customer Order Management System: A Case Stu... Assessment of the Efficiency of Customer Order Management System: A Case Stu...
Assessment of the Efficiency of Customer Order Management System: A Case Stu...
 
Energy-Aware Routing in Wireless Sensor Network Using Modified Bi-Directional A*
Energy-Aware Routing in Wireless Sensor Network Using Modified Bi-Directional A*Energy-Aware Routing in Wireless Sensor Network Using Modified Bi-Directional A*
Energy-Aware Routing in Wireless Sensor Network Using Modified Bi-Directional A*
 
Security in Software Defined Networks (SDN): Challenges and Research Opportun...
Security in Software Defined Networks (SDN): Challenges and Research Opportun...Security in Software Defined Networks (SDN): Challenges and Research Opportun...
Security in Software Defined Networks (SDN): Challenges and Research Opportun...
 
Measure the Similarity of Complaint Document Using Cosine Similarity Based on...
Measure the Similarity of Complaint Document Using Cosine Similarity Based on...Measure the Similarity of Complaint Document Using Cosine Similarity Based on...
Measure the Similarity of Complaint Document Using Cosine Similarity Based on...
 
Hangul Recognition Using Support Vector Machine
Hangul Recognition Using Support Vector MachineHangul Recognition Using Support Vector Machine
Hangul Recognition Using Support Vector Machine
 
Application of 3D Printing in Education
Application of 3D Printing in EducationApplication of 3D Printing in Education
Application of 3D Printing in Education
 
Survey on Energy-Efficient Routing Algorithms for Underwater Wireless Sensor ...
Survey on Energy-Efficient Routing Algorithms for Underwater Wireless Sensor ...Survey on Energy-Efficient Routing Algorithms for Underwater Wireless Sensor ...
Survey on Energy-Efficient Routing Algorithms for Underwater Wireless Sensor ...
 
Comparative analysis on Void Node Removal Routing algorithms for Underwater W...
Comparative analysis on Void Node Removal Routing algorithms for Underwater W...Comparative analysis on Void Node Removal Routing algorithms for Underwater W...
Comparative analysis on Void Node Removal Routing algorithms for Underwater W...
 
Decay Property for Solutions to Plate Type Equations with Variable Coefficients
Decay Property for Solutions to Plate Type Equations with Variable CoefficientsDecay Property for Solutions to Plate Type Equations with Variable Coefficients
Decay Property for Solutions to Plate Type Equations with Variable Coefficients
 

Recently uploaded

Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 

Recently uploaded (20)

Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 

An Extension of RETRO Framework: Translating SQL Insert, Update and Delete Queries to SPARQL UPDATE

  • 1. International Journal of Computer Applications Technology and Research Volume 6–Issue 3, 130-132, 2017, ISSN:-2319–8656 www.ijcat.com 130 Figure 1. RETRO Schema and Query Mapping An Extension of RETRO Framework: Translating SQL Insert, Update and Delete Queries to SPARQL UPDATE Abatal Ahmed University Hassan, Faculty of Science and Technologies, Settat, Morocco Alaoui Khadija University Hassan, Faculty of Science and Technologies, Settat, Morocco Larbi Alaoui International University of Rabat, Sala Al Jadida, Morocco Bahaj Mohamed University Hassan, Faculty of Science and Technologies, Settat, Morocco Abstract—in this paper we propose a set of algorithms to improve the functioning of RETRO framework, these algorithms will convert SQL queries like INSERT, UPDATE and DELETE to the equivalent queries SPARQL Update. Keywords—RDB, RDF, SQL, SPARQL, Query Translation 1. INTRODUCTION RDF (Resource Description Framework) which was standardized by the W3C is a language for describing the semantics of data that allows sharing of its meaning between different applications. RDF provides a powerful data model based on representing data in RDF graphs that can be queried using SPARQL. SPARQL (SPARQL Protocol and RDF Query Language) was proposed and standardized by W3C as a query language for RDF. 2. RETRO FRAMEWORK RETRO Framework is to conserve and translate SQL queries into SPARQL. This framework is composed of several algorithms. The first schema-mapping () algorithm is to convert an RDF store RDB, this algorithm uses the property table method (for every single predicate it creates a table with two columns (subject and object). This algorithm returns a map P representing the relational schema for users, this relational schema is generated by extracting each predicate name from the map P, S and O are added to each predicate. Figure. 2 Example of an RDB Table
  • 2. International Journal of Computer Applications Technology and Research Volume 6–Issue 3, 130-132, 2017, ISSN:-2319–8656 www.ijcat.com 131 Before starting to translate queries, RETRO separates SQL clauses, so that an algorithm as specified must convert each clause. The TransSqlFromClause () algorithm that will return triple patterns in the SQL FROM clause. Then TransSqlWhereClause () algorithm that will translate into SPARQL WHERE clause WHERE clause, using pattern returned by TransSqlFromClause (). After the algorithm Trans SQL Select clause () also translate the SQL select clause in select SPARQL. Then a main algorithm query-mapping () that brings together the outputs of these sub-programs, to combine and give a query SPARQL Equivalent to the SQL. 3. RETRO UPDATE QUERIES In this section we give an extension to the Framework retro, our proposal is to convert SQL queries type INSERT / DELETE / UPDATE to equivalent SPARQL UPDATE queries. Our algorithms are based on the query-mapping () algorithm [1] query-mapping () is to convert an RDF STORE RDB, this algorithm property table method, for every single predicate it creates a table with 2 columns (subject and object). SQL Query SPARQL Query delete from name where subject=‘S1’ DELETE DATA { ‘s1’ name o } delete from name where object='Mohammed' DELETE DATA { s name 'mohammed' } 3.1 Insert Query To insert the table name in the query is executed Insert into name (subject, object) values ('S1', 'Ali'). Our algorithm transSqlInsert (), receives the SQL query string form, and it will extract the triple patterns to generate an equivalent SPARQL INSERT Therefore, the algorithm takes the table 'name' as a predicate for the new triple pattern and the values corresponding to the two columns (subject, object) subject and object to have a triple subject predicate object. INSERT DATA {'S1' name 'Ali' }  The algorithm uses the method splitQuery () to cut the SQL query and extract the name of the table matches the predicate, the values of subject and object.  Then do call the generate () method that will deduct the triple pattern from the result splitQuery () and creating an equivalent SPARQL INSERT query. Figure. 3 Example of an SQL Insert converted 3.2 Delete Query To delete from the table name it executes the query Delete from name Where subject = 'S1'; TransSqlDelete () receives the SQL query string form, and it will extract the triple pattern to generate an equivalent SPARQL DELETE. ALGORITHM: TRANSSQLDELETE () Input Q an SQL Insert Query Output Z a SPARQL Delete Query 1 2 3 4 5 6 7 8 p<= '' tps<=null o<= '' q=splitQuery(Q) ; p=q.getPredicatValue() ; tps=q.getTriples() ; Z =generateQuery(p,tps) ; Return Z ; This algorithm begins by extracting the name of the table representing the predicate of GDI drawing propose, and extract the Boolean condition in the WHERE clause to build a triple pattern is using spliteQuery () method, which receives as a parameter the SQL DELETE as a
  • 3. International Journal of Computer Applications Technology and Research Volume 6–Issue 3, 130-132, 2017, ISSN:-2319–8656 www.ijcat.com 132 string. After extracting the predicate for the request, the method generateQuery (p, tps) reference SPARQL query Delete, from the extracted variable (p predicate and list of pattern triples). Figure. 4 Example of an SQL Delete converted 3.3 Update Query In the SPARQL language there is no equivalence of the update query, so to execute an update query, you must combine the two DELETE queries then INSERT, but you must keep the delete values to re-insert them in the RDF without loss of data 4. CONCLUSION In this paper, we described an extension of RETRO framework, this extension is in the form of n set of algorithms to convert SQL queries INSERT, DELETE and UPDATE to SPARQL Update, and these algorithms are implemented and tested by java language. Another promising avenue for future work is to implement a framework for translating queries for other storing methods. 4. REFERENCES [1] Jyothsna Rachapalli, Vaibhav Khadilkar, Murat Kantarcioglu and Bhavani Thuraisingham, “RETRO: A Framework for Semantics Preserving SQL-to-SPARQL Translation”, EvoDyn Workshop, 2011. [2] Bajda-Pawlikowski, K.: Querying RDF data stored in DBMS: SPARQL to SQL Conversion. Technical Report TR-1409, Yale Computer Science Department, USA [3] A. Seaborne, G. Manjunath: SPARQL/Update: A language for updating RDF graphs. External HPL-2007-102, HP Labs Bristol (2007). [4] W3C, Resource description framework (RDF): concepts and abstract syntax, in: G. Klyne, J.J. Carroll, B. McBride (Eds.), and W3C Recommendation [S], 10 February2004. http://www.w3.org/TR/2004/REC-rdf-concepts- 20040210