You are on page 1of 42

SIM Data Model and ReL

Dr. Philip Cannata

Semantic Data Models

2/88
Dr. Philip Cannata 2

Doug Tolbert Unisys doug_tolbert@omg.org Doug Tolbert has been involved with OMG since the early 1990s. He is a member of the Board of Directors and currently holds a Platform seat on the Architecture Board. Doug was a principal member of the team that developed CWM, and he has made contributions to many OMG platform (UML, MOF, XMI, IMM, SOA, Alf, and ADTF) and domain (Finance, Life Science, Insurance) over the years. He is currently active on the UML Simplification and IMM submission teams. On the AB, Doug works to ensure that OMG specifications are clear and understandable in both their human- and machine-readable forms.

Dr. Philip Cannata

Dr. Philip Cannata

SIM Example: Organization Schema


Person
Child Parent Name (First-Name, Mid-Initial, Last-Name) Current-Residence (Street, City, State, ZipCode) Education (Degree-Obtained, Year-Obtained, GPA) MV Next-of-Kin (Relationship, Phone, Name-Of-Kin (First-Name, Mid_Initial, Last-Name)) Marital-Status US-Citizen Soc-Sec-No Birth-Date Gender Age Spouse

Previous-Employee
Termination-Reason Leave-Status Last-Work-Date Hire-Date

Employee
Employee-ID Employee-Hire-Date Employee-Salary Employee-Status

Employee-Manager Employees-Managed

Project-Employee
Title Overall-Rating Dept-In Dept-Staff

Interim-Manager
Interim-History (Start-Date, End-Date) MV

Manager
Manager-Title Bonus Project-Manager Projects-Managing

Department
Dept-No Dept-Title Dept-Location Dept-Assigned

Project
(Next-Project-No) Project-No Project-Title Sub-Project-Of
Sub-Projects

Assignment-Record

Assignment
Start-Date AssignmentNo End-Date Rating Est-Person-Hours

Project-Of Assignment-History

Staff-Assigned

Dr. Philip Cannata

Unisys

Enterprise Server Division

SIM
Origins and Evolution
Doug Tolbert Unisys Corporation Mission Viejo, CA
Dr. Philip Cannata 6

SIM Motivations: Objectives (1983)

Ease of Use

Integrated, high level interface Query & schema flexibility Data Independence Set-oriented, non-procedural interface Naturally handle complexity System enforced integrity Shared data definitions Referential integrity No impact on DMS II customer base New capabilities for existing data Must support production level transaction processing systems Fast Fast Fast Easy to learn Minimal programming effort Retrieval without programming

Productivity

Data Integrity

Coexistence

Performance

Dr. Philip Cannata

SIM Motivations: Options (1983)

Enhance DMS II of use Improve ease


Gain productivity & data integrity without sacrificing installed base Performance thought to be near architectural limits (but wasnt true!) Not likely to expand customer base

Relational System
Ease of use would improve Productivity gains marginal Data integrity very limited Extensive data engine rework No migration path for customer base Performance? Late to market

Something New
Designed to meet Ease of use, productivity, and data integrity goals New features for existing databases without migration Performance based on proven DMS II algorithms Semantic Data Model provided best framework

Dr. Philip Cannata

SIM: Something New!

Artificial Intelligence

Semantic Models

Semantic Networks
Quillian, Brachman

SDM
Hammer & McLeod

Graphical Data Models

Entity Relationship
Chen

SIM

Programmatic Model

DAPLEX
Shipman

Set Data Models

RM/T
Codd

Query Languages

GORDAS
El-Masri

Dr. Philip Cannata

SIM: A Semantic Data Model


What makes a data model semantic?
During the last few years numerous investigations have been aimed at capturing (in a reasonably formal way) more of the meaning of the data, while preserving independence of implementation. This activity is sometimes called semantic data modelling. Actually, the task of capturing the meaning of data is a never-ending one. So the label semantic must not be interpreted in a absolute way. -- E. F. Codd, 1979

How does a semantic data model capture meaning?


... it is appropriate that the structure of a database mirror the structure of the system that it models. A database whose organization is based on naturally occurring structures will be easier for a database designer to construct and modify than one that forces him to translate the primitives of his problem domain into artificial specification construction. -- Hammer & McLeod, 1981

SDMs capture the meaning of data, not just its physical representation So, the more meaning a data model captures, the more semantic it is

Schema objects should look like corresponding real world objects Meaning captured by object types, relationships, attribute types, cardinality constraints, active rules

