A SParqly Jython++ A SParqly Jython++ an ASP/SPARQL enhanced Jython Cliff Cheng Carlos Urrutia Francisco Garcia.

Slides:



Advertisements
Similar presentations
SQL/PL SQL Oracle By Rana Umer. Performance Tuning Indexes ROWID View Sequences Oracle By Rana Umer.
Advertisements

Chapter Thirteen Sequences Dr. Chitsaz Objectives: Sequence objects Create and use sequences Application of sequences.
A Guide to SQL, Seventh Edition. Objectives Create a new table from an existing table Change data using the UPDATE command Add new data using the INSERT.
Introduction to Structured Query Language (SQL)
Sequence Sen Zhang. The AutoNumber data type stores an integer that Access increments (adds to) automatically as you add new records. You can use the.
View Sen Zhang. Views are very common in business systems users view of data is simplified a form of security - user sees only the data he/she needs to.
Copyright س Oracle Corporation, All rights reserved. 13 Other Database Objects.
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
Introduction to Structured Query Language (SQL)
INTEGRITY Enforcing integrity in Oracle. Oracle Tables mrobbert owner granted access.
DAY 21: MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Akhila Kondai October 30, 2013.
Dr. Philip Cannata 1 fJyswan. Dr. Philip Cannata 2 10 Java (Object Oriented) ASP RDF (Horn Clause Deduction, Semantic Web) Relation Jython in Java This.
2.2 A Simple Syntax-Directed Translator Syntax-Directed Translation 2.4 Parsing 2.5 A Translator for Simple Expressions 2.6 Lexical Analysis.
Chapter 6 Additional Database Objects
MS Access Database Connection. Database? A database is a program that stores data and records in a structured and queryable format. The tools that are.
Constraints  Constraints are used to enforce rules at table level.  Constraints prevent the deletion of a table if there is dependencies.  The following.
13 Other Database Objects Important Legal Notice:  Materials on this lecture are from a book titled “Oracle Education” by Kochhar, Gravina, and Nathan.
12 Copyright © Oracle Corporation, All rights reserved. Other Database Objects.
Oracle’s take on joins Where it differs from ANSI standard.
Other database objects (Sequence). What Is a Sequence? A sequence: Automatically generates sequential numbers Is a sharable object Is typically used to.
11 Copyright © 2007, Oracle. All rights reserved. Creating Other Schema Objects.
Chapter 6 Additional Database Objects Oracle 10g: SQL.
Chapter 5 Sequences.
(Chapter 10 continued) Our examples feature MySQL as the database engine. It's open source and free. It's fully featured. And it's platform independent.
1 Copyright © 2004, Oracle. All rights reserved. Introduction.
DBMS Implementation Chapter 6.4 V3.0 Napier University Dr Gordon Russell.
7 1 Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Interpretation Environments and Evaluation. CS 354 Spring Translation Stages Lexical analysis (scanning) Parsing –Recognizing –Building parse tree.
Database Programming Sections 11 & 12 – Creating, and Managing Views, Sequences, Indexes, and Synonymns.
SQL: DDL. SQL Statements DDL - data definition language –Defining and modifying data structures (metadata): database, tables, views, etc. DML - data manipulation.
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
ITBIS373 Database Development Lecture 3a - Chapter 3: Using SQL Queries to Insert, Update, Delete, and View Data.
8 1 Chapter 8 Advanced SQL Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
SQL Basic. What is SQL? SQL (pronounced "ess-que-el") stands for Structured Query Language. SQL is used to communicate with a database.
ASPJ YLOG +SQL Integration of SQL functionality into ASPJylog++ Russell Beavers Srijith Prabhu Venkat Yerramsetti.
Mitchell McMullen Paul Nguyen SWAN. Python written entirely in C#. Can access all.NET libraries and Silverlight. Created by the same guy as Jython. No.
CHAPTER 9 Views, Synonyms, and Sequences. Views are used extensively in reporting applications and also to present subsets of data to applications. Synonyms.
SQL: Advanced topics Prof. Weining Zhang Cs.utsa.edu.
Chapter 4 Constraints Oracle 10g: SQL. Oracle 10g: SQL 2 Objectives Explain the purpose of constraints in a table Distinguish among PRIMARY KEY, FOREIGN.
Database Programming Sections 11 & 12 –Sequences, Indexes, and Synonymns.
Visual Programing SQL Overview Section 1.
5. Simple SQL using Oracle1 Simple SQL using Oracle 5. Working with Tables: Data management and Retrieval 6. Working with Tables: Functions and Grouping.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 (Part II) INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor.
Database Design And Implementation. Done so far… Started a design of your own data model In Software Engineering, recognised the processes that occur.
Chapter 3 Context-Free Grammars and Parsing. The Parsing Process sequence of tokens syntax tree parser Duties of parser: Determine correct syntax Build.
Oracle Data Integrator User Functions, Variables and Advanced Mappings
Continue the Development of SQL in fJySwan Blake Kobelan, Brittany Blassingill, Andrew Spence.
Session 1 Module 1: Introduction to Data Integrity
A Guide to SQL, Eighth Edition Chapter Six Updating Data.
Relational Database Management System(RDBMS) Structured Query Language(SQL)
Database Programming Sections 12 – Sequences, Indexes, and Synonymns.
10 1 Chapter 10 - A Transaction Management Database Systems: Design, Implementation, and Management, Rob and Coronel.
1 CS 430 Database Theory Winter 2005 Lecture 7: Designing a Database Logical Level.
1 Topic 4: Abstract Syntax Symbol Tables COS 320 Compiling Techniques Princeton University Spring 2016 Lennart Beringer.
LM 5 Introduction to SQL MISM 4135 Instructor: Dr. Lei Li.
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
 CONACT UC:  Magnific training   
