Skip to content

Commit

Permalink
Merge branch 'development' into 'master'
Browse files Browse the repository at this point in the history
Release 4.4.2

See merge request rml/proc/rmlmapper-java!60
  • Loading branch information
pheyvaer committed Jul 15, 2019
2 parents a3adfbe + 95259f6 commit b128a6b
Show file tree
Hide file tree
Showing 268 changed files with 18,541 additions and 18,308 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docs/apidocs/* binary
13 changes: 13 additions & 0 deletions .github/no-response.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Configuration for probot-no-response - https://github.com/probot/no-response

# Number of days of inactivity before an Issue is closed for lack of response
daysUntilClose: 28
# Label requiring a response
responseRequiredLabel: more-information-needed
# Comment to post when closing an Issue for lack of response. Set to `false` to disable
closeComment: >
This issue has been automatically closed because there has been no response
to our request for more information from the original author. With only the
information that is currently in the issue, we don't have enough information
to take action. Please reach out if you have or find the answers we need so
that we can investigate further.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## Unreleased

## [4.4.2] - 2019-07-15

### Added

- Configure [no-response bot](https://github.com/probot/no-response) for Github ([issue 35](https://github.com/RMLio/rmlmapper-java/issues/35))
- Dockerfile
- Add table of contents to README
- Refactor data access and records
- Test case for CSV with special characters

### Fixed

- Base IRI is read from the mapping doc when using CLI

## [4.4.1] - 2019-06-17

### Added
Expand Down Expand Up @@ -183,6 +197,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

[4.4.2]: https://github.com/RMLio/rmlmapper-java/compare/v4.4.1...v4.4.2
[4.4.1]: https://github.com/RMLio/rmlmapper-java/compare/v4.4.0...v4.4.1
[4.4.0]: https://github.com/RMLio/rmlmapper-java/compare/v4.3.3...v4.4.0
[4.3.3]: https://github.com/RMLio/rmlmapper-java/compare/v4.3.2...v4.3.3
Expand Down
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM openjdk:8-alpine

RUN apk add --no-cache git maven
ADD . /rmlmapper-java

WORKDIR rmlmapper-java
RUN mvn clean install -DskipTests=true
RUN mv `find target/ -iname rmlmapper*.jar;` /rmlmapper.jar
WORKDIR /data

ENTRYPOINT ["java", "-jar", "/rmlmapper.jar"]
56 changes: 40 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ The RMLMapper execute RML rules to generate Linked Data.
It is a Java library, which is available via the command line ([API docs online](https://rmlio.github.io/rmlmapper-java/apidocs/)).
The RMLMapper loads all data in memory, so be aware when working with big datasets.

## Table of contents

- [Features](#features)
- [Build](#build)
- [Usage](#usage)
- [CLI](#cli)
- [Library](#library)
- [Docker](#docker)
- [Including functions](#including-functions)
- [Testing](#testing)
- [Dependencies](#dependencies)
- [Remarks](#remarks)
- [Documentation](#documentation)
- [UML Diagrams](#uml-diagrams)

## Features

### Supported
Expand Down Expand Up @@ -73,7 +88,6 @@ import org.eclipse.rdf4j.model.Model;
import org.eclipse.rdf4j.rio.RDFFormat;
import org.eclipse.rdf4j.rio.Rio;

import be.ugent.rml.DataFetcher;
import be.ugent.rml.Executor;
import be.ugent.rml.records.RecordsFactory;
import be.ugent.rml.store.RDF4JStore;
Expand All @@ -89,27 +103,37 @@ class Main {

String cwd = "/home/rml"; //path to default directory for local files
String mappingFile = "/home/rml/mapping.rml.ttl"; //path to the mapping file that needs to be executed

try {
InputStream mappingStream = new FileInputStream(mappingFile);
Model model = Rio.parse(mappingStream, "", RDFFormat.TURTLE);
RDF4JStore rmlStore = new RDF4JStore(model);

Executor executor = new Executor(rmlStore, new RecordsFactory(new DataFetcher(cwd, rmlStore)));
Executor executor = new Executor(rmlStore, new RecordsFactory(cwd));
QuadStore result = executor.execute(null);
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
}
}
```

### Docker

You can use Docker to run the RMLMapper by following these steps:

- Build the Docker image: `docker build -t rmlmapper .`.
- Run a Docker container: `docker run --rm -v $(pwd):/data rmlmapper -m mapping.ttl`.

The same parameters are available as via the CLI.
The RMLMapper is executed in the `/data` folder in the Docker container.

### Including functions

There are two ways to include (new) functions within the RML Mapper
* dynamic loading: you add links to java files or jar files, and those files are loaded dynamically at runtime
* preloading: you register functionality via code, and you need to rebuild the mapper to use that functionality

Registration of functions is done using a Turtle file, which you can find in `src/main/resources/functions.ttl`

The snippet below for example links an fno:function to a library, provided by a jar-file (`GrelFunctions.jar`).
Expand Down Expand Up @@ -173,8 +197,8 @@ class Main {
// execute mapping file
File mappingFile = Utils.getFile(mapPath);
QuadStore rmlStore = Utils.readTurtle(mappingFile);
Executor executor = new Executor(rmlStore, new RecordsFactory(new DataFetcher(mappingFile.getParent(), rmlStore)),

Executor executor = new Executor(rmlStore, new RecordsFactory(mappingFile.getParent()),
functionLoader);
QuadStore result = executor.execute(null);
} catch (Exception e) {
Expand All @@ -184,12 +208,12 @@ class Main {
}
```

### Testing
## Testing

#### RDBs
### RDBs
Make sure you have [Docker](https://www.docker.com) running.

##### Problems
#### Problems
* A problem with Docker (can't start the container) causes the SQLServer tests to fail locally. These tests will always succeed locally.
* A problem with Docker (can't start the container) causes the PostgreSQL tests to fail locally on Windows 7 machines.

Expand Down Expand Up @@ -227,24 +251,24 @@ However, the RMLMapper can be easily adapted to use a different XML parsing impl
The processor checks whether correct language tags are not, using a regular expression.
The regex has no support for languages of length 5-8, but this currently only applies to 'qaa..qtz'.

# Documentation
## Documentation
Generate static files at /docs/apidocs with:
```
mvn javadoc:javadoc
```

# UML Diagrams
### UML Diagrams

## Architecture UML Diagram
### How to generate with IntelliJ IDEA
#### Architecture UML Diagram
##### How to generate with IntelliJ IDEA
(Requires Ultimate edition)

* Right click on package: "be.ugent.rml"
* Diagrams > Show Diagram > Java Class Diagrams
* Choose what properties of the classes you want to show in the upper left corner
* Export to file > .png | Save diagram > .uml

## Sequence Diagram
### Edit on [draw.io](https://www.draw.io)
#### Sequence Diagram
##### Edit on [draw.io](https://www.draw.io)
* Go to [draw.io](https://www.draw.io)
* Click on 'Open Existing Diagram' and choose the .html file
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
#Mon Jun 17 17:22:16 CEST 2019
buildNumber0=97
#Mon Jul 15 13:18:09 CEST 2019
buildNumber0=129
4 changes: 2 additions & 2 deletions dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>be.ugent.rml</groupId>
<artifactId>rmlmapper</artifactId>
<version>4.4.1</version>
<version>4.4.2</version>
<scm>
<connection>scm:git:ssh://[email protected]:RMLio/rmlmapper-java.git</connection>
<url>https://github.com/RMLio/rmlmapper-java</url>
Expand Down Expand Up @@ -176,9 +176,9 @@
</dependency>
</dependencies>
<properties>
<maven.compiler.target>8</maven.compiler.target>
<maven.compiler.source>8</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>8</maven.compiler.target>
<junit.version>4.12</junit.version>
</properties>
</project>
25 changes: 14 additions & 11 deletions docs/apidocs/allclasses-frame.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_212) on Fri May 03 16:50:48 CEST 2019 -->
<!-- Generated by javadoc (1.8.0_212) on Mon Jul 15 13:18:22 CEST 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>All Classes (rmlmapper 4.3.3 API)</title>
<meta name="date" content="2019-05-03">
<title>All Classes (rmlmapper 4.4.2 API)</title>
<meta name="date" content="2019-07-15">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
Expand All @@ -15,15 +15,16 @@ <h1 class="bar">All&nbsp;Classes</h1>
<ul>
<li><a href="be/ugent/rml/functions/AbstractSingleRecordFunctionExecutor.html" title="class in be.ugent.rml.functions" target="classFrame">AbstractSingleRecordFunctionExecutor</a></li>
<li><a href="be/ugent/rml/term/AbstractTerm.html" title="class in be.ugent.rml.term" target="classFrame">AbstractTerm</a></li>
<li><a href="be/ugent/rml/access/Access.html" title="interface in be.ugent.rml.access" target="classFrame"><span class="interfaceName">Access</span></a></li>
<li><a href="be/ugent/rml/access/AccessFactory.html" title="class in be.ugent.rml.access" target="classFrame">AccessFactory</a></li>
<li><a href="be/ugent/rml/term/BlankNode.html" title="class in be.ugent.rml.term" target="classFrame">BlankNode</a></li>
<li><a href="be/ugent/rml/termgenerator/BlankNodeGenerator.html" title="class in be.ugent.rml.termgenerator" target="classFrame">BlankNodeGenerator</a></li>
<li><a href="be/ugent/rml/functions/ConcatFunction.html" title="class in be.ugent.rml.functions" target="classFrame">ConcatFunction</a></li>
<li><a href="be/ugent/rml/extractor/ConstantExtractor.html" title="class in be.ugent.rml.extractor" target="classFrame">ConstantExtractor</a></li>
<li><a href="be/ugent/rml/records/CSV.html" title="class in be.ugent.rml.records" target="classFrame">CSV</a></li>
<li><a href="be/ugent/rml/records/CSVRecord.html" title="class in be.ugent.rml.records" target="classFrame">CSVRecord</a></li>
<li><a href="be/ugent/rml/records/CSVRecordFactory.html" title="class in be.ugent.rml.records" target="classFrame">CSVRecordFactory</a></li>
<li><a href="be/ugent/rml/DatabaseType.html" title="class in be.ugent.rml" target="classFrame">DatabaseType</a></li>
<li><a href="be/ugent/rml/DatabaseType.Database.html" title="enum in be.ugent.rml" target="classFrame">DatabaseType.Database</a></li>
<li><a href="be/ugent/rml/DataFetcher.html" title="class in be.ugent.rml" target="classFrame">DataFetcher</a></li>
<li><a href="be/ugent/rml/metadata/DatasetLevelMetadataGenerator.html" title="class in be.ugent.rml.metadata" target="classFrame">DatasetLevelMetadataGenerator</a></li>
<li><a href="be/ugent/rml/functions/DynamicMultipleRecordsFunctionExecutor.html" title="class in be.ugent.rml.functions" target="classFrame">DynamicMultipleRecordsFunctionExecutor</a></li>
<li><a href="be/ugent/rml/functions/DynamicSingleRecordFunctionExecutor.html" title="class in be.ugent.rml.functions" target="classFrame">DynamicSingleRecordFunctionExecutor</a></li>
Expand All @@ -37,11 +38,11 @@ <h1 class="bar">All&nbsp;Classes</h1>
<li><a href="be/ugent/rml/functions/lib/IDLabFunctions.html" title="class in be.ugent.rml.functions.lib" target="classFrame">IDLabFunctions</a></li>
<li><a href="be/ugent/rml/Initializer.html" title="class in be.ugent.rml" target="classFrame">Initializer</a></li>
<li><a href="be/ugent/rml/records/IteratorFormat.html" title="class in be.ugent.rml.records" target="classFrame">IteratorFormat</a></li>
<li><a href="be/ugent/rml/functions/JoinConditionFunctionExecutor.html" title="interface in be.ugent.rml.functions" target="classFrame"><span class="interfaceName">JoinConditionFunctionExecutor</span></a></li>
<li><a href="be/ugent/rml/records/JSON.html" title="class in be.ugent.rml.records" target="classFrame">JSON</a></li>
<li><a href="be/ugent/rml/records/JSONRecord.html" title="class in be.ugent.rml.records" target="classFrame">JSONRecord</a></li>
<li><a href="be/ugent/rml/records/JSONRecordFactory.html" title="class in be.ugent.rml.records" target="classFrame">JSONRecordFactory</a></li>
<li><a href="be/ugent/rml/term/Literal.html" title="class in be.ugent.rml.term" target="classFrame">Literal</a></li>
<li><a href="be/ugent/rml/termgenerator/LiteralGenerator.html" title="class in be.ugent.rml.termgenerator" target="classFrame">LiteralGenerator</a></li>
<li><a href="be/ugent/rml/access/LocalFileAccess.html" title="class in be.ugent.rml.access" target="classFrame">LocalFileAccess</a></li>
<li><a href="be/ugent/rml/cli/Main.html" title="class in be.ugent.rml.cli" target="classFrame">Main</a></li>
<li><a href="be/ugent/rml/Mapping.html" title="class in be.ugent.rml" target="classFrame">Mapping</a></li>
<li><a href="be/ugent/rml/MappingFactory.html" title="class in be.ugent.rml" target="classFrame">MappingFactory</a></li>
Expand All @@ -61,16 +62,18 @@ <h1 class="bar">All&nbsp;Classes</h1>
<li><a href="be/ugent/rml/term/ProvenancedTerm.html" title="class in be.ugent.rml.term" target="classFrame">ProvenancedTerm</a></li>
<li><a href="be/ugent/rml/store/Quad.html" title="class in be.ugent.rml.store" target="classFrame">Quad</a></li>
<li><a href="be/ugent/rml/store/QuadStore.html" title="class in be.ugent.rml.store" target="classFrame">QuadStore</a></li>
<li><a href="be/ugent/rml/records/RDBs.html" title="class in be.ugent.rml.records" target="classFrame">RDBs</a></li>
<li><a href="be/ugent/rml/access/RDBAccess.html" title="class in be.ugent.rml.access" target="classFrame">RDBAccess</a></li>
<li><a href="be/ugent/rml/store/RDF4JStore.html" title="class in be.ugent.rml.store" target="classFrame">RDF4JStore</a></li>
<li><a href="be/ugent/rml/records/Record.html" title="class in be.ugent.rml.records" target="classFrame">Record</a></li>
<li><a href="be/ugent/rml/RecordFunctionExecutorFactory.html" title="class in be.ugent.rml" target="classFrame">RecordFunctionExecutorFactory</a></li>
<li><a href="be/ugent/rml/records/RecordsFactory.html" title="class in be.ugent.rml.records" target="classFrame">RecordsFactory</a></li>
<li><a href="be/ugent/rml/extractor/ReferenceExtractor.html" title="class in be.ugent.rml.extractor" target="classFrame">ReferenceExtractor</a></li>
<li><a href="be/ugent/rml/records/ReferenceFormulationRecordFactory.html" title="interface in be.ugent.rml.records" target="classFrame"><span class="interfaceName">ReferenceFormulationRecordFactory</span></a></li>
<li><a href="be/ugent/rml/access/RemoteFileAccess.html" title="class in be.ugent.rml.access" target="classFrame">RemoteFileAccess</a></li>
<li><a href="be/ugent/rml/store/SimpleQuadStore.html" title="class in be.ugent.rml.store" target="classFrame">SimpleQuadStore</a></li>
<li><a href="be/ugent/rml/functions/SingleRecordFunctionExecutor.html" title="interface in be.ugent.rml.functions" target="classFrame"><span class="interfaceName">SingleRecordFunctionExecutor</span></a></li>
<li><a href="be/ugent/rml/records/SPARQL.html" title="class in be.ugent.rml.records" target="classFrame">SPARQL</a></li>
<li><a href="be/ugent/rml/records/SPARQL.ResultFormat.html" title="enum in be.ugent.rml.records" target="classFrame">SPARQL.ResultFormat</a></li>
<li><a href="be/ugent/rml/access/SPARQLEndpointAccess.html" title="class in be.ugent.rml.access" target="classFrame">SPARQLEndpointAccess</a></li>
<li><a href="be/ugent/rml/records/SPARQLResultFormat.html" title="enum in be.ugent.rml.records" target="classFrame">SPARQLResultFormat</a></li>
<li><a href="be/ugent/rml/functions/StaticMultipleRecordsFunctionExecutor.html" title="class in be.ugent.rml.functions" target="classFrame">StaticMultipleRecordsFunctionExecutor</a></li>
<li><a href="be/ugent/rml/functions/StaticSingleRecordFunctionExecutor.html" title="class in be.ugent.rml.functions" target="classFrame">StaticSingleRecordFunctionExecutor</a></li>
<li><a href="be/ugent/rml/Template.html" title="class in be.ugent.rml" target="classFrame">Template</a></li>
Expand All @@ -82,8 +85,8 @@ <h1 class="bar">All&nbsp;Classes</h1>
<li><a href="be/ugent/rml/functions/lib/UtilFunctions.html" title="class in be.ugent.rml.functions.lib" target="classFrame">UtilFunctions</a></li>
<li><a href="be/ugent/rml/Utils.html" title="class in be.ugent.rml" target="classFrame">Utils</a></li>
<li><a href="be/ugent/rml/ValuedJoinCondition.html" title="class in be.ugent.rml" target="classFrame">ValuedJoinCondition</a></li>
<li><a href="be/ugent/rml/records/XML.html" title="class in be.ugent.rml.records" target="classFrame">XML</a></li>
<li><a href="be/ugent/rml/records/XMLRecord.html" title="class in be.ugent.rml.records" target="classFrame">XMLRecord</a></li>
<li><a href="be/ugent/rml/records/XMLRecordFactory.html" title="class in be.ugent.rml.records" target="classFrame">XMLRecordFactory</a></li>
</ul>
</div>
</body>
Expand Down
Loading

0 comments on commit b128a6b

Please sign in to comment.