Dr. Philip Cannata

10

SIM Concepts:

Entities & Attributes

Entity An object or idea of interest in the application environment Does not imply a particular physical implementation But functional analogs are records and tuples in other data models e.g., The employee named John Doe The Accounting department

Attribute A characteristic of an entity John Doe has an address, an employee ID, a salary, ...
Dr. Philip Cannata 11

SIM Concepts:

Classes & Subclasses

Class A collection of entities of the same type Employee, the set of all employees working for a company Subclass A subset of entities in a class Project-Employees are employees that work on projects

Employee

IS A

Project-Employee

Dr. Philip Cannata

12

SIM Concepts:

Attributes
Employee
Name EmployeeID

Attribute Inheritance Subclasses inherit attributes from all their superclasses Subclasses may declare additional attributes Attribute Types Data-Valued Attributes (DVA)

Have a printable value


Entity-Valued Attributes (EVA) Entities in another class Model relationships

Project-Employee
Title DeptI n

Department

Dr. Philip Cannata

13

SIM Concepts:

Extended Attributes
Employee
Name EmployeeID

Perspective Class A point of view class chosen for a query Same data may have different meanings from different perspective classes Extended Attributes Attributes of related entities may be considered extended attributes of the perspective class

Project-Employee
Title DeptI n

Department
Dept-No

Dept-No of Dept-In of Project-Employee = 123 Dept-No of Department = 123

Dr. Philip Cannata

14

SIM Concepts:

Constraints & Relations

Attribute Constraints Isomorphic for EVA/DVA Single-Valued Multi-Valued Required Unique Relationships (EVAs) Always bi-directional Automatic referential integrity Transitive closure function

Employee
Name EmployeeID

Project-Employee
Title

DeptI n Dept-Staff

Department
Dept-No

Title of INVERSE(Dept-In) of Department

Title of Dept-Staff of Department

Dr. Philip Cannata

15

SIM Concepts:
Class Attributes

Data Types

One value per class, not associated with any entity, DVA only Data Types Similar to Pascal, with relaxed string type checking

System Defined
Integer Real Boolean Date Time Character Number String (fixed) String (variable) Kanji Symbolic Ordered Symbolic

User Defined
Based on system defined types Set membership for strings WeekDay : String(Mon, ..., Fri) Enforced subrange Employee-Age : Integer(18..70)

Dr. Philip Cannata

16

SIM Concepts:
Verify

Verify

General constraints not related to schema structure Full power of SIM expression syntax in WHERE clause For example

Spouses of employees hired after December 31, 1995, may not work for the company

VERIFY NoCouples ON Employee ASSERT Not (Spouse ISA Employee)

WHERE Employee-Hire-Date > 12/31/95 ELSE Spouse may not work for company

Dr. Philip Cannata

17

SIM Concepts:
Security

Security

Accesses limit visibility of and operations on attributes

Permissions associate Accesses with users or programs


For example The Accounting Department may examine but not change the salary of journeyman and higher employees

ACCESS RETRIEVE

LookButDontTouch ON Employee (Employee-Salary)

WHERE Employee-Status >= Journeyman PERMISSION USERCODE = Accounting, ACCESS = LookButDontTouch

Dr. Philip Cannata

18

SIM Concepts:

Indexes

Indexes Multiple DVA keys, ascending or descending For performance improvement Visible to database administrators & query optimizer Not visible to programmers or query users

INDEX (Employee-ID) ON Employee ASCENDING

Dr. Philip Cannata

19

SIM Concepts:

Expressions

Operators
Arithmetic Boolean Relational String Existence +, -, *, /, DIV, MOD, ** NOT, AND, OR <, >, =, <=, >=, <> &, pattern matching EXISTS

Functions
Arithmetic String Symbolic Date Time Relationships ABS, ROUND, TRUNC, SQRT LENGTH, EXT, POS, RPT PRED, SUCC YEAR, MONTH, DAY, ELAPSED_DAYS, ADD_DAYS, DAY_OF_WEEK, MONTH_NAME, CURRENT_DATE HOUR, MINUTE, SECOND, ELAPSED_TIME, ADD_TIME, CURRENT_TIME INVERSE, TRANSITIVE

Multi-Valued
Operators Aggregates Quantifiers INCLUDE, EXCLUDE AVG, SUM, COUNT, MIN, MAX SOME, ALL, NO

Dr. Philip Cannata

20

