fixing some mistmaches
authorBoris Villazon-Terrazas <bvillazon@fi.upm.es>
Sat, 06 Aug 2011 21:13:10 +0100
changeset 19 9d7861140814
parent 18 6a177981074b
child 20 625cee5c2233
fixing some mistmaches
D001-1table1row/create.sql
D002-1table2columns1row/create.sql
D002-1table2columns1row/r2rmlb.ttl
D003-1table3columns1row/create.sql
D004-1table2columnsprojection/create.sql
D005-2duplicates0nulls/create.sql
D006-1table1primarykey1column1row/create.sql
D007-1table1primarykey2columns1row/create.sql
D008-1table1compositeprimarykey3columns1row/create.sql
D009-2tables1primarykey1foreingkey/create.sql
D010-I18NnoSpecialChars/create.sql
D011-M2MRelations/create.sql
D012-2tables2duplicates0nulls/create.sql
D013-1table3columns2rows1nullvalue/create.sql
D014-3tablesExample/create.sql
D014-3tablesExample/r2rmlb.ttl
D014-3tablesExample/r2rmlc.ttl
D014-3tablesExample/r2rmld.ttl
D014-3tablesExample/r2rmle.ttl
--- a/D001-1table1row/create.sql	Fri Jul 29 16:03:56 2011 +0100
+++ b/D001-1table1row/create.sql	Sat Aug 06 21:13:10 2011 +0100
@@ -1,4 +1,4 @@
 CREATE TABLE Student (
 Name varchar(50)
 );
-INSERT INTO Student (Name) VALUES ("Venus");
+INSERT INTO Student (Name) VALUES ('Venus');
--- a/D002-1table2columns1row/create.sql	Fri Jul 29 16:03:56 2011 +0100
+++ b/D002-1table2columns1row/create.sql	Sat Aug 06 21:13:10 2011 +0100
@@ -2,4 +2,4 @@
 ID integer,
 Name varchar(50)
 );
