Skip to content

Commit

Permalink
added trig example, updated pom
Browse files Browse the repository at this point in the history
  • Loading branch information
bjdmeest committed Jan 4, 2019
1 parent 5741b2a commit d1f1597
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .gitlab-ci.yml
Expand Up @@ -3,8 +3,8 @@ image: maven:3.5.0-jdk-8
variables:
# This will suppress any download for dependencies and plugins or upload messages which would clutter the console log.
# `showDateTime` will show the passed time in milliseconds.
# MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
# Postgres
POSTGRES_DB: postgres
POSTGRES_USER: postgres
Expand All @@ -20,7 +20,7 @@ cache:

verify:
script:
- mvn test --batch-mode
- 'mvn $MAVEN_CLI_OPTS test'

services:
- postgres:10.4
Expand Down
4 changes: 2 additions & 2 deletions buildNumber.properties
@@ -1,3 +1,3 @@
#maven.buildNumber.plugin properties file
#Thu Jan 03 14:34:03 CET 2019
buildNumber0=74
#Thu Jan 03 16:27:40 CET 2019
buildNumber0=78
8 changes: 4 additions & 4 deletions dependency-reduced-pom.xml
Expand Up @@ -23,7 +23,7 @@
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.1</version>
<version>3.2.1</version>
<executions>
<execution>
<id>make-assembly</id>
Expand Down Expand Up @@ -59,9 +59,10 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<version>3.0.0-M3</version>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
<useSystemClassLoader>true</useSystemClassLoader>
<useManifestOnlyJar>false</useManifestOnlyJar>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -135,4 +136,3 @@
<junit.version>4.12</junit.version>
</properties>
</project>

16 changes: 11 additions & 5 deletions pom.xml
Expand Up @@ -41,6 +41,11 @@
<artifactId>commons-cli</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>com.github.jsonld-java.jsonld-java</groupId>
<artifactId>jsonld-java</artifactId>
<version>0.12.3</version>
</dependency>
<dependency>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-runtime</artifactId>
Expand Down Expand Up @@ -166,7 +171,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.1</version>
<version>3.2.1</version>
<configuration>
<shadedArtifactAttached>false</shadedArtifactAttached>
<transformers>
Expand Down Expand Up @@ -210,11 +215,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<version>3.0.0-M3</version>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
<!--<parallel>methods</parallel>-->
<!--<threadCount>10</threadCount>-->
<useSystemClassLoader>true</useSystemClassLoader>
<useManifestOnlyJar>false</useManifestOnlyJar>
<!--&lt;!&ndash;<parallel>methods</parallel>&ndash;&gt;-->
<!--&lt;!&ndash;<threadCount>10</threadCount>&ndash;&gt;-->
</configuration>
</plugin>
<plugin>
Expand Down
29 changes: 29 additions & 0 deletions src/test/java/be/ugent/rml/Arguments_Test.java
Expand Up @@ -110,6 +110,35 @@ public void outputJSON() {
}
}

@Test
public void outputTrig() {
Main.main("-m ./argument/mapping.ttl -o ./generated_output.trig -s trig".split(" "));
compareFiles(
"argument/output-trig/target_output.trig",
"./generated_output.trig",
false
);

File outputFile;

try {
byte[] encoded = Files.readAllBytes(Paths.get("./generated_output.trig"));
String content = new String(encoded, StandardCharsets.UTF_8);

assertTrue(content.contains("{"));
} catch (IOException e) {
e.printStackTrace();
}


try {
outputFile = Utils.getFile("./generated_output.trig");
assertTrue(outputFile.delete());
} catch (Exception e) {
e.printStackTrace();
}
}

@Test
public void outputHDT() throws IOException {
Main.main("-m ./argument/mapping.ttl -o ./generated_output.hdt -s hdt".split(" "));
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/be/ugent/rml/TestCore.java
Expand Up @@ -123,6 +123,8 @@ private RDF4JStore filePathToStore(String path) {
store = Utils.readTurtle(outputFile, RDFFormat.NQUADS);
} else if (path.endsWith(".json")) {
store = Utils.readTurtle(outputFile, RDFFormat.JSONLD);
} else if (path.endsWith(".trig")) {
store = Utils.readTurtle(outputFile, RDFFormat.TRIG);
} else {
store = Utils.readTurtle(outputFile);
}
Expand Down
12 changes: 12 additions & 0 deletions src/test/resources/argument/output-trig/target_output.trig
@@ -0,0 +1,12 @@
@prefix ex: <http://example.com/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix ql: <http://semweb.mmlab.be/ns/ql#> .
@prefix rml: <http://semweb.mmlab.be/ns/rml#> .
@prefix rr: <http://www.w3.org/ns/r2rml#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

{
<http://example.com/10/Venus> ex:id "10";
a foaf:Person;
foaf:name "Venus" .
}

0 comments on commit d1f1597

Please sign in to comment.