Copyright © 2004 Pearson Education, Inc.. Chapter 24 Enhanced Data Models for Advanced Applications.
Other database objects (Sequence and view). What Is a Sequence? A sequence: Automatically generates sequential numbers Is a sharable object Is typically.
Active Database Concepts
ITEC 313 Database Programming
Views, Stored Procedures, Functions, and Triggers
Oracle Certified 1z0-047 Exam Questions
PL/SQL Programing : Triggers
Chapter 5 Sequences.
Managing Objects with Data Dictionary Views
CPSC-608 Database Systems
Updating Databases With Open SQL
Updating Databases With Open SQL
Presentation transcript:

A SParqly Jython++ A SParqly Jython++ an ASP/SPARQL enhanced Jython Cliff Cheng Carlos Urrutia Francisco Garcia

Summary Improving ASPJython++ by incorporating homeworks. (SPARQL not fully supported, joins, update, delete, etc,.) Added syntax to be allow conversion of a RDF database into ASP/Prolog facts by returning a Tuple. Added syntax to be able to create RDF table from SQL table, using the Tuple as the return type. Use of Oracle Sequence as a GUID.

Phyton.g These tokens behave like the regular SELECT. The grammar will check for syntax correctness. Since the format of ASPSELECT and RDFSELECT is similar as SELECT, we just treated them as SQL grammar, which implies no need to build a node of type Tuple (Tuple.java) because SQL node were already created by Frank, and so the conversion of the nodes into python objects(CodeCompiler.java).... | (ASPSELECT sqlquery SEMI {$sql_stmt::strings.add($sql_stmt::temp); } -> ^(ASPSELECT [$sql_stmt.start, actions.castExprs($sql_stmt::exprs), $expr::ctype,$sql_stmt::strings, $connection::url, $connection::uname, $connection::pword])) | (RDFSELECT sqlquery SEMI {$sql_stmt::strings.add($sql_stmt::temp); } -> ^(RDFSELECT [$sql_stmt.start, actions.castExprs($sql_stmt::exprs), $expr::ctype,$sql_stmt::strings, $connection::url, $connection::uname, $connection::pword])) … //new Tokens to help get ASP/Prolog facts ASPSELECT :'ASPSELECT'; RDFSELECT :'RDFSELECT';

PyTuple.java Here is where Tuples get evaluated. The use of ASPSELECT is to indicate weather we return the RDF “triple” parsed into (SUB, PRED, OBJ) without the RDF format, to be used by end users to create ASP/Prolog facts. RDFSELECT is used to create an RDF table from a SQL table. But this new created syntax are best used with *, because ASPSELECT uses an RDF database, so you probably want to get the whole tuple as (SUB, PRED, OBJ) Note: This does not mean it only works with *. Sample syntax: ASPSELECT * FROM SOMETABLE; ASPSELECT * FROM SOMETABLE; RDFSELECT * FROM SOMETABLE; RDFSELECT * FROM SOMETABLE;

PyTuple.java (some code) PyTuple.java PyTuple.java PyTuple.java

Oracle Sequence ASPSELECT In order for ASPSELECT to work properly, the way the guid was implemented for the INSERT statements had to be modified. INSERT Before: every separate session's INSERT to the same RDF table would reset the guid to 1, since there will not be prior records of the last guid used. Now: Oracle sequence: What is an Oracle sequence? A sequence is an object in Oracle to generate a number sequence. Useful to act as a primary key, here for our guid.

Oracle Sequnce Syntax CREATE SEQUENCE sequence_name MINVALUE value MAXVALUE value START WITH value INCREMENT BY value CACHE value; Way implemented: //Create sequence stmt.executeQuery("CREATE SEQUENCE "+caststmt.getTable()+"_RDF_DATA_sqnc MINVALUE 1 START WITH 1 INCREMENT BY 1 NOCACHE"); //Drop sequence stmt.executeQuery("DROP SEQUENCE "+caststmt.getName()+"_RDF_DATA_sqnc"); //To get next value in sequence OracleResultSet rs2 = (OracleResultSet)stmt.executeQuery("SELECT " + tableName + "_RDF_DATA_sqnc.nextval FROM dual");

Concepts Tokens Terminal Non-terminal Context-Free grammar Abstract Syntax Tree ASP/Prolog facts and rules SQL SPARQL RDF Concepts

Improvements Keep working on fully supporting SPARQL (joins,delete,update) Make ASP/Prolog more dynamic Keep integrating more languages(Lisp, Haskell, etc) :-)