-INSERT INTO Student (ID, Name) VALUES(10,"Venus");
+INSERT INTO Student (ID, Name) VALUES(10,'Venus');
--- a/D002-1table2columns1row/r2rmlb.ttl	Fri Jul 29 16:03:56 2011 +0100
+++ b/D002-1table2columns1row/r2rmlb.ttl	Sat Aug 06 21:13:10 2011 +0100
@@ -9,7 +9,7 @@
     
     rr:logicalTable [ 
                      rr:sqlQuery """
-                       Select ('Student' || ID ) AS "StudentId"
+                       Select ('Student' || ID ) AS StudentId
                             , ID
                             , Name
                          from Student
--- a/D003-1table3columns1row/create.sql	Fri Jul 29 16:03:56 2011 +0100
+++ b/D003-1table3columns1row/create.sql	Sat Aug 06 21:13:10 2011 +0100
@@ -3,4 +3,4 @@
 FirstName varchar(50),
 LastName varchar(50)
 );
-INSERT INTO Student (ID, FirstName, LastName) VALUES (10,"Venus", "Williams");
+INSERT INTO Student (ID, FirstName, LastName) VALUES (10,'Venus', 'Williams');
--- a/D004-1table2columnsprojection/create.sql	Fri Jul 29 16:03:56 2011 +0100
+++ b/D004-1table2columnsprojection/create.sql	Sat Aug 06 21:13:10 2011 +0100
@@ -2,4 +2,4 @@
       Student varchar(50),
       Sport varchar(50)
 );
-INSERT INTO Student_Sport (Student,Sport) VALUES ("Venus", "Tennis");
+INSERT INTO Student_Sport (Student,Sport) VALUES ('Venus', 'Tennis');
--- a/D005-2duplicates0nulls/create.sql	Fri Jul 29 16:03:56 2011 +0100
+++ b/D005-2duplicates0nulls/create.sql	Sat Aug 06 21:13:10 2011 +0100
@@ -2,6 +2,6 @@
       fname CHAR(20),
       lname CHAR(20),
       amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ("Bob", "Smith", 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ("Sue", "Jones", 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ("Bob", "Smith", 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
--- a/D006-1table1primarykey1column1row/create.sql	Fri Jul 29 16:03:56 2011 +0100
+++ b/D006-1table1primarykey1column1row/create.sql	Sat Aug 06 21:13:10 2011 +0100
@@ -1,4 +1,4 @@
 CREATE TABLE Student (
 Name varchar(50) PRIMARY KEY
 );
-INSERT INTO Student (Name) VALUES ("Venus");
+INSERT INTO Student (Name) VALUES ('Venus');
--- a/D007-1table1primarykey2columns1row/create.sql	Fri Jul 29 16:03:56 2011 +0100
+++ b/D007-1table1primarykey2columns1row/create.sql	Sat Aug 06 21:13:10 2011 +0100
@@ -3,4 +3,4 @@
 Name varchar(50),
 PRIMARY KEY (ID)
 );
-INSERT INTO Student (ID, Name) VALUES(10,"Venus");
+INSERT INTO Student (ID, Name) VALUES(10,'Venus');
--- a/D008-1table1compositeprimarykey3columns1row/create.sql	Fri Jul 29 16:03:56 2011 +0100
+++ b/D008-1table1compositeprimarykey3columns1row/create.sql	Sat Aug 06 21:13:10 2011 +0100
@@ -4,4 +4,4 @@
 Sport varchar (50),
 PRIMARY KEY (ID,Name)
 );
-INSERT INTO Student (ID, Name,Sport) VALUES(10,"Venus Williams","Tennis");
+INSERT INTO Student (ID, Name,Sport) VALUES(10,'Venus Williams','Tennis');
--- a/D009-2tables1primarykey1foreingkey/create.sql	Fri Jul 29 16:03:56 2011 +0100
+++ b/D009-2tables1primarykey1foreingkey/create.sql	Sat Aug 06 21:13:10 2011 +0100
@@ -12,7 +12,7 @@
 FOREIGN KEY(Sport) REFERENCES Sport(ID)
 );
 
-INSERT INTO Sport (ID, Name) VALUES (100,"Tennis");
-INSERT INTO Student (ID, Name, Sport) VALUES (10,"Venus Williams", 100);
-INSERT INTO Student (ID, Name, Sport) VALUES (20,"Demi Moore", NULL);
+INSERT INTO Sport (ID, Name) VALUES (100,'Tennis');
+INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100);
+INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL);
 
Binary file D010-I18NnoSpecialChars/create.sql has changed
--- a/D011-M2MRelations/create.sql	Fri Jul 29 16:03:56 2011 +0100
+++ b/D011-M2MRelations/create.sql	Sat Aug 06 21:13:10 2011 +0100
@@ -15,13 +15,13 @@
 FOREIGN KEY (ID_Sport) REFERENCES Sport(ID)
 );
 
-INSERT INTO Student (ID,FirstName,LastName) VALUES (10,"Venus", "Williams");
-INSERT INTO Student (ID,FirstName,LastName) VALUES (11,"Fernando", "Alonso");
-INSERT INTO Student (ID,FirstName,LastName) VALUES (12,"David", "Villa");
+INSERT INTO Student (ID,FirstName,LastName) VALUES (10,'Venus', 'Williams');
+INSERT INTO Student (ID,FirstName,LastName) VALUES (11,'Fernando', 'Alonso');
+INSERT INTO Student (ID,FirstName,LastName) VALUES (12,'David', 'Villa');
 
-INSERT INTO Sport (ID, Description) VALUES (110,"Tennis");
-INSERT INTO Sport (ID, Description) VALUES (111,"Football");
-INSERT INTO Sport (ID, Description) VALUES (112,"Formula1");
+INSERT INTO Sport (ID, Description) VALUES (110,'Tennis');
+INSERT INTO Sport (ID, Description) VALUES (111,'Football');
+INSERT INTO Sport (ID, Description) VALUES (112,'Formula1');
 
 INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (10,110);
 INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,111);
--- a/D012-2tables2duplicates0nulls/create.sql	Fri Jul 29 16:03:56 2011 +0100
+++ b/D012-2tables2duplicates0nulls/create.sql	Sat Aug 06 21:13:10 2011 +0100
@@ -2,14 +2,14 @@
       fname CHAR(20),
       lname CHAR(20),
       amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ("Bob", "Smith", 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ("Sue", "Jones", 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ("Bob", "Smith", 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
 
 CREATE TABLE Lives (
       fname CHAR(20),
       lname CHAR(20),
       city CHAR(20));
-INSERT INTO IOUs (fname, lname, amount) VALUES ("Bob", "Smith", "London");
-INSERT INTO IOUs (fname, lname, amount) VALUES ("Sue", "Jones", "Madrid");
-INSERT INTO IOUs (fname, lname, amount) VALUES ("Bob", "Smith", "London");
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 'London');
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 'Madrid');
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 'London');
--- a/D013-1table3columns2rows1nullvalue/create.sql	Fri Jul 29 16:03:56 2011 +0100
+++ b/D013-1table3columns2rows1nullvalue/create.sql	Sat Aug 06 21:13:10 2011 +0100
@@ -1,7 +1,8 @@
 CREATE TABLE Person (
 ID integer,
 Name varchar(50),
-DateOfBirth varchar(50)
+DateOfBirth varchar(50),
+PRIMARY KEY (ID)
 );
-INSERT INTO Person (ID, Name, DateOfBirth) VALUES (1,"Alice", NULL);
-INSERT INTO Person (ID, Name, DateOfBirth) VALUES (2,"Bob", "September, 2010");
\ No newline at end of file
+INSERT INTO Person (ID, Name, DateOfBirth) VALUES (1,'Alice', NULL);
+INSERT INTO Person (ID, Name, DateOfBirth) VALUES (2,'Bob', 'September, 2010');
\ No newline at end of file
--- a/D014-3tablesExample/create.sql	Fri Jul 29 16:03:56 2011 +0100
+++ b/D014-3tablesExample/create.sql	Sat Aug 06 21:13:10 2011 +0100
@@ -2,7 +2,7 @@
       deptno INTEGER UNIQUE,
       dname VARCHAR(30),
       loc VARCHAR(100));
-INSERT INTO DEPT (deptno, dname, loc) VALUES (10, "APPSERVER", "NEW YORK");
+INSERT INTO DEPT (deptno, dname, loc) VALUES (10, 'APPSERVER', 'NEW YORK');
 
 CREATE TABLE EMP (
       empno INTEGER PRIMARY KEY,
@@ -10,12 +10,12 @@
       job VARCHAR(30),
 	  deptno INTEGER REFERENCES DEPT (deptno),
 	  etype VARCHAR(30));
-INSERT INTO EMP (empno, ename, job, deptno, etype ) VALUES (7369, "SMITH", "CLERK", 10, "PART_TIME");
+INSERT INTO EMP (empno, ename, job, deptno, etype ) VALUES (7369, 'SMITH', 'CLERK', 10, 'PART_TIME');
 
 CREATE TABLE LIKES (
       id INTEGER,
       likeType VARCHAR(30),
       likedObj VARCHAR(100));
-INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, "Playing", "Soccer");
-INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, "Watching", "Basketball");
+INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Playing', 'Soccer');
+INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Watching', 'Basketball');
 
--- a/D014-3tablesExample/r2rmlb.ttl	Fri Jul 29 16:03:56 2011 +0100
+++ b/D014-3tablesExample/r2rmlb.ttl	Sat Aug 06 21:13:10 2011 +0100
@@ -7,18 +7,59 @@
 @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
 @base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
 
+
+<TriplesMap1>
+    a rr:TriplesMap;
+    rr:logicalTable [ rr:sqlQuery """
+       Select ('Department' || deptno) AS deptId
+            , deptno
+            , dname
+            , loc
+         from SCOTT.DEPT
+       """ ];
+
+    rr:subjectMap [ rr:column "deptId"; rr:termType rr:BlankNode;
+                    rr:class ex:dept; 
+                    rr:graphMap [ rr:graph ex:DeptGraph; ];
+                    rr:inverseExpression "{deptno} = substr({deptId},length('Department')+1)"];
+
+    rr:predicateObjectMap
+    [ 
+      rr:predicateMap [ rr:predicate dept:deptno ]; 
+      rr:objectMap    [ rr:column "deptno"; rr:datatype xsd:positiveInteger ]
+    ];
+
+    rr:predicateObjectMap 
+    [ 
+      rr:predicateMap [ rr:predicate dept:name ]; 
+      rr:objectMap    [ rr:column "dname" ]
+    ];
+
+    rr:predicateObjectMap 
+    [ 
+      rr:predicateMap [ rr:predicate dept:location ]; 
+      rr:objectMap    [ rr:column "loc" ]
+    ];
+
+    rr:predicateObjectMap 
+    [ 
+      rr:predicateMap [ rr:predicate dept:COMPANY ]; 
+      rr:objectMap    [ rr:object "EXAMPLE Corporation" ]
+    ]
+.
+
 <TriplesMap2>
     a rr:TriplesMap;
     rr:logicalTable [ rr:sqlQuery """
-       Select ('http://example.com/emp/' || "empno") AS "empURI"
-            , "empno"
-            , "ename"
-            , ('http://example.com/emp/job/'|| "job") AS "jobTypeURI"
-            , "job"
-            , "deptno"
-            , ('http://example.com/emp/etype/'|| "etype") AS "empTypeURI"
-            , "etype"
-            , ('http://example.com/graph/'|| "job" || '/' || "etype") AS "graphURI"
+       Select ('http://example.com/emp/' || empno) AS empURI
+            , empno
+            , ename
+            , ('http://example.com/emp/job/'|| job) AS jobTypeURI
+            , job
+            , deptno
+            , ('http://example.com/emp/etype/'|| etype) AS empTypeURI
+            , etype
+            , ('http://example.com/graph/'|| job || '/' || etype) AS graphURI
        from SCOTT.EMP
        """ ];
 
@@ -84,7 +125,7 @@
     rr:predicateObjectMap [
       rr:predicateMap [ rr:predicate emp:c_ref_deptno ];
       rr:refObjectMap    [
-        rr:parentTriplesMap <#TriplesMap1>;
+        rr:parentTriplesMap <TriplesMap1>;
         rr:joinCondition [
           rr:child "deptno";
           rr:parent "deptno";
--- a/D014-3tablesExample/r2rmlc.ttl	Fri Jul 29 16:03:56 2011 +0100
+++ b/D014-3tablesExample/r2rmlc.ttl	Sat Aug 06 21:13:10 2011 +0100
@@ -7,6 +7,48 @@
 @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
 @base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
 
+
+
+<TriplesMap1>
+    a rr:TriplesMap;
+    rr:logicalTable [ rr:sqlQuery """
+       Select ('Department' || deptno) AS deptId
+            , deptno
+            , dname
+            , loc
+         from SCOTT.DEPT
+       """ ];
+
+    rr:subjectMap [ rr:column "deptId"; rr:termType rr:BlankNode;
+                    rr:class ex:dept; 
+                    rr:graphMap [ rr:graph ex:DeptGraph; ];
+                    rr:inverseExpression "{deptno} = substr({deptId},length('Department')+1)"];
+
+    rr:predicateObjectMap
+    [ 
+      rr:predicateMap [ rr:predicate dept:deptno ]; 
+      rr:objectMap    [ rr:column "deptno"; rr:datatype xsd:positiveInteger ]
+    ];
+
+    rr:predicateObjectMap 
+    [ 
+      rr:predicateMap [ rr:predicate dept:name ]; 
+      rr:objectMap    [ rr:column "dname" ]
+    ];
+
+    rr:predicateObjectMap 
+    [ 
+      rr:predicateMap [ rr:predicate dept:location ]; 
+      rr:objectMap    [ rr:column "loc" ]
+    ];
+
+    rr:predicateObjectMap 
+    [ 
+      rr:predicateMap [ rr:predicate dept:COMPANY ]; 
+      rr:objectMap    [ rr:object "EXAMPLE Corporation" ]
+    ]
+.
+
 <TriplesMap2>
     a rr:TriplesMap;
 
@@ -75,7 +117,7 @@
     rr:predicateObjectMap [
       rr:predicateMap [ rr:predicate emp:c_ref_deptno ];
       rr:refObjectMap    [
-        rr:parentTriplesMap <#TriplesMap1>;
+        rr:parentTriplesMap <TriplesMap1>;
         rr:joinCondition [
           rr:child "deptno";
           rr:parent "deptno";
--- a/D014-3tablesExample/r2rmld.ttl	Fri Jul 29 16:03:56 2011 +0100
+++ b/D014-3tablesExample/r2rmld.ttl	Sat Aug 06 21:13:10 2011 +0100
@@ -7,6 +7,47 @@
 @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
 @base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
 
+<TriplesMap1>
+    a rr:TriplesMap;
+    rr:logicalTable [ rr:sqlQuery """
+       Select ('Department' || deptno) AS deptId
+            , deptno
+            , dname
+            , loc
+         from SCOTT.DEPT
+       """ ];
+
+    rr:subjectMap [ rr:column "deptId"; rr:termType rr:BlankNode;
+                    rr:class ex:dept; 
+                    rr:graphMap [ rr:graph ex:DeptGraph; ];
+                    rr:inverseExpression "{deptno} = substr({deptId},length('Department')+1)"];
+
+    rr:predicateObjectMap
+    [ 
+      rr:predicateMap [ rr:predicate dept:deptno ]; 
+      rr:objectMap    [ rr:column "deptno"; rr:datatype xsd:positiveInteger ]
+    ];
+
+    rr:predicateObjectMap 
+    [ 
+      rr:predicateMap [ rr:predicate dept:name ]; 
+      rr:objectMap    [ rr:column "dname" ]
+    ];
+
+    rr:predicateObjectMap 
+    [ 
+      rr:predicateMap [ rr:predicate dept:location ]; 
+      rr:objectMap    [ rr:column "loc" ]
+    ];
+
+    rr:predicateObjectMap 
+    [ 
+      rr:predicateMap [ rr:predicate dept:COMPANY ]; 
+      rr:objectMap    [ rr:object "EXAMPLE Corporation" ]
+    ]
+.
+
+
 <#jobtypeObjectMap>
     a rr:ObjectMap;
     rr:template "http://example.com/emp/job/{job}"
@@ -17,7 +58,7 @@
     rr:template "http://example.com/emp/etype/{etype}"
     .
 
-<#TriplesMap2>
+<TriplesMap2>
     a rr:TriplesMap;
 
     rr:logicalTable [ rr:tableName "SCOTT.EMP" ];
@@ -85,7 +126,7 @@
     rr:predicateObjectMap [
       rr:predicateMap [ rr:predicate emp:c_ref_deptno ];
       rr:refObjectMap    [
-        rr:parentTriplesMap <#TriplesMap1>;
+        rr:parentTriplesMap <TriplesMap1>;
         rr:joinCondition [
           rr:child "deptno";
           rr:parent "deptno";
--- a/D014-3tablesExample/r2rmle.ttl	Fri Jul 29 16:03:56 2011 +0100
+++ b/D014-3tablesExample/r2rmle.ttl	Sat Aug 06 21:13:10 2011 +0100
@@ -10,9 +10,9 @@
 <TriplesMap3>
     a rr:TriplesMap;
     rr:logicalTable [ rr:sqlQuery """
-      Select ('http://example.com/emp/' || "id") AS "empId"
-           , ('http://example.com/emp/likes/' || "likeType") AS "empLikes"
-           , "likedObj"
+      Select ('http://example.com/emp/' || id) AS empId
+           , ('http://example.com/emp/likes/' || likeType) AS empLikes
+           , likedObj
         from SCOTT.LIKES
       """ ];