Skip to content

Commit

Permalink
updated test cases for correct mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
bjdmeest committed Feb 13, 2019
1 parent 4668a68 commit e8ac8d0
Show file tree
Hide file tree
Showing 166 changed files with 1,492 additions and 1,225 deletions.
6 changes: 3 additions & 3 deletions test-cases/RMLTC0002d-MySQL/mapping.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
rml:logicalSource [
rml:source <#DB_source>;
rr:sqlVersion rr:SQL2008;
rml:query "SELECT ('Student' || \"ID\" ) AS StudentId, \"ID\", \"Name\" FROM student";
rml:query "SELECT CONCAT('Student', ID) AS StudentId, ID, Name FROM student";
rml:referenceFormulation ql:CSV
];

rr:subjectMap [
rml:reference "StudentId". rr:termType rr:BlankNode
rml:reference "StudentId"; rr:termType rr:BlankNode
];

rr:predicateObjectMap [
rr:predicate foaf:name ;
rr:objectMap [ rml:reference "\"Name\"" ]
rr:objectMap [ rml:reference "Name" ]
].

<#DB_source> a d2rq:Database;
Expand Down
6 changes: 3 additions & 3 deletions test-cases/RMLTC0002d-PostgreSQL/mapping.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
rml:logicalSource [
rml:source <#DB_source>;
rr:sqlVersion rr:SQL2008;
rml:query "SELECT ('Student' || \"ID\" ) AS StudentId, \"ID\", \"Name\" FROM student";
rml:query "SELECT ('Student' || ID) AS StudentId, ID, Name FROM student";
rml:referenceFormulation ql:CSV
];

rr:subjectMap [
rml:reference "StudentId". rr:termType rr:BlankNode
rml:reference "StudentId"; rr:termType rr:BlankNode
];

rr:predicateObjectMap [
rr:predicate foaf:name ;
rr:objectMap [ rml:reference "\"Name\"" ]
rr:objectMap [ rml:reference "Name" ]
].

<#DB_source> a d2rq:Database;
Expand Down
6 changes: 3 additions & 3 deletions test-cases/RMLTC0002d-SQLServer/mapping.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
rml:logicalSource [
rml:source <#DB_source>;
rr:sqlVersion rr:SQL2008;
rml:query "SELECT ('Student' || \"ID\" ) AS StudentId, \"ID\", \"Name\" FROM student";
rml:query "SELECT ('Student' || ID ) AS StudentId, ID, Name FROM student";
rml:referenceFormulation ql:CSV
];

rr:subjectMap [
rml:reference "StudentId". rr:termType rr:BlankNode
rml:reference "StudentId"; rr:termType rr:BlankNode
];

rr:predicateObjectMap [
rr:predicate foaf:name ;
rr:objectMap [ rml:reference "\"Name\"" ]
rr:objectMap [ rml:reference "Name" ]
].

<#DB_source> a d2rq:Database;
Expand Down
8 changes: 4 additions & 4 deletions test-cases/RMLTC0002f-MySQL/mapping.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@
rml:logicalSource [
rml:source <#DB_source>;
rr:sqlVersion rr:SQL2008;
rr:tableName "\"Student\""
rr:tableName "Student"
];

rr:subjectMap [
rr:template "http://example.com/{ID}/{Name}";
r:class foaf:Person
rr:class foaf:Person
];

rr:predicateObjectMap
[
rr:predicate ex:id ;
rr:objectMap [ rml:reference "\"ID\""; ]
rr:objectMap [ rml:reference "ID"; ]
];

rr:predicateObjectMap
[
rr:predicate foaf:name ;
rr:objectMap [ rml:reference "\"Name\"" ]
rr:objectMap [ rml:reference "Name" ]
].

