Skip to content

Commit

Permalink
Hotfix/bug 64
Browse files Browse the repository at this point in the history
  • Loading branch information
pheyvaer committed Aug 16, 2018
1 parent 2bf45bf commit afa69ce
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 10 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- support for SPARQL endpoints
- support for TPF servers

## [0.2.1] - 2018-08-14

### Fixed

- Create valid temp file for prepackaged functions jars
- Use GrelProcessor.class by default instead of GrelFunctions.jar

## [0.2.0] - 2018-08-09

### Added
Expand Down Expand Up @@ -67,6 +74,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- support for accessing remote files (via HTTP GET)
- basic support for functions

[0.2.1]: https://github.com/RMLio/rmlmapper-java/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/RMLio/rmlmapper-java/compare/v0.1.6...v0.2.0
[0.1.6]: https://github.com/RMLio/rmlmapper-java/compare/v0.1.5...v0.1.6
[0.1.5]: https://github.com/RMLio/rmlmapper-java/compare/v0.1.4...v0.1.5
Expand Down
4 changes: 2 additions & 2 deletions buildNumber.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#maven.buildNumber.plugin properties file
#Thu Aug 09 14:40:24 CEST 2018
buildNumber0=32
#Tue Aug 14 10:23:00 CEST 2018
buildNumber0=40
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>be.ugent.rml</groupId>
<artifactId>rmlmapper</artifactId>
<version>0.2.0</version>
<version>0.2.1</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>4.12</junit.version>
Expand Down
12 changes: 10 additions & 2 deletions src/main/java/be/ugent/rml/MyFileUtils.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package be.ugent.rml;

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -42,6 +43,7 @@ public static class ClasspathResourceFileResource implements FileResource {

private ClassLoader cl;
private String resource;
private String extension;

/**
* @param cl
Expand All @@ -50,20 +52,26 @@ public static class ClasspathResourceFileResource implements FileResource {
ClasspathResourceFileResource(ClassLoader cl, String resource) {
this.cl = cl;
this.resource = resource;
this.extension = FilenameUtils.getExtension(resource);
}

/**
* @return
* @throws IOException
*/
public File getFile() throws IOException {
String suffix = "temp";

if (this.extension != null) {
suffix += "." + this.extension;
}

InputStream cpResource = cl.getResourceAsStream(resource);
File tmpFile = File.createTempFile("file", "temp");
File tmpFile = File.createTempFile("file", suffix);
FileUtils.copyInputStreamToFile(cpResource, tmpFile);
tmpFile.deleteOnExit();
return tmpFile;
}

}

public static class URLClassLoaderFileResource implements FileResource {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/be/ugent/rml/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ private static String getNTripleOfQuad(Quad q) {
}

private static String getNQuadOfQuad(Quad q) {
return q.getSubject() + " " + q.getPredicate() + " " + q.getObject() + "" + q.getGraph() + ".";
return q.getSubject() + " " + q.getPredicate() + " " + q.getObject() + " " + q.getGraph() + ".";
}

public static String encodeURI(String url) {
Expand Down
10 changes: 6 additions & 4 deletions src/main/java/be/ugent/rml/cli/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import be.ugent.rml.*;
import be.ugent.rml.functions.FunctionLoader;
import be.ugent.rml.functions.lib.GrelProcessor;
import be.ugent.rml.records.RecordsFactory;
import be.ugent.rml.store.Quad;
import be.ugent.rml.store.QuadStore;
Expand All @@ -14,9 +15,7 @@
import org.slf4j.LoggerFactory;

import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.*;

public class Main {

Expand Down Expand Up @@ -84,7 +83,10 @@ public static void main(String [] args) {
FunctionLoader functionLoader = new FunctionLoader(functionFile);
executor = new Executor(rmlStore, factory, functionLoader);
} else {
executor = new Executor(rmlStore, factory);
Map<String, Class> libraryMap = new HashMap<>();
libraryMap.put("GrelFunctions", GrelProcessor.class);
FunctionLoader functionLoader = new FunctionLoader(null, null, libraryMap);
executor = new Executor(rmlStore, factory, functionLoader);
}

List<Term> triplesMaps = new ArrayList<>();
Expand Down

0 comments on commit afa69ce

Please sign in to comment.