-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merged with development + fixed bugs
- Loading branch information
Showing
501 changed files
with
10,121 additions
and
722 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#maven.buildNumber.plugin properties file | ||
#Tue Aug 07 15:31:45 CEST 2018 | ||
buildNumber0=26 | ||
#Thu Aug 09 14:05:44 CEST 2018 | ||
buildNumber0=29 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
verbose = true | ||
mapping = path_to_mapping_file | ||
output = path_to_output_file | ||
help = true | ||
mappingfile = path_to_mapping_file | ||
outputfile = path_to_output_file | ||
help = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/main/java/be/ugent/rml/ApplyTemplateFunctionFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package be.ugent.rml; | ||
|
||
import be.ugent.rml.functions.ApplyTemplateFunction; | ||
import be.ugent.rml.functions.Function; | ||
import be.ugent.rml.term.NamedNode; | ||
import be.ugent.rml.term.Term; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
|
||
public class ApplyTemplateFunctionFactory { | ||
|
||
static Function generate(String genericTemplate, Term termType) { | ||
return ApplyTemplateFunctionFactory.generate(genericTemplate, termType.equals(new NamedNode(NAMESPACES.RR + "IRI"))); | ||
} | ||
|
||
static Function generate(String genericTemplate, boolean encodeURI) { | ||
HashMap<String, List<Template>> parameters = new HashMap<>(); | ||
ArrayList<Template> temp = new ArrayList<>(); | ||
temp.add(Utils.parseTemplate(genericTemplate)); | ||
parameters.put("_TEMPLATE", temp); | ||
return new ApplyTemplateFunction(parameters, encodeURI); | ||
} | ||
|
||
static Function generateWithConstantValue(String value) { | ||
HashMap<String, List<Template>> parameters = new HashMap<>(); | ||
List<Template> temp = new ArrayList<>(); | ||
Template temp2 = new Template(); | ||
temp2.addElement(new TemplateElement(value, TEMPLATETYPE.CONSTANT)); | ||
temp.add(temp2); | ||
|
||
parameters.put("_TEMPLATE", temp); | ||
|
||
return new ApplyTemplateFunction(parameters); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
package be.ugent.rml; | ||
|
||
/* | ||
NOTE: Oracle is disabled because there are multiple drivers possible: http://www.orafaq.com/wiki/JDBC | ||
*/ | ||
|
||
public class DatabaseType { | ||
|
||
public static final String MYSQL = "com.mysql.cj.jdbc.Driver"; | ||
public static final String POSTGRES = "org.postgresql.Driver"; | ||
public static final String SQL_SERVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; | ||
//public static final String ORACLE = "oracle.jdbc.driver.OracleDrive"; | ||
public static final String DB2 = "com.ibm.as400.access.AS400JDBCDriver"; | ||
/* | ||
public static final String JAVA_DB = ; | ||
public static final String SYBASE = ; | ||
*/ | ||
|
||
/* | ||
Used to abstract as much as possible | ||
Name fields are used to create JDBC connection strings in @RDBs | ||
*/ | ||
public enum Database { | ||
MYSQL ("mysql"), | ||
POSTGRES ("postgresql"), | ||
SQL_SERVER ("sqlserver"), | ||
//ORACLE (""), | ||
DB2 ("as400"); | ||
|
||
private final String name; | ||
|
||
private Database(String s) { | ||
name = s; | ||
} | ||
|
||
public String toString() { | ||
return this.name; | ||
} | ||
} | ||
|
||
/* | ||
Retrieves the Database enum type from a given (driver) string | ||
*/ | ||
public static Database getDBtype(String db) { | ||
String db_lower = db.toLowerCase(); | ||
if (db_lower.contains("mysql")) { | ||
return Database.MYSQL; | ||
} else if (db_lower.contains("postgres")) { | ||
return Database.POSTGRES; | ||
} else if (db_lower.contains("sqlserver")) { | ||
return Database.SQL_SERVER; | ||
// } else if (db_lower.contains("oracle")) { | ||
// return Database.ORACLE; | ||
} else if (db_lower.contains("ibm")) { | ||
return Database.DB2; | ||
} else { | ||
throw new Error("Couldn't find a driver for the given DB: " + db); | ||
} | ||
} | ||
|
||
/* | ||
Retrieves the JDBC driver URL from a given Database enum type | ||
*/ | ||
public static String getDriver(Database db) { | ||
switch(db) { | ||
case MYSQL: | ||
return MYSQL; | ||
|
||
case POSTGRES: | ||
return POSTGRES; | ||
|
||
case SQL_SERVER: | ||
return SQL_SERVER; | ||
|
||
// case ORACLE: | ||
// return ORACLE; | ||
|
||
case DB2: | ||
return DB2; | ||
default: | ||
throw new Error("Couldn't find a driver for the given DB: " + db); | ||
} | ||
} | ||
} |
Oops, something went wrong.