<#DB_source> a d2rq:Database;
Expand Down
10 changes: 6 additions & 4 deletions test-cases/RMLTC0002f-MySQL/resource.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
CREATE TABLE "Student" (
"ID" INTEGER,
"Name" VARCHAR(15)
USE test;
DROP TABLE IF EXISTS test.Student;
CREATE TABLE Student (
ID INTEGER,
Name VARCHAR(15)
);
INSERT INTO "Student" ("ID", "Name") VALUES(10,'Venus');
INSERT INTO Student (ID, Name) VALUES(10,'Venus');
8 changes: 4 additions & 4 deletions test-cases/RMLTC0002f-PostgreSQL/mapping.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@
rml:logicalSource [
rml:source <#DB_source>;
rr:sqlVersion rr:SQL2008;
rr:tableName "\"Student\""
rr:tableName "Student"
];

rr:subjectMap [
rr:template "http://example.com/{ID}/{Name}";
r:class foaf:Person
rr:class foaf:Person
];

rr:predicateObjectMap
[
rr:predicate ex:id ;
rr:objectMap [ rml:reference "\"ID\""; ]
rr:objectMap [ rml:reference "ID"; ]
];

rr:predicateObjectMap
[
rr:predicate foaf:name ;
rr:objectMap [ rml:reference "\"Name\"" ]
rr:objectMap [ rml:reference "Name" ]
].

<#DB_source> a d2rq:Database;
Expand Down
10 changes: 6 additions & 4 deletions test-cases/RMLTC0002f-PostgreSQL/resource.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
CREATE TABLE "Student" (
"ID" INTEGER,
"Name" VARCHAR(15)
USE test;
DROP TABLE IF EXISTS test.Student;
CREATE TABLE Student (
ID INTEGER,
Name VARCHAR(15)
);
INSERT INTO "Student" ("ID", "Name") VALUES(10,'Venus');
INSERT INTO Student (ID, Name) VALUES(10,'Venus');
8 changes: 4 additions & 4 deletions test-cases/RMLTC0002f-SQLServer/mapping.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@
rml:logicalSource [
rml:source <#DB_source>;
rr:sqlVersion rr:SQL2008;
rr:tableName "\"Student\""
rr:tableName "Student"
];

rr:subjectMap [
rr:template "http://example.com/{ID}/{Name}";
r:class foaf:Person
rr:class foaf:Person
];

rr:predicateObjectMap
[
rr:predicate ex:id ;
rr:objectMap [ rml:reference "\"ID\""; ]
rr:objectMap [ rml:reference "ID"; ]
];

rr:predicateObjectMap
[
rr:predicate foaf:name ;
rr:objectMap [ rml:reference "\"Name\"" ]
rr:objectMap [ rml:reference "Name" ]
].

<#DB_source> a d2rq:Database;
Expand Down
10 changes: 6 additions & 4 deletions test-cases/RMLTC0002f-SQLServer/resource.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
CREATE TABLE "Student" (
"ID" INTEGER,
"Name" VARCHAR(15)
USE test;
DROP TABLE IF EXISTS test.Student;
CREATE TABLE Student (
ID INTEGER,
Name VARCHAR(15)
);
INSERT INTO "Student" ("ID", "Name") VALUES(10,'Venus');
INSERT INTO Student (ID, Name) VALUES(10,'Venus');
7 changes: 4 additions & 3 deletions test-cases/RMLTC0005a-MySQL/mapping.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,25 @@
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rml: <http://semweb.mmlab.be/ns/rml#> .
@prefix ql: <http://semweb.mmlab.be/ns/ql#> .
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
@base <http://example.com/base/> .

<TriplesMap1> a rr:TriplesMap;

rml:logicalSource [
rml:source <#DB_source>;
rr:sqlVersion rr:SQL2008;
rr:tableName "\"IOUs\"";
rr:tableName "IOUs";
];

rr:subjectMap [
rr:template "http://example.com/{\"fname\"};{\"lname\"}";
rr:template "http://example.com/{fname};{lname}";
rr:class foaf:Person;
];

rr:predicateObjectMap [
rr:predicate ex:owes;
rr:objectMap [ rml:reference "\"amount\""; ]
rr:objectMap [ rml:reference "amount"; ]
].

<#DB_source> a d2rq:Database;
Expand Down
17 changes: 9 additions & 8 deletions test-cases/RMLTC0005a-MySQL/resource.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
CREATE TABLE "IOUs" (
"fname" VARCHAR(20),
"lname" VARCHAR(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);

USE test;
DROP TABLE IF EXISTS test.IOUs;
CREATE TABLE IOUs (
fname VARCHAR(20),
lname VARCHAR(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);
8 changes: 4 additions & 4 deletions test-cases/RMLTC0005a-PostgreSQL/mapping.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rml: <http://semweb.mmlab.be/ns/rml#> .
@prefix ql: <http://semweb.mmlab.be/ns/ql#> .
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
@base <http://example.com/base/> .

<TriplesMap1> a rr:TriplesMap;

rml:logicalSource [
rml:source <#DB_source>;
rr:sqlVersion rr:SQL2008;
rr:tableName "\"IOUs\"";
rr:tableName "IOUs";
];

rr:subjectMap [
rr:template "http://example.com/{\"fname\"};{\"lname\"}";
rr:template "http://example.com/{fname};{lname}";
rr:class foaf:Person;
];

rr:predicateObjectMap [
rr:predicate ex:owes;
rr:objectMap [ rml:reference "\"amount\""; ]
rr:objectMap [ rml:reference "amount"; ]
].


<#DB_source> a d2rq:Database;
d2rq:jdbcDSN "CONNECTIONDSN";
d2rq:jdbcDriver "org.postgresql.Driver";
Expand Down
17 changes: 9 additions & 8 deletions test-cases/RMLTC0005a-PostgreSQL/resource.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
CREATE TABLE "IOUs" (
"fname" VARCHAR(20),
"lname" VARCHAR(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);

USE test;
DROP TABLE IF EXISTS test.IOUs;
CREATE TABLE IOUs (
fname VARCHAR(20),
lname VARCHAR(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);
8 changes: 4 additions & 4 deletions test-cases/RMLTC0005a-SQLServer/mapping.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rml: <http://semweb.mmlab.be/ns/rml#> .
@prefix ql: <http://semweb.mmlab.be/ns/ql#> .
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
@base <http://example.com/base/> .

<TriplesMap1> a rr:TriplesMap;

rml:logicalSource [
rml:source <#DB_source>;
rr:sqlVersion rr:SQL2008;
rr:tableName "\"IOUs\"";
rr:tableName "IOUs";
];

rr:subjectMap [
rr:template "http://example.com/{\"fname\"};{\"lname\"}";
rr:template "http://example.com/{fname};{lname}";
rr:class foaf:Person;
];

rr:predicateObjectMap [
rr:predicate ex:owes;
rr:objectMap [ rml:reference "\"amount\""; ]
rr:objectMap [ rml:reference "amount"; ]
].


<#DB_source> a d2rq:Database;
d2rq:jdbcDSN "CONNECTIONDSN";
d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
Expand Down
17 changes: 9 additions & 8 deletions test-cases/RMLTC0005a-SQLServer/resource.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
CREATE TABLE "IOUs" (
"fname" VARCHAR(20),
"lname" VARCHAR(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);

USE test;
DROP TABLE IF EXISTS test.IOUs;
CREATE TABLE IOUs (
fname VARCHAR(20),
lname VARCHAR(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);
15 changes: 8 additions & 7 deletions test-cases/RMLTC0005b-MySQL/mapping.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,36 @@
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rml: <http://semweb.mmlab.be/ns/rml#> .
@prefix ql: <http://semweb.mmlab.be/ns/ql#> .
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
@base <http://example.com/base/> .

<TriplesMap1> a rr:TriplesMap;

rml:logicalSource [
rml:source <#DB_source>;
rr:sqlVersion rr:SQL2008;
rr:tableName "\"IOUs\"";
rr:tableName "IOUs";
];

rr:subjectMap [
rr:template "{\"fname\"}_{\"lname\"}";
rr:template "{fname}_{lname}";
rr:class <IOUs>;
rr:termType rr:BlankNode
];

rr:predicateObjectMap [
rr:predicate <IOUs#fname>;
rr:objectMap [ rml:reference "\"fname\""; ]
].
rr:objectMap [ rml:reference "fname"; ]
];

rr:predicateObjectMap [
rr:predicate <IOUs#lname>;
rr:objectMap [ rml:reference "\"lname\""; ]
].
rr:objectMap [ rml:reference "lname"; ]
];

rr:predicateObjectMap [
rr:predicate <IOUs#amount>;
rr:objectMap [ rml:reference "\"amount\""; ]
rr:objectMap [ rml:reference "amount"; ]
].

<#DB_source> a d2rq:Database;
Expand Down
16 changes: 9 additions & 7 deletions test-cases/RMLTC0005b-MySQL/resource.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
CREATE TABLE "IOUs" (
"fname" VARCHAR(20),
"lname" VARCHAR(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);
USE test;
DROP TABLE IF EXISTS test.IOUs;
CREATE TABLE IOUs (
fname VARCHAR(20),
lname VARCHAR(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);
Loading

0 comments on commit e8ac8d0

Please sign in to comment.