SIM Concepts:

Advanced Query Topics

Subrole Attribute (Readonly enumeration of subclasses in a class)


Retrieve the names of employees that are managers. RETRIEVE Name of Employee WHERE Profession = Manager

Role Testing
Retrieve the names of employees whose spouses are managers. RETRIEVE Name of Employee WHERE Spouse ISA Manager

Role Qualification
Retrieve the names of US citizens and the employee IDs of their spouses. RETRIEVE Name of Person, Employee-ID of Spouse AS Employee WHERE US-Citizen

Dr. Philip Cannata

21

SIM Concepts:

Advanced Query Topics

Multiple Perspective Queries (aka Joins)


Retrieve the names of project employees and managers that are the same age. RETRIEVE Name of Project-Employee, Name of Manager WHERE Age of Project-Employee = Age of Manager

Reference Variables
Retrieve the names of all managers who manage employees making more than $40,000 and employees making less than $20,000. RETRIEVE Name of Manager WHERE Employee-Salary of Employees-Managing > 40000 AND Employee-Salary of Employees-Managing CALLED Underpaid < 20000

Local Selection
Retrieve the names of managers of all departments and the salaries of only the division managers. RETRIEVE Name of Dept-Managers of Department, Employee-Salary of Dept-Managers WITH (Manager-Title of Dept-Managers = Division-Manager)

Dr. Philip Cannata

22

SIM Concepts:

Update

Insert Entity: Create a new employee named John Doe and assign him to the manager named Smith. INSERT Employee (Name := (First-Name := John, Last-Name := Doe), Gender := Male, Soc-Sec-No := 123-45-6789, US-Citizen := True, Employee-ID := 726478, Spouse := Person WITH (First-Name of Name = Mary AND Last-Name of Name = Doe), Child := INCLUDE Person WITH (First-Name of Name = Junior AND Last-Name of Name = Doe), Employee-Manager := Manager WITH (Last-Name of Name = Smith) Insert Role: Promote John Doe to department manager with a bonus of $5000. INSERT Manager FROM Employee WHERE Last-Name of Name = Doe (Manager-Title := Department-Manager, Bonus := 5000)

Modify: Reassign all Journeyman Project-Employees in the Construction Department to the Maintenance Department. MODIFY Project-Employee (Dept-In := Department WITH (Dept-Title = Maintenance)) WHERE Title = Journeyman AND Dept-Title of Dept-In = Construction Delete: Remove all projects assigned to managers that manage departments located in Los Angeles. DELETE Project WHERE Dept-Location of Managers-Department of Project-Manager = Los Angeles

Dr. Philip Cannata

23

SIM Example

Organization: a projects and employee database

Database descriptions DMS II A record oriented DBMS


DB2 A relational DBMS

SIM

A semantic DBMS

Query Comparisons Three retrieval queries of increasing complexity

Application program sizes

Dr. Philip Cannata

24

SIM Example
Organization Basic Facts Employees are People Project-Employees are Employees who are assigned to Projects Managers are Employees who manage Projects Sometimes a Project-Employee can act as a Manager on an interim basis Projects may have Subprojects Historical records of Previous Employees must be retained
Dr. Philip Cannata 25

SIM Example: DMS II Schema

Family
Parent-SSN Child-SSN Family-Set

Person
Soc-Sec-No Spouse-SSN Managers-SSN Assignment-No Dept-No Employed Employee-ID Person-Set

Assignment
Assignment-No Project-No Assignment-Set

Education
Soc-Sec-No Education-Set

Project-Person
Employee-ID Project-No ProjPerson-Set

Project
Project-No Dept-No SuperProject-No Project-Set

Interim-Manager
Employee-ID

Duration
StartDate EndDate InterimHist-Set Interim-Set

Department
Dept-No Department-Set

Legend Data Set Name


Attributes

Primary Index

Dr. Philip Cannata

26

SIM Example: DB2 Schema

Family
Parent-SSN Child-SSN

Person
Soc-Sec-No Spouse-No Managers-SSN Assignment-No Dept-No Employed Employee-ID

Assignment
Assignment-No Project-No

Education
Soc-Sec-No

Project-Person
Employee-ID Project-No

Project
Project-No Dept-No SuperProject-No

Interim-History
Employee-ID StartDate EndDate

Department
Dept-No

Legend Table Name Column Name

Dr. Philip Cannata

27

SIM Example: Organization Schema


Person
Child Parent Name (First-Name, Mid-Initial, Last-Name) Current-Residence (Street, City, State, ZipCode) Education (Degree-Obtained, Year-Obtained, GPA) MV Next-of-Kin (Relationship, Phone, Name-Of-Kin (First-Name, Mid_Initial, Last-Name)) Marital-Status US-Citizen Soc-Sec-No Birth-Date Gender Age Spouse

Previous-Employee
Termination-Reason Leave-Status Last-Work-Date Hire-Date

Employee
Employee-ID Employee-Hire-Date Employee-Salary Employee-Status

Employee-Manager Employees-Managed

Project-Employee
Title Overall-Rating Dept-In Dept-Staff

Interim-Manager
Interim-History (Start-Date, End-Date) MV

Manager
Manager-Title Bonus Project-Manager Projects-Managing

Department
Dept-No Dept-Title Dept-Location Dept-Assigned

Project
(Next-Project-No) Project-No Project-Title
Sub-Projects

Sub-Project-Of

Assignment-Record

Assignment
Start-Date AssignmentNo
End-Date Rating Est-Person-Hours

Project-Of Assignment-History

Staff-Assigned

Dr. Philip Cannata

28

SIM Example: Comparison Queries

Simple Query
Print the names of all non-managers and the title of the department in which they work.

Complex Query
Print the names of employees and the titles of all their projects if they work on any project assigned to the Accounting Department.

Hard Query
For the Annual Report Preparation project, print the titles of its subprojects and the names of employees currently assigned.

Dr. Philip Cannata

29

SIM Example: Simple Query


Print the names of all non-managers and the title of the department in which they work.

DMS II
RELATE TAB WHERE FROM Person TO Department BY MATCHING Dept-No WITH Dept-No AS Person-Dept; First-Name, Mid-Initial, Last-Name, Dept-Title Employed NEQ Manager Person TO Department;

DB2
SELECT FROM WHERE AND First-Name, Mid-Initial, Last-Name, Title Person, Department Person.Dept-No = Department.Dept-No Person.Employed NEQ Manager;

SIM
RETRIEVE Name of Project-Employee, Dept-Title of Dept-In

Dr. Philip Cannata

30

SIM Example: Complex Query


Print the names of employees and the titles of all their projects if they work on any project assigned to the Accounting Department. DMS II RELATE Department TO Project BY MATCHING Dept-No WITH Dept-No AS Dept-Proj;
EXTRACT Soc-Sec-No, COUNT AS SSN-Cnt WHERE Dept-TItle Accounting FROM Person TO Project-Person TO Project TO Department : EXTRACTFILE = ExtFile; OPEN FILE ExtFile; RELATE ExtFile TO Project-Person BY MATCHING Soc-Sec-No WITH Soc-Sec-No AS Extrel; TAB First-Name, Mid-Initial, Last-Name, Project-Title

FROM ExtFile TO Project-Person TO Project RELATE Project TO Project-Person BY WHERE SSN-Cnt > 0; MATCHING Project-No WITH Project-No AS ProjPerson; DB2 RELATE TO Person BY SELECT Project-Person FIrst-Name, MId-Initial, Last-Name, Project-Title MATCHING FROM Person, Project-Person, Project Soc-Sec-No WITH Soc-Sec-No AS ProjWHERE Person.Soc-Sec-No = Project-Person.Soc-Sec-No Emp; AND Project.Project-No = Project-Person.Project-No AND EXISTS (SELECT * FROM Project-Person, Project, Department WHERE Project-Person.Soc-Sec-No = Person.Soc-Sec-No AND Project-Person.Project-No = Project.Project-No AND Department.Dept-No = Project.Dept-No AND Department.Dept-Title = Accounting)

SIM RETRIEVE Name of Project-Employee, Project-TItle of Current-Project WHERE Dept-TItle of SOME(Dept-Assigned of Current-Project) = Accounting

Dr. Philip Cannata

31

SIM Example: Hard Query


For the Annual Report Preparation project, print the titles of its subprojects and the names of employees currently assigned.
DMS II OPEN DMSII Oranization; OPEN DMSII OrgCopy (DMI =DMINTERPRETER/ORGANIZATION);
RELATE Project-Person of OrgCopy TO Person of OrgCopy BY MATCHING Employee-ID WITH Employee-ID AS Proj-Person; TAB Project-Title of Project of OrgCopy, First-Name of Person of OrgCopy, Mid-Initial of Person of OrgCopy, Last-Name of Person of OrgCopy FROM Project of Organization TO Project of OrgCopy TO Project-Person of OrgCopy TO Person of OrgCopy WHERE Project-Title of Project of Organization = Annual Report Preparation

RELATE Project of Organization TO Project of OrgCopy BY MATCHING Project-No WITH SuperProject-No AS SubProj;

DB2 RELATE Project of Organization TO Person of OrgCopy BY SELECT Project-Title, First-Name, Mid-Initial, MATCHING Project-No WITH Project-No ASLast-Name FROM Project, Project, SubProj, Person, Project-Person Project-Emp; WHERE Project.Project-No = SubProj.SuperProject-No AND SubProj.Project-No = Project-Person.Project-No AND Project-Person.Soc-Sec-No = Person.Soc-Sec-No AND Project.Project-Title = Annual Report Preparation SIM RETRIEVE Project-Title of Sub-Projects of Project, Name of Project-Team of Sub-Projects WHERE Project-Title of Project = Annual Report Preparation

Dr. Philip Cannata

32

SIM - Semantic Data Management

mgr

Dr. Philip Cannata

33

SIM - Semantic Data Management


CLASS person ( ss_num: INTEGER, REQUIRED; name: STRING; ); SUBCLASS emp OF person ( job : STRING; mgr : emp, SV, INVERSE IS employees; sal : INTEGER; comm : INTEGER; dept : dept, SV, INVERSE IS employees; ); CLASS dept ( deptno : INTEGER, REQUIRED; dname : STRING; loc : STRING; employees : emp, MV, INVERSE IS dept; );

mgr

Dr. Philip Cannata

34

CLASS person ( ss_num: INTEGER, REQUIRED; name: STRING; ); SUBCLASS emp "Employees of a company" OF person ( job : STRING; mgr : emp, SV, INVERSE IS employees; employees : emp, MV, INVERSE IS mgr; sal : INTEGER; comm : INTEGER; dept : department, SV, INVERSE IS employees; ); INSERT emp ( ss_num:= 7369 , name := "SMITH" , job := "CLERK" , sal := 800 ); INSERT emp ( ss_num:= 7499 , name := "ALLEN" , job := "SALESMAN" , sal := 1600 , comm := 300 ); INSERT emp ( ss_num:= 7521 , name := "WARD" , job := "SALESMAN" , sal := 1250 , comm := 500 ); INSERT emp ( ss_num:= 7566 , name := "JONES" , job := "MANAGER" , sal := 2975 ); INSERT emp ( ss_num:= 7654 , name := "MARTIN" , job := "SALESMAN" , sal := 1250 , comm := 1400 ); INSERT emp ( ss_num:= 7698 , name := "BLAKE" , job := "MANAGER" , sal := 2850 ); INSERT emp ( ss_num:= 7782 , name := "CLARK" , job := "MANAGER" , sal := 2450 ); INSERT emp ( ss_num:= 7788 , name := "SCOTT" , job := "ANALYST" , sal := 3000 ); INSERT emp ( ss_num:= 7839 , name := "KING" , job := "PRESIDENT" , sal := 5000 ); INSERT emp ( ss_num:= 7844 , name := "TURNER" , job := "SALESMAN" , sal := 1500 ); INSERT emp ( ss_num:= 7876 , name := "ADAMS" , job := "CLERK" , sal := 1100 ); INSERT emp ( ss_num:= 7900 , name := "JAMES" , job := "CLERK" , sal := 950 ); INSERT emp ( ss_num:= 7902 , name := "FORD" , job := "ANALYST" , sal := 3000 ); INSERT emp ( ss_num:= 7934 , name := "MILLER" , job := "CLERK" , sal := 1300 );
Dr. Philip Cannata 35

CLASS department "Departments of a company" ( deptno : INTEGER, REQUIRED; dname : STRING; loc : STRING; employees : emp, MV, INVERSE IS dept; ); INSERT department ( deptno := 10 , dname := "ACCOUNTING" , loc := "NEW YORK" );

INSERT department ( deptno := 20 , dname := "RESEARCH" , loc := "DALLAS" ); INSERT department ( deptno := 30 , dname := "SALES" , loc := "CHICAGO" ); INSERT department ( deptno := 40 , dname := "OPERATIONS" , loc := "BOSTON" );

Dr. Philip Cannata

36

MODIFY emp ( dept := department WITH (deptno = 20) ) WHERE ss_num = 7369 ; MODIFY emp ( dept := department WITH (deptno = 30) ) WHERE ss_num = 7499 ; MODIFY emp ( dept := department WITH (deptno = 30) ) WHERE ss_num = 7521 ;

MODIFY emp ( dept := MODIFY emp ( dept := MODIFY emp ( dept := MODIFY emp ( dept := MODIFY emp ( dept := MODIFY emp ( dept := MODIFY emp ( dept := MODIFY emp ( dept := MODIFY emp ( dept := MODIFY emp ( dept := MODIFY emp ( dept :=

department WITH (deptno = department WITH (deptno = department WITH (deptno = department WITH (deptno = department WITH (deptno = department WITH (deptno = department WITH (deptno = department WITH (deptno = department WITH (deptno = department WITH (deptno = department WITH (deptno =

20) ) WHERE ss_num = 7566 ; 30) ) WHERE ss_num = 7654 ; 30) ) WHERE ss_num = 7698 ; 10) ) WHERE ss_num = 7782 ; 20) ) WHERE ss_num = 7788 ; 10) ) WHERE ss_num = 7839 ; 30) ) WHERE ss_num = 7844 ; 20) ) WHERE ss_num = 7876 ; 30) ) WHERE ss_num = 7900 ; 20) ) WHERE ss_num = 7902 ; 10) ) WHERE ss_num = 7934 ;

MODIFY emp ( mgr := emp WITH (ss_num = 7902) ) WHERE ss_num = 7369 ;

MODIFY emp ( mgr MODIFY emp ( mgr MODIFY emp ( mgr MODIFY emp ( mgr MODIFY emp ( mgr MODIFY emp ( mgr MODIFY emp ( mgr MODIFY emp ( mgr MODIFY emp ( mgr MODIFY emp ( mgr MODIFY emp ( mgr MODIFY emp ( mgr Dr. Philip Cannata

:= := := := := := := := := := := :=

emp emp emp emp emp emp emp emp emp emp emp emp

WITH (ss_num = WITH (ss_num = WITH (ss_num = WITH (ss_num = WITH (ss_num = WITH (ss_num = WITH (ss_num = WITH (ss_num = WITH (ss_num = WITH (ss_num = WITH (ss_num = WITH (ss_num =

7698) ) WHERE ss_num = 7499 ; 7698) ) WHERE ss_num = 7521 ; 7839) ) WHERE ss_num = 7566 ; 7698) ) WHERE ss_num = 7654 ; 7839) ) WHERE ss_num = 7698 ; 7839) ) WHERE ss_num = 7782 ; 7566) ) WHERE ss_num = 7788 ; 7698) ) WHERE ss_num = 7844 ; 7788) ) WHERE ss_num = 7876 ; 7698) ) WHERE ss_num = 7900 ; 7566) ) WHERE ss_num = 7902 ; 7782) ) WHERE ss_num = 7934 ;

37

WDB> from person retrieve * where true;

WDB> from emp retrieve * where true;

Dr. Philip Cannata

38

WDB> from emp retrieve * where true;

WDB> from department retrieve * where true;

WDB> from emp retrieve *, * of dept where true;

Dr. Philip Cannata

39

WDB> from emp retrieve ss_num, name, dname of dept, name of mgr, dname of dept of mgr where true;

Dr. Philip Cannata

40

with

ReL

Dr. Philip Cannata

41

ReL Components

CodeCompiler.java
Python.g
The Python grammar was changed to include SIM, SQL, Prolog, and ASP statements.

AST

Visitor Interpreter Runtime Stack

The Tuple entry in CodeCompiler was modified to deal with putting SIM, SQL, Prolog, and ASP information and expressions on the runtime stack and to assure that a new instance of PyTuple is created after the expressions are evaluated.

jSIMParser
There is no jSIMParser to parse SIM statements like jSQLParser for SQL but I hope one will be built as a project.

PyTuple.java

-----------parseSIM()
parseSIM parses SIM statements from PyTuple and produces and passes AS information to SIMHelper.

jSQLParser
jSQLParser parses SQL statements from PyTuple and produces an AST that can be visited.

SIMHelper.java
SIMHelper produces appropriate SPARQL statements for the SIM statements which are sent to SPARQLDoer.
Dr. Philip Cannata

SQLVisitor.java
SQLVisitor visits the jSQLParser AST and produces appropriate SPARQL statements for the SQL statements which are sent to SPARQLDoer. 42

SPARQLDoer.java Oracle DBMS

You might also like