diff --git a/.gitattributes b/.gitattributes index eea259e2..50d31d15 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,4 @@ docs/apidocs/* binary + +# Mark Jelly files as binary +*.jelly binary diff --git a/.gitignore b/.gitignore index d2e91178..43e76666 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,13 @@ .idea -target -rmlmapper.iml +target/* +*.iml .DS_Store .settings .vscode -.attach_* \ No newline at end of file +.attach_* +ojdbc*.jar +pom-oracle.xml +dependency-reduced-pom.xml +settings.xml +.classpath +.project \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3454e6e1..856fa4c9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,28 +1,139 @@ -image: maven:3.5.0-jdk-8 +stages: + - lint + - unittests + - mirror + - release + - deploy + +include: + # Make sure the CHANGELOG is always updated + - project: 'rml/util/ci-templates' + ref: main + file: 'CHANGELOG.gitlab-ci.yml' +# # Push a Docker Image to Docker Hub on new tags +# - project: 'rml/util/ci-templates' +# ref: main +# file: 'Docker-Hub.gitlab-ci.yml' + # Push a build to Maven Central on new tags + - project: 'rml/util/ci-templates' + ref: main + file: 'Maven-Central.gitlab-ci.yml' 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=$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" + MAVEN_CLI_OPTS: "-s $CI_PROJECT_DIR/.m2/settings.xml --batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true" # Postgres POSTGRES_DB: postgres POSTGRES_USER: postgres POSTGRES_PASSWORD: "YourSTRONG!Passw0rd" # SQLServer - ACCEPT_EULA: Y + ACCEPT_EULA: "Y" SA_PASSWORD: "YourSTRONG!Passw0rd" + # https://hub.docker.com/r/alpine/git/tags + GIT_VERSION: v2.32.0 cache: key: ${CI_JOB_NAME} paths: - .m2/repository -verify: +# Cancel pipeline if a newer pipeline is running +default: + interruptible: true + +############################### +# # +# Unittests # +# # +############################### + +General: + stage: unittests + image: + name: maven:3-eclipse-temurin-21 + pull_policy: if-not-present + services: + - name: docker:29-dind + # explicitly disable tls to avoid docker startup interruption + command: ["--tls=false"] + variables: + # Instruct Testcontainers to use the daemon of DinD. + DOCKER_HOST: "tcp://docker:2375" + # Instruct Docker not to start over TLS. + DOCKER_TLS_CERTDIR: "" + # Improve performance with overlayfs. + DOCKER_DRIVER: overlay2 + script: + - 'mvn $MAVEN_CLI_OPTS -Dtest=$TEST test 2>&1 | tee $TEST.log' + artifacts: + when: always + paths: + - '$TEST.log' + parallel: + matrix: + - TEST: [ArgumentsTest, MapperCSVTest, MapperJSONTest, MapperMySQLTest, MapperPostgresR2RMLTest, MapperWoTTest, ArgumentsTestMySQLTest, MapperCSVWTest, MapperLDESTest, MapperODSTest, MapperOracleDBTest, MapperPostgresXMLTest, MapperXMLTest, CustomRMLFnOMapperCSVTest, MapperEXCELTest, MapperMappingFileURLTest, MapperSPARQLTest, MetadataTest, CustomRMLFnOMapperJSONTest, CustomRMLFnOMapperTest, MapperHTMLTest, MapperMySQLR2RMLTest, MapperPostgresCSVTest, MapperSQLServerTest, OptimizationsTest, R2RMLConverterTest, QuadTest, ReadmeTest, ReadmeFunctionTest, ConformerDetectionTest, MapperNewRMLCoreJSONTest, MapperNewRMLIOSourceTest, MapperNewRMLIOTargetTest, HttpRequestTargetTest, MapperCrossConcatSequenceTest] + except: + - master + - development + +# Generate R2RML test report and attach it as a artifact. +# Manual: make a MR to the rml.io website +R2RML Test Report: + stage: deploy + image: + name: docker:29 + pull_policy: if-not-present + services: + - docker:29-dind + before_script: + # Dependencies + - apk add git python3 python3-dev py3-pip postgresql-dev postgresql libpq gcc musl-dev docker docker-compose java-jre-headless maven java-jdk + + # Clone the repository via HTTPS inside a new directory + - git clone "https://github.com/kg-construct/r2rml-test-cases-support" + + # Set the displayed user with the commits that are about to be made + - git config --global user.email "${GIT_USER_EMAIL:-$GITLAB_USER_EMAIL}" + - git config --global user.name "${GIT_USER_NAME:-$GITLAB_USER_NAME}" + + # Show docker + - docker info script: - - 'mvn $MAVEN_CLI_OPTS test' + # Variables + - R2RML_TAG_NAME=$(git tag -l "v*" --sort=-creatordate | head -n1 || echo "$CI_COMMIT_REF_NAME") + - (if [ "$R2RML_TAG_NAME" == "$CI_COMMIT_REF_NAME" ]; then echo "$CI_COMMIT_REF_NAME"; else R2RML_TAG_NAME=$(echo "$R2RML_TAG_NAME" | cut -c2-); fi) + - R2RML_TAG_NAME=$(echo "$R2RML_TAG_NAME" | tr -d '\n') + - TODAY=$(date +"%Y-%m-%d") + + # Build RMLMapper jar + - mvn install -DskipTests=true + + # Setup R2RML test cases configs + - cp data/r2rml-test-cases-config-postgresql.ini r2rml-test-cases-support/config-postgresql.ini + - cp data/r2rml-test-cases-config-mysql.ini r2rml-test-cases-support/config-mysql.ini + - cd r2rml-test-cases-support + - echo "Generating test report for release v${R2RML_TAG_NAME} on ${TODAY}" + - sed -i "s/VERSION/${R2RML_TAG_NAME}/" config-postgresql.ini + - sed -i "s/VERSION/${R2RML_TAG_NAME}/" config-mysql.ini + - sed -i "s/DATE/${TODAY}/" config-postgresql.ini + - sed -i "s/DATE/${TODAY}/" config-mysql.ini + + # Install R2RML test cases dependencies + - python3 -m pip install requests 'rdflib==6.0.2' 'psycopg2-binary<3' 'mysql-connector-python<9' --break-system-packages + + # Execute R2RML test cases + - HOST=docker python3 test.py config-postgresql.ini + - HOST=$(getent hosts docker | cut -f1 -d " ") python3 test.py config-mysql.ini # MySQL wants an IP address -services: - - postgres:10.4 - - name: microsoft/mssql-server-linux:latest - alias: sqlserver + - cd .. + # Run during merge requests and tags + except: + - development + - master + artifacts: + when: always + paths: + - $CI_PROJECT_DIR/r2rml-test-cases-support/results.ttl + - $CI_PROJECT_DIR/r2rml-test-cases-support/config-*.ini diff --git a/.m2/settings.xml b/.m2/settings.xml new file mode 100644 index 00000000..48953beb --- /dev/null +++ b/.m2/settings.xml @@ -0,0 +1,10 @@ + + + + central + ${env.MAVEN_REPO_USER} + ${env.MAVEN_REPO_PASS} + + + diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e64f935..148a5c8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,631 @@ All notable changes to this project will be documented in this file. -The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.1.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## Unreleased +## [8.1.0] - 2025-12-23 + +### Added +- `crossConcat` and `crossConcatSequence` functions (by updating dependency to idlab-functions-java) + +### Changed +- Requires Java version >= 21 + +### Fixed +- Updated dependency function-agent-java to 1.3.0 +- Updated idlab-functions-java to 1.4.0 +- Publish to Maven Central using central-publishing-maven-plugin + +## [8.0.1] - 2025-12-11 + +### Fixed +- Dependency updates to address some vulnerabilities: +- DataIO to 2.5.2 +- Jena to 5.2.0 +- commons-lang3 to 3.18.0 +- json-smart to 2.5.2 +- Added dependency to commons-cli (a transitive dependency which got lost) +- Update DataIO to 2.2.0 (to address https://github.com/RMLio/rmlmapper-java/issues/266) +- Update testcontainers-* dependencies to 2.0.2 +- GitLab CI: update GitLab CI Docker (services) to version 29 +- Update grel-functions-java to v0.10.1 to fix bug in quotient function + +## [8.0.0] - 2025-09-18 + +### Fixed +- A join between triples maps with different logical targets might result in quads ending up in wrong targets. +- rmle:contentTypeHeader and rmle:acceptHeader is replaced by generic htv:headers for Http Request Targets. +- Comparing htv:headers might go wrong due to String comparison. +- Conversion to new RML goes wrong when an object map has term type Literal. + +### Added +- Option to serialize output as Jelly. + +### Changed +- Updated new RML test cases for IO and Core. +- Updated dependency of DataIO to 2.1.2 + +### Removed +- `QuadStore`: removed deprecated `write` methods. + +## [7.3.3] - 2025-04-07 + +### Fixed +- Better handle unsupported reference formulation (See [issue 247](https://github.com/RMLio/rmlmapper-java/issues/247)) +- Graph Maps with default graph must not be ignored (See [issue 252](https://github.com/RMLio/rmlmapper-java/issues/252)) +- Honor datatypes for constants (See [issue 251](https://github.com/RMLio/rmlmapper-java/issues/251)) +- Honor language tags for constants (See [issue 251](https://github.com/RMLio/rmlmapper-java/issues/251)) + +## [7.3.2] - 2025-03-04 + +### Fixed +- Updated Function Agent to 1.2.1 because of a bugfix (See [this issue in Gitlab](https://gitlab.ilabt.imec.be/KNoWS/fno/proc/function-component/-/issues/23), fixes [#249](https://github.com/RMLio/rmlmapper-java/issues/249) on GitHub; + +## [7.3.1] - 2025-01-22 + +### Fixed +- Upgraded dataio to 2.0.1 incorporating dataio security fixes. +- Upgraded logback-core to 1.5.16 to fix 2 security CVEs. + +## [7.3.0] - 2025-01-22 + +### Changed +- Some tests are changed because record error handling has changed. + +### Fixed +- Optimization for authentication with CSS Client Credentials +- Update URI of prefix 'rmle:' to persistent w3id URI: 'https://w3id.org/imec/rml/ns/extensions#' +- Added all known content types for newline delimited JSON +- Fixed the return type of GREL array slice function in function description. +- Updated all Jena library dependencies to version 5.0.0 +- Added explicit dependencies on commons-io:2.18.0, commons-compress-1.27.1 and commons-lang3:3.17.0 to avoid runtime errors. +- Updated rdf4j-client to 5.1.0 +- Updated wiremock to 3.9.1 (3.10.0 contains bugs in combination with saxon). +- Updated grel-functions-java to v0.10.0 +- Updated dataio to 2.0.0, *the* reason for most changes ;) +- Updated testcontainers to 1.18.3 +- Inconsistencies in test case RMLTC0007h (mapping + all formats) and RMLTC0009a (JSON) + +## [7.2.0] - 2024-12-09 + +### Added +- CLI option `--convert-mapping` to convert your existing R2RML and older RML mappings +to the latest version by the W3C Community Group. +- HTTP request targets +- dynamic logical targets + +### Fixed +- GREL array functions handling. + +## [7.1.2] - 2024-09-19 + +### Fixed +- `release.sh` now also updates `pom.xml` with the given tag. + +## [7.1.1] - 2024-09-19 + +### Fixed +- Updated idlab-functions-java to 1.3.3 to use correct state path in stateful functions when `ifState` environment variable is set. + +### Changed +- CI: use local script for release + +## [7.1.0] - 2024-08-13 + +### Added +- Serialization format TriG is now supported for Logical Targets (fixes GitHub [issue 225](https://github.com/RMLio/rmlmapper-java/issues/225)). + +### Fixed +- Crash when null is returned in an XPath function for subject generation (fixes GitHub [issue 236](https://github.com/RMLio/rmlmapper-java/issues/236)) +- Update to DataIO 1.3.1: `DATAIO_NULL` value occurring in RDF output when CSV quoted string has newline character in it (fixes GitHub [issue 238](https://github.com/RMLio/rmlmapper-java/issues/238)) +- RML Test report script: remove newlines from R2RML targ name + +## [7.0.0] - 2024-06-07 + +### Fixed +- Gitlab CI R2RML test cases compliance +- Gitlab CI Maven Central retrying on failure due to Maven Central server problems +- Gitlab CI Docker Hub deployment fixed +- Update DataIO dependency to 1.1.0 (fixes GitLab [issue 274](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/274)) +- R2RML Test Report CI script failed in development due to missing pip parameter. +- Optimization for self-joins without join conditions (fixes Gitlab [issue 275](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/275)) +- Optimization for self joins with join condition. +- Updated junit to 5.10.0 +- Updated jena to 4.9.0 +- Updated testcontainers to 1.18.3 +- Added explicit dependency on json-smart, since it was an indirect dependency which changed scope +- Updated idlab-functions-java to 1.3.2, fixing an issue with IncRML +- Updated dataio to 1.2.0 +- Changed scope of `json-path` dependency to `runtime` + +### Changed +- Changed basepath from null to http://example.com/ (see [issue 263](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/263)) +- gitlab CI pull policy + +### Added +- Translation to new RML. Only for Core. + +## [6.5.1] - 2023-12-06 + +## Fixed +- Upgrade logback-classic to 1.4.14. +- Upgrade wiremock-jre8 to 2.35.1. + +## [6.5.0] - 2023-12-06 + +### Changed +- Update dependency on `idlab-functions-java` to 1.3.1. This implies three things: + - The namespace for IDLab functions FnO descriptions changed, so RMLMapper loads the old and the new one to remain compatible; + - All tests in RMLMapper use the new namespace; + - Stateful functions use a more compact and efficient state. +- Update dependency on `function-agent-java` to 1.2.0, the first version released on Maven Central. +- Upgraded rdf4j-client dependency to version 4.3.8 +- Compile regex patterns for RDF4J store only once for performance. + +### Fixed +- Setting option `disable-automatic-eof-marker` in a configuration file has no effect (see GitLab [issue #269](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/269)). +- Start adhering to [Keep a Changelog](http://keepachangelog.com/en/1.1.0/) from now on (`Improvements` -> `Changed`). +- Compatibility issue with old IDLab functions FnO descriptions (see GitLab [issue #270](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/270)) + +### Added +- Test case for working with CSV logical sources without header. + +## [6.4.0] - 2023-11-14 + +### Added +- Test handling Windows CRLF line ending for CSV files ([issue #201](https://github.com/RMLio/rmlmapper-java/issues/201)) +- Added test for empty column handling in csv logical source files ([issue #159](https://github.com/RMLio/rmlmapper-java/issues/159)) + +### Improvements +- Tests: let Java handle temporary files. +- pom: upgrade maven-surefire-plugin to 3.2.2 +- pom: upgrade nexus-staging-maven-plugin to 1.6.13 +- pom: upgrade json-path to 2.8.0 +- pom: upgrade logback-classic to 1.4.11 +- resources: rml-ldes: avoid symlinks +- pom: upgrade RDB connectors (postgresql 42.6.0, mssql-jdbc 12.4.2.jre11, ojdbc11 23.3.0.23.09, mysql-connector-j 8.2.0) + +### Changed +- Use the DataIO library to handle access to files. +- Requires Java 17 language level. +- Refactoring to use interfaces where possible (e.g. `ArrayList` -> `List`). + +### Fixed +- Test cases: add array initializers to avoid bugs. +- Use correct prefix for `EventStreamTarget`s in tests. +- Refactoring of Executor: code deduplication +- Document `--disable-automatic-eof-marker` option. + +## [6.3.0] - 2023-11-14 + +### Improvements +- Add support for detecting additions, modifications, and deletions in a Knowledge Graph with FnO functions. +- Verify LDES EventStreamTarget output for additions, modifications, and deletions. +- Added RML-LDES test-cases. +- Added test for mapping with CSV file where column does not match header + +### Changed +- Build Docker image in two stages, reducing the final image size. +- LDES EventStreamTarget properties are now all optional. +- Removed usage of legacy RDF model, using RDF4J instead. + +### Fixed +- Don't close output streams that don't need closing. +- Add url decoders to file paths so special characters and spaces work. +- Test cases: add array initializers to avoid bugs. + +## [6.2.2] - 2023-10-05 + +### Fixed +- Fixed self-joins with join conditions ([internal issue #199](https://github.com/RMLio/rmlmapper-java/issues/199)) +- Upgrade to rdfhdt to 3.0.10 ([issue #215](https://github.com/RMLio/rmlmapper-java/issues/215)) +- Improve docs on deduplication ([issue #214](https://github.com/RMLio/rmlmapper-java/issues/214)) +- Handle plain old Java Arrays as well for FnO return values +- Update dependency to `idlab-functions-java`, fixing [issue #218](https://github.com/RMLio/rmlmapper-java/issues/218) + +### Changed +- Dockerfile: switched to Eclipse OpenJDK Docker base image because OpenJDK is deprecated +- CI: dropped GitHub release automation +- CI: verify if token is valid + +### Improvements +- Heavily increased performance of RMLMapper through several optimizations + +## [6.2.1] - 2023-07-06 + +### Fixed +- Updated idlab-functions-java to v1.0.0 +- CSVW 1025 testcase now reads correct logical source + +## [6.2.0] - 2023-06-22 + +### Fixed +- Updated function-agent-java to v1.1.0 +- Updated grel-functions-java to v0.9.1 +- Updated idlab-functions-java to v0.3.1 +- Updated junit to 5.9.1 +- Updated testcontainers to 1.17.6 +- Updated logback to 1.4.5 +- Updated Saxon-HE to 11.4 +- Updated postgresql to 42.5.1 +- Detect non existing files early ([issue 223](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/233)) +- Subject of LDES event stream has wrong IRI (internal GitLab issue [#253](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/253)) +- MS SQLServer JDBC driver was only for tests on classpath (internal GitLab issue [#255](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/255)) +- Normalising Double numbers from RDBs went wrong (internal GitLab issue [#256](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/256), GitHub issue [#206](https://github.com/RMLio/rmlmapper-java/issues/206)) + +### Changed +- `tree:view` and `ldes:retentionPolicy` are omitted when generating LDES metadata. + +### Added +- A new Maven profile `no-buildnumber` disables using and updating `buildNumber.properties`. +- Mocked DBpedia Spotlight service ([issue #250](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/250)) +- Update [dynamic-loading](https://github.com/RMLio/rmlmapper-java#dynamic-loading) in README.md + +## [6.1.3] - 2022-12-20 + +### Fixed +- Reraise execeptions from executor, so that CLI exits with non-zero exit code in the event of errors in execution ([issue 194](https://github.com/RMLio/rmlmapper-java/issues/194)) + +## [6.1.2] - 2022-11-22 + +## [6.1.1] - 2022-11-21 + +## [6.1.0] - 2022-11-21 + +### Changed +- Require Java 11+ +- Port all tests to Junit 5 +- Database tests are executed with a fresh instance of the required database in a Docker container +- Update of function libraries IDLab functions, GREL functions, Function Agent +- Removed need for (deprecated) SecurityManager + +### Fixed +- Dropped dependency on Guava +- Dropped explicit dependency on Jetty +- Dropped dependency on mariaDB4j +- `RDF4JStore` had wrong regex to check for Literals when they have a language tag or data type. +- Updated RDF4J to 4.2.1 +- Updated Jena to 4.6.1 +- Updated indirect dependencies to Xerces 2.12.2 +- Updated mysql-connector-java to 8.0.31 +- Updated postgresql to 42.5.0 +- Updated mssql-jdbc to 11.2.1.jre11 +- Updated com.fasterxml.jackson.core.* dependencies to 2.14.0 +- Updated jsoup to 1.15.3 +- Updated opencsv to 5.7.1 +- Updated poi-ooxml to 5.2.3 +- Updated testcontainers to 1.17.5 +- Updated mybatis to 3.5.11 +- Updated ojdbc8 21.6.0.0.1 to ojdbc11 21.7.0.0 +- Force Wiremock to use commons-fileupload 1.4 +- Main: Output paths can again be fully relative +- Dropped dependency on com.spotify.docker-client ([issue 231](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/231)) +- Running multiple pipelines should no longer interfere with each other ([issue 245](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/245)) +- Fixed TriplesMaps detection of MappingConformer [issue 251](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/251) +- `NamedNodeGenerator` now checks if the given IRI is valid ([issue 249](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/249)) + +### Added +- pom.xml: Added Testcontainers library dependencies for databases we test on +- pom.xml: Added JUnit5 dependencies +- Check for changelog changes in a separate lint stage during CI. + +## [6.0.0] - 2022-07-04 + +### Changed +- Run all tests in parallel on CI infrastructure +- Upgrade Function Agent to v0.1.0 + +### Fixed +- Upgrade postgresql JDBC driver to 42.3.3 +- Rename `logback.xml` to `logback-test.xml` in test resources (see [issue 240](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/240)) +- If exception occurs while mapping data, already processed data gets written to output file +- Properly close resources such as input streams +- Github release notes are now properly extracted +- Discard UTF Byte-Order-Marks (BOM) (see [issue 171](https://github.com/RMLio/rmlmapper-java/issues/171)) +- Dropped lib directory for functions as we now use a separate FnO Function Agent + +### Added +- IDLabFunctions: added functions lookup and lookupWithDelimiter +- IDLabFunctionsTest: added unit tests for lookup functions +- IDLabFunctionsTest: relocate csv files used by tests for lookup function +- IDLabFunctions: silence stack trace +- CSVW: filter out rows with a comment prefix +- Output file path now gets checked before the mapping +- .gitignore: ignore vscode files +- pom.xml: add Saxon-HE v11.3 dependency +- XMLRecord: adjusted to use Saxon +- XMLRecordFactory: adjusted to use Saxon +- SaxNamespaceResolver: added class for resolving namespaces in Saxon. This fixes (#154)[https://github.com/RMLio/rmlmapper-java/issues/154]. +- Added unit tests for XPath 2/3 expressions and functions +- Loggers across the codebase have been updated to use parameterized strings +- Add support for WoT OAuth2 Security Scheme (see [issue 212](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/212)) +- Integration of independent function handler + +## [5.0.0] - 2022-03-11 +- TestCore: enable debug logs when VERBOSE env variable is set (see [issue 230](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/230)) +- Switched to fork of ODFtoolkit (see [issue 237](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/237)) + +### Added + +- Add support for LDES Logical Target +- Add support for generating unique reproducible IRIs for LDES + +### Changed + +- Write LDES state to disk when mapping execution is complete. +- Removed deprecated execute() and executeWithFunction() methods, and refactored the executeV5() executeWithFunctionV5() method to execute() and executeWithFunction(). + +### Fixed + +- Clarified Readme for quick start +- No cartesian product when referring to the same logical source (see [issue 28](https://github.com/RMLio/rmlmapper-java/issues/28)]) + - If you still want the cartesian product, update your mappings to refer to different logical sources with the same contents +- Upgraded jetty-server and jetty-security to 9.4.44.v20210927 +- Upgraded wiremock-jre8 to 2.32.0 +- Upgraded ch.qos.logback to 1.2.10 +- Upgraded commons-cli to 1.5.0 +- Upgraded com.jayway.jsonpath to 2.7.0 +- Upgraded ch.vorburger.mariaDB4j to 2.5.3 +- Upgraded com.microsoft.sqlserver to 10.2.0.jre8 +- Upgraded com.fasterxml.jackson.core to 2.13.1 +- Upgraded org.jsoup to 1.14.3 +- Upgraded org.apache.poi to 5.0.0 +- Resources: functions_grel: use xsd:integer (see [issue 234](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/234)) +- Print error if referenceformulation is unsupported + +### Changed + +- Upgrade postgresql JDBC driver to 42.3.2 (see [issue 146](https://github.com/RMLio/rmlmapper-java/issues/146)) + +## [4.15.0] - 2022-02-01 + +### Fixed +- Bump buildnumber during release (see [issue 227](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/227)) +- Always include xml: prefix (see [issue 144](https://github.com/RMLio/rmlmapper-java/issues/144)) +- `normalizeDate` function uses wrong pattern (see [issue 228](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/228)) +- CI: only publish `-all.jar` releases on Github (see [issue 145](https://github.com/RMLio/rmlmapper-java/issues/145)) +- CI: make use of templates + +### Changed +- CSVRecordFactory: Replace Apache CSV library with OpenCSV to be able to differentiate between empty string and null (see [issue 140](https://github.com/RMLio/rmlmapper-java/issues/140)) +- CI: use Gitlab's own mirror feature instead of mirroring in a CI job. +- CI: enforce CHANGELOG updates. +- Added functions to normalize dates and datetimes. + +### Added +- JSONRecordFactory: support JSONL files (see [issue 221](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/221)). + +## [4.14.3] - 2022-01-13 + +### Fixed +- Github CLI needs to specify a repo to create a release. + +## [4.14.2] - 2022-01-13 + +### Fixed +- Maven Central automatic builds fixed. +- Upstream R2RML test cases. +- Correctly install Github CLI in CI. + +## [4.14.1] - 2022-01-13 + +### Fixed +- Mirror development branch to Github when releasing new versions. +- Github Release stage works now properly. +- Build newer version during deployment. + +## [4.14.0] - 2022-01-13 + +### Added +- Mapper_Postgres_CSV_Test: Add test RMLTC1027 to check whether NULLs are ignored in PostgreSQL (see [issue 159](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/159)) +- IDLabFunctions: add isNull function (see [issue 219](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/219)). +- Replaced PowerMock with WireMock (see [issue 45](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/45)) +- FunctionModel: Change the way Lists are processed to take into account generic types +- CSVW: Add support for csvw:null (see [issue 217](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/217)) +- FnO: improve error messages for incomplete descriptions (see [issue 222](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/222)) +- CSVW: Ignore nulls instead of removing (see [issue 224](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/224)) + +### Fixed +- Update RELEASE.md with up-to-date notes for releasing new versions (see [issue 218](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/218)). +- RELEASE: Fixed Maven Central deployment instructions (see [issue 223](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/223)) +- AccessFactory: Do not clean SPARQL queries by default (see [issue 214](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/214)) + +## [4.13.0] - 2021-11-22 + +### Fixed + +- update dependencies +- cleaned up code +- fixed undefined prefixes +- CI: fix MS SQL Server docker image name +- pom: mark Jena, Docker, Jetty and Fuseki as test dependencies (see [issue 127](https://github.com/RMLio/rmlmapper-java/issues/127)) +- XMLRecord: fallback to STRING if NODESET fails (see [issue 128](https://github.com/RMLio/rmlmapper-java/issues/128)) +- Tests: Updated RML test-cases 0002i and 0003a to no longer expect an error. (see [issue 130](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/130)) +- Tests: Added test case 0002k where no sqlVersion is present, as its presence is not mandatory. +- README: mention [RML questions repository](https://github.com/kg-construct/rml-questions) (see [issue 216](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/216)) +- XML parsing: allow parsing of fully namespaced xml by injecting xml source's namespaces in the XPath compiler (see [issue 134](https://github.com/RMLio/rmlmapper-java/pull/134)) +- R2RML: No longer add sqlVersion 2008, as its presence is not mandatory. +- CSVRecordFactory: allow empty column names (see [issue 124](https://github.com/RMLio/rmlmapper-java/issues/124)) + +### Added + +- Main: add piping support of mapping rules (see [issue 124](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/124)) +- Logging: Log loaded functions when in verbose mode (see [issue 136](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/136)) +- Mapper_MySQL_R2RML_Test: Add information regarding non-compliance of MySQL for certain tests cases (see [issue 189](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/189)) +- Tests: Add test RMLTC1027 to check whether NULLs are ignored properly for various data sources (see [issue 159](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/159)) + +## [4.12.0] - 2021-08-02 + +### Fixed +- R2RML: floating point differences between RDBs (see [issue 203](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/203)) +- R2RML: do not percent-encode binary data (see [issue 184](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/184)) +- R2RML: handle binary data differences between RDBs (see [issue 200](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/200)) +- Create an empty output file for empty JSON arrays as well (see [issue 98](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/98)) +- Always output UTF-8 encoded RDF (see [issue 119](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/119)) +- Refactor RDB records for better NULL and empty string handling (see [issue 131](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/131)) +- Align R2RML test cases with [kg-construct/r2rml-test-cases](https://github.com/kg-construct/r2rml-test-cases-support/pull/16) (see [issue 211](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/211)) + +### Added +- FunctionLoader: throw error on missing function parameters (see [issue 125](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/125)) +- HTMLRecordFactory: add CSS3 selector support (see [issue 52](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/52)) +- CSVRecordFactory: add spreadsheet support (see [issue 42](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/42)) +- IDLabFunctions: add slugify to default idlab-fn functions (see [issue 209](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/209)) +- RDBAccess: add XML support for PostgreSQL RDB (see [issue 51](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/51)) +- AccessFactory: add WoT BearerSecurity scheme (see [issue 195](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/195)) +- README: add clarification on where to find standalone release jars (see [issue 174](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/174)) + +## [4.11.0] - 2021-07-05 + +### Added +- R2RML test cases (see [issue 192](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/192)) +- DCAT support + +### Fixed +- R2RML support: handle booleans correctly (see [issue 187](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/187)) +- W3C Formats Namespace: use http instead of https + +## [4.10.1] - 2021-06-15 + +### Fixed +- README Markdown rendering and links +- Follow HTTP redirects for Web APIs (see [issue 196](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/196)) + +## [4.10.0] - 2021-05-05 + +### Added +- Added support for named graphs in RDFJStore. +- Support for Logical Target and exporting to a local file with various +serializations and compression, or a SPARQL endpoint using +SPARQL UPDATE queries. +- W3C Web of Things Web API access support to retrieve data from Web API +with token authentication. + +### Changed +- Use RDF4JStore by default (see [issue 108](https://github.com/RMLio/rmlmapper-java/issues/108)). +- Public API of the Executor has been updated and is available under `V5`, +the old API is still available but deprecated. In a future release, the old API +will be removed and the new one will drop the `V5` suffix. + +### Fixed +- Add remark about duplicate removal and serialization format performance (see [issue 108](https://github.com/RMLio/rmlmapper-java/issues/108)). +- Treat empty values in CSV columns as NULL values in RDBs (see [issue 188](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/188)). +- Fixed reloading the function every iteration, hopefully this gives a speed boost +- Fix R2RML conversion of multiple Triples Maps (see [issue 186](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/186)). +- Fix datatype retrieval when RDB colum names are quoted (see [issue 185](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/185)). + +## [4.9.4] - 2021-03-19 + +### Changed +- Link to our Docker images on Dockerhub in README (see [issue 109](https://github.com/RMLio/rmlmapper-java/issues/109)) + +### Fixed +- Support @ in JSONPath (see [issue 178](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/178)) +- JSONRecord: ignore 'null' values in JSONArray as well (see [issue 103](https://github.com/RMLio/rmlmapper-java/issues/103)) + +## [4.9.3] - 2021-03-05 + +### Fixed + +- Docker build (see [issue 106](https://github.com/RMLio/rmlmapper-java/issues/106)) +- Consistent builds with Maven + +## [4.9.2] - 2021-03-04 + +### Changed + +- Endpoints of Oracle and DBpedia Spotlight for tests +- getColumnLabel instead of getColumnName (see [issue 92](https://github.com/RMLio/rmlmapper-java/issues/92)) +- Updated dependencies + - added FnO Grel v0.6.1 which adds toTitlecase, lastIndexOfMapping, sha1, md5 + +### Fixed + +- support SQL queries that have unnamed columns + +### Added +- Add Logical Target support +- Add Web of Things support +- Add compression support + +## [4.9.1] - 2020-12-04 + +### Added +- Support commas in JSONPath + +### Fixed +- Handling of boolean/any FnO parameters (see [MR 116](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/merge_requests/116)) +- Print descriptive error when mapping file does not exist or is invalid Turtle (see Github [issue 54](https://github.com/RMLio/rmlmapper-java/issues/54)) +- Print mapping file path as debug instead of a warning (see [issue 172](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/172)) + +## [4.9.0] - 2020-09-14 + +### Added +- Add to Maven Central (see [issue 94](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/94)) + +### Fixed +- Fix CSVW with tab (see issues [168](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/168) +and [169](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/169)) + +## [4.8.2] - 2020-08-17 + +### Added +- Support function on SubjectMap that generates blank nodes (see [issue 167](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/167)) + +### Changed +- Updated licenses on the README + +### Fixed +- Documentation updated to reflect metadata generation +- Function objects with types other than String/Boolean don't get discarded (see [issue 165](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/165)) +- Generating metadata in different RDF format (see [issue 68](https://github.com/RMLio/rmlmapper-java/issues/68)) + +## [4.8.1] - 2020-07-03 + +### Changed +- updated grel-functions-java to 0.5.2 + +### Fixed +- ObjectMap with type Blank Node is ignored (see [issue 164](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/164)) +- Support double quotes in references of RDBs (see [issue 163](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/163)) + +## [4.8.0] - 2020-05-25 + +### Added +- Oracle driver information in README (see [issue 142](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/142)) +- Support Oracle databases (see [issue 160](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/160)) + +### Changed +- Functions support more datatypes: `be/ugent/rml/functions/FunctionUtils.java` + +### Removed +- Oracle setup file (see [issue 161](https://gitlab.ilabt.imec.be/rml/proc/rmlmapper-java/-/issues/161)) + +## [4.7.0] - 2020-03-09 + +### Added + +- support for list-style parameter arguments for functions (see test `rml-fno-test-cases/RMLFNOTC0023-CSV`) + +### Changed + +- conform with latest spec + - the old way of describing a link to a JAVA library is currently still supported +- usage of external GREL functions library + - by default, these _classes_ are loaded, _even when the function file parameter has another file_ + - moved some functions to IDLabFunctions +- FunctionLoader takes a `store` as constructor, not a file +- for now, allow fallback on old FnO IRIs +- dynamic function libraries (i.e., jars) are found relative to the cwd +- renamed Utils::getInputStreamFromMOptionValue to Utils::getInputStreamFromFileOrContentString +- changed URL of remote data file src/test/resources/test-cases/RMLTC1003-CSV/mapping.ttl +- moved IDLabFunction tests to its canonical place +- added idlab-fn:inRange function +- in `TestFunctionCore`: `doPreloadMapping` just adds up to the existing `functions_idlab.ttl` descriptions to avoid duplication + - random generator defaults to "random_string_here" to avoid space characters. + ## [4.6.0] - 2019-11-19 ### Added @@ -226,6 +846,49 @@ 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 +[8.1.0]: https://github.com/RMLio/rmlmapper-java/compare/v8.0.1...v8.1.0 +[8.0.1]: https://github.com/RMLio/rmlmapper-java/compare/v8.0.0...v8.0.1 +[8.0.0]: https://github.com/RMLio/rmlmapper-java/compare/v7.3.3...v8.0.0 +[7.3.3]: https://github.com/RMLio/rmlmapper-java/compare/v7.3.2...v7.3.3 +[7.3.2]: https://github.com/RMLio/rmlmapper-java/compare/v7.3.1...v7.3.2 +[7.3.1]: https://github.com/RMLio/rmlmapper-java/compare/v7.3.0...v7.3.1 +[7.3.0]: https://github.com/RMLio/rmlmapper-java/compare/v7.2.0...v7.3.0 +[7.2.0]: https://github.com/RMLio/rmlmapper-java/compare/v7.1.2...v7.2.0 +[7.1.2]: https://github.com/RMLio/rmlmapper-java/compare/v7.1.1...v7.1.2 +[7.1.1]: https://github.com/RMLio/rmlmapper-java/compare/v7.1.0...v7.1.1 +[7.1.0]: https://github.com/RMLio/rmlmapper-java/compare/v7.0.0...v7.1.0 +[7.0.0]: https://github.com/RMLio/rmlmapper-java/compare/v6.5.1...v7.0.0 +[6.5.1]: https://github.com/RMLio/rmlmapper-java/compare/v6.5.0...v6.5.1 +[6.5.0]: https://github.com/RMLio/rmlmapper-java/compare/v6.3.0...v6.5.0 +[6.3.0]: https://github.com/RMLio/rmlmapper-java/compare/v6.2.2...v6.3.0 +[6.2.2]: https://github.com/RMLio/rmlmapper-java/compare/v6.2.1...v6.2.2 +[6.2.1]: https://github.com/RMLio/rmlmapper-java/compare/v6.2.0...v6.2.1 +[6.2.0]: https://github.com/RMLio/rmlmapper-java/compare/v6.1.3...v6.2.0 +[6.1.3]: https://github.com/RMLio/rmlmapper-java/compare/v6.1.2...v6.1.3 +[6.1.2]: https://github.com/RMLio/rmlmapper-java/compare/v6.1.1...v6.1.2 +[6.1.1]: https://github.com/RMLio/rmlmapper-java/compare/v6.1.0...v6.1.1 +[6.1.0]: https://github.com/RMLio/rmlmapper-java/compare/v6.0.0...v6.1.0 +[6.0.0]: https://github.com/RMLio/rmlmapper-java/compare/v5.0.0...v6.0.0 +[5.0.0]: https://github.com/RMLio/rmlmapper-java/compare/v4.15.0...v5.0.0 +[4.15.0]: https://github.com/RMLio/rmlmapper-java/compare/v4.14.3...v4.15.0 +[4.14.3]: https://github.com/RMLio/rmlmapper-java/compare/v4.14.2...v4.14.3 +[4.14.2]: https://github.com/RMLio/rmlmapper-java/compare/v4.14.1...v4.14.2 +[4.14.1]: https://github.com/RMLio/rmlmapper-java/compare/v4.14.0...v4.14.1 +[4.14.0]: https://github.com/RMLio/rmlmapper-java/compare/v4.13.0...v4.14.0 +[4.13.0]: https://github.com/RMLio/rmlmapper-java/compare/v4.12.0...v4.13.0 +[4.12.0]: https://github.com/RMLio/rmlmapper-java/compare/v4.11.0...v4.12.0 +[4.11.0]: https://github.com/RMLio/rmlmapper-java/compare/v4.10.1...v4.11.0 +[4.10.1]: https://github.com/RMLio/rmlmapper-java/compare/v4.10.0...v4.10.1 +[4.10.0]: https://github.com/RMLio/rmlmapper-java/compare/v4.9.3...v4.10.0 +[4.9.4]: https://github.com/RMLio/rmlmapper-java/compare/v4.9.3...v4.9.4 +[4.9.3]: https://github.com/RMLio/rmlmapper-java/compare/v4.9.2...v4.9.3 +[4.9.2]: https://github.com/RMLio/rmlmapper-java/compare/v4.9.1...v4.9.2 +[4.9.1]: https://github.com/RMLio/rmlmapper-java/compare/v4.9.0...v4.9.1 +[4.9.0]: https://github.com/RMLio/rmlmapper-java/compare/v4.8.2...v4.9.0 +[4.8.2]: https://github.com/RMLio/rmlmapper-java/compare/v4.8.1...v4.8.2 +[4.8.1]: https://github.com/RMLio/rmlmapper-java/compare/v4.8.0...v4.8.1 +[4.8.0]: https://github.com/RMLio/rmlmapper-java/compare/v4.7.0...v4.8.0 +[4.7.0]: https://github.com/RMLio/rmlmapper-java/compare/v4.6.0...v4.7.0 [4.6.0]: https://github.com/RMLio/rmlmapper-java/compare/v4.5.1...v4.6.0 [4.5.1]: https://github.com/RMLio/rmlmapper-java/compare/v4.5.0...v4.5.1 [4.5.0]: https://github.com/RMLio/rmlmapper-java/compare/v4.4.2...v4.5.0 diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 00000000..11df63e6 --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,23 @@ +cff-version: 1.2.0 +message: "If you use this software, please cite it as below." +authors: +- family-names: "Heyvaert" + given-names: "Pieter" + orcid: "https://orcid.org/0000-0002-1583-5719" +- family-names: "Van Assche" + given-names: "Dylan" + orcid: "https://orcid.org/0000-0002-7195-9935" +- family-names: "De Meester" + given-names: "Ben" + orcid: "https://orcid.org/0000-0003-0248-0987" +- family-names: "Haesendonck" + given-names: "Gerald" + orcid: "https://orcid.org/0000-0003-1605-3855" +- family-names: "de Vleeschauwer" + given-names: "Els" + orcid: "https://orcid.org/0000-0002-8630-3947" +- given-names: "Sitt Min Oo" + orcid: "https://orcid.org/0000-0001-9157-7507" +title: "RMLMapper-JAVA" +doi: 10.5281/zenodo.3929132 +url: "https://github.com/RMLio/rmlmapper-java" \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 608426ed..f58a25be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,16 @@ -FROM openjdk:8-alpine +# Build image +FROM maven:3.9.12-eclipse-temurin-21-alpine AS buildimage -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 /rmlmapper-java +RUN mvn -Pno-buildnumber clean package -DskipTests=true +RUN mv $(readlink -f target/rmlmapper-*-all.jar) /rmlmapper.jar + +# "Runtime" image +FROM eclipse-temurin:25-jre +COPY --from=buildimage /rmlmapper.jar /rmlmapper.jar + WORKDIR /data ENTRYPOINT ["java", "-jar", "/rmlmapper.jar"] diff --git a/README.md b/README.md index ac300e5d..74218ff9 100644 --- a/README.md +++ b/README.md @@ -1,64 +1,129 @@ -# RMLMapper +# RMLMapper -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/)). +[![Maven Central](https://img.shields.io/maven-central/v/be.ugent.rml/rmlmapper.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22be.ugent.rml%22%20AND%20a:%22rmlmapper%22) + +The RMLMapper executes RML rules to generate Linked Data. +It is a Java library, which is available via the command line ([API docs online](https://javadoc.io/doc/be.ugent.rml/rmlmapper)). The RMLMapper loads all data in memory, so be aware when working with big datasets. -## Table of contents +Want to get started quickly? Check out [Releases](#releases) on where to find the latest CLI build as a jar, +and see [Usage](#cli) on how to use the commandline interface! + +## Table of contents - [Features](#features) + - [Supported](#supported) + - [Future](#future) +- [Releases](#releases) - [Build](#build) - [Usage](#usage) - [CLI](#cli) - [Library](#library) - [Docker](#docker) - [Including functions](#including-functions) + - [Generating metadata](#generating-metadata) - [Testing](#testing) + - [Command line](#command-line) + - [IntelliJ](#intellij) + - [RDBs](#rdbs) - [Dependencies](#dependencies) +- [Commercial Support](#commercial-support) - [Remarks](#remarks) + - [Typed spreadsheet files](#typed-spreadsheet-files) + - [XML file parsing performance](#xml-file-parsing-performance) + - [Language tag support](#language-tag-support) + - [Duplicate removal and serialization format](#duplicate-removal-and-serialization-format) + - [I have a question! Where can I get help?](#i-have-a-question-where-can-i-get-help) - [Documentation](#documentation) - [UML Diagrams](#uml-diagrams) ## Features ### Supported + - local data sources: - - CSV files (including CSVW) - - JSON files (JSONPath) - - XML files (XPath) -- remote data sources: - - relational databases (MySQL, PostgreSQL, and SQLServer) - - SPARQL endpoints - - files via HTTP urls (via GET) + - Excel (.xlsx) + - LibreOffice (.ods) - CSV files - - JSON files (JSONPath) + - including CSVW, for an overview of which parts of CSVW are supported, have a look at the [test cases, introduced in v4.4.0](https://github.com/RMLio/rmlmapper-java/tree/master/src/test/resources/test-cases-CSVW) + - JSON files (JSONPath (`@` can be used to select the current object.)) - XML files (XPath) +- remote data sources: + - relational databases (MySQL, PostgreSQL, Oracle, and SQLServer) + - Web APIs with W3C Web of Things, see [an exemplary test case, introduced in v4.13.0](https://github.com/RMLio/rmlmapper-java/blob/master/src/test/resources/web-of-things/logical-target/sparql/mapping.ttl) + - SPARQL endpoints + - files via HTTP urls (via GET) + - CSV files, see [an exemplary test case, introduced in v0.1.0](https://github.com/RMLio/rmlmapper-java/blob/master/src/test/resources/test-cases/RMLTC1003-CSV/mapping.ttl) + - JSON files (JSONPath (`@` can be used to select the current object.)) + - XML files (XPath) - functions (most cases) + - For examples on how to use functions within RML mapping documents, you can have a look at the [RML+FnO test cases](https://github.com/RMLio/rml-fno-test-cases) + - Notable function examples include + - SHA1 and MD5 functions, see [this comment on issue 100](https://github.com/RMLio/rmlmapper-java/issues/100#issuecomment-826547387) + - Lookup function, see [this comment on issue 200](https://github.com/RMLio/rmlmapper-java/issues/220#issuecomment-1754422677) - configuration file - metadata generation -- output formats: nquads (default), turtle, trig, trix, jsonld, hdt - join conditions +- output formats: nquads (default), turtle, trig, trix, jsonld, hdt, [jelly](https://w3id.org/jelly) +- targets: + - local file + - VoID dataset + - SPARQL endpoint with SPARQL UPDATE + - [HTTP request access](https://rml.io/specs/access/httprequest/) + - [dynamic logical targets](https://rml.io/specs/target/dynamictarget/) + +All functionalities above refer to using RML as maintained at . +There is _some_ support for RML as developed within W3C's [Knowledge Graph Construction Community Group](https://www.w3.org/community/kg-construct/), for a recent view, see the [test cases, support introduced in v7.0.0](https://github.com/RMLio/rmlmapper-java/tree/master/src/test/resources/new-test-cases). ### Future + - functions (all cases) - conditions (all cases) +- logical views + - Currently, this can be mitigated: we maintain a preprocessor to support this: [RML-view-to-CSV](https://github.com/RMLio/rml-view-to-csv). - data sources: - - NoSQL databases - - web APIs - - TPF servers + - NoSQL databases + - TPF servers + - [HTTP request access](https://rml.io/specs/access/httprequest/) + - dynamic logical source + - Currently, this can be mitigated: RMLMapper allows to use the commandline interface to combine multiple mapping rules, so you could script it, for more info, see [issue 161](https://github.com/RMLio/rmlmapper-java/issues/161). + +## Releases + +The standalone jar file (that has a [commandline interface](#cli)) for every release can be found on the release's page on GitHub. +You can find the latest release on [the dedicated RMLMapper-JAVA Github release page](https://github.com/RMLio/rmlmapper-java/releases/latest). +This is the recommended way to get started with RMLMapper. +Do you want to build from source yourself? Check [Build](#build). ## Build -The RMLMapper is build using Maven: `mvn install`. + +The RMLMapper is built using Maven. +As it is also tested against Oracle (check [the RDB documentation below](#rdbs) for details), +it needs a specific set-up to run all tests. +That's why we recommend to build without testing: `mvn install -DskipTests=true`. +If you want, you can install with tests, and just skip the Oracle tests: `mvn test -Dtest=!Mapper_OracleDB_Test`. + A standalone jar can be found in `/target`. +Two jars are found in `/target`: a slim jar without bundled dependencies, and a standalone jar (suffixed with `-all.jar`) with all dependencies bundled. + +Building with profile `no-buildnumber` disables using and updating `buildNumber.properties` (and uses `0` as build number), e.g.: + +```bash +mvn clean package -P no-buildnumber +``` + +outputs for example `target/rmlmapper--r0.jar` + ## Usage ### CLI + The following options are most common. - `-m, --mapping `: one or more mapping file paths and/or strings (multiple values are concatenated). - `-o, --output `: path to output file -- `-s,--serialization `: serialization format (nquads (default), trig, trix, jsonld, hdt) +- `-s,--serialization `: serialization format (nquads (default), trig, trix, jsonld, hdt, [jelly](https://w3id.org/jelly)) All options can be found when executing `java -jar rmlmapper.jar --help`, that output is found below. @@ -66,31 +131,66 @@ that output is found below. ``` usage: java -jar mapper.jar options: - -c,--configfile path to configuration file - -d,--duplicates remove duplicates in the output - -dsn,--r2rml-jdbcDriver DSN of the database when using R2RML rules - -e,--metadatafile path to output metadata file - -f,--functionfile path to functions.ttl file (dynamic - functions are found relative to - functions.ttl) - -h,--help show help info - -l,--metadataDetailLevel generate metadata on given detail level - (dataset - triple - term) - -m,--mappingfile one or more mapping file paths and/or - strings (multiple values are - concatenated). r2rml is converted to rml - if needed using the r2rml arguments. - -o,--outputfile path to output file (default: stdout) - -p,--r2rml-password password of the database when using R2RML rules - -s,--serialization serialization format (nquads (default), - turtle, trig, trix, jsonld, hdt) - -t,--triplesmaps IRIs of the triplesmaps that should be - executed in order, split by ',' (default - is all triplesmaps) - -u,--r2rml-username username of the database when using R2RML rules - -v,--verbose show more details in debugging output + -b,--base-iri Base IRI used to expand relative IRIs + in generated terms in the output. + -c,--configfile path to configuration file + --convert-mapping Only convert the mapping to the + latest RML specification by the W3C + Community Group + -d,--duplicates remove duplicates in the HDT, + N-Triples, or N-Quads output + --disable-automatic-eof-marker Setting this option assumes input + data has a kind of End-of-File + marker. Don't use unless you're + absolutely sure what you're doing! + -dsn,--r2rml-jdbcDSN DSN of the database when using R2RML + rules + -e,--metadatafile path to output metadata file + -f,--functionfile one or more function file paths + (dynamic functions with relative + paths are found relative to the cwd) + -h,--help show help info + -l,--metadataDetailLevel generate metadata on given detail + level (dataset - triple - term) + -m,--mappingfile one or more mapping file paths and/or + strings (multiple values are + concatenated). r2rml is converted to + rml if needed using the r2rml + arguments.RDF Format is determined + based on extension. + -o,--outputfile path to output file (default: stdout) + -p,--r2rml-password password of the database when using + R2RML rules + -psd,--privatesecuritydata one or more private security files + containing all private security + information such as usernames, + passwords, certificates, etc. + -s,--serialization serialization format (nquads + (default), turtle, trig, trix, + jsonld, hdt, jelly) + --strict Enable strict mode. In strict mode, + the mapper will fail on invalid IRIs + instead of skipping them. + -t,--triplesmaps IRIs of the triplesmaps that should + be executed in order, split by ',' + (default is all triplesmaps) + -u,--r2rml-username username of the database when using + R2RML rules + -v,--verbose show more details in debugging output ``` +#### Accessing Web APIs with authentication + +The [W3C Web of Things Security Ontology](https://www.w3.org/2019/wot/security) +is used to describe how Web APIs authentication should be performed +but does not include the necessary credentials to access the Web API. +These credentials can be supplied using the `-psd ` CLI argument. +The `PATH` argument must point to one or more private security files +which contain the necessary credentials to access the Web API. + +An example can be found in the test cases +[src/test/resources/web-of-things](src/test/resources/web-of-things). + ### Library An example of how you can use the RMLMapper as an external library can be found @@ -98,6 +198,13 @@ at [./src/test/java/be/ugent/rml/readme/ReadmeTest.java](https://github.com/RMLi ### Docker +#### Dockerhub + +We publish our Docker images automatically on Dockerhub for every release. +You can find our images here: [rmlio/rmlmapper-java](https://hub.docker.com/r/rmlio/rmlmapper-java). + +#### Build image + You can use Docker to run the RMLMapper by following these steps: - Build the Docker image: `docker build -t rmlmapper .`. @@ -108,37 +215,71 @@ 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 +There are three 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 +- add as dependency 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`). +#### Dynamic loading -``` -grel:toUpperCase a fno:Function ; - fno:name "to Uppercase" ; - rdfs:label "to Uppercase" ; - dcterms:description "Returns the input with all letters in upper case." ; +Create a Turtle file that describe the functions that need to be included and add the jar which contains those functions. + +> Note: the java or jar-files are found relative to the cwd. +You can change the functions.ttl path (or use multiple functions.ttl paths) using a commandline-option (`-f`). + +For example the snippets below dynamically link an fno:Function to a library, provided by a jar-file (`CustomFunctions.jar`). The example links a function that parses the latitude (`50.2`) out of the following string `"POINT (50.2 5.3)"`. + + `functions.ttl` contains the description of the function in Turtle: + +```turtle +@prefix dcterms: . +@prefix doap: . +@prefix fno: . +@prefix fnoi: . +@prefix fnom: . +@prefix grel: . +@prefix grelm: . +@prefix rdfs: . + +grel:parsePointLat a fno:Function ; + fno:name "parsePointLat" ; + rdfs:label "parsePointLat" ; + dcterms:description "Parse the latitude from a point." ; fno:expects ( grel:valueParam ) ; - fno:returns ( grel:stringOut ) ; - lib:providedBy [ - lib:localLibrary "GrelFunctions.jar"; - lib:class "GrelFunctions"; - lib:method "toUppercase" - ]. + fno:returns ( grel:stringOut ) . + +grelm:javaString + a fnoi:JavaClass ; + doap:download-page "CustomFunctions.jar" ; + fnoi:class-name "CustomFunctions" . + +grelm:parsePointLat + a fno:Mapping ; + fno:function grel:parsePointLat ; + fno:implementation grelm:javaString ; + fno:methodMapping [ a fnom:Function ; + fnom:method-name "parsePointLat" ] . ``` -#### Dynamic loading +The accompanying java file `CustomFunctions.java`: -Just put the java or jar-file in the resources folder, -at the root folder of the jar-location, -or the parent folder of the jar-location, -it will be found dynamically. +```java +public class CustomFunctions { + public static String parsePointLat(String s) { + return s.replace("POINT ", "").replace('(', ' ').replace(')', ' ').trim().split("\\s+")[0]; + } +} +``` -> Note: the java or jar-files are found relative to the loaded functions.ttl. -You can change the functions.ttl path using a commandline-option (`-f`). +To dynamically include the custom function, compile the java-file and include `functions.ttl` with the `-f` option: + +```bash +javac CustomFunctions.java && jar cvf CustomFunctions.jar CustomFunctions.class +java -jar mapper.jar -f functions.ttl +``` #### Preloading @@ -146,38 +287,107 @@ This overrides the dynamic loading. An example of how you can use Preload a custom function can be found at [./src/test/java/be/ugent/rml/readme/ReadmeFunctionTest.java](https://github.com/RMLio/rmlmapper-java/blob/master/src/test/java/be/ugent/rml/readme/ReadmeFunctionTest.java) +#### Adding as dependency + +This is most interesting if you use RMLMapper as a library in your own project. +Just add the dependency to the function library you want to use in your project. + +You can also add a function library as a Maven dependency in `pom.xml` of RMLMapper. +You'll have to rebuild RMLMapper to use it. + +### Generating metadata + +Conform to how it is described in the scientific paper [1], +the RMLMapper allows to automatically generate [PROV-O](https://www.w3.org/TR/prov-o/) metadata. +Specifically, you need the CLI arguments below. +You can specify in which output file the metadata should be stored, +and up to which level metadata should be stored (dataset, triple, or term level metadata). + +``` + -e,--metadatafile path to output metadata file + -l,--metadataDetailLevel generate metadata on given detail level + (dataset - triple - term) +``` + ## Testing +### Command line + +Run the tests via `test.sh`. + +### IntelliJ + +Right-click `src/test/java` directory and select "Run 'All tests'". + +#### Derived tests + +Some tests (Excel, ODS) are derived from other tests (CSV) using a script (`./generate_spreadsheet_test_cases.sh`) + ### RDBs -Make sure you have [Docker](https://www.docker.com) running. + +Make sure you have [Docker](https://www.docker.com) running. On Unix, others read-write permission (006) is required on `/var/run/docker.sock` in order to run the tests. +The tests will fail otherwise, as Testcontainers can't spin up the container. #### 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. + +- 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. ## Dependencies -| Dependency | License | -|:----------------------------------:|--------------------------------------------------------------------| -| com.spotify docker client | Apache License 2.0 | -| com.h2database h2 | Eclipse Public License 1.0 & Mozilla Public License 2.0 | -| com.googlecode.zohhak | GNU Lesser General Public License v3.0 | -| com.microsoft.sqlserver mssql-jdbc | MIT | -| ch.vorbuger.mariaDB4j | Apache License 2.0 | -| mysql-connector-java | GNU General Public License v2.0 | -| com.google.guava | Apache License 2.0 | -| javax.xml.parsers jaxp-api | Apache License 2.0 | -| com.jayway.jsonpath | Apache License 2.0 | -| junit | Eclipse Public License 1.0 | -| org.eclipse.rdf4j rdf4j-runtime | Eclipse Public License 1.0 | -| commons-cli | Apache License 2.0 | -| commons-csv | Apache License 2.0 | -| commons-lang | Apache License 2.0 | -| ch.qos.logback | Eclipse Public License 1.0 & GNU Lesser General Public License 2.1 | -| org.rdfhdt.hdt-jena | GNU Lesser General Public License v3.0 | +| Dependency | License | +|:--------------------------------------:|--------------------------------------------------------------------| +| ch.qos.logback logback-classic | Eclipse Public License 1.0 & GNU Lesser General Public License 2.1 | +| com.github.fnoio function-agent-java | MIT | +| com.github.fnoio grel-functions-java | MIT | +| com.github.fnoio idlab-functions-java | MIT | +| com.github.rdfhdt hdt-java | GNU Lesser General Public License v3.0 | +| com.github.tomakehurst:wiremock-jre8 | Apache License 2.0 | +| com.google.protobuf protobuf-java | BSD 3-clause | +| com.microsoft.sqlserver mssql-jdbc | MIT | +| com.mysql mysql-connector-java | GNU General Public License v2.0 | +| com.oracle.database.jdbc:ojdbc11 | Oracle Free Use Terms and Conditions | +| eu.neverblink.jelly jelly-core | Apache License 2.0 | +| eu.neverblink.jelly jelly-rdf4j | Apache License 2.0 | +| net.minidev json-smart | Apache License 2.0 | +| org.apache.jena fuseki-main | Apache License 2.0 | +| org.eclipse.rdf4j rdf4j-client | Eclipse Distribution License v1.0 | +| org.junit.jupiter junit-jupiter-api | Eclipse Public License v2.0 | +| org.junit.jupiter junit-jupiter-engine | Eclipse Public License v2.0 | +| org.junit.jupiter junit-jupiter-params | Eclipse Public License v2.0 | +| org.junit.vintage junit-vintage-engine | Eclipse Public License v2.0 | +| org.postgresql postgresql | BSD | +| org.testcontainers jdbc | MIT | +| org.testcontainers junit-jupiter | MIT | +| org.testcontainers mssqlserver | MIT | +| org.testcontainers mysql | MIT | +| org.testcontainers oracle-xe | MIT | +| org.testcontainers postgresql | MIT | + +## Commercial Support + +Do you need... + +- training? +- specific features? +- different integrations? +- bugfixes, on _your_ timeline? +- custom code, built by experts? +- commercial support and licensing? + +You're welcome to [contact us](mailto:info@rml.io) regarding +on-premise, enterprise, and internal installations, integrations, and deployments. + +We have commercial support available. + +We also offer consulting for all-things-RML. ## Remarks +### Typed spreadsheet files + +All spreadsheet files are as of yet regarded as plain CSV files. No type information like Currency, Date... is used. + ### XML file parsing performance The RMLMapper's XML parsing implementation (`javax.xml.parsers`) has been chosen to support full XPath. @@ -189,24 +399,48 @@ 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'. +### Duplicate removal and serialization format + +Performance depends on the serialization format (`--serialization `) +and if duplicate removal is enabled (`--duplicates`). +Experimenting with various configurations may lead to better performance for +your use case. + +### I have a question! Where can I get help? + +Do you have any question related to writing RML mapping rules, +the RML specification, etc., feel free to ask them +here: ! +If you have found a bug or need a feature for the RMLMapper itself, +you can make an issue in this repository. + ## Documentation + Generate static files at /docs/apidocs with: -``` + +```bash mvn javadoc:javadoc ``` ### UML Diagrams #### 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 +- 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) -* Go to [draw.io](https://www.draw.io) -* Click on 'Open Existing Diagram' and choose the .html file + +- Go to [draw.io](https://www.draw.io) +- Click on 'Open Existing Diagram' and choose the .html file + +[1]: A. Dimou, T. De Nies, R. Verborgh, E. Mannens, P. Mechant, and R. Van de Walle, “Automated metadata generation for linked data generation and publishing workflows,†in Proceedings of the 9th Workshop on Linked Data on the Web, Montreal, Canada, 2016, pp. 1–10. +[PDF](http://events.linkeddata.org/ldow2016/papers/LDOW2016_paper_04.pdf) diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 00000000..72f1ab46 --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,72 @@ +# Release process + +## Automated + +1. Go to Gitlab's Pipelines in the repository. +2. Click on the grey job with an arrow in it (`development` branch). +3. Click on 'Create Release' manually job of the pipeline, not on the play button! +4. Enter the following key-value variable: + - Key: `RELEASE_TAG_NAME` + - Value: The git tag you want, for example: `1.2.3` +5. Press 'Run job' + +All release steps are automatically executed including syncing the `master` branch, git tags, Maven, Docker, etc. +Once the job completes, make manually a GitHub Release from the tag your created on GitHub. + +## Manually + +### Release branch and tags + +1. Make a new release branch (named `release/X.Y.Z`) +2. Bump version number in `pom.xml` +3. Update the changelog with the release name, use [ChangeFrog](https://github.com/pheyvaer/changefrog) to avoid mistakes. +4. Run `mvn clean install -DskipTests=True` to generate a fat jar. +5. Create a merge request from the `release/X.Y.Z` branch to the `development` branch and merge it if all tests pass. +6. Repeat this for `development` to `master`. +7. Create a git tag: `git tag $TAG` on `master`. +8. Push tag: `git push --tags` + +### Docker image + +1. Run `docker build -t rmlio/rmlmapper-java:$TAG .` to generate a Docker image for your `$TAG`. +2. Repeat this for the `latest` tag: `docker build -t rmlio/rmlmapper-java:latest` +3. Push Docker images to Docker Hub: `docker push rmlio/rmlmapper-java:$TAG` and `docker push rmlio/rmlmapper-java:latest`. + +### Deploy on Central Repository + +The following steps deploy a new version to the Central Repository, +based on [this tutorial](https://central.sonatype.org/pages/apache-maven.html). + +1. Check if `~/.m2/settings.xml` exists. +2. If so, add the content of `settings.example.xml` to it, else +copy `settings.example.xml` to `~/.m2/settings.xml`. +3. Fill in your JIRA user name and password in `settings.xml`. +4. Fill in your GPG passphrase. Find more information about setting up your key [here](https://central.sonatype.org/pages/working-with-pgp-signatures.html). +5. Make sure `JAVA_HOME` is properly set for your setup. Example: `export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64` +6. Deploy the latest release via `mvn clean deploy -P release -DskipTests=true`. + +### Create a release on Github + +1. Update the `master` and `development` branches on Github. +2. Go to the Github repo and make a new release. +3. Select the tag you created earlier. +4. Add the content of `CHANGELOG.md` in the release notes +5. Append the fat jar you generated earlier as release binaries + +### Create a Merge Request to Alpine Linux's aports + +1. Make sure you have `pmbootstrap` installed and ran `pmbootstrap init`, see https://wiki.postmarketos.org/wiki/Installing_pmbootstrap#Installing_automatically +3. Fork and clone aports: https://gitlab.alpinelinux.org/alpine/aports +4. Copy `APKBUILD` file of the rmlmapper in `testing/rmlmapper` to `~/.local/var/pmbootstrap/cache_git/pmaports/temp/rmlmapper/`. You might need to create the `rmlmapper` directory. +5. Update the version number in the `APKBUILD` file. +6. Run `pmbootstrap checksum rmlmapper`. This will update the SHA512 checksums. +7. Check if everything builds: `pmbootstrap build rmlmapper` +8. If it passes, copy the `APKBUILD` file back to `aports/testing/rmlmapper` +9. Create a new commit in the `aports` git repo with title: `testing/rmlmapper: update to $TAG` +10. Push to your fork and create a Merge Request in Alpine Linux's Gitlab. +11. If the CI properly passes, maintainers will merge it in the next few hours or days. + +### Re-run the R2RML implementation report test cases + +1. Re-run them for this `$TAG` +2. Make a merge request to the `rmlio` website diff --git a/build-release.sh b/build-release.sh new file mode 100755 index 00000000..d0d49673 --- /dev/null +++ b/build-release.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +apk add java-jre-headless maven java-jdk +mvn install -DskipTests=true diff --git a/buildNumber.properties b/buildNumber.properties index 123f434c..a30686cb 100644 --- a/buildNumber.properties +++ b/buildNumber.properties @@ -1,3 +1,3 @@ #maven.buildNumber.plugin properties file -#Tue Nov 19 11:48:03 CET 2019 -buildNumber0=144 +#Thu Dec 11 14:28:34 CET 2025 +buildNumber0=379 diff --git a/bump-patch.sh b/bump-patch.sh deleted file mode 100755 index b3d4494b..00000000 --- a/bump-patch.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash -mvn validate -mvn compile -mvn test -mvn build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} versions:commit - -echo "Don't forget to change the CHANGELOG" diff --git a/bump.sh b/bump.sh new file mode 100644 index 00000000..14b4be8c --- /dev/null +++ b/bump.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +mvn validate +mvn compile +mvn test + +# patch +# mvn build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} versions:commit +# minor +# mvn build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.nextMinorVersion}.\${parsedVersion.incrementalVersion} versions:commit +# major +# mvn build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.nextMajorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.incrementalVersion} versions:commit + +echo "Don't forget to change the CHANGELOG" diff --git a/data/r2rml-test-cases-config-mysql.ini b/data/r2rml-test-cases-config-mysql.ini new file mode 100644 index 00000000..10325c35 --- /dev/null +++ b/data/r2rml-test-cases-config-mysql.ini @@ -0,0 +1,18 @@ +[tester] +tester_name: Dylan Van Assche +tester_url: https://rml.io/ +tester_contact: dylan.vanassche@ugent.be + +[engine] +test_date: DATE +engine_version: VERSION +engine_name: RMLMapper +engine_created: 2018-04-18 +engine_url: https://github.com/rmlio/rmlmapper-java + +[properties] +database_system: mysql +tests: all +output_results: ./output.nq +output_format: nquads +engine_command: java -jar ../target/rmlmapper-*-all.jar -d -s nquads -m ./r2rml.ttl -dsn jdbc:mysql://docker:3306/r2rml -u r2rml -p r2rml -o ./output.nq diff --git a/data/r2rml-test-cases-config-postgresql.ini b/data/r2rml-test-cases-config-postgresql.ini new file mode 100644 index 00000000..15a50075 --- /dev/null +++ b/data/r2rml-test-cases-config-postgresql.ini @@ -0,0 +1,18 @@ +[tester] +tester_name: Dylan Van Assche +tester_url: https://rml.io/ +tester_contact: dylan.vanassche@ugent.be + +[engine] +test_date: DATE +engine_version: VERSION +engine_name: RMLMapper +engine_created: 2018-04-18 +engine_url: https://github.com/rmlio/rmlmapper-java + +[properties] +database_system: postgresql +tests: all +output_results: ./output.nq +output_format: nquads +engine_command: java -jar ../target/rmlmapper-*-all.jar -d -s nquads -m ./r2rml.ttl -dsn jdbc:postgresql://docker:5432/r2rml -u r2rml -p r2rml -o ./output.nq diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml deleted file mode 100644 index 5f5daeeb..00000000 --- a/dependency-reduced-pom.xml +++ /dev/null @@ -1,185 +0,0 @@ - - - 4.0.0 - be.ugent.rml - rmlmapper - 4.5.1 - - scm:git:ssh://git@github.com:RMLio/rmlmapper-java.git - https://github.com/RMLio/rmlmapper-java - - - src/main/java - src/test/java - ${project.artifactId}-${project.version}-r${buildNumber} - - - maven-compiler-plugin - 3.8.1 - - ${maven.compiler.source} - ${maven.compiler.source} - - - - maven-javadoc-plugin - 3.1.0 - - - attach-javadocs - install - - javadoc - - - public - docs - false - none - - - - - docs - en - - - - maven-shade-plugin - 3.2.1 - - - make-assembly - package - - shade - - - - - false - - - be.ugent.rml.cli.Main - - - - - false - - - - - *:* - - META-INF/*.SF - META-INF/*.DSA - META-INF/*.RSA - - - - - - - maven-surefire-plugin - 3.0.0-M3 - - true - false - - - - org.codehaus.mojo - buildnumber-maven-plugin - 1.4 - - - validate - - create - - - - - {0,number} - - buildNumber0 - - - - - - - - repo.maven.apache.org - https://repo.maven.apache.org/maven2/ - - - jitpack.io - https://jitpack.io - - - - - junit - junit - 4.12 - test - - - hamcrest-core - org.hamcrest - - - - - ch.vorburger.mariaDB4j - mariaDB4j - 2.4.0 - test - - - mariaDB4j-core - ch.vorburger.mariaDB4j - - - mariaDB4j-db-linux64 - ch.vorburger.mariaDB4j - - - mariaDB4j-db-win32 - ch.vorburger.mariaDB4j - - - mariaDB4j-db-mac64 - ch.vorburger.mariaDB4j - - - - - com.microsoft.sqlserver - mssql-jdbc - 7.2.2.jre8 - test - - - com.googlecode.zohhak - zohhak - 1.1.1 - test - - - org.apache.jena - apache-jena-libs - 3.8.0 - pom - compile - - - - 8 - 8 - UTF-8 - 4.12 - - diff --git a/docs/apidocs/allclasses-frame.html b/docs/apidocs/allclasses-frame.html deleted file mode 100644 index 7e92f931..00000000 --- a/docs/apidocs/allclasses-frame.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - -All Classes (rmlmapper 4.5.0 API) - - - - - -

All Classes

- - - diff --git a/docs/apidocs/allclasses-noframe.html b/docs/apidocs/allclasses-noframe.html deleted file mode 100644 index 7cefcc90..00000000 --- a/docs/apidocs/allclasses-noframe.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - -All Classes (rmlmapper 4.5.0 API) - - - - - -

All Classes

- - - diff --git a/docs/apidocs/be/ugent/rml/DatabaseType.Database.html b/docs/apidocs/be/ugent/rml/DatabaseType.Database.html deleted file mode 100644 index 94e305eb..00000000 --- a/docs/apidocs/be/ugent/rml/DatabaseType.Database.html +++ /dev/null @@ -1,388 +0,0 @@ - - - - - - -DatabaseType.Database (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml
-

Enum DatabaseType.Database

-
-
- -
- -
-
- -
-
-
    -
  • - - - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        values

        -
        public static DatabaseType.Database[] values()
        -
        Returns an array containing the constants of this enum type, in -the order they are declared. This method may be used to iterate -over the constants as follows: -
        -for (DatabaseType.Database c : DatabaseType.Database.values())
        -    System.out.println(c);
        -
        -
        -
        Returns:
        -
        an array containing the constants of this enum type, in the order they are declared
        -
        -
      • -
      - - - -
        -
      • -

        valueOf

        -
        public static DatabaseType.Database valueOf(String name)
        -
        Returns the enum constant of this type with the specified name. -The string must match exactly an identifier used to declare an -enum constant in this type. (Extraneous whitespace characters are -not permitted.)
        -
        -
        Parameters:
        -
        name - the name of the enum constant to be returned.
        -
        Returns:
        -
        the enum constant with the specified name
        -
        Throws:
        -
        IllegalArgumentException - if this enum type has no constant with the specified name
        -
        NullPointerException - if the argument is null
        -
        -
      • -
      - - - - -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/DatabaseType.html b/docs/apidocs/be/ugent/rml/DatabaseType.html deleted file mode 100644 index bc3cdad3..00000000 --- a/docs/apidocs/be/ugent/rml/DatabaseType.html +++ /dev/null @@ -1,396 +0,0 @@ - - - - - - -DatabaseType (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml
-

Class DatabaseType

-
-
- -
-
    -
  • -
    -
    -
    public class DatabaseType
    -extends Object
    -
  • -
-
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/Executor.html b/docs/apidocs/be/ugent/rml/Executor.html deleted file mode 100644 index 446a039d..00000000 --- a/docs/apidocs/be/ugent/rml/Executor.html +++ /dev/null @@ -1,418 +0,0 @@ - - - - - - -Executor (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml
-

Class Executor

-
-
- -
-
    -
  • -
    -
    -
    public class Executor
    -extends Object
    -
  • -
-
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/Initializer.html b/docs/apidocs/be/ugent/rml/Initializer.html deleted file mode 100644 index 5c4b1663..00000000 --- a/docs/apidocs/be/ugent/rml/Initializer.html +++ /dev/null @@ -1,306 +0,0 @@ - - - - - - -Initializer (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml
-

Class Initializer

-
-
- -
-
    -
  • -
    -
    -
    public class Initializer
    -extends Object
    -
  • -
-
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/Mapping.html b/docs/apidocs/be/ugent/rml/Mapping.html deleted file mode 100644 index a23622a0..00000000 --- a/docs/apidocs/be/ugent/rml/Mapping.html +++ /dev/null @@ -1,303 +0,0 @@ - - - - - - -Mapping (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml
-

Class Mapping

-
-
- -
-
    -
  • -
    -
    -
    public class Mapping
    -extends Object
    -
  • -
-
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/MappingFactory.html b/docs/apidocs/be/ugent/rml/MappingFactory.html deleted file mode 100644 index 30605232..00000000 --- a/docs/apidocs/be/ugent/rml/MappingFactory.html +++ /dev/null @@ -1,280 +0,0 @@ - - - - - - -MappingFactory (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml
-

Class MappingFactory

-
-
- -
-
    -
  • -
    -
    -
    public class MappingFactory
    -extends Object
    -
  • -
-
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/MappingInfo.html b/docs/apidocs/be/ugent/rml/MappingInfo.html deleted file mode 100644 index ad2b8021..00000000 --- a/docs/apidocs/be/ugent/rml/MappingInfo.html +++ /dev/null @@ -1,288 +0,0 @@ - - - - - - -MappingInfo (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml
-

Class MappingInfo

-
-
- -
-
    -
  • -
    -
    -
    public class MappingInfo
    -extends Object
    -
  • -
-
-
- -
-
-
    -
  • - - - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        getTerm

        -
        public Term getTerm()
        -
      • -
      - - - -
        -
      • -

        getTermGenerator

        -
        public TermGenerator getTermGenerator()
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/NAMESPACES.html b/docs/apidocs/be/ugent/rml/NAMESPACES.html deleted file mode 100644 index 77dbdfcf..00000000 --- a/docs/apidocs/be/ugent/rml/NAMESPACES.html +++ /dev/null @@ -1,466 +0,0 @@ - - - - - - -NAMESPACES (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml
-

Class NAMESPACES

-
-
- -
-
    -
  • -
    -
    -
    public class NAMESPACES
    -extends Object
    -
  • -
-
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/PredicateObjectGraph.html b/docs/apidocs/be/ugent/rml/PredicateObjectGraph.html deleted file mode 100644 index 6bb0534e..00000000 --- a/docs/apidocs/be/ugent/rml/PredicateObjectGraph.html +++ /dev/null @@ -1,303 +0,0 @@ - - - - - - -PredicateObjectGraph (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml
-

Class PredicateObjectGraph

-
-
- -
-
    -
  • -
    -
    -
    public class PredicateObjectGraph
    -extends Object
    -
  • -
-
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/PredicateObjectGraphMapping.html b/docs/apidocs/be/ugent/rml/PredicateObjectGraphMapping.html deleted file mode 100644 index 99f9c2a1..00000000 --- a/docs/apidocs/be/ugent/rml/PredicateObjectGraphMapping.html +++ /dev/null @@ -1,355 +0,0 @@ - - - - - - -PredicateObjectGraphMapping (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml
-

Class PredicateObjectGraphMapping

-
-
- -
-
    -
  • -
    -
    -
    public class PredicateObjectGraphMapping
    -extends Object
    -
  • -
-
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/RecordFunctionExecutorFactory.html b/docs/apidocs/be/ugent/rml/RecordFunctionExecutorFactory.html deleted file mode 100644 index 6b6ff837..00000000 --- a/docs/apidocs/be/ugent/rml/RecordFunctionExecutorFactory.html +++ /dev/null @@ -1,277 +0,0 @@ - - - - - - -RecordFunctionExecutorFactory (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml
-

Class RecordFunctionExecutorFactory

-
-
- -
-
    -
  • -
    -
    -
    public class RecordFunctionExecutorFactory
    -extends Object
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        RecordFunctionExecutorFactory

        -
        public RecordFunctionExecutorFactory()
        -
      • -
      -
    • -
    - - -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/TEMPLATETYPE.html b/docs/apidocs/be/ugent/rml/TEMPLATETYPE.html deleted file mode 100644 index a5fd0a21..00000000 --- a/docs/apidocs/be/ugent/rml/TEMPLATETYPE.html +++ /dev/null @@ -1,343 +0,0 @@ - - - - - - -TEMPLATETYPE (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml
-

Enum TEMPLATETYPE

-
-
- -
- -
-
- -
-
-
    -
  • - - - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        values

        -
        public static TEMPLATETYPE[] values()
        -
        Returns an array containing the constants of this enum type, in -the order they are declared. This method may be used to iterate -over the constants as follows: -
        -for (TEMPLATETYPE c : TEMPLATETYPE.values())
        -    System.out.println(c);
        -
        -
        -
        Returns:
        -
        an array containing the constants of this enum type, in the order they are declared
        -
        -
      • -
      - - - -
        -
      • -

        valueOf

        -
        public static TEMPLATETYPE valueOf(String name)
        -
        Returns the enum constant of this type with the specified name. -The string must match exactly an identifier used to declare an -enum constant in this type. (Extraneous whitespace characters are -not permitted.)
        -
        -
        Parameters:
        -
        name - the name of the enum constant to be returned.
        -
        Returns:
        -
        the enum constant with the specified name
        -
        Throws:
        -
        IllegalArgumentException - if this enum type has no constant with the specified name
        -
        NullPointerException - if the argument is null
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/Template.html b/docs/apidocs/be/ugent/rml/Template.html deleted file mode 100644 index 65d980a4..00000000 --- a/docs/apidocs/be/ugent/rml/Template.html +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - -Template (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml
-

Class Template

-
-
- -
-
    -
  • -
    -
    -
    public class Template
    -extends Object
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        Template

        -
        public Template()
        -
      • -
      - - - - -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - - - - - -
        -
      • -

        addElement

        -
        public void addElement(TemplateElement templateElement)
        -
      • -
      - - - -
        -
      • -

        countVariables

        -
        public int countVariables()
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/TemplateElement.html b/docs/apidocs/be/ugent/rml/TemplateElement.html deleted file mode 100644 index 8e1088f7..00000000 --- a/docs/apidocs/be/ugent/rml/TemplateElement.html +++ /dev/null @@ -1,288 +0,0 @@ - - - - - - -TemplateElement (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml
-

Class TemplateElement

-
-
- -
-
    -
  • -
    -
    -
    public class TemplateElement
    -extends Object
    -
  • -
-
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/Utils.html b/docs/apidocs/be/ugent/rml/Utils.html deleted file mode 100644 index 54edeec2..00000000 --- a/docs/apidocs/be/ugent/rml/Utils.html +++ /dev/null @@ -1,938 +0,0 @@ - - - - - - -Utils (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml
-

Class Utils

-
-
- -
-
    -
  • -
    -
    -
    public class Utils
    -extends Object
    -
  • -
-
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/ValuedJoinCondition.html b/docs/apidocs/be/ugent/rml/ValuedJoinCondition.html deleted file mode 100644 index da969e22..00000000 --- a/docs/apidocs/be/ugent/rml/ValuedJoinCondition.html +++ /dev/null @@ -1,288 +0,0 @@ - - - - - - -ValuedJoinCondition (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml
-

Class ValuedJoinCondition

-
-
- -
-
    -
  • -
    -
    -
    public class ValuedJoinCondition
    -extends Object
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        ValuedJoinCondition

        -
        public ValuedJoinCondition(Template path,
        -                           List<String> values)
        -
      • -
      -
    • -
    - - -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/access/Access.html b/docs/apidocs/be/ugent/rml/access/Access.html deleted file mode 100644 index a0bca610..00000000 --- a/docs/apidocs/be/ugent/rml/access/Access.html +++ /dev/null @@ -1,260 +0,0 @@ - - - - - - -Access (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.access
-

Interface Access

-
-
-
- -
-
- -
-
-
    -
  • - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        getInputStream

        -
        InputStream getInputStream()
        -                    throws IOException
        -
        This method returns an InputStream for the access.
        -
        -
        Returns:
        -
        the InputStream corresponding to the access.
        -
        Throws:
        -
        IOException
        -
        -
      • -
      - - - -
        -
      • -

        getDataTypes

        -
        Map<String,String> getDataTypes()
        -
        This method returns a map of datatypes. - References to values are mapped to their datatypes, if available.
        -
        -
        Returns:
        -
        map of datatypes.
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/access/AccessFactory.html b/docs/apidocs/be/ugent/rml/access/AccessFactory.html deleted file mode 100644 index 89b68336..00000000 --- a/docs/apidocs/be/ugent/rml/access/AccessFactory.html +++ /dev/null @@ -1,293 +0,0 @@ - - - - - - -AccessFactory (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.access
-

Class AccessFactory

-
-
- -
-
    -
  • -
    -
    -
    public class AccessFactory
    -extends Object
    -
    This class creates Access instances.
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        AccessFactory

        -
        public AccessFactory(String basePath)
        -
        The constructor of the AccessFactory.
        -
        -
        Parameters:
        -
        basePath - the base path for the local file system.
        -
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        getAccess

        -
        public Access getAccess(Term logicalSource,
        -                        QuadStore rmlStore)
        -
        This method returns an Access instance based on the RML rules in rmlStore.
        -
        -
        Parameters:
        -
        logicalSource - the Logical Source for which the Access needs to be created.
        -
        rmlStore - a QuadStore with RML rules.
        -
        Returns:
        -
        an Access instance based on the RML rules in rmlStore.
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/access/LocalFileAccess.html b/docs/apidocs/be/ugent/rml/access/LocalFileAccess.html deleted file mode 100644 index b5237e9d..00000000 --- a/docs/apidocs/be/ugent/rml/access/LocalFileAccess.html +++ /dev/null @@ -1,415 +0,0 @@ - - - - - - -LocalFileAccess (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.access
-

Class LocalFileAccess

-
-
- -
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    Access
    -
    -
    -
    -
    public class LocalFileAccess
    -extends Object
    -implements Access
    -
    This class represents access to a local file.
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        LocalFileAccess

        -
        public LocalFileAccess(String path,
        -                       String basePath)
        -
        This constructor takes the path and the base path of a file.
        -
        -
        Parameters:
        -
        path - the relative path of the file.
        -
        basePath - the used base path.
        -
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - - - - - -
        -
      • -

        getDataTypes

        -
        public Map<String,String> getDataTypes()
        -
        This methods returns the datatypes of the file. - This method always returns null, because the datatypes can't be determined from a local file for the moment.
        -
        -
        Specified by:
        -
        getDataTypes in interface Access
        -
        Returns:
        -
        the datatypes of the file.
        -
        -
      • -
      - - - -
        -
      • -

        equals

        -
        public boolean equals(Object o)
        -
        -
        Overrides:
        -
        equals in class Object
        -
        -
      • -
      - - - -
        -
      • -

        hashCode

        -
        public int hashCode()
        -
        -
        Overrides:
        -
        hashCode in class Object
        -
        -
      • -
      - - - -
        -
      • -

        getPath

        -
        public String getPath()
        -
        This method returns the path of the access.
        -
        -
        Returns:
        -
        the relative path.
        -
        -
      • -
      - - - -
        -
      • -

        getBasePath

        -
        public String getBasePath()
        -
        This method returns the base path of the access.
        -
        -
        Returns:
        -
        the base path.
        -
        -
      • -
      - - - - -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/access/RDBAccess.html b/docs/apidocs/be/ugent/rml/access/RDBAccess.html deleted file mode 100644 index ead9e835..00000000 --- a/docs/apidocs/be/ugent/rml/access/RDBAccess.html +++ /dev/null @@ -1,489 +0,0 @@ - - - - - - -RDBAccess (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.access
-

Class RDBAccess

-
-
- -
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    Access
    -
    -
    -
    -
    public class RDBAccess
    -extends Object
    -implements Access
    -
    This class represents the access to a relational database.
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        RDBAccess

        -
        public RDBAccess(String dsn,
        -                 DatabaseType.Database database,
        -                 String username,
        -                 String password,
        -                 String query,
        -                 String contentType)
        -
        This constructor takes as arguments the dsn, database, username, password, query, and content type.
        -
        -
        Parameters:
        -
        dsn - the data source name.
        -
        database - the database type.
        -
        username - the username of the user that executes the query.
        -
        password - the password of the above user.
        -
        query - the SQL query to use.
        -
        contentType - the content type of the results.
        -
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        getInputStream

        -
        public InputStream getInputStream()
        -                           throws IOException
        -
        This method returns an InputStream of the results of the SQL query.
        -
        -
        Specified by:
        -
        getInputStream in interface Access
        -
        Returns:
        -
        an InputStream with the results.
        -
        Throws:
        -
        IOException
        -
        -
      • -
      - - - -
        -
      • -

        getDataTypes

        -
        public Map<String,String> getDataTypes()
        -
        This method returns the datatypes used for the columns in the accessed database.
        -
        -
        Specified by:
        -
        getDataTypes in interface Access
        -
        Returns:
        -
        a map of column names and their datatypes.
        -
        -
      • -
      - - - -
        -
      • -

        equals

        -
        public boolean equals(Object o)
        -
        -
        Overrides:
        -
        equals in class Object
        -
        -
      • -
      - - - -
        -
      • -

        hashCode

        -
        public int hashCode()
        -
        -
        Overrides:
        -
        hashCode in class Object
        -
        -
      • -
      - - - -
        -
      • -

        getDSN

        -
        public String getDSN()
        -
        This method returns the DNS.
        -
        -
        Returns:
        -
        the DNS.
        -
        -
      • -
      - - - -
        -
      • -

        getDatabase

        -
        public DatabaseType.Database getDatabase()
        -
        This method returns the database type.
        -
        -
        Returns:
        -
        the database type.
        -
        -
      • -
      - - - -
        -
      • -

        getUsername

        -
        public String getUsername()
        -
        This method returns the username.
        -
        -
        Returns:
        -
        the username.
        -
        -
      • -
      - - - -
        -
      • -

        getPassword

        -
        public String getPassword()
        -
        This method returns the password.
        -
        -
        Returns:
        -
        the password.
        -
        -
      • -
      - - - -
        -
      • -

        getQuery

        -
        public String getQuery()
        -
        This method returns the SQL query.
        -
        -
        Returns:
        -
        the SQL query.
        -
        -
      • -
      - - - -
        -
      • -

        getContentType

        -
        public String getContentType()
        -
        This method returns the content type.
        -
        -
        Returns:
        -
        the content type.
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/access/RemoteFileAccess.html b/docs/apidocs/be/ugent/rml/access/RemoteFileAccess.html deleted file mode 100644 index 009a4d7a..00000000 --- a/docs/apidocs/be/ugent/rml/access/RemoteFileAccess.html +++ /dev/null @@ -1,411 +0,0 @@ - - - - - - -RemoteFileAccess (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.access
-

Class RemoteFileAccess

-
-
- -
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    Access
    -
    -
    -
    -
    public class RemoteFileAccess
    -extends Object
    -implements Access
    -
    This class represents access to a remote file.
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        RemoteFileAccess

        -
        public RemoteFileAccess(String location)
        -
      • -
      - - - -
        -
      • -

        RemoteFileAccess

        -
        public RemoteFileAccess(String location,
        -                        String contentType)
        -
        This constructor of RemoteFileAccess taking location and content type as arguments.
        -
        -
        Parameters:
        -
        location - the location of the remote file.
        -
        contentType - the content type of the remote file.
        -
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        getInputStream

        -
        public InputStream getInputStream()
        -                           throws IOException
        -
        Description copied from interface: Access
        -
        This method returns an InputStream for the access.
        -
        -
        Specified by:
        -
        getInputStream in interface Access
        -
        Returns:
        -
        the InputStream corresponding to the access.
        -
        Throws:
        -
        IOException
        -
        -
      • -
      - - - -
        -
      • -

        getDataTypes

        -
        public Map<String,String> getDataTypes()
        -
        This methods returns the datatypes of the file. - This method always returns null, because the datatypes can't be determined from a remote file for the moment.
        -
        -
        Specified by:
        -
        getDataTypes in interface Access
        -
        Returns:
        -
        the datatypes of the file.
        -
        -
      • -
      - - - -
        -
      • -

        equals

        -
        public boolean equals(Object o)
        -
        -
        Overrides:
        -
        equals in class Object
        -
        -
      • -
      - - - -
        -
      • -

        hashCode

        -
        public int hashCode()
        -
        -
        Overrides:
        -
        hashCode in class Object
        -
        -
      • -
      - - - -
        -
      • -

        getLocation

        -
        public String getLocation()
        -
        The method returns the location of the remote file.
        -
        -
        Returns:
        -
        the location.
        -
        -
      • -
      - - - -
        -
      • -

        getContentType

        -
        public String getContentType()
        -
        This method returns the content type of the remote file.
        -
        -
        Returns:
        -
        the content type.
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/access/SPARQLEndpointAccess.html b/docs/apidocs/be/ugent/rml/access/SPARQLEndpointAccess.html deleted file mode 100644 index a797eb50..00000000 --- a/docs/apidocs/be/ugent/rml/access/SPARQLEndpointAccess.html +++ /dev/null @@ -1,421 +0,0 @@ - - - - - - -SPARQLEndpointAccess (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.access
-

Class SPARQLEndpointAccess

-
-
- -
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    Access
    -
    -
    -
    -
    public class SPARQLEndpointAccess
    -extends Object
    -implements Access
    -
    This class represents the access to a SPARQL endpoint.
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        SPARQLEndpointAccess

        -
        public SPARQLEndpointAccess(String contentType,
        -                            String endpoint,
        -                            String query)
        -
        This constructor takes a content type, url of the endpoint, and a SPARQL query as arguments.
        -
        -
        Parameters:
        -
        contentType - the content type of the results.
        -
        endpoint - the url of the SPARQL endpoint.
        -
        query - the SPARQL query used on the endpoint.
        -
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - - - - - -
        -
      • -

        equals

        -
        public boolean equals(Object o)
        -
        -
        Overrides:
        -
        equals in class Object
        -
        -
      • -
      - - - -
        -
      • -

        hashCode

        -
        public int hashCode()
        -
        -
        Overrides:
        -
        hashCode in class Object
        -
        -
      • -
      - - - -
        -
      • -

        getDataTypes

        -
        public Map<String,String> getDataTypes()
        -
        This methods returns the datatypes of the results of the SPARQL query. - This method always returns null at the moment.
        -
        -
        Specified by:
        -
        getDataTypes in interface Access
        -
        Returns:
        -
        the datatypes of the results of the SPARQL query.
        -
        -
      • -
      - - - -
        -
      • -

        getContentType

        -
        public String getContentType()
        -
        This method returns the content type of the results.
        -
        -
        Returns:
        -
        the content type of the results.
        -
        -
      • -
      - - - -
        -
      • -

        getEndpoint

        -
        public String getEndpoint()
        -
        This method returns the url of the endpoint.
        -
        -
        Returns:
        -
        the url of the endpoint.
        -
        -
      • -
      - - - -
        -
      • -

        getQuery

        -
        public String getQuery()
        -
        This method returns the SPARQL query that is used to get the results.
        -
        -
        Returns:
        -
        the SPARQL query that is used to get the results.
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/access/class-use/Access.html b/docs/apidocs/be/ugent/rml/access/class-use/Access.html deleted file mode 100644 index a5c4a486..00000000 --- a/docs/apidocs/be/ugent/rml/access/class-use/Access.html +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - -Uses of Interface be.ugent.rml.access.Access (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Interface
be.ugent.rml.access.Access

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/access/class-use/AccessFactory.html b/docs/apidocs/be/ugent/rml/access/class-use/AccessFactory.html deleted file mode 100644 index 22d1717e..00000000 --- a/docs/apidocs/be/ugent/rml/access/class-use/AccessFactory.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.access.AccessFactory (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.access.AccessFactory

-
-
No usage of be.ugent.rml.access.AccessFactory
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/access/class-use/LocalFileAccess.html b/docs/apidocs/be/ugent/rml/access/class-use/LocalFileAccess.html deleted file mode 100644 index a3cd9480..00000000 --- a/docs/apidocs/be/ugent/rml/access/class-use/LocalFileAccess.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.access.LocalFileAccess (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.access.LocalFileAccess

-
-
No usage of be.ugent.rml.access.LocalFileAccess
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/access/class-use/RDBAccess.html b/docs/apidocs/be/ugent/rml/access/class-use/RDBAccess.html deleted file mode 100644 index 962d5770..00000000 --- a/docs/apidocs/be/ugent/rml/access/class-use/RDBAccess.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.access.RDBAccess (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.access.RDBAccess

-
-
No usage of be.ugent.rml.access.RDBAccess
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/access/class-use/RemoteFileAccess.html b/docs/apidocs/be/ugent/rml/access/class-use/RemoteFileAccess.html deleted file mode 100644 index 836e5061..00000000 --- a/docs/apidocs/be/ugent/rml/access/class-use/RemoteFileAccess.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.access.RemoteFileAccess (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.access.RemoteFileAccess

-
-
No usage of be.ugent.rml.access.RemoteFileAccess
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/access/class-use/SPARQLEndpointAccess.html b/docs/apidocs/be/ugent/rml/access/class-use/SPARQLEndpointAccess.html deleted file mode 100644 index 5cba8d01..00000000 --- a/docs/apidocs/be/ugent/rml/access/class-use/SPARQLEndpointAccess.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.access.SPARQLEndpointAccess (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.access.SPARQLEndpointAccess

-
-
No usage of be.ugent.rml.access.SPARQLEndpointAccess
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/access/package-frame.html b/docs/apidocs/be/ugent/rml/access/package-frame.html deleted file mode 100644 index f07a719f..00000000 --- a/docs/apidocs/be/ugent/rml/access/package-frame.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - -be.ugent.rml.access (rmlmapper 4.5.0 API) - - - - - -

be.ugent.rml.access

- - - diff --git a/docs/apidocs/be/ugent/rml/access/package-summary.html b/docs/apidocs/be/ugent/rml/access/package-summary.html deleted file mode 100644 index 246113a5..00000000 --- a/docs/apidocs/be/ugent/rml/access/package-summary.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - -be.ugent.rml.access (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Package be.ugent.rml.access

-
-
-
    -
  • - - - - - - - - - - - - -
    Interface Summary 
    InterfaceDescription
    Access -
    This interface represents the access to a data source.
    -
    -
  • -
  • - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Class Summary 
    ClassDescription
    AccessFactory -
    This class creates Access instances.
    -
    LocalFileAccess -
    This class represents access to a local file.
    -
    RDBAccess -
    This class represents the access to a relational database.
    -
    RemoteFileAccess -
    This class represents access to a remote file.
    -
    SPARQLEndpointAccess -
    This class represents the access to a SPARQL endpoint.
    -
    -
  • -
-
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/access/package-tree.html b/docs/apidocs/be/ugent/rml/access/package-tree.html deleted file mode 100644 index 260ba08b..00000000 --- a/docs/apidocs/be/ugent/rml/access/package-tree.html +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - -be.ugent.rml.access Class Hierarchy (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Hierarchy For Package be.ugent.rml.access

-Package Hierarchies: - -
-
-

Class Hierarchy

- -

Interface Hierarchy

-
    -
  • be.ugent.rml.access.Access
  • -
-
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/access/package-use.html b/docs/apidocs/be/ugent/rml/access/package-use.html deleted file mode 100644 index 3a3f3a56..00000000 --- a/docs/apidocs/be/ugent/rml/access/package-use.html +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - -Uses of Package be.ugent.rml.access (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Package
be.ugent.rml.access

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/class-use/DatabaseType.Database.html b/docs/apidocs/be/ugent/rml/class-use/DatabaseType.Database.html deleted file mode 100644 index f1b4b106..00000000 --- a/docs/apidocs/be/ugent/rml/class-use/DatabaseType.Database.html +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.DatabaseType.Database (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.DatabaseType.Database

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/class-use/DatabaseType.html b/docs/apidocs/be/ugent/rml/class-use/DatabaseType.html deleted file mode 100644 index bc0f3886..00000000 --- a/docs/apidocs/be/ugent/rml/class-use/DatabaseType.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.DatabaseType (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.DatabaseType

-
-
No usage of be.ugent.rml.DatabaseType
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/class-use/Executor.html b/docs/apidocs/be/ugent/rml/class-use/Executor.html deleted file mode 100644 index 886af734..00000000 --- a/docs/apidocs/be/ugent/rml/class-use/Executor.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.Executor (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.Executor

-
-
No usage of be.ugent.rml.Executor
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/class-use/Initializer.html b/docs/apidocs/be/ugent/rml/class-use/Initializer.html deleted file mode 100644 index 65682dae..00000000 --- a/docs/apidocs/be/ugent/rml/class-use/Initializer.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.Initializer (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.Initializer

-
-
No usage of be.ugent.rml.Initializer
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/class-use/Mapping.html b/docs/apidocs/be/ugent/rml/class-use/Mapping.html deleted file mode 100644 index f448e477..00000000 --- a/docs/apidocs/be/ugent/rml/class-use/Mapping.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.Mapping (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.Mapping

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/class-use/MappingFactory.html b/docs/apidocs/be/ugent/rml/class-use/MappingFactory.html deleted file mode 100644 index e4aa6757..00000000 --- a/docs/apidocs/be/ugent/rml/class-use/MappingFactory.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.MappingFactory (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.MappingFactory

-
-
No usage of be.ugent.rml.MappingFactory
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/class-use/MappingInfo.html b/docs/apidocs/be/ugent/rml/class-use/MappingInfo.html deleted file mode 100644 index d31917b3..00000000 --- a/docs/apidocs/be/ugent/rml/class-use/MappingInfo.html +++ /dev/null @@ -1,243 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.MappingInfo (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.MappingInfo

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/class-use/NAMESPACES.html b/docs/apidocs/be/ugent/rml/class-use/NAMESPACES.html deleted file mode 100644 index 041dcb22..00000000 --- a/docs/apidocs/be/ugent/rml/class-use/NAMESPACES.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.NAMESPACES (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.NAMESPACES

-
-
No usage of be.ugent.rml.NAMESPACES
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/class-use/PredicateObjectGraph.html b/docs/apidocs/be/ugent/rml/class-use/PredicateObjectGraph.html deleted file mode 100644 index 2d68796a..00000000 --- a/docs/apidocs/be/ugent/rml/class-use/PredicateObjectGraph.html +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.PredicateObjectGraph (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.PredicateObjectGraph

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/class-use/PredicateObjectGraphMapping.html b/docs/apidocs/be/ugent/rml/class-use/PredicateObjectGraphMapping.html deleted file mode 100644 index bcfee4b6..00000000 --- a/docs/apidocs/be/ugent/rml/class-use/PredicateObjectGraphMapping.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.PredicateObjectGraphMapping (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.PredicateObjectGraphMapping

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/class-use/RecordFunctionExecutorFactory.html b/docs/apidocs/be/ugent/rml/class-use/RecordFunctionExecutorFactory.html deleted file mode 100644 index 75a22761..00000000 --- a/docs/apidocs/be/ugent/rml/class-use/RecordFunctionExecutorFactory.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.RecordFunctionExecutorFactory (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.RecordFunctionExecutorFactory

-
-
No usage of be.ugent.rml.RecordFunctionExecutorFactory
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/class-use/TEMPLATETYPE.html b/docs/apidocs/be/ugent/rml/class-use/TEMPLATETYPE.html deleted file mode 100644 index e2bfd614..00000000 --- a/docs/apidocs/be/ugent/rml/class-use/TEMPLATETYPE.html +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.TEMPLATETYPE (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.TEMPLATETYPE

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/class-use/Template.html b/docs/apidocs/be/ugent/rml/class-use/Template.html deleted file mode 100644 index 75761d01..00000000 --- a/docs/apidocs/be/ugent/rml/class-use/Template.html +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.Template (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.Template

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/class-use/TemplateElement.html b/docs/apidocs/be/ugent/rml/class-use/TemplateElement.html deleted file mode 100644 index 8373822c..00000000 --- a/docs/apidocs/be/ugent/rml/class-use/TemplateElement.html +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.TemplateElement (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.TemplateElement

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/class-use/Utils.html b/docs/apidocs/be/ugent/rml/class-use/Utils.html deleted file mode 100644 index 484688f3..00000000 --- a/docs/apidocs/be/ugent/rml/class-use/Utils.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.Utils (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.Utils

-
-
No usage of be.ugent.rml.Utils
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/class-use/ValuedJoinCondition.html b/docs/apidocs/be/ugent/rml/class-use/ValuedJoinCondition.html deleted file mode 100644 index 6fe745c0..00000000 --- a/docs/apidocs/be/ugent/rml/class-use/ValuedJoinCondition.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.ValuedJoinCondition (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.ValuedJoinCondition

-
-
No usage of be.ugent.rml.ValuedJoinCondition
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/cli/Main.html b/docs/apidocs/be/ugent/rml/cli/Main.html deleted file mode 100644 index 6091b6ab..00000000 --- a/docs/apidocs/be/ugent/rml/cli/Main.html +++ /dev/null @@ -1,296 +0,0 @@ - - - - - - -Main (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.cli
-

Class Main

-
-
- -
-
    -
  • -
    -
    -
    public class Main
    -extends Object
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        Main

        -
        public Main()
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        main

        -
        public static void main(String[] args)
        -
      • -
      - - - -
        -
      • -

        main

        -
        public static void main(String[] args,
        -                        String basePath)
        -
        Main method use for the CLI. Allows to also set the current working directory via the argument basePath.
        -
        -
        Parameters:
        -
        args - the CLI arguments
        -
        basePath - the basePath used during the execution.
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/cli/class-use/Main.html b/docs/apidocs/be/ugent/rml/cli/class-use/Main.html deleted file mode 100644 index f9551e8a..00000000 --- a/docs/apidocs/be/ugent/rml/cli/class-use/Main.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.cli.Main (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.cli.Main

-
-
No usage of be.ugent.rml.cli.Main
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/cli/package-frame.html b/docs/apidocs/be/ugent/rml/cli/package-frame.html deleted file mode 100644 index a6dc3f8d..00000000 --- a/docs/apidocs/be/ugent/rml/cli/package-frame.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - -be.ugent.rml.cli (rmlmapper 4.5.0 API) - - - - - -

be.ugent.rml.cli

-
-

Classes

- -
- - diff --git a/docs/apidocs/be/ugent/rml/cli/package-summary.html b/docs/apidocs/be/ugent/rml/cli/package-summary.html deleted file mode 100644 index c569436e..00000000 --- a/docs/apidocs/be/ugent/rml/cli/package-summary.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -be.ugent.rml.cli (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Package be.ugent.rml.cli

-
-
-
    -
  • - - - - - - - - - - - - -
    Class Summary 
    ClassDescription
    Main 
    -
  • -
-
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/cli/package-tree.html b/docs/apidocs/be/ugent/rml/cli/package-tree.html deleted file mode 100644 index 3c27bb93..00000000 --- a/docs/apidocs/be/ugent/rml/cli/package-tree.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - -be.ugent.rml.cli Class Hierarchy (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Hierarchy For Package be.ugent.rml.cli

-Package Hierarchies: - -
-
-

Class Hierarchy

- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/cli/package-use.html b/docs/apidocs/be/ugent/rml/cli/package-use.html deleted file mode 100644 index c691aff5..00000000 --- a/docs/apidocs/be/ugent/rml/cli/package-use.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Package be.ugent.rml.cli (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Package
be.ugent.rml.cli

-
-
No usage of be.ugent.rml.cli
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/extractor/ConstantExtractor.html b/docs/apidocs/be/ugent/rml/extractor/ConstantExtractor.html deleted file mode 100644 index 68c9f0d7..00000000 --- a/docs/apidocs/be/ugent/rml/extractor/ConstantExtractor.html +++ /dev/null @@ -1,302 +0,0 @@ - - - - - - -ConstantExtractor (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.extractor
-

Class ConstantExtractor

-
-
- -
- -
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/extractor/Extractor.html b/docs/apidocs/be/ugent/rml/extractor/Extractor.html deleted file mode 100644 index 193f53ce..00000000 --- a/docs/apidocs/be/ugent/rml/extractor/Extractor.html +++ /dev/null @@ -1,227 +0,0 @@ - - - - - - -Extractor (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.extractor
-

Interface Extractor

-
-
-
- -
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/extractor/ReferenceExtractor.html b/docs/apidocs/be/ugent/rml/extractor/ReferenceExtractor.html deleted file mode 100644 index 0d378593..00000000 --- a/docs/apidocs/be/ugent/rml/extractor/ReferenceExtractor.html +++ /dev/null @@ -1,355 +0,0 @@ - - - - - - -ReferenceExtractor (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.extractor
-

Class ReferenceExtractor

-
-
- -
- -
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/extractor/class-use/ConstantExtractor.html b/docs/apidocs/be/ugent/rml/extractor/class-use/ConstantExtractor.html deleted file mode 100644 index 06139519..00000000 --- a/docs/apidocs/be/ugent/rml/extractor/class-use/ConstantExtractor.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.extractor.ConstantExtractor (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.extractor.ConstantExtractor

-
-
No usage of be.ugent.rml.extractor.ConstantExtractor
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/extractor/class-use/Extractor.html b/docs/apidocs/be/ugent/rml/extractor/class-use/Extractor.html deleted file mode 100644 index 2ea8abd9..00000000 --- a/docs/apidocs/be/ugent/rml/extractor/class-use/Extractor.html +++ /dev/null @@ -1,220 +0,0 @@ - - - - - - -Uses of Interface be.ugent.rml.extractor.Extractor (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Interface
be.ugent.rml.extractor.Extractor

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/extractor/class-use/ReferenceExtractor.html b/docs/apidocs/be/ugent/rml/extractor/class-use/ReferenceExtractor.html deleted file mode 100644 index ae5672b7..00000000 --- a/docs/apidocs/be/ugent/rml/extractor/class-use/ReferenceExtractor.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.extractor.ReferenceExtractor (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.extractor.ReferenceExtractor

-
-
No usage of be.ugent.rml.extractor.ReferenceExtractor
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/extractor/package-frame.html b/docs/apidocs/be/ugent/rml/extractor/package-frame.html deleted file mode 100644 index f53dcb81..00000000 --- a/docs/apidocs/be/ugent/rml/extractor/package-frame.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - -be.ugent.rml.extractor (rmlmapper 4.5.0 API) - - - - - -

be.ugent.rml.extractor

-
-

Interfaces

- -

Classes

- -
- - diff --git a/docs/apidocs/be/ugent/rml/extractor/package-summary.html b/docs/apidocs/be/ugent/rml/extractor/package-summary.html deleted file mode 100644 index b963bccb..00000000 --- a/docs/apidocs/be/ugent/rml/extractor/package-summary.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - -be.ugent.rml.extractor (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Package be.ugent.rml.extractor

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/extractor/package-tree.html b/docs/apidocs/be/ugent/rml/extractor/package-tree.html deleted file mode 100644 index f2a1bbd4..00000000 --- a/docs/apidocs/be/ugent/rml/extractor/package-tree.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -be.ugent.rml.extractor Class Hierarchy (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Hierarchy For Package be.ugent.rml.extractor

-Package Hierarchies: - -
-
-

Class Hierarchy

- -

Interface Hierarchy

- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/extractor/package-use.html b/docs/apidocs/be/ugent/rml/extractor/package-use.html deleted file mode 100644 index e718e230..00000000 --- a/docs/apidocs/be/ugent/rml/extractor/package-use.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - -Uses of Package be.ugent.rml.extractor (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Package
be.ugent.rml.extractor

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/AbstractSingleRecordFunctionExecutor.html b/docs/apidocs/be/ugent/rml/functions/AbstractSingleRecordFunctionExecutor.html deleted file mode 100644 index 7a83c3fc..00000000 --- a/docs/apidocs/be/ugent/rml/functions/AbstractSingleRecordFunctionExecutor.html +++ /dev/null @@ -1,289 +0,0 @@ - - - - - - -AbstractSingleRecordFunctionExecutor (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.functions
-

Class AbstractSingleRecordFunctionExecutor

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • be.ugent.rml.functions.AbstractSingleRecordFunctionExecutor
    • -
    -
  • -
-
- -
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/ConcatFunction.html b/docs/apidocs/be/ugent/rml/functions/ConcatFunction.html deleted file mode 100644 index 9c5144d7..00000000 --- a/docs/apidocs/be/ugent/rml/functions/ConcatFunction.html +++ /dev/null @@ -1,296 +0,0 @@ - - - - - - -ConcatFunction (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.functions
-

Class ConcatFunction

-
-
- -
- -
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/DynamicMultipleRecordsFunctionExecutor.html b/docs/apidocs/be/ugent/rml/functions/DynamicMultipleRecordsFunctionExecutor.html deleted file mode 100644 index 4410d1d7..00000000 --- a/docs/apidocs/be/ugent/rml/functions/DynamicMultipleRecordsFunctionExecutor.html +++ /dev/null @@ -1,287 +0,0 @@ - - - - - - -DynamicMultipleRecordsFunctionExecutor (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.functions
-

Class DynamicMultipleRecordsFunctionExecutor

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • be.ugent.rml.functions.DynamicMultipleRecordsFunctionExecutor
    • -
    -
  • -
-
- -
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/DynamicSingleRecordFunctionExecutor.html b/docs/apidocs/be/ugent/rml/functions/DynamicSingleRecordFunctionExecutor.html deleted file mode 100644 index cb132edc..00000000 --- a/docs/apidocs/be/ugent/rml/functions/DynamicSingleRecordFunctionExecutor.html +++ /dev/null @@ -1,257 +0,0 @@ - - - - - - -DynamicSingleRecordFunctionExecutor (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.functions
-

Class DynamicSingleRecordFunctionExecutor

-
-
- -
- -
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/FunctionLoader.html b/docs/apidocs/be/ugent/rml/functions/FunctionLoader.html deleted file mode 100644 index 7d372044..00000000 --- a/docs/apidocs/be/ugent/rml/functions/FunctionLoader.html +++ /dev/null @@ -1,319 +0,0 @@ - - - - - - -FunctionLoader (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.functions
-

Class FunctionLoader

-
-
- -
-
    -
  • -
    -
    -
    public class FunctionLoader
    -extends Object
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        FunctionLoader

        -
        public FunctionLoader()
        -
      • -
      - - - -
        -
      • -

        FunctionLoader

        -
        public FunctionLoader(File functionsFile)
        -
      • -
      - - - -
        -
      • -

        FunctionLoader

        -
        public FunctionLoader(File functionsFile,
        -                      QuadStore functionDescriptionTriples,
        -                      Map<String,Class> libraryMap)
        -
      • -
      -
    • -
    - - -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/FunctionModel.html b/docs/apidocs/be/ugent/rml/functions/FunctionModel.html deleted file mode 100644 index a1b5ca0f..00000000 --- a/docs/apidocs/be/ugent/rml/functions/FunctionModel.html +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - -FunctionModel (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.functions
-

Class FunctionModel

-
-
- -
-
    -
  • -
    -
    -
    public class FunctionModel
    -extends Object
    -
    Function Model
    -
    -
    Author:
    -
    bjdmeest
    -
    -
  • -
-
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/FunctionUtils.html b/docs/apidocs/be/ugent/rml/functions/FunctionUtils.html deleted file mode 100644 index 94a76df7..00000000 --- a/docs/apidocs/be/ugent/rml/functions/FunctionUtils.html +++ /dev/null @@ -1,325 +0,0 @@ - - - - - - -FunctionUtils (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.functions
-

Class FunctionUtils

-
-
- -
-
    -
  • -
    -
    -
    public class FunctionUtils
    -extends Object
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        FunctionUtils

        -
        public FunctionUtils()
        -
      • -
      -
    • -
    - - -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/MultipleRecordsFunctionExecutor.html b/docs/apidocs/be/ugent/rml/functions/MultipleRecordsFunctionExecutor.html deleted file mode 100644 index 3c243562..00000000 --- a/docs/apidocs/be/ugent/rml/functions/MultipleRecordsFunctionExecutor.html +++ /dev/null @@ -1,232 +0,0 @@ - - - - - - -MultipleRecordsFunctionExecutor (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.functions
-

Interface MultipleRecordsFunctionExecutor

-
-
-
- -
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/ParameterValueOriginPair.html b/docs/apidocs/be/ugent/rml/functions/ParameterValueOriginPair.html deleted file mode 100644 index 56fc04b8..00000000 --- a/docs/apidocs/be/ugent/rml/functions/ParameterValueOriginPair.html +++ /dev/null @@ -1,288 +0,0 @@ - - - - - - -ParameterValueOriginPair (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.functions
-

Class ParameterValueOriginPair

-
-
- -
-
    -
  • -
    -
    -
    public class ParameterValueOriginPair
    -extends Object
    -
  • -
-
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/ParameterValuePair.html b/docs/apidocs/be/ugent/rml/functions/ParameterValuePair.html deleted file mode 100644 index 4f2b0cec..00000000 --- a/docs/apidocs/be/ugent/rml/functions/ParameterValuePair.html +++ /dev/null @@ -1,288 +0,0 @@ - - - - - - -ParameterValuePair (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.functions
-

Class ParameterValuePair

-
-
- -
-
    -
  • -
    -
    -
    public class ParameterValuePair
    -extends Object
    -
  • -
-
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/SingleRecordFunctionExecutor.html b/docs/apidocs/be/ugent/rml/functions/SingleRecordFunctionExecutor.html deleted file mode 100644 index b740c4b8..00000000 --- a/docs/apidocs/be/ugent/rml/functions/SingleRecordFunctionExecutor.html +++ /dev/null @@ -1,232 +0,0 @@ - - - - - - -SingleRecordFunctionExecutor (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.functions
-

Interface SingleRecordFunctionExecutor

-
-
-
- -
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/StaticMultipleRecordsFunctionExecutor.html b/docs/apidocs/be/ugent/rml/functions/StaticMultipleRecordsFunctionExecutor.html deleted file mode 100644 index db5abf22..00000000 --- a/docs/apidocs/be/ugent/rml/functions/StaticMultipleRecordsFunctionExecutor.html +++ /dev/null @@ -1,287 +0,0 @@ - - - - - - -StaticMultipleRecordsFunctionExecutor (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.functions
-

Class StaticMultipleRecordsFunctionExecutor

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • be.ugent.rml.functions.StaticMultipleRecordsFunctionExecutor
    • -
    -
  • -
-
- -
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/StaticSingleRecordFunctionExecutor.html b/docs/apidocs/be/ugent/rml/functions/StaticSingleRecordFunctionExecutor.html deleted file mode 100644 index f2e27a04..00000000 --- a/docs/apidocs/be/ugent/rml/functions/StaticSingleRecordFunctionExecutor.html +++ /dev/null @@ -1,257 +0,0 @@ - - - - - - -StaticSingleRecordFunctionExecutor (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.functions
-

Class StaticSingleRecordFunctionExecutor

-
-
- -
- -
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/TermGeneratorOriginPair.html b/docs/apidocs/be/ugent/rml/functions/TermGeneratorOriginPair.html deleted file mode 100644 index 491b5de0..00000000 --- a/docs/apidocs/be/ugent/rml/functions/TermGeneratorOriginPair.html +++ /dev/null @@ -1,288 +0,0 @@ - - - - - - -TermGeneratorOriginPair (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.functions
-

Class TermGeneratorOriginPair

-
-
- -
-
    -
  • -
    -
    -
    public class TermGeneratorOriginPair
    -extends Object
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        TermGeneratorOriginPair

        -
        public TermGeneratorOriginPair(TermGenerator termGenerator,
        -                               String origin)
        -
      • -
      -
    • -
    - - -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/class-use/AbstractSingleRecordFunctionExecutor.html b/docs/apidocs/be/ugent/rml/functions/class-use/AbstractSingleRecordFunctionExecutor.html deleted file mode 100644 index 5b3e2fcc..00000000 --- a/docs/apidocs/be/ugent/rml/functions/class-use/AbstractSingleRecordFunctionExecutor.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.functions.AbstractSingleRecordFunctionExecutor (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.functions.AbstractSingleRecordFunctionExecutor

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/class-use/ConcatFunction.html b/docs/apidocs/be/ugent/rml/functions/class-use/ConcatFunction.html deleted file mode 100644 index 0d54be5f..00000000 --- a/docs/apidocs/be/ugent/rml/functions/class-use/ConcatFunction.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.functions.ConcatFunction (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.functions.ConcatFunction

-
-
No usage of be.ugent.rml.functions.ConcatFunction
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/class-use/DynamicMultipleRecordsFunctionExecutor.html b/docs/apidocs/be/ugent/rml/functions/class-use/DynamicMultipleRecordsFunctionExecutor.html deleted file mode 100644 index 9ca8e207..00000000 --- a/docs/apidocs/be/ugent/rml/functions/class-use/DynamicMultipleRecordsFunctionExecutor.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.functions.DynamicMultipleRecordsFunctionExecutor (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.functions.DynamicMultipleRecordsFunctionExecutor

-
-
No usage of be.ugent.rml.functions.DynamicMultipleRecordsFunctionExecutor
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/class-use/DynamicSingleRecordFunctionExecutor.html b/docs/apidocs/be/ugent/rml/functions/class-use/DynamicSingleRecordFunctionExecutor.html deleted file mode 100644 index 0b50b761..00000000 --- a/docs/apidocs/be/ugent/rml/functions/class-use/DynamicSingleRecordFunctionExecutor.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.functions.DynamicSingleRecordFunctionExecutor (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.functions.DynamicSingleRecordFunctionExecutor

-
-
No usage of be.ugent.rml.functions.DynamicSingleRecordFunctionExecutor
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/class-use/FunctionLoader.html b/docs/apidocs/be/ugent/rml/functions/class-use/FunctionLoader.html deleted file mode 100644 index f56ec5e7..00000000 --- a/docs/apidocs/be/ugent/rml/functions/class-use/FunctionLoader.html +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.functions.FunctionLoader (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.functions.FunctionLoader

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/class-use/FunctionModel.html b/docs/apidocs/be/ugent/rml/functions/class-use/FunctionModel.html deleted file mode 100644 index 5ada862e..00000000 --- a/docs/apidocs/be/ugent/rml/functions/class-use/FunctionModel.html +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.functions.FunctionModel (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.functions.FunctionModel

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/class-use/FunctionUtils.html b/docs/apidocs/be/ugent/rml/functions/class-use/FunctionUtils.html deleted file mode 100644 index c4306f6d..00000000 --- a/docs/apidocs/be/ugent/rml/functions/class-use/FunctionUtils.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.functions.FunctionUtils (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.functions.FunctionUtils

-
-
No usage of be.ugent.rml.functions.FunctionUtils
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/class-use/MultipleRecordsFunctionExecutor.html b/docs/apidocs/be/ugent/rml/functions/class-use/MultipleRecordsFunctionExecutor.html deleted file mode 100644 index cd8f84ce..00000000 --- a/docs/apidocs/be/ugent/rml/functions/class-use/MultipleRecordsFunctionExecutor.html +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - -Uses of Interface be.ugent.rml.functions.MultipleRecordsFunctionExecutor (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Interface
be.ugent.rml.functions.MultipleRecordsFunctionExecutor

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/class-use/ParameterValueOriginPair.html b/docs/apidocs/be/ugent/rml/functions/class-use/ParameterValueOriginPair.html deleted file mode 100644 index a372067a..00000000 --- a/docs/apidocs/be/ugent/rml/functions/class-use/ParameterValueOriginPair.html +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.functions.ParameterValueOriginPair (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.functions.ParameterValueOriginPair

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/class-use/ParameterValuePair.html b/docs/apidocs/be/ugent/rml/functions/class-use/ParameterValuePair.html deleted file mode 100644 index 9401c92a..00000000 --- a/docs/apidocs/be/ugent/rml/functions/class-use/ParameterValuePair.html +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.functions.ParameterValuePair (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.functions.ParameterValuePair

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/class-use/SingleRecordFunctionExecutor.html b/docs/apidocs/be/ugent/rml/functions/class-use/SingleRecordFunctionExecutor.html deleted file mode 100644 index c6264c49..00000000 --- a/docs/apidocs/be/ugent/rml/functions/class-use/SingleRecordFunctionExecutor.html +++ /dev/null @@ -1,269 +0,0 @@ - - - - - - -Uses of Interface be.ugent.rml.functions.SingleRecordFunctionExecutor (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Interface
be.ugent.rml.functions.SingleRecordFunctionExecutor

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/class-use/StaticMultipleRecordsFunctionExecutor.html b/docs/apidocs/be/ugent/rml/functions/class-use/StaticMultipleRecordsFunctionExecutor.html deleted file mode 100644 index b5a03995..00000000 --- a/docs/apidocs/be/ugent/rml/functions/class-use/StaticMultipleRecordsFunctionExecutor.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.functions.StaticMultipleRecordsFunctionExecutor (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.functions.StaticMultipleRecordsFunctionExecutor

-
-
No usage of be.ugent.rml.functions.StaticMultipleRecordsFunctionExecutor
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/class-use/StaticSingleRecordFunctionExecutor.html b/docs/apidocs/be/ugent/rml/functions/class-use/StaticSingleRecordFunctionExecutor.html deleted file mode 100644 index ab368c02..00000000 --- a/docs/apidocs/be/ugent/rml/functions/class-use/StaticSingleRecordFunctionExecutor.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.functions.StaticSingleRecordFunctionExecutor (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.functions.StaticSingleRecordFunctionExecutor

-
-
No usage of be.ugent.rml.functions.StaticSingleRecordFunctionExecutor
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/class-use/TermGeneratorOriginPair.html b/docs/apidocs/be/ugent/rml/functions/class-use/TermGeneratorOriginPair.html deleted file mode 100644 index e5fe9aaf..00000000 --- a/docs/apidocs/be/ugent/rml/functions/class-use/TermGeneratorOriginPair.html +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.functions.TermGeneratorOriginPair (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.functions.TermGeneratorOriginPair

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/lib/GrelProcessor.html b/docs/apidocs/be/ugent/rml/functions/lib/GrelProcessor.html deleted file mode 100644 index 04cee43e..00000000 --- a/docs/apidocs/be/ugent/rml/functions/lib/GrelProcessor.html +++ /dev/null @@ -1,327 +0,0 @@ - - - - - - -GrelProcessor (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.functions.lib
-

Class GrelProcessor

-
-
- -
-
    -
  • -
    -
    -
    public class GrelProcessor
    -extends Object
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        GrelProcessor

        -
        public GrelProcessor()
        -
      • -
      -
    • -
    - - -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/lib/GrelTestProcessor.html b/docs/apidocs/be/ugent/rml/functions/lib/GrelTestProcessor.html deleted file mode 100644 index e57636a2..00000000 --- a/docs/apidocs/be/ugent/rml/functions/lib/GrelTestProcessor.html +++ /dev/null @@ -1,353 +0,0 @@ - - - - - - -GrelTestProcessor (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.functions.lib
-

Class GrelTestProcessor

-
-
- -
-
    -
  • -
    -
    -
    public class GrelTestProcessor
    -extends Object
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        GrelTestProcessor

        -
        public GrelTestProcessor()
        -
      • -
      -
    • -
    - - -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/lib/IDLabFunctions.html b/docs/apidocs/be/ugent/rml/functions/lib/IDLabFunctions.html deleted file mode 100644 index 7a2ba25b..00000000 --- a/docs/apidocs/be/ugent/rml/functions/lib/IDLabFunctions.html +++ /dev/null @@ -1,365 +0,0 @@ - - - - - - -IDLabFunctions (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.functions.lib
-

Class IDLabFunctions

-
-
- -
-
    -
  • -
    -
    -
    public class IDLabFunctions
    -extends Object
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        IDLabFunctions

        -
        public IDLabFunctions()
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        stringContainsOtherString

        -
        public static boolean stringContainsOtherString(String str,
        -                                                String otherStr,
        -                                                String delimiter)
        -
      • -
      - - - -
        -
      • -

        listContainsElement

        -
        public static boolean listContainsElement(List list,
        -                                          String str)
        -
      • -
      - - - - - - - -
        -
      • -

        trueCondition

        -
        public static Object trueCondition(String bool,
        -                                   String value)
        -
      • -
      - - - - - - - -
        -
      • -

        getMIMEType

        -
        public static String getMIMEType(String filename)
        -
      • -
      - - - -
        -
      • -

        readFile

        -
        public static String readFile(String path)
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/lib/UtilFunctions.html b/docs/apidocs/be/ugent/rml/functions/lib/UtilFunctions.html deleted file mode 100644 index aee6f9a3..00000000 --- a/docs/apidocs/be/ugent/rml/functions/lib/UtilFunctions.html +++ /dev/null @@ -1,290 +0,0 @@ - - - - - - -UtilFunctions (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.functions.lib
-

Class UtilFunctions

-
-
- -
-
    -
  • -
    -
    -
    public class UtilFunctions
    -extends Object
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        UtilFunctions

        -
        public UtilFunctions()
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        equal

        -
        public static boolean equal(String str1,
        -                            String str2)
        -
      • -
      - - - -
        -
      • -

        notEqual

        -
        public static boolean notEqual(String str1,
        -                               String str2)
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/lib/class-use/GrelProcessor.html b/docs/apidocs/be/ugent/rml/functions/lib/class-use/GrelProcessor.html deleted file mode 100644 index af0b61d8..00000000 --- a/docs/apidocs/be/ugent/rml/functions/lib/class-use/GrelProcessor.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.functions.lib.GrelProcessor (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.functions.lib.GrelProcessor

-
-
No usage of be.ugent.rml.functions.lib.GrelProcessor
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/lib/class-use/GrelTestProcessor.html b/docs/apidocs/be/ugent/rml/functions/lib/class-use/GrelTestProcessor.html deleted file mode 100644 index 8a819f80..00000000 --- a/docs/apidocs/be/ugent/rml/functions/lib/class-use/GrelTestProcessor.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.functions.lib.GrelTestProcessor (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.functions.lib.GrelTestProcessor

-
-
No usage of be.ugent.rml.functions.lib.GrelTestProcessor
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/lib/class-use/IDLabFunctions.html b/docs/apidocs/be/ugent/rml/functions/lib/class-use/IDLabFunctions.html deleted file mode 100644 index a5aacd3e..00000000 --- a/docs/apidocs/be/ugent/rml/functions/lib/class-use/IDLabFunctions.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.functions.lib.IDLabFunctions (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.functions.lib.IDLabFunctions

-
-
No usage of be.ugent.rml.functions.lib.IDLabFunctions
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/lib/class-use/UtilFunctions.html b/docs/apidocs/be/ugent/rml/functions/lib/class-use/UtilFunctions.html deleted file mode 100644 index 5a8155cf..00000000 --- a/docs/apidocs/be/ugent/rml/functions/lib/class-use/UtilFunctions.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.functions.lib.UtilFunctions (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.functions.lib.UtilFunctions

-
-
No usage of be.ugent.rml.functions.lib.UtilFunctions
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/lib/package-frame.html b/docs/apidocs/be/ugent/rml/functions/lib/package-frame.html deleted file mode 100644 index 5a3cfdf0..00000000 --- a/docs/apidocs/be/ugent/rml/functions/lib/package-frame.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - -be.ugent.rml.functions.lib (rmlmapper 4.5.0 API) - - - - - -

be.ugent.rml.functions.lib

- - - diff --git a/docs/apidocs/be/ugent/rml/functions/lib/package-summary.html b/docs/apidocs/be/ugent/rml/functions/lib/package-summary.html deleted file mode 100644 index 87b25513..00000000 --- a/docs/apidocs/be/ugent/rml/functions/lib/package-summary.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - -be.ugent.rml.functions.lib (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Package be.ugent.rml.functions.lib

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/lib/package-tree.html b/docs/apidocs/be/ugent/rml/functions/lib/package-tree.html deleted file mode 100644 index 9ab608fc..00000000 --- a/docs/apidocs/be/ugent/rml/functions/lib/package-tree.html +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - -be.ugent.rml.functions.lib Class Hierarchy (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Hierarchy For Package be.ugent.rml.functions.lib

-Package Hierarchies: - -
-
-

Class Hierarchy

- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/lib/package-use.html b/docs/apidocs/be/ugent/rml/functions/lib/package-use.html deleted file mode 100644 index bd7bc369..00000000 --- a/docs/apidocs/be/ugent/rml/functions/lib/package-use.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Package be.ugent.rml.functions.lib (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Package
be.ugent.rml.functions.lib

-
-
No usage of be.ugent.rml.functions.lib
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/package-frame.html b/docs/apidocs/be/ugent/rml/functions/package-frame.html deleted file mode 100644 index 28b07ca3..00000000 --- a/docs/apidocs/be/ugent/rml/functions/package-frame.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - -be.ugent.rml.functions (rmlmapper 4.5.0 API) - - - - - -

be.ugent.rml.functions

- - - diff --git a/docs/apidocs/be/ugent/rml/functions/package-summary.html b/docs/apidocs/be/ugent/rml/functions/package-summary.html deleted file mode 100644 index 09e0f8e7..00000000 --- a/docs/apidocs/be/ugent/rml/functions/package-summary.html +++ /dev/null @@ -1,209 +0,0 @@ - - - - - - -be.ugent.rml.functions (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Package be.ugent.rml.functions

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/package-tree.html b/docs/apidocs/be/ugent/rml/functions/package-tree.html deleted file mode 100644 index 10645bd3..00000000 --- a/docs/apidocs/be/ugent/rml/functions/package-tree.html +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - -be.ugent.rml.functions Class Hierarchy (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Hierarchy For Package be.ugent.rml.functions

-Package Hierarchies: - -
-
-

Class Hierarchy

- -

Interface Hierarchy

- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/functions/package-use.html b/docs/apidocs/be/ugent/rml/functions/package-use.html deleted file mode 100644 index dc97a0f3..00000000 --- a/docs/apidocs/be/ugent/rml/functions/package-use.html +++ /dev/null @@ -1,245 +0,0 @@ - - - - - - -Uses of Package be.ugent.rml.functions (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Package
be.ugent.rml.functions

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/metadata/DatasetLevelMetadataGenerator.html b/docs/apidocs/be/ugent/rml/metadata/DatasetLevelMetadataGenerator.html deleted file mode 100644 index 0b4fcdd6..00000000 --- a/docs/apidocs/be/ugent/rml/metadata/DatasetLevelMetadataGenerator.html +++ /dev/null @@ -1,288 +0,0 @@ - - - - - - -DatasetLevelMetadataGenerator (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.metadata
-

Class DatasetLevelMetadataGenerator

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • be.ugent.rml.metadata.DatasetLevelMetadataGenerator
    • -
    -
  • -
-
-
    -
  • -
    -
    -
    public class DatasetLevelMetadataGenerator
    -extends Object
    -
    Unique class -- reusable outside of the mapper
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        DatasetLevelMetadataGenerator

        -
        public DatasetLevelMetadataGenerator()
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        createMetadata

        -
        public static void createMetadata(Term rdfDataset,
        -                                  Term rdfDatasetGeneration,
        -                                  Term rmlMapper,
        -                                  QuadStore result,
        -                                  List<Term> logicalSources,
        -                                  String startTimestamp,
        -                                  String stopTimestamp,
        -                                  String[] mappingFiles)
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/metadata/Metadata.html b/docs/apidocs/be/ugent/rml/metadata/Metadata.html deleted file mode 100644 index f3085e01..00000000 --- a/docs/apidocs/be/ugent/rml/metadata/Metadata.html +++ /dev/null @@ -1,300 +0,0 @@ - - - - - - -Metadata (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.metadata
-

Class Metadata

-
-
- -
-
    -
  • -
    -
    -
    public class Metadata
    -extends Object
    -
    Holds the source triplesMap and Subject-, Object- or PredicateMap for a specific (provenanced) term.
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        Metadata

        -
        public Metadata()
        -
      • -
      - - - -
        -
      • -

        Metadata

        -
        public Metadata(Term triplesMap)
        -
      • -
      - - - -
        -
      • -

        Metadata

        -
        public Metadata(Term triplesMap,
        -                Term sourceMap)
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        setSourceMap

        -
        public void setSourceMap(Term sourceMap)
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/metadata/MetadataGenerator.DETAIL_LEVEL.html b/docs/apidocs/be/ugent/rml/metadata/MetadataGenerator.DETAIL_LEVEL.html deleted file mode 100644 index b0056813..00000000 --- a/docs/apidocs/be/ugent/rml/metadata/MetadataGenerator.DETAIL_LEVEL.html +++ /dev/null @@ -1,372 +0,0 @@ - - - - - - -MetadataGenerator.DETAIL_LEVEL (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.metadata
-

Enum MetadataGenerator.DETAIL_LEVEL

-
-
- -
- -
-
- -
-
-
    -
  • - - - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        values

        -
        public static MetadataGenerator.DETAIL_LEVEL[] values()
        -
        Returns an array containing the constants of this enum type, in -the order they are declared. This method may be used to iterate -over the constants as follows: -
        -for (MetadataGenerator.DETAIL_LEVEL c : MetadataGenerator.DETAIL_LEVEL.values())
        -    System.out.println(c);
        -
        -
        -
        Returns:
        -
        an array containing the constants of this enum type, in the order they are declared
        -
        -
      • -
      - - - -
        -
      • -

        valueOf

        -
        public static MetadataGenerator.DETAIL_LEVEL valueOf(String name)
        -
        Returns the enum constant of this type with the specified name. -The string must match exactly an identifier used to declare an -enum constant in this type. (Extraneous whitespace characters are -not permitted.)
        -
        -
        Parameters:
        -
        name - the name of the enum constant to be returned.
        -
        Returns:
        -
        the enum constant with the specified name
        -
        Throws:
        -
        IllegalArgumentException - if this enum type has no constant with the specified name
        -
        NullPointerException - if the argument is null
        -
        -
      • -
      - - - -
        -
      • -

        getLevel

        -
        public int getLevel()
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/metadata/MetadataGenerator.html b/docs/apidocs/be/ugent/rml/metadata/MetadataGenerator.html deleted file mode 100644 index 7d1d8432..00000000 --- a/docs/apidocs/be/ugent/rml/metadata/MetadataGenerator.html +++ /dev/null @@ -1,384 +0,0 @@ - - - - - - -MetadataGenerator (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.metadata
-

Class MetadataGenerator

-
-
- -
-
    -
  • -
    -
    -
    public class MetadataGenerator
    -extends Object
    -
    Class that encapsulates the generation of metadata. - (Does everything for metadata generation)
    -
  • -
-
-
- -
-
-
    -
  • - - - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        insertQuad

        -
        public void insertQuad(ProvenancedQuad provenancedQuad)
        -
        Gets called every time a quad is generated. - Creates a node representing the quad. - Applies the metadatageneration functions to the given quad.
        -
        -
        Parameters:
        -
        provenancedQuad - provenanced Quad
        -
        -
      • -
      - - - -
        -
      • -

        preMappingGeneration

        -
        public void preMappingGeneration(List<Term> triplesMaps,
        -                                 QuadStore mappingQuads)
        -
        Generates metadata before the actual mapping.
        -
        -
        Parameters:
        -
        triplesMaps - list of tripleMap terms
        -
        mappingQuads - mapping quadstore
        -
        -
      • -
      - - - -
        -
      • -

        postMappingGeneration

        -
        public void postMappingGeneration(String startTimestamp,
        -                                  String stopTimestamp,
        -                                  QuadStore result)
        -
        Generates metadata after the actual mapping.
        -
        -
        Parameters:
        -
        startTimestamp - string of starting timestamp
        -
        stopTimestamp - string of stopping timestamp
        -
        result - result quadstore
        -
        -
      • -
      - - - - - - - -
        -
      • -

        getResult

        -
        public QuadStore getResult()
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/metadata/class-use/DatasetLevelMetadataGenerator.html b/docs/apidocs/be/ugent/rml/metadata/class-use/DatasetLevelMetadataGenerator.html deleted file mode 100644 index 3baa9631..00000000 --- a/docs/apidocs/be/ugent/rml/metadata/class-use/DatasetLevelMetadataGenerator.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.metadata.DatasetLevelMetadataGenerator (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.metadata.DatasetLevelMetadataGenerator

-
-
No usage of be.ugent.rml.metadata.DatasetLevelMetadataGenerator
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/metadata/class-use/Metadata.html b/docs/apidocs/be/ugent/rml/metadata/class-use/Metadata.html deleted file mode 100644 index 05d09f8e..00000000 --- a/docs/apidocs/be/ugent/rml/metadata/class-use/Metadata.html +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.metadata.Metadata (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.metadata.Metadata

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/metadata/class-use/MetadataGenerator.DETAIL_LEVEL.html b/docs/apidocs/be/ugent/rml/metadata/class-use/MetadataGenerator.DETAIL_LEVEL.html deleted file mode 100644 index 795a3aaf..00000000 --- a/docs/apidocs/be/ugent/rml/metadata/class-use/MetadataGenerator.DETAIL_LEVEL.html +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.metadata.MetadataGenerator.DETAIL_LEVEL (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.metadata.MetadataGenerator.DETAIL_LEVEL

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/metadata/class-use/MetadataGenerator.html b/docs/apidocs/be/ugent/rml/metadata/class-use/MetadataGenerator.html deleted file mode 100644 index e9e29457..00000000 --- a/docs/apidocs/be/ugent/rml/metadata/class-use/MetadataGenerator.html +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.metadata.MetadataGenerator (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.metadata.MetadataGenerator

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/metadata/package-frame.html b/docs/apidocs/be/ugent/rml/metadata/package-frame.html deleted file mode 100644 index 6e1eeeed..00000000 --- a/docs/apidocs/be/ugent/rml/metadata/package-frame.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - -be.ugent.rml.metadata (rmlmapper 4.5.0 API) - - - - - -

be.ugent.rml.metadata

- - - diff --git a/docs/apidocs/be/ugent/rml/metadata/package-summary.html b/docs/apidocs/be/ugent/rml/metadata/package-summary.html deleted file mode 100644 index 54be09bb..00000000 --- a/docs/apidocs/be/ugent/rml/metadata/package-summary.html +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - -be.ugent.rml.metadata (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Package be.ugent.rml.metadata

-
-
-
    -
  • - - - - - - - - - - - - - - - - - - - - -
    Class Summary 
    ClassDescription
    DatasetLevelMetadataGenerator -
    Unique class -- reusable outside of the mapper
    -
    Metadata -
    Holds the source triplesMap and Subject-, Object- or PredicateMap for a specific (provenanced) term.
    -
    MetadataGenerator -
    Class that encapsulates the generation of metadata.
    -
    -
  • -
  • - - - - - - - - - - - - -
    Enum Summary 
    EnumDescription
    MetadataGenerator.DETAIL_LEVEL 
    -
  • -
-
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/metadata/package-tree.html b/docs/apidocs/be/ugent/rml/metadata/package-tree.html deleted file mode 100644 index 0a17629e..00000000 --- a/docs/apidocs/be/ugent/rml/metadata/package-tree.html +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - -be.ugent.rml.metadata Class Hierarchy (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Hierarchy For Package be.ugent.rml.metadata

-Package Hierarchies: - -
-
-

Class Hierarchy

- -

Enum Hierarchy

- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/metadata/package-use.html b/docs/apidocs/be/ugent/rml/metadata/package-use.html deleted file mode 100644 index d2e55ffe..00000000 --- a/docs/apidocs/be/ugent/rml/metadata/package-use.html +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - -Uses of Package be.ugent.rml.metadata (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Package
be.ugent.rml.metadata

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/package-frame.html b/docs/apidocs/be/ugent/rml/package-frame.html deleted file mode 100644 index a758db16..00000000 --- a/docs/apidocs/be/ugent/rml/package-frame.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - -be.ugent.rml (rmlmapper 4.5.0 API) - - - - - -

be.ugent.rml

- - - diff --git a/docs/apidocs/be/ugent/rml/package-summary.html b/docs/apidocs/be/ugent/rml/package-summary.html deleted file mode 100644 index 5006ba7f..00000000 --- a/docs/apidocs/be/ugent/rml/package-summary.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - -be.ugent.rml (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Package be.ugent.rml

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/package-tree.html b/docs/apidocs/be/ugent/rml/package-tree.html deleted file mode 100644 index 2023de58..00000000 --- a/docs/apidocs/be/ugent/rml/package-tree.html +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - -be.ugent.rml Class Hierarchy (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Hierarchy For Package be.ugent.rml

-Package Hierarchies: - -
-
-

Class Hierarchy

- -

Enum Hierarchy

- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/package-use.html b/docs/apidocs/be/ugent/rml/package-use.html deleted file mode 100644 index 6446ba26..00000000 --- a/docs/apidocs/be/ugent/rml/package-use.html +++ /dev/null @@ -1,237 +0,0 @@ - - - - - - -Uses of Package be.ugent.rml (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Package
be.ugent.rml

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/records/CSVRecord.html b/docs/apidocs/be/ugent/rml/records/CSVRecord.html deleted file mode 100644 index f762416b..00000000 --- a/docs/apidocs/be/ugent/rml/records/CSVRecord.html +++ /dev/null @@ -1,281 +0,0 @@ - - - - - - -CSVRecord (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.records
-

Class CSVRecord

-
-
- -
-
    -
  • -
    -
    -
    public class CSVRecord
    -extends Record
    -
    This class is a specific implementation of a record for CSV. - Every record corresponds with a row of the CSV data source.
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        getDataType

        -
        public String getDataType(String value)
        -
        This method returns the datatype of a reference in the record.
        -
        -
        Overrides:
        -
        getDataType in class Record
        -
        Parameters:
        -
        value - the reference for which the datatype needs to be returned.
        -
        Returns:
        -
        the IRI of the datatype.
        -
        -
      • -
      - - - -
        -
      • -

        get

        -
        public List<Object> get(String value)
        -
        This method returns the objects for a column in the CSV record (= CSV row).
        -
        -
        Specified by:
        -
        get in class Record
        -
        Parameters:
        -
        value - the column for which objects need to be returned.
        -
        Returns:
        -
        a list of objects for the column.
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/records/CSVRecordFactory.html b/docs/apidocs/be/ugent/rml/records/CSVRecordFactory.html deleted file mode 100644 index 71e7062e..00000000 --- a/docs/apidocs/be/ugent/rml/records/CSVRecordFactory.html +++ /dev/null @@ -1,299 +0,0 @@ - - - - - - -CSVRecordFactory (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.records
-

Class CSVRecordFactory

-
-
- -
- -
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        CSVRecordFactory

        -
        public CSVRecordFactory()
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        getRecords

        -
        public List<Record> getRecords(Access access,
        -                               Term logicalSource,
        -                               QuadStore rmlStore)
        -                        throws IOException
        -
        This method returns a list of CSV records for a data source.
        -
        -
        Specified by:
        -
        getRecords in interface ReferenceFormulationRecordFactory
        -
        Parameters:
        -
        access - the access from which records need to be fetched.
        -
        logicalSource - the used Logical Source.
        -
        rmlStore - the QuadStore with the RML rules.
        -
        Returns:
        -
        a list of records.
        -
        Throws:
        -
        IOException
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/records/IteratorFormat.html b/docs/apidocs/be/ugent/rml/records/IteratorFormat.html deleted file mode 100644 index 027ae192..00000000 --- a/docs/apidocs/be/ugent/rml/records/IteratorFormat.html +++ /dev/null @@ -1,303 +0,0 @@ - - - - - - -IteratorFormat (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.records
-

Class IteratorFormat<DocumentClass>

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • be.ugent.rml.records.IteratorFormat<DocumentClass>
    • -
    -
  • -
-
- -
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        IteratorFormat

        -
        public IteratorFormat()
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        getRecords

        -
        public List<Record> getRecords(Access access,
        -                               Term logicalSource,
        -                               QuadStore rmlStore)
        -                        throws IOException
        -
        This method returns a list of records for a data source.
        -
        -
        Specified by:
        -
        getRecords in interface ReferenceFormulationRecordFactory
        -
        Parameters:
        -
        access - the access from which records need to be fetched.
        -
        logicalSource - the used Logical Source.
        -
        rmlStore - the QuadStore with the RML rules.
        -
        Returns:
        -
        a list of records.
        -
        Throws:
        -
        IOException
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/records/JSONRecord.html b/docs/apidocs/be/ugent/rml/records/JSONRecord.html deleted file mode 100644 index caccf366..00000000 --- a/docs/apidocs/be/ugent/rml/records/JSONRecord.html +++ /dev/null @@ -1,300 +0,0 @@ - - - - - - -JSONRecord (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.records
-

Class JSONRecord

-
-
- -
-
    -
  • -
    -
    -
    public class JSONRecord
    -extends Record
    -
    This class is a specific implementation of a record for JSON. - Every record corresponds with a JSON object in a data source.
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        JSONRecord

        -
        public JSONRecord(Object document,
        -                  String path)
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        get

        -
        public List<Object> get(String value)
        -
        This method returns the objects for a reference (JSONPath) in the record.
        -
        -
        Specified by:
        -
        get in class Record
        -
        Parameters:
        -
        value - the reference for which objects need to be returned.
        -
        Returns:
        -
        a list of objects for the reference.
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/records/JSONRecordFactory.html b/docs/apidocs/be/ugent/rml/records/JSONRecordFactory.html deleted file mode 100644 index daa0ac4a..00000000 --- a/docs/apidocs/be/ugent/rml/records/JSONRecordFactory.html +++ /dev/null @@ -1,264 +0,0 @@ - - - - - - -JSONRecordFactory (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.records
-

Class JSONRecordFactory

-
-
- -
- -
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        JSONRecordFactory

        -
        public JSONRecordFactory()
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/records/Record.html b/docs/apidocs/be/ugent/rml/records/Record.html deleted file mode 100644 index 0c3bd19f..00000000 --- a/docs/apidocs/be/ugent/rml/records/Record.html +++ /dev/null @@ -1,309 +0,0 @@ - - - - - - -Record (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.records
-

Class Record

-
-
- -
-
    -
  • -
    -
    Direct Known Subclasses:
    -
    CSVRecord, JSONRecord, XMLRecord
    -
    -
    -
    -
    public abstract class Record
    -extends Object
    -
    This class represents a generic record in a data source.
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        Record

        -
        public Record()
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        get

        -
        public abstract List<Object> get(String value)
        -
        This method returns the objects for a reference in the record.
        -
        -
        Parameters:
        -
        value - the reference for which objects need to be returned.
        -
        Returns:
        -
        a list of objects for the reference.
        -
        -
      • -
      - - - -
        -
      • -

        getDataType

        -
        public String getDataType(String value)
        -
        This method returns the datatype of a reference in the record.
        -
        -
        Parameters:
        -
        value - the reference for which the datatype needs to be returned.
        -
        Returns:
        -
        the IRI of the datatype.
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/records/RecordsFactory.html b/docs/apidocs/be/ugent/rml/records/RecordsFactory.html deleted file mode 100644 index e5b98a83..00000000 --- a/docs/apidocs/be/ugent/rml/records/RecordsFactory.html +++ /dev/null @@ -1,289 +0,0 @@ - - - - - - -RecordsFactory (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.records
-

Class RecordsFactory

-
-
- -
-
    -
  • -
    -
    -
    public class RecordsFactory
    -extends Object
    -
    This class creates records based on RML rules.
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        RecordsFactory

        -
        public RecordsFactory(String basePath)
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        createRecords

        -
        public List<Record> createRecords(Term triplesMap,
        -                                  QuadStore rmlStore)
        -                           throws IOException
        -
        This method creates and returns records for a given Triples Map and set of RML rules.
        -
        -
        Parameters:
        -
        triplesMap - the Triples Map for which the record need to be created.
        -
        rmlStore - the QuadStore with the RML rules.
        -
        Returns:
        -
        a list of records.
        -
        Throws:
        -
        IOException
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/records/ReferenceFormulationRecordFactory.html b/docs/apidocs/be/ugent/rml/records/ReferenceFormulationRecordFactory.html deleted file mode 100644 index 14efaed5..00000000 --- a/docs/apidocs/be/ugent/rml/records/ReferenceFormulationRecordFactory.html +++ /dev/null @@ -1,246 +0,0 @@ - - - - - - -ReferenceFormulationRecordFactory (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.records
-

Interface ReferenceFormulationRecordFactory

-
-
-
- -
-
- -
-
-
    -
  • - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        getRecords

        -
        List<Record> getRecords(Access access,
        -                        Term logicalSource,
        -                        QuadStore rmlStore)
        -                 throws IOException
        -
        This method returns a list of records for a data source.
        -
        -
        Parameters:
        -
        access - the access from which records need to be fetched.
        -
        logicalSource - the used Logical Source.
        -
        rmlStore - the QuadStore with the RML rules.
        -
        Returns:
        -
        a list of records.
        -
        Throws:
        -
        IOException
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/records/SPARQLResultFormat.html b/docs/apidocs/be/ugent/rml/records/SPARQLResultFormat.html deleted file mode 100644 index b4f671f6..00000000 --- a/docs/apidocs/be/ugent/rml/records/SPARQLResultFormat.html +++ /dev/null @@ -1,438 +0,0 @@ - - - - - - -SPARQLResultFormat (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.records
-

Enum SPARQLResultFormat

-
-
- -
- -
-
- -
-
-
    -
  • - - - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        values

        -
        public static SPARQLResultFormat[] values()
        -
        Returns an array containing the constants of this enum type, in -the order they are declared. This method may be used to iterate -over the constants as follows: -
        -for (SPARQLResultFormat c : SPARQLResultFormat.values())
        -    System.out.println(c);
        -
        -
        -
        Returns:
        -
        an array containing the constants of this enum type, in the order they are declared
        -
        -
      • -
      - - - -
        -
      • -

        valueOf

        -
        public static SPARQLResultFormat valueOf(String name)
        -
        Returns the enum constant of this type with the specified name. -The string must match exactly an identifier used to declare an -enum constant in this type. (Extraneous whitespace characters are -not permitted.)
        -
        -
        Parameters:
        -
        name - the name of the enum constant to be returned.
        -
        Returns:
        -
        the enum constant with the specified name
        -
        Throws:
        -
        IllegalArgumentException - if this enum type has no constant with the specified name
        -
        NullPointerException - if the argument is null
        -
        -
      • -
      - - - -
        -
      • -

        getUri

        -
        public String getUri()
        -
        This method returns the uri of the format.
        -
        -
        Returns:
        -
        the uri of the format.
        -
        -
      • -
      - - - -
        -
      • -

        getContentType

        -
        public String getContentType()
        -
        This method returns the content type of the format.
        -
        -
        Returns:
        -
        the content type of the format.
        -
        -
      • -
      - - - -
        -
      • -

        getReferenceFormulations

        -
        public Set<String> getReferenceFormulations()
        -
        This method returns the reference formulation of the format.
        -
        -
        Returns:
        -
        the reference formulation of the format.
        -
        -
      • -
      - - - -
        -
      • -

        toString

        -
        public String toString()
        -
        This method returns a String representation of the format, based on the format's name.
        -
        -
        Overrides:
        -
        toString in class Enum<SPARQLResultFormat>
        -
        Returns:
        -
        String representation of the format.
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/records/XMLRecord.html b/docs/apidocs/be/ugent/rml/records/XMLRecord.html deleted file mode 100644 index af6404e4..00000000 --- a/docs/apidocs/be/ugent/rml/records/XMLRecord.html +++ /dev/null @@ -1,298 +0,0 @@ - - - - - - -XMLRecord (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.records
-

Class XMLRecord

-
-
- -
-
    -
  • -
    -
    -
    public class XMLRecord
    -extends Record
    -
    This class is a specific implementation of a record for XML. - Every record corresponds with an XML element in a data source.
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        XMLRecord

        -
        public XMLRecord(Node node)
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        get

        -
        public List<Object> get(String value)
        -
        This method returns the objects for a reference (XPath) in the record.
        -
        -
        Specified by:
        -
        get in class Record
        -
        Parameters:
        -
        value - the reference for which objects need to be returned.
        -
        Returns:
        -
        a list of objects for the reference.
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/records/XMLRecordFactory.html b/docs/apidocs/be/ugent/rml/records/XMLRecordFactory.html deleted file mode 100644 index 5a98d5e6..00000000 --- a/docs/apidocs/be/ugent/rml/records/XMLRecordFactory.html +++ /dev/null @@ -1,264 +0,0 @@ - - - - - - -XMLRecordFactory (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.records
-

Class XMLRecordFactory

-
-
- -
- -
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        XMLRecordFactory

        -
        public XMLRecordFactory()
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/records/class-use/CSVRecord.html b/docs/apidocs/be/ugent/rml/records/class-use/CSVRecord.html deleted file mode 100644 index 597f2c94..00000000 --- a/docs/apidocs/be/ugent/rml/records/class-use/CSVRecord.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.records.CSVRecord (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.records.CSVRecord

-
-
No usage of be.ugent.rml.records.CSVRecord
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/records/class-use/CSVRecordFactory.html b/docs/apidocs/be/ugent/rml/records/class-use/CSVRecordFactory.html deleted file mode 100644 index 0143e423..00000000 --- a/docs/apidocs/be/ugent/rml/records/class-use/CSVRecordFactory.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.records.CSVRecordFactory (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.records.CSVRecordFactory

-
-
No usage of be.ugent.rml.records.CSVRecordFactory
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/records/class-use/IteratorFormat.html b/docs/apidocs/be/ugent/rml/records/class-use/IteratorFormat.html deleted file mode 100644 index 87275998..00000000 --- a/docs/apidocs/be/ugent/rml/records/class-use/IteratorFormat.html +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.records.IteratorFormat (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.records.IteratorFormat

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/records/class-use/JSONRecord.html b/docs/apidocs/be/ugent/rml/records/class-use/JSONRecord.html deleted file mode 100644 index 36b55798..00000000 --- a/docs/apidocs/be/ugent/rml/records/class-use/JSONRecord.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.records.JSONRecord (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.records.JSONRecord

-
-
No usage of be.ugent.rml.records.JSONRecord
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/records/class-use/JSONRecordFactory.html b/docs/apidocs/be/ugent/rml/records/class-use/JSONRecordFactory.html deleted file mode 100644 index 997ee9be..00000000 --- a/docs/apidocs/be/ugent/rml/records/class-use/JSONRecordFactory.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.records.JSONRecordFactory (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.records.JSONRecordFactory

-
-
No usage of be.ugent.rml.records.JSONRecordFactory
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/records/class-use/Record.html b/docs/apidocs/be/ugent/rml/records/class-use/Record.html deleted file mode 100644 index 15f54382..00000000 --- a/docs/apidocs/be/ugent/rml/records/class-use/Record.html +++ /dev/null @@ -1,343 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.records.Record (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.records.Record

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/records/class-use/RecordsFactory.html b/docs/apidocs/be/ugent/rml/records/class-use/RecordsFactory.html deleted file mode 100644 index 3d86e56b..00000000 --- a/docs/apidocs/be/ugent/rml/records/class-use/RecordsFactory.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.records.RecordsFactory (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.records.RecordsFactory

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/records/class-use/ReferenceFormulationRecordFactory.html b/docs/apidocs/be/ugent/rml/records/class-use/ReferenceFormulationRecordFactory.html deleted file mode 100644 index 7027de17..00000000 --- a/docs/apidocs/be/ugent/rml/records/class-use/ReferenceFormulationRecordFactory.html +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - -Uses of Interface be.ugent.rml.records.ReferenceFormulationRecordFactory (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Interface
be.ugent.rml.records.ReferenceFormulationRecordFactory

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/records/class-use/SPARQLResultFormat.html b/docs/apidocs/be/ugent/rml/records/class-use/SPARQLResultFormat.html deleted file mode 100644 index a6e15e16..00000000 --- a/docs/apidocs/be/ugent/rml/records/class-use/SPARQLResultFormat.html +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.records.SPARQLResultFormat (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.records.SPARQLResultFormat

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/records/class-use/XMLRecord.html b/docs/apidocs/be/ugent/rml/records/class-use/XMLRecord.html deleted file mode 100644 index 2fbbc590..00000000 --- a/docs/apidocs/be/ugent/rml/records/class-use/XMLRecord.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.records.XMLRecord (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.records.XMLRecord

-
-
No usage of be.ugent.rml.records.XMLRecord
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/records/class-use/XMLRecordFactory.html b/docs/apidocs/be/ugent/rml/records/class-use/XMLRecordFactory.html deleted file mode 100644 index 093ba6d5..00000000 --- a/docs/apidocs/be/ugent/rml/records/class-use/XMLRecordFactory.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.records.XMLRecordFactory (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.records.XMLRecordFactory

-
-
No usage of be.ugent.rml.records.XMLRecordFactory
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/records/package-frame.html b/docs/apidocs/be/ugent/rml/records/package-frame.html deleted file mode 100644 index f45bdbed..00000000 --- a/docs/apidocs/be/ugent/rml/records/package-frame.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - -be.ugent.rml.records (rmlmapper 4.5.0 API) - - - - - -

be.ugent.rml.records

- - - diff --git a/docs/apidocs/be/ugent/rml/records/package-summary.html b/docs/apidocs/be/ugent/rml/records/package-summary.html deleted file mode 100644 index 175fec42..00000000 --- a/docs/apidocs/be/ugent/rml/records/package-summary.html +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - -be.ugent.rml.records (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Package be.ugent.rml.records

-
-
-
    -
  • - - - - - - - - - - - - -
    Interface Summary 
    InterfaceDescription
    ReferenceFormulationRecordFactory -
    This is the interface for reference formulation-specific record factories.
    -
    -
  • -
  • - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Class Summary 
    ClassDescription
    CSVRecord -
    This class is a specific implementation of a record for CSV.
    -
    CSVRecordFactory -
    This class is a record factory that creates CSV records.
    -
    IteratorFormat<DocumentClass> -
    This an abstract class for reference formulation-specific record factories that use iterators.
    -
    JSONRecord -
    This class is a specific implementation of a record for JSON.
    -
    JSONRecordFactory -
    This class is a record factory that creates JSON records.
    -
    Record -
    This class represents a generic record in a data source.
    -
    RecordsFactory -
    This class creates records based on RML rules.
    -
    XMLRecord -
    This class is a specific implementation of a record for XML.
    -
    XMLRecordFactory -
    This class is a record factory that creates XML records.
    -
    -
  • -
  • - - - - - - - - - - - - -
    Enum Summary 
    EnumDescription
    SPARQLResultFormat -
    This enum represents the different SPARQL result formats.
    -
    -
  • -
-
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/records/package-tree.html b/docs/apidocs/be/ugent/rml/records/package-tree.html deleted file mode 100644 index 6ece12bf..00000000 --- a/docs/apidocs/be/ugent/rml/records/package-tree.html +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - -be.ugent.rml.records Class Hierarchy (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Hierarchy For Package be.ugent.rml.records

-Package Hierarchies: - -
-
-

Class Hierarchy

- -

Interface Hierarchy

- -

Enum Hierarchy

- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/records/package-use.html b/docs/apidocs/be/ugent/rml/records/package-use.html deleted file mode 100644 index 8047cc80..00000000 --- a/docs/apidocs/be/ugent/rml/records/package-use.html +++ /dev/null @@ -1,260 +0,0 @@ - - - - - - -Uses of Package be.ugent.rml.records (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Package
be.ugent.rml.records

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/store/Quad.html b/docs/apidocs/be/ugent/rml/store/Quad.html deleted file mode 100644 index 532ecd59..00000000 --- a/docs/apidocs/be/ugent/rml/store/Quad.html +++ /dev/null @@ -1,356 +0,0 @@ - - - - - - -Quad (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.store
-

Class Quad

-
-
- -
- -
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        Quad

        -
        public Quad(Term subject,
        -            Term predicate,
        -            Term object,
        -            Term graph)
        -
      • -
      - - - -
        -
      • -

        Quad

        -
        public Quad(Term subject,
        -            Term predicate,
        -            Term object)
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        getSubject

        -
        public Term getSubject()
        -
      • -
      - - - -
        -
      • -

        getPredicate

        -
        public Term getPredicate()
        -
      • -
      - - - -
        -
      • -

        getObject

        -
        public Term getObject()
        -
      • -
      - - - -
        -
      • -

        getGraph

        -
        public Term getGraph()
        -
      • -
      - - - - -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/store/QuadStore.html b/docs/apidocs/be/ugent/rml/store/QuadStore.html deleted file mode 100644 index 5d8a7d83..00000000 --- a/docs/apidocs/be/ugent/rml/store/QuadStore.html +++ /dev/null @@ -1,464 +0,0 @@ - - - - - - -QuadStore (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.store
-

Class QuadStore

-
-
- -
- -
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        QuadStore

        -
        public QuadStore()
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        removeDuplicates

        -
        public abstract void removeDuplicates()
        -
      • -
      - - - -
        -
      • -

        addQuad

        -
        public abstract void addQuad(Term subject,
        -                             Term predicate,
        -                             Term object,
        -                             Term graph)
        -
      • -
      - - - -
        -
      • -

        getQuads

        -
        public abstract List<Quad> getQuads(Term subject,
        -                                    Term predicate,
        -                                    Term object,
        -                                    Term graph)
        -
      • -
      - - - -
        -
      • -

        getQuads

        -
        public abstract List<Quad> getQuads(Term subject,
        -                                    Term predicate,
        -                                    Term object)
        -
      • -
      - - - -
        -
      • -

        isEmpty

        -
        public abstract boolean isEmpty()
        -
      • -
      - - - -
        -
      • -

        size

        -
        public abstract int size()
        -
      • -
      - - - - - - - -
        -
      • -

        setNamespaces

        -
        public abstract void setNamespaces(Set<org.eclipse.rdf4j.model.Namespace> namespaces)
        -
      • -
      - - - -
        -
      • -

        addTriple

        -
        public void addTriple(Term subject,
        -                      Term predicate,
        -                      Term object)
        -
      • -
      - - - -
        -
      • -

        addQuads

        -
        public void addQuads(List<Quad> quads)
        -
      • -
      - - - - - - - -
        -
      • -

        toSortedString

        -
        public String toSortedString()
        -
      • -
      - - - -
        -
      • -

        toSimpleSortedQuadStore

        -
        public QuadStore toSimpleSortedQuadStore()
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/store/RDF4JStore.html b/docs/apidocs/be/ugent/rml/store/RDF4JStore.html deleted file mode 100644 index 214ae08a..00000000 --- a/docs/apidocs/be/ugent/rml/store/RDF4JStore.html +++ /dev/null @@ -1,517 +0,0 @@ - - - - - - -RDF4JStore (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.store
-

Class RDF4JStore

-
-
- -
-
    -
  • -
    -
    -
    public class RDF4JStore
    -extends QuadStore
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        RDF4JStore

        -
        public RDF4JStore(org.eclipse.rdf4j.model.Model model)
        -
      • -
      - - - -
        -
      • -

        RDF4JStore

        -
        public RDF4JStore()
        -
      • -
      -
    • -
    - - -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/store/SimpleQuadStore.html b/docs/apidocs/be/ugent/rml/store/SimpleQuadStore.html deleted file mode 100644 index 64e9fdbb..00000000 --- a/docs/apidocs/be/ugent/rml/store/SimpleQuadStore.html +++ /dev/null @@ -1,441 +0,0 @@ - - - - - - -SimpleQuadStore (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.store
-

Class SimpleQuadStore

-
-
- -
-
    -
  • -
    -
    -
    public class SimpleQuadStore
    -extends QuadStore
    -
  • -
-
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/store/class-use/Quad.html b/docs/apidocs/be/ugent/rml/store/class-use/Quad.html deleted file mode 100644 index dfbae08b..00000000 --- a/docs/apidocs/be/ugent/rml/store/class-use/Quad.html +++ /dev/null @@ -1,268 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.store.Quad (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.store.Quad

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/store/class-use/QuadStore.html b/docs/apidocs/be/ugent/rml/store/class-use/QuadStore.html deleted file mode 100644 index 8e6ba19a..00000000 --- a/docs/apidocs/be/ugent/rml/store/class-use/QuadStore.html +++ /dev/null @@ -1,464 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.store.QuadStore (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.store.QuadStore

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/store/class-use/RDF4JStore.html b/docs/apidocs/be/ugent/rml/store/class-use/RDF4JStore.html deleted file mode 100644 index 9fe63b61..00000000 --- a/docs/apidocs/be/ugent/rml/store/class-use/RDF4JStore.html +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.store.RDF4JStore (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.store.RDF4JStore

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/store/class-use/SimpleQuadStore.html b/docs/apidocs/be/ugent/rml/store/class-use/SimpleQuadStore.html deleted file mode 100644 index 1986351a..00000000 --- a/docs/apidocs/be/ugent/rml/store/class-use/SimpleQuadStore.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.store.SimpleQuadStore (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.store.SimpleQuadStore

-
-
No usage of be.ugent.rml.store.SimpleQuadStore
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/store/package-frame.html b/docs/apidocs/be/ugent/rml/store/package-frame.html deleted file mode 100644 index d0f34453..00000000 --- a/docs/apidocs/be/ugent/rml/store/package-frame.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - -be.ugent.rml.store (rmlmapper 4.5.0 API) - - - - - -

be.ugent.rml.store

- - - diff --git a/docs/apidocs/be/ugent/rml/store/package-summary.html b/docs/apidocs/be/ugent/rml/store/package-summary.html deleted file mode 100644 index 7077feca..00000000 --- a/docs/apidocs/be/ugent/rml/store/package-summary.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - -be.ugent.rml.store (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Package be.ugent.rml.store

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/store/package-tree.html b/docs/apidocs/be/ugent/rml/store/package-tree.html deleted file mode 100644 index 7a369cca..00000000 --- a/docs/apidocs/be/ugent/rml/store/package-tree.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - -be.ugent.rml.store Class Hierarchy (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Hierarchy For Package be.ugent.rml.store

-Package Hierarchies: - -
-
-

Class Hierarchy

- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/store/package-use.html b/docs/apidocs/be/ugent/rml/store/package-use.html deleted file mode 100644 index d1864b0a..00000000 --- a/docs/apidocs/be/ugent/rml/store/package-use.html +++ /dev/null @@ -1,263 +0,0 @@ - - - - - - -Uses of Package be.ugent.rml.store (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Package
be.ugent.rml.store

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/term/AbstractTerm.html b/docs/apidocs/be/ugent/rml/term/AbstractTerm.html deleted file mode 100644 index 1c494591..00000000 --- a/docs/apidocs/be/ugent/rml/term/AbstractTerm.html +++ /dev/null @@ -1,320 +0,0 @@ - - - - - - -AbstractTerm (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.term
-

Class AbstractTerm

-
-
- -
- -
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        AbstractTerm

        -
        public AbstractTerm(String value)
        -
      • -
      -
    • -
    - - -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/term/BlankNode.html b/docs/apidocs/be/ugent/rml/term/BlankNode.html deleted file mode 100644 index 1e21a983..00000000 --- a/docs/apidocs/be/ugent/rml/term/BlankNode.html +++ /dev/null @@ -1,322 +0,0 @@ - - - - - - -BlankNode (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.term
-

Class BlankNode

-
-
- -
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    Term
    -
    -
    -
    -
    public class BlankNode
    -extends AbstractTerm
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        BlankNode

        -
        public BlankNode(String suffix)
        -
      • -
      - - - -
        -
      • -

        BlankNode

        -
        public BlankNode()
        -
      • -
      -
    • -
    - - -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/term/Literal.html b/docs/apidocs/be/ugent/rml/term/Literal.html deleted file mode 100644 index 615ba95c..00000000 --- a/docs/apidocs/be/ugent/rml/term/Literal.html +++ /dev/null @@ -1,364 +0,0 @@ - - - - - - -Literal (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.term
-

Class Literal

-
-
- -
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    Term
    -
    -
    -
    -
    public class Literal
    -extends AbstractTerm
    -
  • -
-
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/term/NamedNode.html b/docs/apidocs/be/ugent/rml/term/NamedNode.html deleted file mode 100644 index bfe57632..00000000 --- a/docs/apidocs/be/ugent/rml/term/NamedNode.html +++ /dev/null @@ -1,310 +0,0 @@ - - - - - - -NamedNode (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.term
-

Class NamedNode

-
-
- -
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    Term
    -
    -
    -
    -
    public class NamedNode
    -extends AbstractTerm
    -
  • -
-
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/term/ProvenancedQuad.html b/docs/apidocs/be/ugent/rml/term/ProvenancedQuad.html deleted file mode 100644 index f1121ec9..00000000 --- a/docs/apidocs/be/ugent/rml/term/ProvenancedQuad.html +++ /dev/null @@ -1,334 +0,0 @@ - - - - - - -ProvenancedQuad (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.term
-

Class ProvenancedQuad

-
-
- -
-
    -
  • -
    -
    -
    public class ProvenancedQuad
    -extends Object
    -
  • -
-
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/term/ProvenancedTerm.html b/docs/apidocs/be/ugent/rml/term/ProvenancedTerm.html deleted file mode 100644 index 409a719e..00000000 --- a/docs/apidocs/be/ugent/rml/term/ProvenancedTerm.html +++ /dev/null @@ -1,314 +0,0 @@ - - - - - - -ProvenancedTerm (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.term
-

Class ProvenancedTerm

-
-
- -
-
    -
  • -
    -
    -
    public class ProvenancedTerm
    -extends Object
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        ProvenancedTerm

        -
        public ProvenancedTerm(Term term,
        -                       Metadata metadata)
        -
      • -
      - - - -
        -
      • -

        ProvenancedTerm

        -
        public ProvenancedTerm(Term term,
        -                       MappingInfo mappingInfo)
        -
      • -
      - - - -
        -
      • -

        ProvenancedTerm

        -
        public ProvenancedTerm(Term term)
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        getTerm

        -
        public Term getTerm()
        -
      • -
      - - - -
        -
      • -

        getMetadata

        -
        public Metadata getMetadata()
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/term/Term.html b/docs/apidocs/be/ugent/rml/term/Term.html deleted file mode 100644 index 8a75efd9..00000000 --- a/docs/apidocs/be/ugent/rml/term/Term.html +++ /dev/null @@ -1,227 +0,0 @@ - - - - - - -Term (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.term
-

Interface Term

-
-
-
- -
-
- -
-
-
    -
  • - - -
  • -
-
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/term/class-use/AbstractTerm.html b/docs/apidocs/be/ugent/rml/term/class-use/AbstractTerm.html deleted file mode 100644 index 945dcddd..00000000 --- a/docs/apidocs/be/ugent/rml/term/class-use/AbstractTerm.html +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.term.AbstractTerm (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.term.AbstractTerm

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/term/class-use/BlankNode.html b/docs/apidocs/be/ugent/rml/term/class-use/BlankNode.html deleted file mode 100644 index 2a8c3df4..00000000 --- a/docs/apidocs/be/ugent/rml/term/class-use/BlankNode.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.term.BlankNode (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.term.BlankNode

-
-
No usage of be.ugent.rml.term.BlankNode
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/term/class-use/Literal.html b/docs/apidocs/be/ugent/rml/term/class-use/Literal.html deleted file mode 100644 index 385b71fc..00000000 --- a/docs/apidocs/be/ugent/rml/term/class-use/Literal.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.term.Literal (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.term.Literal

-
-
No usage of be.ugent.rml.term.Literal
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/term/class-use/NamedNode.html b/docs/apidocs/be/ugent/rml/term/class-use/NamedNode.html deleted file mode 100644 index aebe6f0c..00000000 --- a/docs/apidocs/be/ugent/rml/term/class-use/NamedNode.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.term.NamedNode (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.term.NamedNode

-
-
No usage of be.ugent.rml.term.NamedNode
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/term/class-use/ProvenancedQuad.html b/docs/apidocs/be/ugent/rml/term/class-use/ProvenancedQuad.html deleted file mode 100644 index acdd885c..00000000 --- a/docs/apidocs/be/ugent/rml/term/class-use/ProvenancedQuad.html +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.term.ProvenancedQuad (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.term.ProvenancedQuad

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/term/class-use/ProvenancedTerm.html b/docs/apidocs/be/ugent/rml/term/class-use/ProvenancedTerm.html deleted file mode 100644 index 6c088b0e..00000000 --- a/docs/apidocs/be/ugent/rml/term/class-use/ProvenancedTerm.html +++ /dev/null @@ -1,255 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.term.ProvenancedTerm (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.term.ProvenancedTerm

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/term/class-use/Term.html b/docs/apidocs/be/ugent/rml/term/class-use/Term.html deleted file mode 100644 index 91b27410..00000000 --- a/docs/apidocs/be/ugent/rml/term/class-use/Term.html +++ /dev/null @@ -1,800 +0,0 @@ - - - - - - -Uses of Interface be.ugent.rml.term.Term (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Interface
be.ugent.rml.term.Term

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/term/package-frame.html b/docs/apidocs/be/ugent/rml/term/package-frame.html deleted file mode 100644 index 9bb0d7d0..00000000 --- a/docs/apidocs/be/ugent/rml/term/package-frame.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - -be.ugent.rml.term (rmlmapper 4.5.0 API) - - - - - -

be.ugent.rml.term

- - - diff --git a/docs/apidocs/be/ugent/rml/term/package-summary.html b/docs/apidocs/be/ugent/rml/term/package-summary.html deleted file mode 100644 index 53f282ea..00000000 --- a/docs/apidocs/be/ugent/rml/term/package-summary.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - -be.ugent.rml.term (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Package be.ugent.rml.term

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/term/package-tree.html b/docs/apidocs/be/ugent/rml/term/package-tree.html deleted file mode 100644 index d7aea7d9..00000000 --- a/docs/apidocs/be/ugent/rml/term/package-tree.html +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - -be.ugent.rml.term Class Hierarchy (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Hierarchy For Package be.ugent.rml.term

-Package Hierarchies: - -
-
-

Class Hierarchy

- -

Interface Hierarchy

-
    -
  • be.ugent.rml.term.Term
  • -
-
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/term/package-use.html b/docs/apidocs/be/ugent/rml/term/package-use.html deleted file mode 100644 index e4da6ecb..00000000 --- a/docs/apidocs/be/ugent/rml/term/package-use.html +++ /dev/null @@ -1,304 +0,0 @@ - - - - - - -Uses of Package be.ugent.rml.term (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Package
be.ugent.rml.term

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/termgenerator/BlankNodeGenerator.html b/docs/apidocs/be/ugent/rml/termgenerator/BlankNodeGenerator.html deleted file mode 100644 index ba66f8cb..00000000 --- a/docs/apidocs/be/ugent/rml/termgenerator/BlankNodeGenerator.html +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - -BlankNodeGenerator (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.termgenerator
-

Class BlankNodeGenerator

-
-
- -
-
    -
  • -
    -
    -
    public class BlankNodeGenerator
    -extends TermGenerator
    -
  • -
-
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/termgenerator/LiteralGenerator.html b/docs/apidocs/be/ugent/rml/termgenerator/LiteralGenerator.html deleted file mode 100644 index 30497f25..00000000 --- a/docs/apidocs/be/ugent/rml/termgenerator/LiteralGenerator.html +++ /dev/null @@ -1,327 +0,0 @@ - - - - - - -LiteralGenerator (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.termgenerator
-

Class LiteralGenerator

-
-
- -
- -
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/termgenerator/NamedNodeGenerator.html b/docs/apidocs/be/ugent/rml/termgenerator/NamedNodeGenerator.html deleted file mode 100644 index 0ce9d135..00000000 --- a/docs/apidocs/be/ugent/rml/termgenerator/NamedNodeGenerator.html +++ /dev/null @@ -1,285 +0,0 @@ - - - - - - -NamedNodeGenerator (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.termgenerator
-

Class NamedNodeGenerator

-
-
- -
-
    -
  • -
    -
    -
    public class NamedNodeGenerator
    -extends TermGenerator
    -
  • -
-
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/termgenerator/TermGenerator.html b/docs/apidocs/be/ugent/rml/termgenerator/TermGenerator.html deleted file mode 100644 index ef699619..00000000 --- a/docs/apidocs/be/ugent/rml/termgenerator/TermGenerator.html +++ /dev/null @@ -1,282 +0,0 @@ - - - - - - -TermGenerator (rmlmapper 4.5.0 API) - - - - - - - - - - - - -
-
be.ugent.rml.termgenerator
-

Class TermGenerator

-
-
- -
- -
-
- -
-
- -
-
- - - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/termgenerator/class-use/BlankNodeGenerator.html b/docs/apidocs/be/ugent/rml/termgenerator/class-use/BlankNodeGenerator.html deleted file mode 100644 index 1ff6d96b..00000000 --- a/docs/apidocs/be/ugent/rml/termgenerator/class-use/BlankNodeGenerator.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.termgenerator.BlankNodeGenerator (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.termgenerator.BlankNodeGenerator

-
-
No usage of be.ugent.rml.termgenerator.BlankNodeGenerator
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/termgenerator/class-use/LiteralGenerator.html b/docs/apidocs/be/ugent/rml/termgenerator/class-use/LiteralGenerator.html deleted file mode 100644 index d43218c4..00000000 --- a/docs/apidocs/be/ugent/rml/termgenerator/class-use/LiteralGenerator.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.termgenerator.LiteralGenerator (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.termgenerator.LiteralGenerator

-
-
No usage of be.ugent.rml.termgenerator.LiteralGenerator
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/termgenerator/class-use/NamedNodeGenerator.html b/docs/apidocs/be/ugent/rml/termgenerator/class-use/NamedNodeGenerator.html deleted file mode 100644 index 87255dee..00000000 --- a/docs/apidocs/be/ugent/rml/termgenerator/class-use/NamedNodeGenerator.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.termgenerator.NamedNodeGenerator (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.termgenerator.NamedNodeGenerator

-
-
No usage of be.ugent.rml.termgenerator.NamedNodeGenerator
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/termgenerator/class-use/TermGenerator.html b/docs/apidocs/be/ugent/rml/termgenerator/class-use/TermGenerator.html deleted file mode 100644 index f31b9d77..00000000 --- a/docs/apidocs/be/ugent/rml/termgenerator/class-use/TermGenerator.html +++ /dev/null @@ -1,283 +0,0 @@ - - - - - - -Uses of Class be.ugent.rml.termgenerator.TermGenerator (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Class
be.ugent.rml.termgenerator.TermGenerator

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/termgenerator/package-frame.html b/docs/apidocs/be/ugent/rml/termgenerator/package-frame.html deleted file mode 100644 index cf946456..00000000 --- a/docs/apidocs/be/ugent/rml/termgenerator/package-frame.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - -be.ugent.rml.termgenerator (rmlmapper 4.5.0 API) - - - - - -

be.ugent.rml.termgenerator

- - - diff --git a/docs/apidocs/be/ugent/rml/termgenerator/package-summary.html b/docs/apidocs/be/ugent/rml/termgenerator/package-summary.html deleted file mode 100644 index a4111129..00000000 --- a/docs/apidocs/be/ugent/rml/termgenerator/package-summary.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - -be.ugent.rml.termgenerator (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Package be.ugent.rml.termgenerator

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/termgenerator/package-tree.html b/docs/apidocs/be/ugent/rml/termgenerator/package-tree.html deleted file mode 100644 index ac7d2a4a..00000000 --- a/docs/apidocs/be/ugent/rml/termgenerator/package-tree.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - -be.ugent.rml.termgenerator Class Hierarchy (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Hierarchy For Package be.ugent.rml.termgenerator

-Package Hierarchies: - -
-
-

Class Hierarchy

- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/be/ugent/rml/termgenerator/package-use.html b/docs/apidocs/be/ugent/rml/termgenerator/package-use.html deleted file mode 100644 index e0114035..00000000 --- a/docs/apidocs/be/ugent/rml/termgenerator/package-use.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - -Uses of Package be.ugent.rml.termgenerator (rmlmapper 4.5.0 API) - - - - - - - - - - - -
-

Uses of Package
be.ugent.rml.termgenerator

-
-
- -
- - - - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/constant-values.html b/docs/apidocs/constant-values.html deleted file mode 100644 index 997ab243..00000000 --- a/docs/apidocs/constant-values.html +++ /dev/null @@ -1,272 +0,0 @@ - - - - - - -Constant Field Values (rmlmapper 4.5.0 API) - - - - - - - - -
- - - - - - - -
- - -
-

Constant Field Values

-

Contents

- -
-
- - -

be.ugent.*

-
    -
  • - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    be.ugent.rml.DatabaseType 
    Modifier and TypeConstant FieldValue
    - -public static final StringDB2"com.ibm.as400.access.AS400JDBCDriver"
    - -public static final StringMYSQL"com.mysql.cj.jdbc.Driver"
    - -public static final StringPOSTGRES"org.postgresql.Driver"
    - -public static final StringSQL_SERVER"com.microsoft.sqlserver.jdbc.SQLServerDriver"
    -
  • -
  • - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    be.ugent.rml.NAMESPACES 
    Modifier and TypeConstant FieldValue
    - -public static final StringCSVW"http://www.w3.org/ns/csvw#"
    - -public static final StringD2RQ"http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#"
    - -public static final StringFNML"http://semweb.mmlab.be/ns/fnml#"
    - -public static final StringFNO"http://w3id.org/function/ontology#"
    - -public static final StringPROV"http://www.w3.org/ns/prov#"
    - -public static final StringQL"http://semweb.mmlab.be/ns/ql#"
    - -public static final StringRDF"http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    - -public static final StringRML"http://semweb.mmlab.be/ns/rml#"
    - -public static final StringRR"http://www.w3.org/ns/r2rml#"
    - -public static final StringSD"http://www.w3.org/ns/sparql-service-description#"
    - -public static final StringVOID"http://rdfs.org/ns/void#"
    - -public static final StringXSD"http://www.w3.org/2001/XMLSchema#"
    -
  • -
-
- -
- - - - - - - -
- - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/deprecated-list.html b/docs/apidocs/deprecated-list.html deleted file mode 100644 index 898ebc2b..00000000 --- a/docs/apidocs/deprecated-list.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -Deprecated List (rmlmapper 4.5.0 API) - - - - - - - - -
- - - - - - - -
- - -
-

Deprecated API

-

Contents

-
- -
- - - - - - - -
- - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/help-doc.html b/docs/apidocs/help-doc.html deleted file mode 100644 index b56e409e..00000000 --- a/docs/apidocs/help-doc.html +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - -API Help (rmlmapper 4.5.0 API) - - - - - - - - -
- - - - - - - -
- - -
-

How This API Document Is Organized

-
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
-
-
-
    -
  • -

    Overview

    -

    The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

    -
  • -
  • -

    Package

    -

    Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:

    -
      -
    • Interfaces (italic)
    • -
    • Classes
    • -
    • Enums
    • -
    • Exceptions
    • -
    • Errors
    • -
    • Annotation Types
    • -
    -
  • -
  • -

    Class/Interface

    -

    Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    -
      -
    • Class inheritance diagram
    • -
    • Direct Subclasses
    • -
    • All Known Subinterfaces
    • -
    • All Known Implementing Classes
    • -
    • Class/interface declaration
    • -
    • Class/interface description
    • -
    -
      -
    • Nested Class Summary
    • -
    • Field Summary
    • -
    • Constructor Summary
    • -
    • Method Summary
    • -
    -
      -
    • Field Detail
    • -
    • Constructor Detail
    • -
    • Method Detail
    • -
    -

    Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

    -
  • -
  • -

    Annotation Type

    -

    Each annotation type has its own separate page with the following sections:

    -
      -
    • Annotation Type declaration
    • -
    • Annotation Type description
    • -
    • Required Element Summary
    • -
    • Optional Element Summary
    • -
    • Element Detail
    • -
    -
  • -
  • -

    Enum

    -

    Each enum has its own separate page with the following sections:

    -
      -
    • Enum declaration
    • -
    • Enum description
    • -
    • Enum Constant Summary
    • -
    • Enum Constant Detail
    • -
    -
  • -
  • -

    Use

    -

    Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.

    -
  • -
  • -

    Tree (Class Hierarchy)

    -

    There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.

    -
      -
    • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
    • -
    • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
    • -
    -
  • -
  • -

    Deprecated API

    -

    The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.

    -
  • -
  • -

    Index

    -

    The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.

    -
  • -
  • -

    Prev/Next

    -

    These links take you to the next or previous class, interface, package, or related page.

    -
  • -
  • -

    Frames/No Frames

    -

    These links show and hide the HTML frames. All pages are available with or without frames.

    -
  • -
  • -

    All Classes

    -

    The All Classes link shows all classes and interfaces except non-static nested types.

    -
  • -
  • -

    Serialized Form

    -

    Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.

    -
  • -
  • -

    Constant Field Values

    -

    The Constant Field Values page lists the static final fields and their values.

    -
  • -
-This help file applies to API documentation generated using the standard doclet.
- -
- - - - - - - -
- - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/index-all.html b/docs/apidocs/index-all.html deleted file mode 100644 index 0747f614..00000000 --- a/docs/apidocs/index-all.html +++ /dev/null @@ -1,1293 +0,0 @@ - - - - - - -Index (rmlmapper 4.5.0 API) - - - - - - - - -
- - - - - - - -
- - -
A B C D E F G H I J L M N P Q R S T U V W X  - - -

A

-
-
AbstractSingleRecordFunctionExecutor - Class in be.ugent.rml.functions
-
 
-
AbstractSingleRecordFunctionExecutor() - Constructor for class be.ugent.rml.functions.AbstractSingleRecordFunctionExecutor
-
 
-
AbstractTerm - Class in be.ugent.rml.term
-
 
-
AbstractTerm(String) - Constructor for class be.ugent.rml.term.AbstractTerm
-
 
-
Access - Interface in be.ugent.rml.access
-
-
This interface represents the access to a data source.
-
-
AccessFactory - Class in be.ugent.rml.access
-
-
This class creates Access instances.
-
-
AccessFactory(String) - Constructor for class be.ugent.rml.access.AccessFactory
-
-
The constructor of the AccessFactory.
-
-
addElement(TemplateElement) - Method in class be.ugent.rml.Template
-
 
-
addJoinCondition(MultipleRecordsFunctionExecutor) - Method in class be.ugent.rml.PredicateObjectGraphMapping
-
 
-
addQuad(Term, Term, Term, Term) - Method in class be.ugent.rml.store.QuadStore
-
 
-
addQuad(Term, Term, Term, Term) - Method in class be.ugent.rml.store.RDF4JStore
-
 
-
addQuad(Term, Term, Term, Term) - Method in class be.ugent.rml.store.SimpleQuadStore
-
 
-
addQuads(List<Quad>) - Method in class be.ugent.rml.store.QuadStore
-
 
-
addTriple(Term, Term, Term) - Method in class be.ugent.rml.store.QuadStore
-
 
-
- - - -

B

-
-
be.ugent.rml - package be.ugent.rml
-
 
-
be.ugent.rml.access - package be.ugent.rml.access
-
 
-
be.ugent.rml.cli - package be.ugent.rml.cli
-
 
-
be.ugent.rml.extractor - package be.ugent.rml.extractor
-
 
-
be.ugent.rml.functions - package be.ugent.rml.functions
-
 
-
be.ugent.rml.functions.lib - package be.ugent.rml.functions.lib
-
 
-
be.ugent.rml.metadata - package be.ugent.rml.metadata
-
 
-
be.ugent.rml.records - package be.ugent.rml.records
-
 
-
be.ugent.rml.store - package be.ugent.rml.store
-
 
-
be.ugent.rml.term - package be.ugent.rml.term
-
 
-
be.ugent.rml.termgenerator - package be.ugent.rml.termgenerator
-
 
-
BlankNode - Class in be.ugent.rml.term
-
 
-
BlankNode(String) - Constructor for class be.ugent.rml.term.BlankNode
-
 
-
BlankNode() - Constructor for class be.ugent.rml.term.BlankNode
-
 
-
BlankNodeGenerator - Class in be.ugent.rml.termgenerator
-
 
-
BlankNodeGenerator() - Constructor for class be.ugent.rml.termgenerator.BlankNodeGenerator
-
 
-
BlankNodeGenerator(SingleRecordFunctionExecutor) - Constructor for class be.ugent.rml.termgenerator.BlankNodeGenerator
-
 
-
- - - -

C

-
-
compareTo(Quad) - Method in class be.ugent.rml.store.Quad
-
 
-
ConcatFunction - Class in be.ugent.rml.functions
-
 
-
ConcatFunction(List<Extractor>, boolean) - Constructor for class be.ugent.rml.functions.ConcatFunction
-
 
-
ConcatFunction(List<Extractor>) - Constructor for class be.ugent.rml.functions.ConcatFunction
-
 
-
ConstantExtractor - Class in be.ugent.rml.extractor
-
 
-
ConstantExtractor(String) - Constructor for class be.ugent.rml.extractor.ConstantExtractor
-
 
-
countVariables() - Method in class be.ugent.rml.Template
-
 
-
createMapping(Term, QuadStore) - Method in class be.ugent.rml.MappingFactory
-
 
-
createMetadata(Term, Term, Term, QuadStore, List<Term>, String, String, String[]) - Static method in class be.ugent.rml.metadata.DatasetLevelMetadataGenerator
-
 
-
createRecords(Term, QuadStore) - Method in class be.ugent.rml.records.RecordsFactory
-
-
This method creates and returns records for a given Triples Map and set of RML rules.
-
-
CSVRecord - Class in be.ugent.rml.records
-
-
This class is a specific implementation of a record for CSV.
-
-
CSVRecordFactory - Class in be.ugent.rml.records
-
-
This class is a record factory that creates CSV records.
-
-
CSVRecordFactory() - Constructor for class be.ugent.rml.records.CSVRecordFactory
-
 
-
CSVW - Static variable in class be.ugent.rml.NAMESPACES
-
 
-
- - - -

D

-
-
D2RQ - Static variable in class be.ugent.rml.NAMESPACES
-
 
-
DatabaseType - Class in be.ugent.rml
-
 
-
DatabaseType() - Constructor for class be.ugent.rml.DatabaseType
-
 
-
DatabaseType.Database - Enum in be.ugent.rml
-
 
-
DatasetLevelMetadataGenerator - Class in be.ugent.rml.metadata
-
-
Unique class -- reusable outside of the mapper
-
-
DatasetLevelMetadataGenerator() - Constructor for class be.ugent.rml.metadata.DatasetLevelMetadataGenerator
-
 
-
DB2 - Static variable in class be.ugent.rml.DatabaseType
-
 
-
dbpediaSpotlight(String, String) - Static method in class be.ugent.rml.functions.lib.IDLabFunctions
-
 
-
decide(String, String, String) - Static method in class be.ugent.rml.functions.lib.IDLabFunctions
-
 
-
DynamicMultipleRecordsFunctionExecutor - Class in be.ugent.rml.functions
-
 
-
DynamicMultipleRecordsFunctionExecutor(List<ParameterValueOriginPair>, FunctionLoader) - Constructor for class be.ugent.rml.functions.DynamicMultipleRecordsFunctionExecutor
-
 
-
DynamicSingleRecordFunctionExecutor - Class in be.ugent.rml.functions
-
 
-
DynamicSingleRecordFunctionExecutor(List<ParameterValuePair>, FunctionLoader) - Constructor for class be.ugent.rml.functions.DynamicSingleRecordFunctionExecutor
-
 
-
- - - -

E

-
-
encodeURI(String) - Static method in class be.ugent.rml.Utils
-
 
-
equal(String, String) - Static method in class be.ugent.rml.functions.lib.UtilFunctions
-
 
-
equals(Object) - Method in class be.ugent.rml.access.LocalFileAccess
-
 
-
equals(Object) - Method in class be.ugent.rml.access.RDBAccess
-
 
-
equals(Object) - Method in class be.ugent.rml.access.RemoteFileAccess
-
 
-
equals(Object) - Method in class be.ugent.rml.access.SPARQLEndpointAccess
-
 
-
equals(Object) - Method in class be.ugent.rml.store.RDF4JStore
-
 
-
equals(Object) - Method in class be.ugent.rml.term.BlankNode
-
 
-
equals(Object) - Method in class be.ugent.rml.term.Literal
-
 
-
equals(Object) - Method in class be.ugent.rml.term.NamedNode
-
 
-
escape(String, String) - Static method in class be.ugent.rml.functions.lib.GrelProcessor
-
 
-
escape(String, String) - Static method in class be.ugent.rml.functions.lib.GrelTestProcessor
-
 
-
execute(List<Term>, boolean, MetadataGenerator) - Method in class be.ugent.rml.Executor
-
 
-
execute(List<Term>) - Method in class be.ugent.rml.Executor
-
 
-
execute(Record) - Method in class be.ugent.rml.extractor.ConstantExtractor
-
 
-
execute(Record) - Method in class be.ugent.rml.extractor.ReferenceExtractor
-
 
-
execute(Record) - Method in class be.ugent.rml.functions.AbstractSingleRecordFunctionExecutor
-
 
-
execute(Record) - Method in class be.ugent.rml.functions.ConcatFunction
-
 
-
execute(Map<String, Record>) - Method in class be.ugent.rml.functions.DynamicMultipleRecordsFunctionExecutor
-
 
-
execute(Map<String, Object>) - Method in class be.ugent.rml.functions.FunctionModel
-
 
-
execute(Map<String, Record>) - Method in interface be.ugent.rml.functions.MultipleRecordsFunctionExecutor
-
 
-
execute(Record) - Method in interface be.ugent.rml.functions.SingleRecordFunctionExecutor
-
 
-
execute(Map<String, Record>) - Method in class be.ugent.rml.functions.StaticMultipleRecordsFunctionExecutor
-
 
-
executeWithFunction(List<Term>, boolean, BiConsumer<ProvenancedTerm, PredicateObjectGraph>) - Method in class be.ugent.rml.Executor
-
 
-
Executor - Class in be.ugent.rml
-
 
-
Executor(QuadStore, RecordsFactory, String) - Constructor for class be.ugent.rml.Executor
-
 
-
Executor(QuadStore, RecordsFactory, FunctionLoader, String) - Constructor for class be.ugent.rml.Executor
-
 
-
Executor(QuadStore, RecordsFactory, FunctionLoader, QuadStore, String) - Constructor for class be.ugent.rml.Executor
-
 
-
extract(Record) - Method in class be.ugent.rml.extractor.ConstantExtractor
-
 
-
extract(Record) - Method in interface be.ugent.rml.extractor.Extractor
-
 
-
extract(Record) - Method in class be.ugent.rml.extractor.ReferenceExtractor
-
 
-
Extractor - Interface in be.ugent.rml.extractor
-
 
-
- - - -

F

-
-
fileToString(File) - Static method in class be.ugent.rml.Utils
-
 
-
FNML - Static variable in class be.ugent.rml.NAMESPACES
-
 
-
FNO - Static variable in class be.ugent.rml.NAMESPACES
-
 
-
FunctionLoader - Class in be.ugent.rml.functions
-
 
-
FunctionLoader() - Constructor for class be.ugent.rml.functions.FunctionLoader
-
 
-
FunctionLoader(File) - Constructor for class be.ugent.rml.functions.FunctionLoader
-
 
-
FunctionLoader(File, QuadStore, Map<String, Class>) - Constructor for class be.ugent.rml.functions.FunctionLoader
-
 
-
FunctionModel - Class in be.ugent.rml.functions
-
-
Function Model
-
-
FunctionModel(Term, Method, List<Term>, List<Term>) - Constructor for class be.ugent.rml.functions.FunctionModel
-
 
-
functionObjectToList(Object, List<String>) - Static method in class be.ugent.rml.functions.FunctionUtils
-
 
-
functionRequire(File, String) - Static method in class be.ugent.rml.functions.FunctionUtils
-
 
-
FunctionUtils - Class in be.ugent.rml.functions
-
 
-
FunctionUtils() - Constructor for class be.ugent.rml.functions.FunctionUtils
-
 
-
- - - -

G

-
-
generate(QuadStore, Term, boolean) - Static method in class be.ugent.rml.RecordFunctionExecutorFactory
-
 
-
generate(Record) - Method in class be.ugent.rml.termgenerator.BlankNodeGenerator
-
 
-
generate(Record) - Method in class be.ugent.rml.termgenerator.LiteralGenerator
-
 
-
generate(Record) - Method in class be.ugent.rml.termgenerator.NamedNodeGenerator
-
 
-
generate(Record) - Method in class be.ugent.rml.termgenerator.TermGenerator
-
 
-
generateA() - Static method in class be.ugent.rml.functions.lib.GrelTestProcessor
-
 
-
get(String) - Method in class be.ugent.rml.records.CSVRecord
-
-
This method returns the objects for a column in the CSV record (= CSV row).
-
-
get(String) - Method in class be.ugent.rml.records.JSONRecord
-
-
This method returns the objects for a reference (JSONPath) in the record.
-
-
get(String) - Method in class be.ugent.rml.records.Record
-
-
This method returns the objects for a reference in the record.
-
-
get(String) - Method in class be.ugent.rml.records.XMLRecord
-
-
This method returns the objects for a reference (XPath) in the record.
-
-
getAccess(Term, QuadStore) - Method in class be.ugent.rml.access.AccessFactory
-
-
This method returns an Access instance based on the RML rules in rmlStore.
-
-
getBaseDirectiveTurtle(File) - Static method in class be.ugent.rml.Utils
-
 
-
getBaseDirectiveTurtle(InputStream) - Static method in class be.ugent.rml.Utils
-
 
-
getBaseDirectiveTurtle(String) - Static method in class be.ugent.rml.Utils
-
 
-
getBasePath() - Method in class be.ugent.rml.access.LocalFileAccess
-
-
This method returns the base path of the access.
-
-
getContentType() - Method in class be.ugent.rml.access.RDBAccess
-
-
This method returns the content type.
-
-
getContentType() - Method in class be.ugent.rml.access.RemoteFileAccess
-
-
This method returns the content type of the remote file.
-
-
getContentType() - Method in class be.ugent.rml.access.SPARQLEndpointAccess
-
-
This method returns the content type of the results.
-
-
getContentType() - Method in enum be.ugent.rml.records.SPARQLResultFormat
-
-
This method returns the content type of the format.
-
-
getDatabase() - Method in class be.ugent.rml.access.RDBAccess
-
-
This method returns the database type.
-
-
getDataType(String) - Method in class be.ugent.rml.records.CSVRecord
-
-
This method returns the datatype of a reference in the record.
-
-
getDataType(String) - Method in class be.ugent.rml.records.Record
-
-
This method returns the datatype of a reference in the record.
-
-
getDatatype() - Method in class be.ugent.rml.term.Literal
-
 
-
getDataTypes() - Method in interface be.ugent.rml.access.Access
-
-
This method returns a map of datatypes.
-
-
getDataTypes() - Method in class be.ugent.rml.access.LocalFileAccess
-
-
This methods returns the datatypes of the file.
-
-
getDataTypes() - Method in class be.ugent.rml.access.RDBAccess
-
-
This method returns the datatypes used for the columns in the accessed database.
-
-
getDataTypes() - Method in class be.ugent.rml.access.RemoteFileAccess
-
-
This methods returns the datatypes of the file.
-
-
getDataTypes() - Method in class be.ugent.rml.access.SPARQLEndpointAccess
-
-
This methods returns the datatypes of the results of the SPARQL query.
-
-
getDBtype(String) - Static method in class be.ugent.rml.DatabaseType
-
 
-
getDetailLevel() - Method in class be.ugent.rml.metadata.MetadataGenerator
-
 
-
getDriver(DatabaseType.Database) - Static method in class be.ugent.rml.DatabaseType
-
 
-
getDSN() - Method in class be.ugent.rml.access.RDBAccess
-
-
This method returns the DNS.
-
-
getEndpoint() - Method in class be.ugent.rml.access.SPARQLEndpointAccess
-
-
This method returns the url of the endpoint.
-
-
getFile(String) - Static method in class be.ugent.rml.Utils
-
 
-
getFile(String, File) - Static method in class be.ugent.rml.Utils
-
 
-
getFreePortNumber() - Static method in class be.ugent.rml.Utils
-
 
-
getFunction(Term) - Method in class be.ugent.rml.functions.FunctionLoader
-
 
-
getFunctionLoader() - Method in class be.ugent.rml.Executor
-
 
-
getFunctionLoader() - Method in class be.ugent.rml.Initializer
-
 
-
getFunctionParameterUris(QuadStore, List<Term>) - Static method in class be.ugent.rml.functions.FunctionUtils
-
 
-
getGraph() - Method in class be.ugent.rml.PredicateObjectGraph
-
 
-
getGraph() - Method in class be.ugent.rml.store.Quad
-
 
-
getGraph() - Method in class be.ugent.rml.term.ProvenancedQuad
-
 
-
getGraphMappingInfo() - Method in class be.ugent.rml.PredicateObjectGraphMapping
-
 
-
getGraphMappingInfos() - Method in class be.ugent.rml.Mapping
-
 
-
getHash(String) - Static method in class be.ugent.rml.Utils
-
 
-
getHashOfString(String) - Static method in class be.ugent.rml.Utils
-
 
-
getInputStream() - Method in interface be.ugent.rml.access.Access
-
-
This method returns an InputStream for the access.
-
-
getInputStream() - Method in class be.ugent.rml.access.LocalFileAccess
-
-
This method returns the InputStream of the local file.
-
-
getInputStream() - Method in class be.ugent.rml.access.RDBAccess
-
-
This method returns an InputStream of the results of the SQL query.
-
-
getInputStream() - Method in class be.ugent.rml.access.RemoteFileAccess
-
 
-
getInputStream() - Method in class be.ugent.rml.access.SPARQLEndpointAccess
-
-
This method returns an InputStream of the results of the SPARQL endpoint.
-
-
getInputStreamFromFile(File) - Static method in class be.ugent.rml.Utils
-
 
-
getInputStreamFromLocation(String) - Static method in class be.ugent.rml.Utils
-
 
-
getInputStreamFromLocation(String, File, String) - Static method in class be.ugent.rml.Utils
-
 
-
getInputStreamFromMOptionValue(String) - Static method in class be.ugent.rml.Utils
-
 
-
getInputStreamFromURL(URL) - Static method in class be.ugent.rml.Utils
-
 
-
getInputStreamFromURL(URL, String) - Static method in class be.ugent.rml.Utils
-
 
-
getJoinConditions() - Method in class be.ugent.rml.PredicateObjectGraphMapping
-
 
-
getLanguage() - Method in class be.ugent.rml.term.Literal
-
 
-
getLevel() - Method in enum be.ugent.rml.metadata.MetadataGenerator.DETAIL_LEVEL
-
 
-
getLibraryPath(String) - Method in class be.ugent.rml.functions.FunctionLoader
-
 
-
getList(QuadStore, Term) - Static method in class be.ugent.rml.Utils
-
 
-
getList(QuadStore, Term, List<Term>) - Static method in class be.ugent.rml.Utils
-
 
-
getLiteralObjectsFromQuads(List<Quad>) - Static method in class be.ugent.rml.Utils
-
 
-
getLocation() - Method in class be.ugent.rml.access.RemoteFileAccess
-
-
The method returns the location of the remote file.
-
-
getMappings() - Method in class be.ugent.rml.Initializer
-
 
-
getMetadata() - Method in class be.ugent.rml.term.ProvenancedTerm
-
 
-
getMIMEType(String) - Static method in class be.ugent.rml.functions.lib.IDLabFunctions
-
 
-
getModel() - Method in class be.ugent.rml.store.RDF4JStore
-
 
-
getNamespaces() - Method in class be.ugent.rml.store.RDF4JStore
-
 
-
getNewBlankNodeID() - Static method in class be.ugent.rml.Executor
-
 
-
getNull() - Static method in class be.ugent.rml.functions.lib.GrelTestProcessor
-
 
-
getObject() - Method in class be.ugent.rml.PredicateObjectGraph
-
 
-
getObject() - Method in class be.ugent.rml.store.Quad
-
 
-
getObject() - Method in class be.ugent.rml.term.ProvenancedQuad
-
 
-
getObjectMappingInfo() - Method in class be.ugent.rml.PredicateObjectGraphMapping
-
 
-
getObjectsFromQuads(List<Quad>) - Static method in class be.ugent.rml.Utils
-
 
-
getOrigin() - Method in class be.ugent.rml.functions.TermGeneratorOriginPair
-
 
-
getParameterGenerators() - Method in class be.ugent.rml.functions.ParameterValueOriginPair
-
 
-
getParameterGenerators() - Method in class be.ugent.rml.functions.ParameterValuePair
-
 
-
getParentTriplesMap() - Method in class be.ugent.rml.PredicateObjectGraphMapping
-
 
-
getPassword() - Method in class be.ugent.rml.access.RDBAccess
-
-
This method returns the password.
-
-
getPath() - Method in class be.ugent.rml.access.LocalFileAccess
-
-
This method returns the path of the access.
-
-
getPath() - Method in class be.ugent.rml.ValuedJoinCondition
-
 
-
getPredicate() - Method in class be.ugent.rml.PredicateObjectGraph
-
 
-
getPredicate() - Method in class be.ugent.rml.store.Quad
-
 
-
getPredicate() - Method in class be.ugent.rml.term.ProvenancedQuad
-
 
-
getPredicateMappingInfo() - Method in class be.ugent.rml.PredicateObjectGraphMapping
-
 
-
getPredicateObjectGraphMappings() - Method in class be.ugent.rml.Mapping
-
 
-
getQuads(Term, Term, Term, Term) - Method in class be.ugent.rml.store.QuadStore
-
 
-
getQuads(Term, Term, Term) - Method in class be.ugent.rml.store.QuadStore
-
 
-
getQuads(Term, Term, Term, Term) - Method in class be.ugent.rml.store.RDF4JStore
-
 
-
getQuads(Term, Term, Term) - Method in class be.ugent.rml.store.RDF4JStore
-
 
-
getQuads(Term, Term, Term, Term) - Method in class be.ugent.rml.store.SimpleQuadStore
-
 
-
getQuads(Term, Term, Term) - Method in class be.ugent.rml.store.SimpleQuadStore
-
 
-
getQuery() - Method in class be.ugent.rml.access.RDBAccess
-
-
This method returns the SQL query.
-
-
getQuery() - Method in class be.ugent.rml.access.SPARQLEndpointAccess
-
-
This method returns the SPARQL query that is used to get the results.
-
-
getReaderFromFile(File) - Static method in class be.ugent.rml.Utils
-
 
-
getReaderFromLocation(String) - Static method in class be.ugent.rml.Utils
-
 
-
getReaderFromLocation(String, File, String) - Static method in class be.ugent.rml.Utils
-
 
-
getReaderFromURL(URL) - Static method in class be.ugent.rml.Utils
-
 
-
getReaderFromURL(URL, String) - Static method in class be.ugent.rml.Utils
-
 
-
getRecords(Access, Term, QuadStore) - Method in class be.ugent.rml.records.CSVRecordFactory
-
-
This method returns a list of CSV records for a data source.
-
-
getRecords(Access, Term, QuadStore) - Method in class be.ugent.rml.records.IteratorFormat
-
-
This method returns a list of records for a data source.
-
-
getRecords(Access, Term, QuadStore) - Method in interface be.ugent.rml.records.ReferenceFormulationRecordFactory
-
-
This method returns a list of records for a data source.
-
-
getReferenceFormulations() - Method in enum be.ugent.rml.records.SPARQLResultFormat
-
-
This method returns the reference formulation of the format.
-
-
getResult() - Method in class be.ugent.rml.metadata.MetadataGenerator
-
 
-
getSubject() - Method in class be.ugent.rml.store.Quad
-
 
-
getSubject() - Method in class be.ugent.rml.term.ProvenancedQuad
-
 
-
getSubjectMappingInfo() - Method in class be.ugent.rml.Mapping
-
 
-
getSubjectsFromQuads(List<Quad>) - Static method in class be.ugent.rml.Utils
-
 
-
getTemplateElements() - Method in class be.ugent.rml.Template
-
 
-
getTerm() - Method in class be.ugent.rml.MappingInfo
-
 
-
getTerm() - Method in class be.ugent.rml.term.ProvenancedTerm
-
 
-
getTermGenerator() - Method in class be.ugent.rml.functions.TermGeneratorOriginPair
-
 
-
getTermGenerator() - Method in class be.ugent.rml.MappingInfo
-
 
-
getTriplesMaps() - Method in class be.ugent.rml.Executor
-
 
-
getTriplesMaps() - Method in class be.ugent.rml.Initializer
-
 
-
getType() - Method in class be.ugent.rml.TemplateElement
-
 
-
getURI() - Method in class be.ugent.rml.functions.FunctionModel
-
 
-
getUri() - Method in enum be.ugent.rml.records.SPARQLResultFormat
-
-
This method returns the uri of the format.
-
-
getURLParamsString(Map<String, String>) - Static method in class be.ugent.rml.Utils
-
 
-
getUsername() - Method in class be.ugent.rml.access.RDBAccess
-
-
This method returns the username.
-
-
getValue() - Method in class be.ugent.rml.TemplateElement
-
 
-
getValue() - Method in class be.ugent.rml.term.AbstractTerm
-
 
-
getValue() - Method in interface be.ugent.rml.term.Term
-
 
-
getValueGeneratorPairs() - Method in class be.ugent.rml.functions.ParameterValueOriginPair
-
 
-
getValueGenerators() - Method in class be.ugent.rml.functions.ParameterValuePair
-
 
-
getValues() - Method in class be.ugent.rml.ValuedJoinCondition
-
 
-
GrelProcessor - Class in be.ugent.rml.functions.lib
-
 
-
GrelProcessor() - Constructor for class be.ugent.rml.functions.lib.GrelProcessor
-
 
-
GrelTestProcessor - Class in be.ugent.rml.functions.lib
-
 
-
GrelTestProcessor() - Constructor for class be.ugent.rml.functions.lib.GrelTestProcessor
-
 
-
- - - -

H

-
-
hashCode() - Method in class be.ugent.rml.access.LocalFileAccess
-
 
-
hashCode() - Method in class be.ugent.rml.access.RDBAccess
-
 
-
hashCode() - Method in class be.ugent.rml.access.RemoteFileAccess
-
 
-
hashCode() - Method in class be.ugent.rml.access.SPARQLEndpointAccess
-
 
-
hashCode() - Method in class be.ugent.rml.term.AbstractTerm
-
 
-
hashCode(String) - Static method in class be.ugent.rml.Utils
-
 
-
- - - -

I

-
-
IDLabFunctions - Class in be.ugent.rml.functions.lib
-
 
-
IDLabFunctions() - Constructor for class be.ugent.rml.functions.lib.IDLabFunctions
-
 
-
Initializer - Class in be.ugent.rml
-
 
-
Initializer(QuadStore, FunctionLoader) - Constructor for class be.ugent.rml.Initializer
-
 
-
insertQuad(ProvenancedQuad) - Method in class be.ugent.rml.metadata.MetadataGenerator
-
-
Gets called every time a quad is generated.
-
-
isEmpty() - Method in class be.ugent.rml.store.QuadStore
-
 
-
isEmpty() - Method in class be.ugent.rml.store.RDF4JStore
-
 
-
isEmpty() - Method in class be.ugent.rml.store.SimpleQuadStore
-
 
-
isRelativeIRI(String) - Static method in class be.ugent.rml.Utils
-
-
This method returns true if a string is a relative IRI.
-
-
isRemoteFile(String) - Static method in class be.ugent.rml.Utils
-
 
-
isValidIRI(String) - Static method in class be.ugent.rml.Utils
-
-
This method returns true if a string is valid IRI.
-
-
isValidrrLanguage(String) - Static method in class be.ugent.rml.Utils
-
-
Check if conforming to https://tools.ietf.org/html/bcp47#section-2.2.9
-
-
IteratorFormat<DocumentClass> - Class in be.ugent.rml.records
-
-
This an abstract class for reference formulation-specific record factories that use iterators.
-
-
IteratorFormat() - Constructor for class be.ugent.rml.records.IteratorFormat
-
 
-
- - - -

J

-
-
JSONRecord - Class in be.ugent.rml.records
-
-
This class is a specific implementation of a record for JSON.
-
-
JSONRecord(Object, String) - Constructor for class be.ugent.rml.records.JSONRecord
-
 
-
JSONRecordFactory - Class in be.ugent.rml.records
-
-
This class is a record factory that creates JSON records.
-
-
JSONRecordFactory() - Constructor for class be.ugent.rml.records.JSONRecordFactory
-
 
-
- - - -

L

-
-
listContainsElement(List, String) - Static method in class be.ugent.rml.functions.lib.IDLabFunctions
-
 
-
Literal - Class in be.ugent.rml.term
-
 
-
Literal(String) - Constructor for class be.ugent.rml.term.Literal
-
 
-
Literal(String, String) - Constructor for class be.ugent.rml.term.Literal
-
 
-
Literal(String, Term) - Constructor for class be.ugent.rml.term.Literal
-
 
-
LiteralGenerator - Class in be.ugent.rml.termgenerator
-
 
-
LiteralGenerator(SingleRecordFunctionExecutor, String) - Constructor for class be.ugent.rml.termgenerator.LiteralGenerator
-
 
-
LiteralGenerator(SingleRecordFunctionExecutor, SingleRecordFunctionExecutor) - Constructor for class be.ugent.rml.termgenerator.LiteralGenerator
-
 
-
LiteralGenerator(SingleRecordFunctionExecutor, Term) - Constructor for class be.ugent.rml.termgenerator.LiteralGenerator
-
 
-
LiteralGenerator(SingleRecordFunctionExecutor) - Constructor for class be.ugent.rml.termgenerator.LiteralGenerator
-
 
-
LocalFileAccess - Class in be.ugent.rml.access
-
-
This class represents access to a local file.
-
-
LocalFileAccess(String, String) - Constructor for class be.ugent.rml.access.LocalFileAccess
-
-
This constructor takes the path and the base path of a file.
-
-
- - - -

M

-
-
Main - Class in be.ugent.rml.cli
-
 
-
Main() - Constructor for class be.ugent.rml.cli.Main
-
 
-
main(String[]) - Static method in class be.ugent.rml.cli.Main
-
 
-
main(String[], String) - Static method in class be.ugent.rml.cli.Main
-
-
Main method use for the CLI.
-
-
Mapping - Class in be.ugent.rml
-
 
-
Mapping(MappingInfo, List<PredicateObjectGraphMapping>, List<MappingInfo>) - Constructor for class be.ugent.rml.Mapping
-
 
-
MappingFactory - Class in be.ugent.rml
-
 
-
MappingFactory(FunctionLoader) - Constructor for class be.ugent.rml.MappingFactory
-
 
-
MappingInfo - Class in be.ugent.rml
-
 
-
MappingInfo(Term, TermGenerator) - Constructor for class be.ugent.rml.MappingInfo
-
 
-
Metadata - Class in be.ugent.rml.metadata
-
-
Holds the source triplesMap and Subject-, Object- or PredicateMap for a specific (provenanced) term.
-
-
Metadata() - Constructor for class be.ugent.rml.metadata.Metadata
-
 
-
Metadata(Term) - Constructor for class be.ugent.rml.metadata.Metadata
-
 
-
Metadata(Term, Term) - Constructor for class be.ugent.rml.metadata.Metadata
-
 
-
MetadataGenerator - Class in be.ugent.rml.metadata
-
-
Class that encapsulates the generation of metadata.
-
-
MetadataGenerator(MetadataGenerator.DETAIL_LEVEL, String, String[], QuadStore) - Constructor for class be.ugent.rml.metadata.MetadataGenerator
-
 
-
MetadataGenerator.DETAIL_LEVEL - Enum in be.ugent.rml.metadata
-
 
-
MultipleRecordsFunctionExecutor - Interface in be.ugent.rml.functions
-
 
-
MYSQL - Static variable in class be.ugent.rml.DatabaseType
-
 
-
- - - -

N

-
-
NamedNode - Class in be.ugent.rml.term
-
 
-
NamedNode(String) - Constructor for class be.ugent.rml.term.NamedNode
-
 
-
NamedNodeGenerator - Class in be.ugent.rml.termgenerator
-
 
-
NamedNodeGenerator(SingleRecordFunctionExecutor) - Constructor for class be.ugent.rml.termgenerator.NamedNodeGenerator
-
 
-
NAMESPACES - Class in be.ugent.rml
-
 
-
NAMESPACES() - Constructor for class be.ugent.rml.NAMESPACES
-
 
-
notEqual(String, String) - Static method in class be.ugent.rml.functions.lib.UtilFunctions
-
 
-
ntriples2hdt(String, String) - Static method in class be.ugent.rml.Utils
-
 
-
- - - -

P

-
-
ParameterValueOriginPair - Class in be.ugent.rml.functions
-
 
-
ParameterValueOriginPair(List<TermGenerator>, List<TermGeneratorOriginPair>) - Constructor for class be.ugent.rml.functions.ParameterValueOriginPair
-
 
-
ParameterValuePair - Class in be.ugent.rml.functions
-
 
-
ParameterValuePair(List<TermGenerator>, List<TermGenerator>) - Constructor for class be.ugent.rml.functions.ParameterValuePair
-
 
-
parseFunctionParameters(QuadStore, List<Term>) - Static method in class be.ugent.rml.functions.FunctionUtils
-
 
-
parseTemplate(String) - Static method in class be.ugent.rml.Utils
-
-
This method parse the generic template and returns a list of Extractors - that can later be used by the executor - to get the data values from the records.
-
-
POSTGRES - Static variable in class be.ugent.rml.DatabaseType
-
 
-
postMappingGeneration(String, String, QuadStore) - Method in class be.ugent.rml.metadata.MetadataGenerator
-
-
Generates metadata after the actual mapping.
-
-
PredicateObjectGraph - Class in be.ugent.rml
-
 
-
PredicateObjectGraph(ProvenancedTerm, ProvenancedTerm, ProvenancedTerm) - Constructor for class be.ugent.rml.PredicateObjectGraph
-
 
-
PredicateObjectGraphMapping - Class in be.ugent.rml
-
 
-
PredicateObjectGraphMapping(MappingInfo, MappingInfo, MappingInfo) - Constructor for class be.ugent.rml.PredicateObjectGraphMapping
-
 
-
preMappingGeneration(List<Term>, QuadStore) - Method in class be.ugent.rml.metadata.MetadataGenerator
-
-
Generates metadata before the actual mapping.
-
-
PROV - Static variable in class be.ugent.rml.NAMESPACES
-
 
-
ProvenancedQuad - Class in be.ugent.rml.term
-
 
-
ProvenancedQuad(ProvenancedTerm, ProvenancedTerm, ProvenancedTerm, ProvenancedTerm) - Constructor for class be.ugent.rml.term.ProvenancedQuad
-
 
-
ProvenancedQuad(ProvenancedTerm, ProvenancedTerm, ProvenancedTerm) - Constructor for class be.ugent.rml.term.ProvenancedQuad
-
 
-
ProvenancedTerm - Class in be.ugent.rml.term
-
 
-
ProvenancedTerm(Term, Metadata) - Constructor for class be.ugent.rml.term.ProvenancedTerm
-
 
-
ProvenancedTerm(Term, MappingInfo) - Constructor for class be.ugent.rml.term.ProvenancedTerm
-
 
-
ProvenancedTerm(Term) - Constructor for class be.ugent.rml.term.ProvenancedTerm
-
 
-
- - - -

Q

-
-
QL - Static variable in class be.ugent.rml.NAMESPACES
-
 
-
Quad - Class in be.ugent.rml.store
-
 
-
Quad(Term, Term, Term, Term) - Constructor for class be.ugent.rml.store.Quad
-
 
-
Quad(Term, Term, Term) - Constructor for class be.ugent.rml.store.Quad
-
 
-
QuadStore - Class in be.ugent.rml.store
-
 
-
QuadStore() - Constructor for class be.ugent.rml.store.QuadStore
-
 
-
- - - -

R

-
-
random() - Static method in class be.ugent.rml.functions.lib.GrelProcessor
-
 
-
random() - Static method in class be.ugent.rml.functions.lib.GrelTestProcessor
-
 
-
randomString(int) - Static method in class be.ugent.rml.Utils
-
 
-
RDBAccess - Class in be.ugent.rml.access
-
-
This class represents the access to a relational database.
-
-
RDBAccess(String, DatabaseType.Database, String, String, String, String) - Constructor for class be.ugent.rml.access.RDBAccess
-
-
This constructor takes as arguments the dsn, database, username, password, query, and content type.
-
-
RDF - Static variable in class be.ugent.rml.NAMESPACES
-
 
-
RDF4JStore - Class in be.ugent.rml.store
-
 
-
RDF4JStore(Model) - Constructor for class be.ugent.rml.store.RDF4JStore
-
 
-
RDF4JStore() - Constructor for class be.ugent.rml.store.RDF4JStore
-
 
-
readFile(String) - Static method in class be.ugent.rml.functions.lib.IDLabFunctions
-
 
-
readFile(String, Charset) - Static method in class be.ugent.rml.Utils
-
 
-
readTurtle(InputStream, RDFFormat) - Static method in class be.ugent.rml.Utils
-
 
-
readTurtle(File, RDFFormat) - Static method in class be.ugent.rml.Utils
-
 
-
readTurtle(File) - Static method in class be.ugent.rml.Utils
-
 
-
Record - Class in be.ugent.rml.records
-
-
This class represents a generic record in a data source.
-
-
Record() - Constructor for class be.ugent.rml.records.Record
-
 
-
RecordFunctionExecutorFactory - Class in be.ugent.rml
-
 
-
RecordFunctionExecutorFactory() - Constructor for class be.ugent.rml.RecordFunctionExecutorFactory
-
 
-
RecordsFactory - Class in be.ugent.rml.records
-
-
This class creates records based on RML rules.
-
-
RecordsFactory(String) - Constructor for class be.ugent.rml.records.RecordsFactory
-
 
-
reference - Variable in class be.ugent.rml.extractor.ReferenceExtractor
-
 
-
ReferenceExtractor - Class in be.ugent.rml.extractor
-
 
-
ReferenceExtractor(String) - Constructor for class be.ugent.rml.extractor.ReferenceExtractor
-
 
-
ReferenceFormulationRecordFactory - Interface in be.ugent.rml.records
-
-
This is the interface for reference formulation-specific record factories.
-
-
RemoteFileAccess - Class in be.ugent.rml.access
-
-
This class represents access to a remote file.
-
-
RemoteFileAccess(String) - Constructor for class be.ugent.rml.access.RemoteFileAccess
-
 
-
RemoteFileAccess(String, String) - Constructor for class be.ugent.rml.access.RemoteFileAccess
-
-
This constructor of RemoteFileAccess taking location and content type as arguments.
-
-
removeDuplicates() - Method in class be.ugent.rml.store.QuadStore
-
 
-
removeDuplicates() - Method in class be.ugent.rml.store.RDF4JStore
-
 
-
removeDuplicates() - Method in class be.ugent.rml.store.SimpleQuadStore
-
 
-
removeQuads(Term, Term, Term, Term) - Method in class be.ugent.rml.store.RDF4JStore
-
 
-
removeQuads(Term, Term, Term) - Method in class be.ugent.rml.store.RDF4JStore
-
 
-
RML - Static variable in class be.ugent.rml.NAMESPACES
-
 
-
RR - Static variable in class be.ugent.rml.NAMESPACES
-
 
-
- - - -

S

-
-
SD - Static variable in class be.ugent.rml.NAMESPACES
-
 
-
selectedColumnHash(String) - Static method in class be.ugent.rml.Utils
-
 
-
setNamespaces(Set<Namespace>) - Method in class be.ugent.rml.store.QuadStore
-
 
-
setNamespaces(Set<Namespace>) - Method in class be.ugent.rml.store.RDF4JStore
-
 
-
setNamespaces(Set<Namespace>) - Method in class be.ugent.rml.store.SimpleQuadStore
-
 
-
setParentTriplesMap(Term) - Method in class be.ugent.rml.PredicateObjectGraphMapping
-
 
-
setSourceMap(Term) - Method in class be.ugent.rml.metadata.Metadata
-
 
-
SimpleQuadStore - Class in be.ugent.rml.store
-
 
-
SimpleQuadStore(ArrayList<Quad>) - Constructor for class be.ugent.rml.store.SimpleQuadStore
-
 
-
SimpleQuadStore() - Constructor for class be.ugent.rml.store.SimpleQuadStore
-
 
-
SingleRecordFunctionExecutor - Interface in be.ugent.rml.functions
-
 
-
size() - Method in class be.ugent.rml.store.QuadStore
-
 
-
size() - Method in class be.ugent.rml.store.RDF4JStore
-
 
-
size() - Method in class be.ugent.rml.store.SimpleQuadStore
-
 
-
SPARQLEndpointAccess - Class in be.ugent.rml.access
-
-
This class represents the access to a SPARQL endpoint.
-
-
SPARQLEndpointAccess(String, String, String) - Constructor for class be.ugent.rml.access.SPARQLEndpointAccess
-
-
This constructor takes a content type, url of the endpoint, and a SPARQL query as arguments.
-
-
SPARQLResultFormat - Enum in be.ugent.rml.records
-
-
This enum represents the different SPARQL result formats.
-
-
SQL_SERVER - Static variable in class be.ugent.rml.DatabaseType
-
 
-
StaticMultipleRecordsFunctionExecutor - Class in be.ugent.rml.functions
-
 
-
StaticMultipleRecordsFunctionExecutor(FunctionModel, Map<String, Object[]>) - Constructor for class be.ugent.rml.functions.StaticMultipleRecordsFunctionExecutor
-
 
-
StaticSingleRecordFunctionExecutor - Class in be.ugent.rml.functions
-
 
-
StaticSingleRecordFunctionExecutor(FunctionModel, Map<String, List<Template>>) - Constructor for class be.ugent.rml.functions.StaticSingleRecordFunctionExecutor
-
 
-
stringContainsOtherString(String, String, String) - Static method in class be.ugent.rml.functions.lib.IDLabFunctions
-
 
-
- - - -

T

-
-
Template - Class in be.ugent.rml
-
 
-
Template() - Constructor for class be.ugent.rml.Template
-
 
-
Template(List<TemplateElement>) - Constructor for class be.ugent.rml.Template
-
 
-
TemplateElement - Class in be.ugent.rml
-
 
-
TemplateElement(String, TEMPLATETYPE) - Constructor for class be.ugent.rml.TemplateElement
-
 
-
TEMPLATETYPE - Enum in be.ugent.rml
-
 
-
Term - Interface in be.ugent.rml.term
-
 
-
TermGenerator - Class in be.ugent.rml.termgenerator
-
 
-
TermGenerator(SingleRecordFunctionExecutor) - Constructor for class be.ugent.rml.termgenerator.TermGenerator
-
 
-
TermGeneratorOriginPair - Class in be.ugent.rml.functions
-
 
-
TermGeneratorOriginPair(TermGenerator, String) - Constructor for class be.ugent.rml.functions.TermGeneratorOriginPair
-
 
-
toLowercase(String) - Static method in class be.ugent.rml.functions.lib.GrelProcessor
-
 
-
toLowercase(String) - Static method in class be.ugent.rml.functions.lib.GrelTestProcessor
-
 
-
toSimpleSortedQuadStore() - Method in class be.ugent.rml.store.QuadStore
-
 
-
toSortedString() - Method in class be.ugent.rml.store.QuadStore
-
 
-
toString() - Method in class be.ugent.rml.access.LocalFileAccess
-
 
-
toString() - Method in enum be.ugent.rml.DatabaseType.Database
-
 
-
toString() - Method in class be.ugent.rml.extractor.ReferenceExtractor
-
 
-
toString() - Method in enum be.ugent.rml.records.SPARQLResultFormat
-
-
This method returns a String representation of the format, based on the format's name.
-
-
toString() - Method in class be.ugent.rml.store.QuadStore
-
 
-
toString() - Method in class be.ugent.rml.term.AbstractTerm
-
 
-
toString() - Method in class be.ugent.rml.term.BlankNode
-
 
-
toString() - Method in class be.ugent.rml.term.Literal
-
 
-
toString() - Method in class be.ugent.rml.term.NamedNode
-
 
-
toUppercase(String) - Static method in class be.ugent.rml.functions.lib.GrelProcessor
-
 
-
toUppercase(String) - Static method in class be.ugent.rml.functions.lib.GrelTestProcessor
-
 
-
toUpperCaseURL(String) - Static method in class be.ugent.rml.functions.lib.GrelProcessor
-
 
-
toUpperCaseURL(String) - Static method in class be.ugent.rml.functions.lib.GrelTestProcessor
-
 
-
transformDatatypeString(String, String) - Static method in class be.ugent.rml.Utils
-
 
-
trueCondition(String, String) - Static method in class be.ugent.rml.functions.lib.IDLabFunctions
-
 
-
- - - -

U

-
-
UtilFunctions - Class in be.ugent.rml.functions.lib
-
 
-
UtilFunctions() - Constructor for class be.ugent.rml.functions.lib.UtilFunctions
-
 
-
Utils - Class in be.ugent.rml
-
 
-
Utils() - Constructor for class be.ugent.rml.Utils
-
 
-
- - - -

V

-
-
ValuedJoinCondition - Class in be.ugent.rml
-
 
-
ValuedJoinCondition(Template, List<String>) - Constructor for class be.ugent.rml.ValuedJoinCondition
-
 
-
valueOf(String) - Static method in enum be.ugent.rml.DatabaseType.Database
-
-
Returns the enum constant of this type with the specified name.
-
-
valueOf(String) - Static method in enum be.ugent.rml.metadata.MetadataGenerator.DETAIL_LEVEL
-
-
Returns the enum constant of this type with the specified name.
-
-
valueOf(String) - Static method in enum be.ugent.rml.records.SPARQLResultFormat
-
-
Returns the enum constant of this type with the specified name.
-
-
valueOf(String) - Static method in enum be.ugent.rml.TEMPLATETYPE
-
-
Returns the enum constant of this type with the specified name.
-
-
values() - Static method in enum be.ugent.rml.DatabaseType.Database
-
-
Returns an array containing the constants of this enum type, in -the order they are declared.
-
-
values() - Static method in enum be.ugent.rml.metadata.MetadataGenerator.DETAIL_LEVEL
-
-
Returns an array containing the constants of this enum type, in -the order they are declared.
-
-
values() - Static method in enum be.ugent.rml.records.SPARQLResultFormat
-
-
Returns an array containing the constants of this enum type, in -the order they are declared.
-
-
values() - Static method in enum be.ugent.rml.TEMPLATETYPE
-
-
Returns an array containing the constants of this enum type, in -the order they are declared.
-
-
VOID - Static variable in class be.ugent.rml.NAMESPACES
-
 
-
- - - -

W

-
-
write(Writer, String) - Method in class be.ugent.rml.store.QuadStore
-
 
-
write(Writer, String) - Method in class be.ugent.rml.store.RDF4JStore
-
 
-
write(Writer, String) - Method in class be.ugent.rml.store.SimpleQuadStore
-
 
-
- - - -

X

-
-
XMLRecord - Class in be.ugent.rml.records
-
-
This class is a specific implementation of a record for XML.
-
-
XMLRecord(Node) - Constructor for class be.ugent.rml.records.XMLRecord
-
 
-
XMLRecordFactory - Class in be.ugent.rml.records
-
-
This class is a record factory that creates XML records.
-
-
XMLRecordFactory() - Constructor for class be.ugent.rml.records.XMLRecordFactory
-
 
-
XSD - Static variable in class be.ugent.rml.NAMESPACES
-
 
-
-A B C D E F G H I J L M N P Q R S T U V W X 
- -
- - - - - - - -
- - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/index.html b/docs/apidocs/index.html deleted file mode 100644 index 946d58f3..00000000 --- a/docs/apidocs/index.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - -rmlmapper 4.5.0 API - - - - - - - - - -<noscript> -<div>JavaScript is disabled on your browser.</div> -</noscript> -<h2>Frame Alert</h2> -<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> - - - diff --git a/docs/apidocs/overview-frame.html b/docs/apidocs/overview-frame.html deleted file mode 100644 index be854135..00000000 --- a/docs/apidocs/overview-frame.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - -Overview List (rmlmapper 4.5.0 API) - - - - - - - -

 

- - diff --git a/docs/apidocs/overview-summary.html b/docs/apidocs/overview-summary.html deleted file mode 100644 index 3430ca5c..00000000 --- a/docs/apidocs/overview-summary.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - -Overview (rmlmapper 4.5.0 API) - - - - - - - - -
- - - - - - - -
- - -
-

rmlmapper 4.5.0 API

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Packages 
PackageDescription
be.ugent.rml 
be.ugent.rml.access 
be.ugent.rml.cli 
be.ugent.rml.extractor 
be.ugent.rml.functions 
be.ugent.rml.functions.lib 
be.ugent.rml.metadata 
be.ugent.rml.records 
be.ugent.rml.store 
be.ugent.rml.term 
be.ugent.rml.termgenerator 
-
- -
- - - - - - - -
- - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/overview-tree.html b/docs/apidocs/overview-tree.html deleted file mode 100644 index ccd9fc8b..00000000 --- a/docs/apidocs/overview-tree.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - -Class Hierarchy (rmlmapper 4.5.0 API) - - - - - - - - -
- - - - - - - -
- - - -
-

Class Hierarchy

- -

Interface Hierarchy

- -

Enum Hierarchy

- -
- -
- - - - - - - -
- - -

Copyright © 2019. All rights reserved.

- - diff --git a/docs/apidocs/package-list b/docs/apidocs/package-list deleted file mode 100644 index 172948cf..00000000 --- a/docs/apidocs/package-list +++ /dev/null @@ -1,11 +0,0 @@ -be.ugent.rml -be.ugent.rml.access -be.ugent.rml.cli -be.ugent.rml.extractor -be.ugent.rml.functions -be.ugent.rml.functions.lib -be.ugent.rml.metadata -be.ugent.rml.records -be.ugent.rml.store -be.ugent.rml.term -be.ugent.rml.termgenerator diff --git a/docs/apidocs/script.js b/docs/apidocs/script.js deleted file mode 100644 index b3463569..00000000 --- a/docs/apidocs/script.js +++ /dev/null @@ -1,30 +0,0 @@ -function show(type) -{ - count = 0; - for (var key in methods) { - var row = document.getElementById(key); - if ((methods[key] & type) != 0) { - row.style.display = ''; - row.className = (count++ % 2) ? rowColor : altColor; - } - else - row.style.display = 'none'; - } - updateTabs(type); -} - -function updateTabs(type) -{ - for (var value in tabs) { - var sNode = document.getElementById(tabs[value][0]); - var spanNode = sNode.firstChild; - if (value == type) { - sNode.className = activeTableTab; - spanNode.innerHTML = tabs[value][1]; - } - else { - sNode.className = tableTab; - spanNode.innerHTML = "" + tabs[value][1] + ""; - } - } -} diff --git a/docs/apidocs/stylesheet.css b/docs/apidocs/stylesheet.css deleted file mode 100644 index 98055b22..00000000 --- a/docs/apidocs/stylesheet.css +++ /dev/null @@ -1,574 +0,0 @@ -/* Javadoc style sheet */ -/* -Overall document style -*/ - -@import url('resources/fonts/dejavu.css'); - -body { - background-color:#ffffff; - color:#353833; - font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; - font-size:14px; - margin:0; -} -a:link, a:visited { - text-decoration:none; - color:#4A6782; -} -a:hover, a:focus { - text-decoration:none; - color:#bb7a2a; -} -a:active { - text-decoration:none; - color:#4A6782; -} -a[name] { - color:#353833; -} -a[name]:hover { - text-decoration:none; - color:#353833; -} -pre { - font-family:'DejaVu Sans Mono', monospace; - font-size:14px; -} -h1 { - font-size:20px; -} -h2 { - font-size:18px; -} -h3 { - font-size:16px; - font-style:italic; -} -h4 { - font-size:13px; -} -h5 { - font-size:12px; -} -h6 { - font-size:11px; -} -ul { - list-style-type:disc; -} -code, tt { - font-family:'DejaVu Sans Mono', monospace; - font-size:14px; - padding-top:4px; - margin-top:8px; - line-height:1.4em; -} -dt code { - font-family:'DejaVu Sans Mono', monospace; - font-size:14px; - padding-top:4px; -} -table tr td dt code { - font-family:'DejaVu Sans Mono', monospace; - font-size:14px; - vertical-align:top; - padding-top:4px; -} -sup { - font-size:8px; -} -/* -Document title and Copyright styles -*/ -.clear { - clear:both; - height:0px; - overflow:hidden; -} -.aboutLanguage { - float:right; - padding:0px 21px; - font-size:11px; - z-index:200; - margin-top:-9px; -} -.legalCopy { - margin-left:.5em; -} -.bar a, .bar a:link, .bar a:visited, .bar a:active { - color:#FFFFFF; - text-decoration:none; -} -.bar a:hover, .bar a:focus { - color:#bb7a2a; -} -.tab { - background-color:#0066FF; - color:#ffffff; - padding:8px; - width:5em; - font-weight:bold; -} -/* -Navigation bar styles -*/ -.bar { - background-color:#4D7A97; - color:#FFFFFF; - padding:.8em .5em .4em .8em; - height:auto;/*height:1.8em;*/ - font-size:11px; - margin:0; -} -.topNav { - background-color:#4D7A97; - color:#FFFFFF; - float:left; - padding:0; - width:100%; - clear:right; - height:2.8em; - padding-top:10px; - overflow:hidden; - font-size:12px; -} -.bottomNav { - margin-top:10px; - background-color:#4D7A97; - color:#FFFFFF; - float:left; - padding:0; - width:100%; - clear:right; - height:2.8em; - padding-top:10px; - overflow:hidden; - font-size:12px; -} -.subNav { - background-color:#dee3e9; - float:left; - width:100%; - overflow:hidden; - font-size:12px; -} -.subNav div { - clear:left; - float:left; - padding:0 0 5px 6px; - text-transform:uppercase; -} -ul.navList, ul.subNavList { - float:left; - margin:0 25px 0 0; - padding:0; -} -ul.navList li{ - list-style:none; - float:left; - padding: 5px 6px; - text-transform:uppercase; -} -ul.subNavList li{ - list-style:none; - float:left; -} -.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { - color:#FFFFFF; - text-decoration:none; - text-transform:uppercase; -} -.topNav a:hover, .bottomNav a:hover { - text-decoration:none; - color:#bb7a2a; - text-transform:uppercase; -} -.navBarCell1Rev { - background-color:#F8981D; - color:#253441; - margin: auto 5px; -} -.skipNav { - position:absolute; - top:auto; - left:-9999px; - overflow:hidden; -} -/* -Page header and footer styles -*/ -.header, .footer { - clear:both; - margin:0 20px; - padding:5px 0 0 0; -} -.indexHeader { - margin:10px; - position:relative; -} -.indexHeader span{ - margin-right:15px; -} -.indexHeader h1 { - font-size:13px; -} -.title { - color:#2c4557; - margin:10px 0; -} -.subTitle { - margin:5px 0 0 0; -} -.header ul { - margin:0 0 15px 0; - padding:0; -} -.footer ul { - margin:20px 0 5px 0; -} -.header ul li, .footer ul li { - list-style:none; - font-size:13px; -} -/* -Heading styles -*/ -div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { - background-color:#dee3e9; - border:1px solid #d0d9e0; - margin:0 0 6px -8px; - padding:7px 5px; -} -ul.blockList ul.blockList ul.blockList li.blockList h3 { - background-color:#dee3e9; - border:1px solid #d0d9e0; - margin:0 0 6px -8px; - padding:7px 5px; -} -ul.blockList ul.blockList li.blockList h3 { - padding:0; - margin:15px 0; -} -ul.blockList li.blockList h2 { - padding:0px 0 20px 0; -} -/* -Page layout container styles -*/ -.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { - clear:both; - padding:10px 20px; - position:relative; -} -.indexContainer { - margin:10px; - position:relative; - font-size:12px; -} -.indexContainer h2 { - font-size:13px; - padding:0 0 3px 0; -} -.indexContainer ul { - margin:0; - padding:0; -} -.indexContainer ul li { - list-style:none; - padding-top:2px; -} -.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { - font-size:12px; - font-weight:bold; - margin:10px 0 0 0; - color:#4E4E4E; -} -.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { - margin:5px 0 10px 0px; - font-size:14px; - font-family:'DejaVu Sans Mono',monospace; -} -.serializedFormContainer dl.nameValue dt { - margin-left:1px; - font-size:1.1em; - display:inline; - font-weight:bold; -} -.serializedFormContainer dl.nameValue dd { - margin:0 0 0 1px; - font-size:1.1em; - display:inline; -} -/* -List styles -*/ -ul.horizontal li { - display:inline; - font-size:0.9em; -} -ul.inheritance { - margin:0; - padding:0; -} -ul.inheritance li { - display:inline; - list-style:none; -} -ul.inheritance li ul.inheritance { - margin-left:15px; - padding-left:15px; - padding-top:1px; -} -ul.blockList, ul.blockListLast { - margin:10px 0 10px 0; - padding:0; -} -ul.blockList li.blockList, ul.blockListLast li.blockList { - list-style:none; - margin-bottom:15px; - line-height:1.4; -} -ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { - padding:0px 20px 5px 10px; - border:1px solid #ededed; - background-color:#f8f8f8; -} -ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { - padding:0 0 5px 8px; - background-color:#ffffff; - border:none; -} -ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { - margin-left:0; - padding-left:0; - padding-bottom:15px; - border:none; -} -ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { - list-style:none; - border-bottom:none; - padding-bottom:0; -} -table tr td dl, table tr td dl dt, table tr td dl dd { - margin-top:0; - margin-bottom:1px; -} -/* -Table styles -*/ -.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary { - width:100%; - border-left:1px solid #EEE; - border-right:1px solid #EEE; - border-bottom:1px solid #EEE; -} -.overviewSummary, .memberSummary { - padding:0px; -} -.overviewSummary caption, .memberSummary caption, .typeSummary caption, -.useSummary caption, .constantsSummary caption, .deprecatedSummary caption { - position:relative; - text-align:left; - background-repeat:no-repeat; - color:#253441; - font-weight:bold; - clear:none; - overflow:hidden; - padding:0px; - padding-top:10px; - padding-left:1px; - margin:0px; - white-space:pre; -} -.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, -.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, -.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, -.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, -.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, -.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, -.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, -.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited { - color:#FFFFFF; -} -.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, -.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { - white-space:nowrap; - padding-top:5px; - padding-left:12px; - padding-right:12px; - padding-bottom:7px; - display:inline-block; - float:left; - background-color:#F8981D; - border: none; - height:16px; -} -.memberSummary caption span.activeTableTab span { - white-space:nowrap; - padding-top:5px; - padding-left:12px; - padding-right:12px; - margin-right:3px; - display:inline-block; - float:left; - background-color:#F8981D; - height:16px; -} -.memberSummary caption span.tableTab span { - white-space:nowrap; - padding-top:5px; - padding-left:12px; - padding-right:12px; - margin-right:3px; - display:inline-block; - float:left; - background-color:#4D7A97; - height:16px; -} -.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab { - padding-top:0px; - padding-left:0px; - padding-right:0px; - background-image:none; - float:none; - display:inline; -} -.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, -.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd { - display:none; - width:5px; - position:relative; - float:left; - background-color:#F8981D; -} -.memberSummary .activeTableTab .tabEnd { - display:none; - width:5px; - margin-right:3px; - position:relative; - float:left; - background-color:#F8981D; -} -.memberSummary .tableTab .tabEnd { - display:none; - width:5px; - margin-right:3px; - position:relative; - background-color:#4D7A97; - float:left; - -} -.overviewSummary td, .memberSummary td, .typeSummary td, -.useSummary td, .constantsSummary td, .deprecatedSummary td { - text-align:left; - padding:0px 0px 12px 10px; -} -th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th, -td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{ - vertical-align:top; - padding-right:0px; - padding-top:8px; - padding-bottom:3px; -} -th.colFirst, th.colLast, th.colOne, .constantsSummary th { - background:#dee3e9; - text-align:left; - padding:8px 3px 3px 7px; -} -td.colFirst, th.colFirst { - white-space:nowrap; - font-size:13px; -} -td.colLast, th.colLast { - font-size:13px; -} -td.colOne, th.colOne { - font-size:13px; -} -.overviewSummary td.colFirst, .overviewSummary th.colFirst, -.useSummary td.colFirst, .useSummary th.colFirst, -.overviewSummary td.colOne, .overviewSummary th.colOne, -.memberSummary td.colFirst, .memberSummary th.colFirst, -.memberSummary td.colOne, .memberSummary th.colOne, -.typeSummary td.colFirst{ - width:25%; - vertical-align:top; -} -td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { - font-weight:bold; -} -.tableSubHeadingColor { - background-color:#EEEEFF; -} -.altColor { - background-color:#FFFFFF; -} -.rowColor { - background-color:#EEEEEF; -} -/* -Content styles -*/ -.description pre { - margin-top:0; -} -.deprecatedContent { - margin:0; - padding:10px 0; -} -.docSummary { - padding:0; -} - -ul.blockList ul.blockList ul.blockList li.blockList h3 { - font-style:normal; -} - -div.block { - font-size:14px; - font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; -} - -td.colLast div { - padding-top:0px; -} - - -td.colLast a { - padding-bottom:3px; -} -/* -Formatting effect styles -*/ -.sourceLineNo { - color:green; - padding:0 30px 0 0; -} -h1.hidden { - visibility:hidden; - overflow:hidden; - font-size:10px; -} -.block { - display:block; - margin:3px 10px 2px 0px; - color:#474747; -} -.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink, -.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel, -.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink { - font-weight:bold; -} -.deprecationComment, .emphasizedPhrase, .interfaceName { - font-style:italic; -} - -div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase, -div.block div.block span.interfaceName { - font-style:normal; -} - -div.contentContainer ul.blockList li.blockList h2{ - padding-bottom:0px; -} diff --git a/generate-spreadsheet-test-cases.sh b/generate-spreadsheet-test-cases.sh new file mode 100644 index 00000000..9b5f0744 --- /dev/null +++ b/generate-spreadsheet-test-cases.sh @@ -0,0 +1,64 @@ +#!/usr/bin/env bash + +# REQUIRES libreoffice!! + +TEST_LOCATION="src/test" +TEST_FILE_LOCATION="java/be/ugent/rml" +TEST_RESOURCES_LOCATION="resources/test-cases" +NAME_CSV_TEST="Mapper_CSV_Test.java" + +# Check for libreoffice +if [[ ! `libreoffice --help` ]] +then + echo "Install libreoffice to convert CSV." + return 1 +fi + +cd ${TEST_LOCATION} +TEST_DIR=$(pwd) + +for i in "EXCEL xlsx" "ODS ods" +do + set -- ${i} + echo "Generating ${1} tests from CSV tests" + + ## Test files + cd "${TEST_DIR}/${TEST_FILE_LOCATION}" + NAME_NEW_TEST="Mapper_${1}_Test.java" + cp ${NAME_CSV_TEST} ${NAME_NEW_TEST} + sed -i "s/CSV/${1}/g" ${NAME_NEW_TEST} + + ## Test resources + cd "${TEST_DIR}/${TEST_RESOURCES_LOCATION}" + for csv_dir in *CSV* + do + # Copy CSV test directory + NEW_DIR_NAME=$(echo ${csv_dir} | sed "s/CSV/${1}/") + if [[ -d ${NEW_DIR_NAME} ]] + then + rm -Rf ${NEW_DIR_NAME} + fi + cp -r ${csv_dir} ${NEW_DIR_NAME} + cd ${NEW_DIR_NAME} + + # Change files within directory + + echo "Test case: ${NEW_DIR_NAME}" + # csv source file + for csv_source in *.csv + do + if [[ ! -f ${csv_source} ]]; then break; fi + # UTF-8 encoding issue + # https://bugs.documentfoundation.org/show_bug.cgi?id=36313 + libreoffice --headless --convert-to ${2} --infilter=CSV:44,34,UTF8 ${csv_source} + rm ${csv_source} + done + # mapping file + sed -i "s/.csv/.${2}/g" "mapping.ttl" + + cd .. + done +done + +echo "Success!" + diff --git a/mappertest.rspec b/mappertest.rspec new file mode 100644 index 00000000..ffdf2511 --- /dev/null +++ b/mappertest.rspec @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 6c74eabd..3defbb85 100644 --- a/pom.xml +++ b/pom.xml @@ -2,12 +2,45 @@ 4.0.0 be.ugent.rml rmlmapper - 4.6.0 + RMLMapper + 8.1.0 + + The RMLMapper executes RML rules to generate high quality Linked Data from multiple originally (semi-)structured data sources. + + https://github.com/RMLio/rmlmapper-java + + + The MIT License + https://raw.githubusercontent.com/RMLio/rmlmapper-java/master/LICENSE + repo + + + + + pheyvaer + Pieter Heyvaert + pieter.heyvaert@ugent.be + + + bjdmeest + Ben De Meester + ben.demeester@ugent.be + + + andimou + Anastasia Dimou + anastasia.dimou@ugent.be + + + UTF-8 - 4.12 - 8 - 8 + 5.10.0 + 21 + 21 + 5.2.0 + 3.2.0 + 2.0.2 @@ -26,42 +59,173 @@ + + + no-buildnumber + + 0 + + + + + org.codehaus.mojo + buildnumber-maven-plugin + 1.4 + + + buildnumber-generation + none + + + + + + + + release + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.5.0 + + 8 + + + + attach-javadocs + + jar + + + public + false + none + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.3.0 + + + attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.1.0 + + + sign-artifacts + verify + + sign + + + + + + + + + ch.qos.logback logback-classic - 1.2.3 + 1.5.16 + + - commons-lang - commons-lang - 2.6 + commons-io + commons-io + 2.18.0 + org.apache.commons - commons-csv - 1.6 + commons-compress + 1.27.1 + + + org.apache.commons + commons-lang3 + 3.18.0 + + commons-cli commons-cli - 1.4 + 1.10.0 + + org.eclipse.rdf4j - rdf4j-runtime - 2.5.1 + rdf4j-client + 5.1.0 + pom + + + commons-io + commons-io + + + commons-codec + commons-codec + + + com.opencsv + opencsv + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit.version} + test - junit - junit + org.junit.jupiter + junit-jupiter-api + ${junit.version} + test + + + org.junit.jupiter + junit-jupiter-params + ${junit.version} + test + + + org.junit.vintage + junit-vintage-engine ${junit.version} test com.jayway.jsonpath json-path - 2.4.0 + 2.9.0 + runtime + + + + net.minidev + json-smart + 2.5.2 javax.xml.parsers @@ -69,75 +233,168 @@ 1.4.5 - mysql - mysql-connector-java - 8.0.15 + org.wiremock + wiremock-jetty12 + 3.9.1 + test - ch.vorburger.mariaDB4j - mariaDB4j - 2.4.0 + org.apache.jena + jena-fuseki-main + ${jena.version} test - postgresql - postgresql - 9.1-901-1.jdbc4 + org.rdfhdt + hdt-java-core + 3.0.10 + + + org.apache.jena + * + + + junit + * + + + org.apache.commons + commons-compress + + - - com.microsoft.sqlserver - mssql-jdbc - 7.2.2.jre8 - test + eu.neverblink.jelly + jelly-rdf4j + ${jelly.version} + + + org.eclipse.rdf4j + * + + - com.googlecode.zohhak - zohhak - 1.1.1 - test + be.ugent.idlab.knows + function-agent-java + 1.3.0 + + + org.apache.jena + * + + - com.spotify - docker-client - 8.15.2 + com.github.fnoio + grel-functions-java + v0.10.1 + + + org.apache.commons + commons-text + + + commons-codec + commons-codec + + - com.fasterxml.jackson.core - jackson-core - 2.9.8 + be.ugent.idlab.knows + idlab-functions-java + 1.4.0 + + + org.apache.commons + commons-lang3 + + + org.apache.commons + commons-text + + - org.eclipse.jetty - jetty-server - 9.4.17.v20190418 + be.ugent.idlab.knows + dataio + 2.2.0 + + + org.apache.commons + commons-lang3 + + + + org.bitbucket.b_c + jose4j + 0.9.6 + + - org.eclipse.jetty - jetty-security - 9.4.17.v20190418 + org.testcontainers + testcontainers-postgresql + ${testcontainers.version} + test - org.apache.jena - apache-jena-libs - pom - 3.8.0 + org.testcontainers + testcontainers-mysql + ${testcontainers.version} + test - org.apache.jena - jena-fuseki-embedded - 3.8.0 + org.testcontainers + testcontainers-mssqlserver + ${testcontainers.version} + test + + + org.testcontainers + testcontainers-oracle-xe + ${testcontainers.version} + test - com.github.bjdmeest - hdt-java - hdt-2.2-SNAPSHOT + org.testcontainers + testcontainers-jdbc + ${testcontainers.version} + test + + + org.testcontainers + testcontainers-junit-jupiter + ${testcontainers.version} + test - + - commons-validator - commons-validator - 1.6 + org.json + json + 20240303 + + + + org.testcontainers + testcontainers + ${testcontainers.version} + compile + + + org.apache.commons + commons-compress + + + commons-io + commons-io + + + org.apache.commons + commons-lang3 + + + @@ -153,49 +410,22 @@ ${maven.compiler.source} ${maven.compiler.source} - 3.8.1 - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.1.0 - - docs - en - - - - attach-javadocs - install - - javadoc - - - public - docs - false - none - - - + 3.13.0 org.apache.maven.plugins maven-shade-plugin 3.2.1 - false + true + r${buildNumber}-all - + be.ugent.rml.cli.Main - - - + + + false @@ -215,8 +445,8 @@ - make-assembly - package + make-assembly + package shade @@ -226,10 +456,12 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M3 + 3.3.1 true false + 1 + false @@ -240,6 +472,7 @@ 1.4 + buildnumber-generation validate create @@ -253,6 +486,16 @@ + + org.sonatype.central + central-publishing-maven-plugin + 0.9.0 + true + + central + true + + diff --git a/pom.xml.versionsBackup b/pom.xml.versionsBackup new file mode 100644 index 00000000..a13886d9 --- /dev/null +++ b/pom.xml.versionsBackup @@ -0,0 +1,436 @@ + + 4.0.0 + be.ugent.rml + rmlmapper + RMLMapper + 7.1.0 + + The RMLMapper executes RML rules to generate high quality Linked Data from multiple originally (semi-)structured data sources. + + https://github.com/RMLio/rmlmapper-java + + + The MIT License + https://raw.githubusercontent.com/RMLio/rmlmapper-java/master/LICENSE + repo + + + + + pheyvaer + Pieter Heyvaert + pieter.heyvaert@ugent.be + + + bjdmeest + Ben De Meester + ben.demeester@ugent.be + + + andimou + Anastasia Dimou + anastasia.dimou@ugent.be + + + + + UTF-8 + 5.10.0 + 17 + 17 + 4.9.0 + 1.18.3 + + + + scm:git:ssh://git@github.com:RMLio/rmlmapper-java.git + https://github.com/RMLio/rmlmapper-java + + + + + repo.maven.apache.org + https://repo.maven.apache.org/maven2/ + + + jitpack.io + https://jitpack.io + + + + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + + + + no-buildnumber + + 0 + + + + + org.codehaus.mojo + buildnumber-maven-plugin + 1.4 + + + buildnumber-generation + none + + + + + + + + release + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + 8 + + + + attach-javadocs + + jar + + + public + false + none + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + ch.qos.logback + logback-classic + 1.4.14 + + + org.eclipse.rdf4j + rdf4j-client + 4.3.8 + pom + + + org.mapdb + * + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit.version} + test + + + org.junit.jupiter + junit-jupiter-api + ${junit.version} + test + + + org.junit.jupiter + junit-jupiter-params + ${junit.version} + test + + + org.junit.vintage + junit-vintage-engine + ${junit.version} + test + + + com.jayway.jsonpath + json-path + 2.9.0 + runtime + + + + net.minidev + json-smart + 2.5.0 + + + javax.xml.parsers + jaxp-api + 1.4.5 + + + com.mysql + mysql-connector-j + 8.2.0 + provided + + + org.postgresql + postgresql + 42.6.0 + provided + + + + com.microsoft.sqlserver + mssql-jdbc + 12.4.2.jre11 + provided + + + com.oracle.database.jdbc + ojdbc11 + 23.3.0.23.09 + provided + + + com.github.tomakehurst + wiremock-jre8 + 2.35.1 + test + + + commons-fileupload + commons-fileupload + + + + + org.apache.jena + jena-fuseki-main + ${jena.version} + test + + + + org.rdfhdt + hdt-java-core + 3.0.10 + + + org.apache.jena + * + + + junit + * + + + + + be.ugent.idlab.knows + function-agent-java + 1.2.0 + + + org.apache.jena + * + + + + + com.github.fnoio + grel-functions-java + v0.9.1 + + + be.ugent.idlab.knows + idlab-functions-java + 1.3.3 + + + be.ugent.idlab.knows + dataio + 1.3.1 + + + + org.testcontainers + postgresql + ${testcontainers.version} + test + + + org.testcontainers + mysql + ${testcontainers.version} + test + + + org.testcontainers + mssqlserver + ${testcontainers.version} + test + + + org.testcontainers + oracle-xe + ${testcontainers.version} + test + + + org.testcontainers + jdbc + ${testcontainers.version} + test + + + org.testcontainers + junit-jupiter + ${testcontainers.version} + test + + + + + src/main/java + src/test/java + ${project.artifactId}-${project.version}-r${buildNumber} + + + org.apache.maven.plugins + maven-compiler-plugin + + ${maven.compiler.source} + ${maven.compiler.source} + + 3.8.1 + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.1 + + true + r${buildNumber}-all + + + be.ugent.rml.cli.Main + + + + + false + + + + + *:* + + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + + make-assembly + package + + shade + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.2.2 + + true + false + 1 + false + + + + + + org.codehaus.mojo + buildnumber-maven-plugin + 1.4 + + + buildnumber-generation + validate + + create + + + + + {0,number} + + buildNumber0 + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.13 + true + + ossrh + https://oss.sonatype.org/ + true + + + + + diff --git a/release.sh b/release.sh new file mode 100755 index 00000000..fb082c38 --- /dev/null +++ b/release.sh @@ -0,0 +1,46 @@ +#!/bin/bash +set -e + +TAG=$1 +DEV_BRANCH="development" +RELEASE_BRANCH="master" + +if [ -z "$1" ]; then + echo "Supply release tag as 'X.Y.Z'. For example: ./release.sh 1.0.0" + exit 1 +fi + +# Dependencies and branch +echo "Installing dependencies and branch..." + +if ! changefrog --help > /dev/null; then + npm install -g changefrog > /dev/null +fi +git checkout "$DEV_BRANCH" + +# Update CHANGELOG.md +echo "Updating CHANGELOG.md" +changefrog -n "$TAG" > /dev/null + +# Update project version in pom.xml +mvn versions:set -DnewVersion=$TAG + +# Create release commit +echo "Creating git commit and tag" +git add . +git commit -m "release v$TAG" +git tag "v$TAG" + +# Add release commit to master branch +echo "Rebasing $DEV_BRANCH upon $RELEASE_BRANCH" +git checkout "$RELEASE_BRANCH" +git rebase "$DEV_BRANCH" + +# Push to branches +echo "Pushing branches..." +git push origin "$DEV_BRANCH" +git push origin "$RELEASE_BRANCH" +git push --tags origin "$RELEASE_BRANCH" +git checkout "$DEV_BRANCH" + +echo "Done!" diff --git a/settings.example.xml b/settings.example.xml new file mode 100644 index 00000000..1c0c6ad3 --- /dev/null +++ b/settings.example.xml @@ -0,0 +1,21 @@ + + + + ossrh + jira-username + jira-password + + + + + ossrh + + true + + + gpg + gpg-passphrase + + + + \ No newline at end of file diff --git a/src/main/java/be/ugent/rml/DatabaseType.java b/src/main/java/be/ugent/rml/DatabaseType.java deleted file mode 100644 index ee544dd9..00000000 --- a/src/main/java/be/ugent/rml/DatabaseType.java +++ /dev/null @@ -1,85 +0,0 @@ -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); - } - } -} diff --git a/src/main/java/be/ugent/rml/Executor.java b/src/main/java/be/ugent/rml/Executor.java index 22d6cd25..7abfc8f9 100644 --- a/src/main/java/be/ugent/rml/Executor.java +++ b/src/main/java/be/ugent/rml/Executor.java @@ -1,86 +1,164 @@ package be.ugent.rml; -import be.ugent.rml.functions.FunctionLoader; +import be.ugent.idlab.knows.dataio.access.LocalFileAccess; +import be.ugent.idlab.knows.dataio.access.RemoteFileAccess; +import be.ugent.idlab.knows.dataio.record.Record; +import be.ugent.idlab.knows.functions.agent.Agent; +import be.ugent.knows.idlabFunctions.IDLabFunctions; +import be.ugent.rml.conformer.MappingConformer; import be.ugent.rml.functions.MultipleRecordsFunctionExecutor; import be.ugent.rml.metadata.Metadata; import be.ugent.rml.metadata.MetadataGenerator; -import be.ugent.rml.records.Record; +import be.ugent.rml.records.MarkerRecord; import be.ugent.rml.records.RecordsFactory; -import be.ugent.rml.store.SimpleQuadStore; -import be.ugent.rml.term.ProvenancedQuad; +import be.ugent.rml.store.Quad; import be.ugent.rml.store.QuadStore; -import be.ugent.rml.term.NamedNode; -import be.ugent.rml.term.ProvenancedTerm; -import be.ugent.rml.term.Term; +import be.ugent.rml.store.RDF4JStore; +import be.ugent.rml.term.*; +import be.ugent.rml.termgenerator.TermGenerator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.IOException; +import java.io.InputStream; +import java.nio.file.NoSuchFileException; import java.util.*; -import java.util.function.BiConsumer; public class Executor { private static final Logger logger = LoggerFactory.getLogger(Executor.class); - private Initializer initializer; - private HashMap> recordsHolders; - // this map stores for every Triples Map, which is a Term, a map with the record index and the record's corresponding subject, - // which is a ProvenancedTerm. - private HashMap> subjectCache; - private QuadStore resultingQuads; - private QuadStore rmlStore; - private RecordsFactory recordsFactory; - private static int blankNodeCounter = 0; - private HashMap mappings; - private String baseIRI; - - public Executor(QuadStore rmlStore, RecordsFactory recordsFactory, String baseIRI) throws Exception { - this(rmlStore, recordsFactory, null, null, baseIRI); + private final Initializer initializer; + private final MappingOptimizer mappingOptimizer; + private final Map> recordsHolders = new HashMap<>(); + + /* + * this map stores for every Triples Map, which is a Term, + * a map with the record index and the record's corresponding subject, which is a ProvenancedTerm. + */ + private final Map>> subjectCache; + private final QuadStore resultingQuads; + private final QuadStore rmlStore; + private final Map targetStores; + private final RecordsFactory recordsFactory; + private static int blankNodeCounter; + private final Map mappings; + + /** + * Indicates whether the data to process contains an End-of-File (EOF) marker. + * If it is not provided, it will be automatically inserted when necessary. + * Don't change unless you're generating LDES and know what you're doing! + */ + private boolean EOFProvidedInData = false; + + public Executor(QuadStore rmlStore, RecordsFactory recordsFactory, String baseIRI, StrictMode strictMode, final Agent functionAgent) throws Exception { + this(rmlStore, recordsFactory, null, baseIRI, strictMode, functionAgent); } - public Executor(QuadStore rmlStore, RecordsFactory recordsFactory, FunctionLoader functionLoader, String baseIRI) throws Exception { - this(rmlStore, recordsFactory, functionLoader, null, baseIRI); + /** + * Defaults to best effort operation. For strict mode, + * use {@link Executor#Executor(QuadStore, RecordsFactory, QuadStore, String, StrictMode, Agent)} + */ + public Executor(QuadStore rmlStore, RecordsFactory recordsFactory, QuadStore resultingQuads, String baseIRI, final Agent functionAgent) throws Exception { + this(rmlStore, recordsFactory, resultingQuads, baseIRI, StrictMode.BEST_EFFORT, functionAgent); } - public Executor(QuadStore rmlStore, RecordsFactory recordsFactory, FunctionLoader functionLoader, QuadStore resultingQuads, String baseIRI) throws Exception { - this.initializer = new Initializer(rmlStore, functionLoader); + /** + * Call this if the data to process contains a specific End-of-File (EOF) marker. + * If it is not provided, it will be automatically inserted when necessary. + * Don't change unless you're generating LDES and know what you're doing! + */ + public void setEOFProvidedInData() { + this.EOFProvidedInData = true; + } + + public Executor(QuadStore rmlStore, RecordsFactory recordsFactory, QuadStore resultingQuads, String baseIRI, StrictMode strictMode, final Agent functionAgent) throws Exception { + this(rmlStore, recordsFactory, resultingQuads, baseIRI, strictMode, functionAgent, null); + } + + public Executor(QuadStore rmlStore, RecordsFactory recordsFactory, QuadStore resultingQuads, String baseIRI, StrictMode strictMode, final Agent functionAgent, Map mappingOptions) throws Exception { + // Convert mapping file to RML if needed. + MappingConformer conformer = new MappingConformer(rmlStore, mappingOptions); + + try { + boolean conversionNeeded = conformer.conform(); + + if (conversionNeeded) { + logger.info("Conversion to RML was needed."); + } + } catch (Exception e) { + logger.error("Failed to make mapping file conformant to RML spec.", e); + } + + this.mappingOptimizer = new MappingOptimizer(rmlStore); + this.rmlStore = mappingOptimizer.optimizeMapping(); + this.initializer = new Initializer(this.rmlStore, functionAgent, baseIRI, strictMode); this.mappings = this.initializer.getMappings(); - this.rmlStore = rmlStore; this.recordsFactory = recordsFactory; - this.baseIRI = baseIRI; - this.recordsHolders = new HashMap>(); - this.subjectCache = new HashMap>(); + this.subjectCache = new HashMap<>(); + this.targetStores = new HashMap<>(); + Executor.blankNodeCounter = 0; - if (resultingQuads == null) { - this.resultingQuads = new SimpleQuadStore(); - } else { - this.resultingQuads = resultingQuads; + // Default store if no Targets are available for a triple + this.resultingQuads = Objects.requireNonNullElseGet(resultingQuads, RDF4JStore::new); + + // Output stores for Targets in Term Maps + for (Map.Entry tm: this.mappings.entrySet()) { + Mapping mapping = tm.getValue(); + + // Subject Map + MappingInfo subjectMapInfo = mapping.getSubjectMappingInfo(); + Set targets = new HashSet<>(subjectMapInfo.getTargets()); + + // Predicate, Object and Language Maps + for(PredicateObjectGraphMapping pog: mapping.getPredicateObjectGraphMappings()) { + if(pog.getPredicateMappingInfo() != null) { + targets.addAll(pog.getPredicateMappingInfo().getTargets()); + } + if(pog.getObjectMappingInfo() != null) { + targets.addAll(pog.getObjectMappingInfo().getTargets()); + } + if(pog.getGraphMappingInfo() != null) { + targets.addAll(pog.getGraphMappingInfo().getTargets()); + } + } + + // Graph Map (only subjectGraphMap...) + for(MappingInfo g: mapping.getGraphMappingInfos()) { + targets.addAll(g.getTargets()); + } + + // Create stores + for (Term t: targets) { + logger.debug("Adding target for {}", t); + this.targetStores.put(t, new RDF4JStore()); + } } } - public QuadStore execute(List triplesMaps, boolean removeDuplicates, MetadataGenerator metadataGenerator) throws Exception { + /* + * New public API for the V5.X.X. releases + */ + public Map execute(List triplesMaps, boolean removeDuplicates, MetadataGenerator metadataGenerator) throws Exception { - BiConsumer pogFunction; + POGFunction pogFunction; if (metadataGenerator != null && metadataGenerator.getDetailLevel().getLevel() >= MetadataGenerator.DETAIL_LEVEL.TRIPLE.getLevel()) { - pogFunction = (subject, pog) -> { - generateQuad(subject, pog.getPredicate(), pog.getObject(), pog.getGraph()); - metadataGenerator.insertQuad(new ProvenancedQuad(subject, pog.getPredicate(), pog.getObject(), pog.getGraph())); + pogFunction = (subject, predicate, object, graph, checkEOFMarker) -> { + if (generateQuad(subject, predicate, object, graph , checkEOFMarker)) { + metadataGenerator.insertQuad(new ProvenancedQuad(subject, predicate, object, graph)); + } }; } else { - pogFunction = (subject, pog) -> { - generateQuad(subject, pog.getPredicate(), pog.getObject(), pog.getGraph()); - }; + pogFunction = this::generateQuad; } return executeWithFunction(triplesMaps, removeDuplicates, pogFunction); } - public QuadStore executeWithFunction(List triplesMaps, boolean removeDuplicates, BiConsumer pogFunction) throws Exception { + public Map executeWithFunction(List triplesMaps, boolean removeDuplicates, POGFunction pogFunction) throws Exception { //check if TriplesMaps are provided if (triplesMaps == null || triplesMaps.isEmpty()) { - triplesMaps = this.initializer.getTriplesMaps(); + triplesMaps = this.getTriplesMaps(); } //we execute every mapping @@ -91,65 +169,32 @@ public QuadStore executeWithFunction(List triplesMaps, boolean removeDupli for (int j = 0; j < records.size(); j++) { Record record = records.get(j); - ProvenancedTerm subject = getSubject(triplesMap, mapping, record, j); - - // If we have subject and it's a named node, - // we validate it and make it an absolute IRI if needed. - if (subject != null && subject.getTerm() instanceof NamedNode) { - String iri = subject.getTerm().getValue(); + List subjects = getSubject(triplesMap, mapping, record, j); - // Is the IRI valid? - if (!Utils.isValidIRI(iri)) { - logger.error("The subject \"" + iri + "\" is not a valid IRI. Skipped."); - subject = null; - - // Is the IRI relative? - } else if (Utils.isRelativeIRI(iri)) { - - // Check the base IRI to see if we can use it to turn the IRI into an absolute one. - if (this.baseIRI == null) { - logger.error("The base IRI is null, so relative IRI of subject cannot be turned in to absolute IRI. Skipped."); - subject = null; - } else { - logger.debug("The IRI of subject is made absolute via base IRI."); - iri = this.baseIRI + iri; - - // Check if the new absolute IRI is valid. - if (Utils.isValidIRI(iri)) { - subject = new ProvenancedTerm(new NamedNode(iri), subject.getMetadata()); - } else { - logger.error("The subject \"" + iri + "\" is not a valid IRI. Skipped."); - } - } - } + if (subjects != null) { + generatePredicateObjectsForSubjects(subjects, mapping, record, pogFunction, EOFProvidedInData); } + } - final ProvenancedTerm finalSubject = subject; - - //TODO validate subject or check if blank node - if (subject != null) { - List subjectGraphs = new ArrayList<>(); - - mapping.getGraphMappingInfos().forEach(mappingInfo -> { - List terms = null; - - try { - terms = mappingInfo.getTermGenerator().generate(record); - } catch (Exception e) { - //todo be more nice and gentle - e.printStackTrace(); + if (!EOFProvidedInData) { + // Generate an EOF marker to indicate the end of the data source and run mappings once more (if not provided). + // This is a hack to call implicitDelete a final time, where it then returns the list of deleted records + TermGenerator generator = mapping.getSubjectMappingInfo().getTermGenerator(); + boolean needsEOFMarker = generator.needsEOFMarker(); + if (needsEOFMarker) { + Record record = new MarkerRecord(); + List subjects = new ArrayList<>(); + List nodes = generator.generate(record); + + if (!nodes.isEmpty()) { + List subjectTargets = getAllTargets(mapping.getSubjectMappingInfo(), record); + for (Term node : nodes) { + subjects.add(new ProvenancedTerm(node, null, subjectTargets)); } - - terms.forEach(term -> { - if (!term.equals(new NamedNode(NAMESPACES.RR + "defaultGraph"))) { - subjectGraphs.add(new ProvenancedTerm(term)); - } - }); - }); - - List pogs = this.generatePredicateObjectGraphs(mapping, record, subjectGraphs); - - pogs.forEach(pog -> pogFunction.accept(finalSubject, pog)); + } + // TODO this only works for the constants in the triples map! + // TODO `record` is not really used, we only need to generate a subject here + generatePredicateObjectsForSubjects(subjects, mapping, null, pogFunction, true); } } } @@ -158,84 +203,63 @@ public QuadStore executeWithFunction(List triplesMaps, boolean removeDupli this.resultingQuads.removeDuplicates(); } - return resultingQuads; + // Add the legacy store to the list of targets as well + this.targetStores.put(new NamedNode("rmlmapper://default.store"), this.resultingQuads); + return this.targetStores; } - public QuadStore execute(List triplesMaps) throws Exception { + public Map execute(List triplesMaps) throws Exception { return this.execute(triplesMaps, false, null); } + private boolean generateQuad(ProvenancedTerm subject, ProvenancedTerm predicate, ProvenancedTerm object, ProvenancedTerm graph, boolean checkEOFMarker) { + Term g = null; + Set targets = new HashSet<>(); - private List generatePredicateObjectGraphs(Mapping mapping, Record record, List alreadyNeededGraphs) throws Exception { - ArrayList results = new ArrayList<>(); - - List predicateObjectGraphMappings = mapping.getPredicateObjectGraphMappings(); - - for (PredicateObjectGraphMapping pogMapping : predicateObjectGraphMappings) { - ArrayList predicates = new ArrayList<>(); - ArrayList poGraphs = new ArrayList<>(); - poGraphs.addAll(alreadyNeededGraphs); - - if (pogMapping.getGraphMappingInfo() != null && pogMapping.getGraphMappingInfo().getTermGenerator() != null) { - pogMapping.getGraphMappingInfo().getTermGenerator().generate(record).forEach(term -> { - if (!term.equals(new NamedNode(NAMESPACES.RR + "defaultGraph"))) { - poGraphs.add(new ProvenancedTerm(term)); - } - }); + if (subject != null && predicate != null && object != null) { + if (graph != null) { + g = graph.getTerm(); + targets.addAll(graph.getTargets()); } - pogMapping.getPredicateMappingInfo().getTermGenerator().generate(record).forEach(p -> { - predicates.add(new ProvenancedTerm(p, pogMapping.getPredicateMappingInfo())); - }); - - if (pogMapping.getObjectMappingInfo() != null && pogMapping.getObjectMappingInfo().getTermGenerator() != null) { - List objects = pogMapping.getObjectMappingInfo().getTermGenerator().generate(record); - ArrayList provenancedObjects = new ArrayList<>(); - - objects.forEach(object -> { - provenancedObjects.add(new ProvenancedTerm(object, pogMapping.getObjectMappingInfo())); - }); - - if (objects.size() > 0) { - //add pogs - results.addAll(combineMultiplePOGs(predicates, provenancedObjects, poGraphs)); - } + if (checkEOFMarker) { + if (subject.getTerm().getValue().contains(IDLabFunctions.MAGIC_MARKER) + || subject.getTerm().getValue().contains(IDLabFunctions.MAGIC_MARKER_ENCODED) + || predicate.getTerm().getValue().contains(IDLabFunctions.MAGIC_MARKER) + || predicate.getTerm().getValue().contains(IDLabFunctions.MAGIC_MARKER_ENCODED) + || object.getTerm().getValue().contains(IDLabFunctions.MAGIC_MARKER) + || object.getTerm().getValue().contains(IDLabFunctions.MAGIC_MARKER_ENCODED)) + return false; + + if (g != null && (g.getValue().contains(IDLabFunctions.MAGIC_MARKER) || g.getValue().contains(IDLabFunctions.MAGIC_MARKER_ENCODED))) + return false; + } - //check if we are dealing with a parentTriplesMap (RefObjMap) - } else if (pogMapping.getParentTriplesMap() != null) { - List objects; + // Get all possible targets for triple, the Set guarantees that we don't have duplicates + targets.addAll(subject.getTargets()); + targets.addAll(predicate.getTargets()); + targets.addAll(object.getTargets()); - //check if need to apply a join condition - if (!pogMapping.getJoinConditions().isEmpty()) { - objects = this.getIRIsWithConditions(record, pogMapping.getParentTriplesMap(), pogMapping.getJoinConditions()); - //this.generateTriples(subject, po.getPredicateGenerator(), objects, record, combinedGraphs); - } else { - objects = this.getAllIRIs(pogMapping.getParentTriplesMap()); + // If we have targets, write to them + if (!targets.isEmpty()) { + for (Term t: targets) { + this.targetStores.get(t).addQuad(subject.getTerm(), predicate.getTerm(), object.getTerm(), g); } - - results.addAll(combineMultiplePOGs(predicates, objects, poGraphs)); } - } - - return results; - } - - private void generateQuad(ProvenancedTerm subject, ProvenancedTerm predicate, ProvenancedTerm object, ProvenancedTerm graph) { - Term g = null; + // If not, use the default processor target + else { + this.resultingQuads.addQuad(subject.getTerm(), predicate.getTerm(), object.getTerm(), g); + } - if (graph != null) { - g = graph.getTerm(); + return true; } - - if (subject != null && predicate != null & object != null) { - this.resultingQuads.addQuad(subject.getTerm(), predicate.getTerm(), object.getTerm(), g); - } + return false; } private List getIRIsWithConditions(Record record, Term triplesMap, List conditions) throws Exception { - ArrayList goodIRIs = new ArrayList(); - ArrayList> allIRIs = new ArrayList>(); + List goodIRIs = new ArrayList<>(); + List> allIRIs = new ArrayList<>(); for (MultipleRecordsFunctionExecutor condition : conditions) { allIRIs.add(this.getIRIsWithTrueCondition(record, triplesMap, condition)); @@ -265,22 +289,21 @@ private List getIRIsWithTrueCondition(Record child, Term triple //iterator over all the records corresponding with @triplesMap List records = this.getRecords(triplesMap); //this array contains all the IRIs that are valid regarding @path and @values - ArrayList iris = new ArrayList(); + List iris = new ArrayList<>(); for (int i = 0; i < records.size(); i++) { Record parent = records.get(i); - HashMap recordsMap = new HashMap<>(); + Map recordsMap = new HashMap<>(); recordsMap.put("child", child); recordsMap.put("parent", parent); Object expectedBoolean = condition.execute(recordsMap); - if (expectedBoolean instanceof Boolean) { - if ((boolean) expectedBoolean) { - ProvenancedTerm subject = this.getSubject(triplesMap, mapping, parent, i); - iris.add(subject); - } + if (Boolean.TRUE.equals(expectedBoolean)) { + List subjects = this.getSubject(triplesMap, mapping, parent, i); + if (subjects != null) + iris.addAll(subjects); } else { logger.warn("The used condition with the Parent Triples Map does not return a boolean."); } @@ -289,17 +312,26 @@ private List getIRIsWithTrueCondition(Record child, Term triple return iris; } - private ProvenancedTerm getSubject(Term triplesMap, Mapping mapping, Record record, int i) throws Exception { + private List getSubject(Term triplesMap, Mapping mapping, Record record, int i) throws Exception { if (!this.subjectCache.containsKey(triplesMap)) { - this.subjectCache.put(triplesMap, new HashMap()); + this.subjectCache.put(triplesMap, new HashMap<>()); } if (!this.subjectCache.get(triplesMap).containsKey(i)) { - List nodes = mapping.getSubjectMappingInfo().getTermGenerator().generate(record); + TermGenerator generator = mapping.getSubjectMappingInfo().getTermGenerator(); + List nodes = generator.generate(record); if (!nodes.isEmpty()) { - //todo: only create metadata when it's required - this.subjectCache.get(triplesMap).put(i, new ProvenancedTerm(nodes.get(0), new Metadata(triplesMap, mapping.getSubjectMappingInfo().getTerm()))); + List subjectTargets = getAllTargets(mapping.getSubjectMappingInfo(), record); + List terms = new ArrayList<>(); + Metadata meta = new Metadata(triplesMap, mapping.getSubjectMappingInfo().getTerm()); + + // TODO: only create metadata when it's required + for (Term node : nodes) { + terms.add(new ProvenancedTerm(node, meta, subjectTargets)); + } + this.subjectCache.get(triplesMap).put(i, terms); + return terms; } } @@ -310,19 +342,19 @@ private List getAllIRIs(Term triplesMap) throws Exception { Mapping mapping = this.mappings.get(triplesMap); List records = getRecords(triplesMap); - ArrayList iris = new ArrayList(); + List iris = new ArrayList<>(); for (int i = 0; i < records.size(); i++) { Record record = records.get(i); - ProvenancedTerm subject = getSubject(triplesMap, mapping, record, i); - - iris.add(subject); + List subjects = getSubject(triplesMap, mapping, record, i); + if (subjects != null) + iris.addAll(subjects); } return iris; } - private List getRecords(Term triplesMap) throws IOException { + private List getRecords(Term triplesMap) throws Exception { if (!this.recordsHolders.containsKey(triplesMap)) { this.recordsHolders.put(triplesMap, this.recordsFactory.createRecords(triplesMap, this.rmlStore)); } @@ -330,24 +362,26 @@ private List getRecords(Term triplesMap) throws IOException { return this.recordsHolders.get(triplesMap); } - public FunctionLoader getFunctionLoader() { - return this.initializer.getFunctionLoader(); - } - private List combineMultiplePOGs(List predicates, List objects, List graphs) { - ArrayList results = new ArrayList<>(); + List results = new ArrayList<>(); if (graphs.isEmpty()) { graphs.add(null); } - predicates.forEach(p -> { - objects.forEach(o -> { - graphs.forEach(g -> { - results.add(new PredicateObjectGraph(p, o, g)); - }); - }); - }); + predicates.forEach( + p -> objects.forEach( + o -> graphs.forEach( + g -> { + if (g != null && g.getTerm().equals(new NamedNode(NAMESPACES.RML2 + "defaultGraph"))) { + results.add(new PredicateObjectGraph(p, o, null)); + } else { + results.add(new PredicateObjectGraph(p, o, g)); + } + } + ) + ) + ); return results; } @@ -360,6 +394,182 @@ public static String getNewBlankNodeID() { } public List getTriplesMaps() { - return initializer.getTriplesMaps(); + List withSubjectMaps = rmlStore.getQuads(null, new NamedNode(NAMESPACES.RML2 + "subjectMap"), null); + + return withSubjectMaps.stream() + .map(Quad::getSubject) + .filter(subject -> rmlStore.contains(subject, new NamedNode(NAMESPACES.RML2 + "logicalSource"), null)).toList(); + } + + public QuadStore getRMLStore() { + return this.rmlStore; + } + + public Map getTargets(){ + if (this.targetStores.isEmpty()){ + return null; + } + return this.targetStores; + } + + public void verifySources(String basepath, String mappingPath) throws Exception { + for (Term triplesMap : this.getTriplesMaps()) { + List logicalSources = Utils.getObjectsFromQuads(rmlStore.getQuads(triplesMap, new NamedNode(NAMESPACES.RML2 + "logicalSource"), null)); + Term logicalSource = logicalSources.get(0); + List sources = Utils.getObjectsFromQuads(rmlStore.getQuads(logicalSource, new NamedNode(NAMESPACES.RML2 + "source"), null)); + for (Term source : sources) { + String value = source.getValue(); + if (source instanceof Literal) { + InputStream is; + if (Utils.isRemoteFile(value)) { + is = new RemoteFileAccess(value).getInputStream(); + } else { + try { + is = new LocalFileAccess(value, basepath, ((Literal) source).getDatatype().stringValue()).getInputStream(); + } catch (NoSuchFileException e) { + is = new LocalFileAccess(value, mappingPath, ((Literal) source).getDatatype().stringValue()).getInputStream(); + } + } + is.close(); // close resources. + } + } + } } -} \ No newline at end of file + + private void generatePredicateObjectsForSubjects(final List subjects, + final Mapping mapping, + final Record record, + final POGFunction pogFunction, + final boolean checkEOFMarker) throws Exception { + for (ProvenancedTerm subject: subjects) { + //TODO validate subject or check if blank node + if (subject != null) { + List subjectGraphs = new ArrayList<>(); + + mapping.getGraphMappingInfos().forEach(mappingInfo -> { + List terms = null; + + try { + terms = mappingInfo.getTermGenerator().generate(record); + } catch (Exception e) { + //todo be more nice and gentle + logger.error("Could not generate graph term for record {}", record, e); + } + + if (terms != null) { + terms.forEach(term -> { + if (!term.equals(new NamedNode(NAMESPACES.RML2 + "defaultGraph"))) { + List subjectGraphTargets = getAllTargets(mappingInfo, record); + subjectGraphs.add(new ProvenancedTerm(term, null, subjectGraphTargets)); + } + }); + } + }); + + List pogs = new ArrayList<>(); + List predicateObjectGraphMappings = mapping.getPredicateObjectGraphMappings(); + + for (PredicateObjectGraphMapping pogMapping : predicateObjectGraphMappings) { + ArrayList predicates = new ArrayList<>(); + MappingInfo pogGraphMappingInfo = pogMapping.getGraphMappingInfo(); + MappingInfo pogPredicateMappingInfo = pogMapping.getPredicateMappingInfo(); + MappingInfo pogObjectMappingInfo = pogMapping.getObjectMappingInfo(); + + ArrayList poGraphs = new ArrayList<>(subjectGraphs); + + if (pogGraphMappingInfo != null) { + TermGenerator pogGraphGenerator = pogGraphMappingInfo.getTermGenerator(); + if (pogGraphGenerator != null) { + pogGraphGenerator.generate(record).forEach(term -> { + List graphTargets = getAllTargets(pogGraphMappingInfo, record); + poGraphs.add(new ProvenancedTerm(term, null, graphTargets)); + }); + } + } + + /* Predicates */ + if (pogPredicateMappingInfo != null) { + TermGenerator pogPredicateGenerator = pogPredicateMappingInfo.getTermGenerator(); + List predicateTargets = getAllTargets(pogPredicateMappingInfo, record); + pogPredicateGenerator.generate(record).forEach(p -> { + Metadata meta = new ProvenancedTerm(p, pogPredicateMappingInfo).getMetadata(); + predicates.add(new ProvenancedTerm(p, meta, predicateTargets)); + }); + } + + /* Objects */ + if (pogObjectMappingInfo != null) { + TermGenerator pogObjectGenerator = pogObjectMappingInfo.getTermGenerator(); + if (pogObjectGenerator != null) { + List objects = pogObjectGenerator.generate(record); + List objectTargets = getAllTargets(pogObjectMappingInfo, record); + List provenancedObjects = new ArrayList<>(); + objects.forEach(object -> { + Metadata meta = new ProvenancedTerm(object, pogObjectMappingInfo).getMetadata(); + provenancedObjects.add(new ProvenancedTerm(object, meta, objectTargets)); + }); + + if (!objects.isEmpty()) { + //add pogs + pogs.addAll(combineMultiplePOGs(predicates, provenancedObjects, poGraphs)); + } + } + + //check if we are dealing with a parentTriplesMap (RefObjMap) + } else if (pogMapping.getParentTriplesMap() != null) { + List objects; + + //check if need to apply a join condition + if (!pogMapping.getJoinConditions().isEmpty()) { + logger.debug("mapping {}'s join conditions are not empty", pogMapping.toString()); + objects = this.getIRIsWithConditions(record, pogMapping.getParentTriplesMap(), pogMapping.getJoinConditions()); + //this.generateTriples(subject, po.getPredicateGenerator(), objects, record, combinedGraphs); + } else { + logger.debug("mapping {}'s join conditions are empty", pogMapping.toString()); + objects = this.getAllIRIs(pogMapping.getParentTriplesMap()); + } + + // Remove targets from objects because they come from another triples map! + // They need to be "cloned" because they are terms that might be cached to use as subject, + // in which case the targets must NOT be removed. + final List objectsWithoutTargets = objects.stream().map(provenancedTerm -> { + List noTargets = Collections.emptyList(); + return new ProvenancedTerm( + provenancedTerm.getTerm(), provenancedTerm.getMetadata(), noTargets); + }).toList(); + + pogs.addAll(combineMultiplePOGs(predicates, objectsWithoutTargets, poGraphs)); + } + } + + pogs.forEach(pog -> pogFunction.generateQuad(subject, pog.getPredicate(), pog.getObject(), pog.getGraph(), checkEOFMarker)); + } + } + } + + private List getAllTargets(MappingInfo mappingInfo, Record record) { + List allTargets = new ArrayList<>(); + allTargets.addAll(generateTargetsAndAddToTargetStore(mappingInfo, record)); + allTargets.addAll(mappingInfo.getTargets()); + return allTargets; + } + + private List generateTargetsAndAddToTargetStore(MappingInfo mappingInfo, Record record) { + List targetGenerators = mappingInfo.getTargetGenerators(); + List generatedTargets = new ArrayList<>(); + for (TermGenerator targetGenerator : targetGenerators) { + try { + generatedTargets.addAll(targetGenerator.generate(record)); + } catch (Exception e) { + logger.error("Error occurred when generating target", e); + } + } + for (Term generatedTarget : generatedTargets){ + if(!targetStores.containsKey(generatedTarget)){ + targetStores.put(generatedTarget, new RDF4JStore()); + } + } + return generatedTargets; + } + +} diff --git a/src/main/java/be/ugent/rml/Initializer.java b/src/main/java/be/ugent/rml/Initializer.java index 6ee162b4..b5c4ab0c 100644 --- a/src/main/java/be/ugent/rml/Initializer.java +++ b/src/main/java/be/ugent/rml/Initializer.java @@ -1,35 +1,47 @@ package be.ugent.rml; -import be.ugent.rml.functions.FunctionLoader; +import be.ugent.idlab.knows.functions.agent.Agent; +import be.ugent.idlab.knows.functions.agent.AgentFactory; +import be.ugent.rml.store.Quad; import be.ugent.rml.store.QuadStore; import be.ugent.rml.term.NamedNode; import be.ugent.rml.term.Term; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +/** + * + */ public class Initializer { private final MappingFactory factory; - private QuadStore rmlStore; - private FunctionLoader functionLoader; - private List triplesMaps; - private HashMap mappings; + private final QuadStore rmlStore; + private final List triplesMaps; + private final Map mappings; - public Initializer(QuadStore rmlStore, FunctionLoader functionLoader) throws Exception { + public Initializer(final QuadStore rmlStore, final Agent functionAgent, final String baseIRI, final StrictMode strictMode) throws Exception { this.rmlStore = rmlStore; //we get all the TriplesMaps from the mapping - this.triplesMaps = this.getAllTriplesMaps(); - this.mappings = new HashMap(); + List subjectMapQuads = rmlStore.getQuads(null, new NamedNode(NAMESPACES.RML2 + "subjectMap"), null); + subjectMapQuads.addAll(rmlStore.getQuads(null, new NamedNode(NAMESPACES.RML2 + "subject"), null)); - if (functionLoader == null) { - this.functionLoader = new FunctionLoader(); - } else { - this.functionLoader = functionLoader; - } + this.triplesMaps = subjectMapQuads.stream().map(Quad::getSubject).collect(Collectors.toList()); + + this.mappings = new HashMap<>(); + + + final Agent initialisedFunctionAgent = functionAgent == null ? + AgentFactory.createFromFnO("fno/functions_idlab.ttl", + "fno/functions_idlab_classes_java_mapping.ttl", + "fno_idlab_old/functions_idlab.ttl", "fno_idlab_old/functions_idlab_classes_java_mapping.ttl", + "functions_grel.ttl", + "grel_java_mapping.ttl") + : functionAgent; - this.factory = new MappingFactory(this.functionLoader); + this.factory = new MappingFactory(initialisedFunctionAgent, baseIRI, strictMode); extractMappings(); } @@ -39,36 +51,7 @@ private void extractMappings() throws Exception { } } - private List getAllTriplesMaps() { - List maps = Utils.getSubjectsFromQuads(this.rmlStore.getQuads(null, new NamedNode(NAMESPACES.RML + "logicalSource"), null)); - - //filter outer Triples Maps that are used for functions - ArrayList temp = new ArrayList<>(); - - for(Term map: maps) { - if (this.rmlStore.getQuads(null, new NamedNode(NAMESPACES.FNML + "functionValue"), map).isEmpty()) { - temp.add(map); - } - } - - maps = temp; - - if (maps.isEmpty()) { - throw new Error("No Triples Maps found. The mapping document you should at least have one Triples Map."); - } else { - return maps; - } - } - - public HashMap getMappings() { + public Map getMappings() { return this.mappings; } - - public List getTriplesMaps() { - return this.triplesMaps; - } - - public FunctionLoader getFunctionLoader() { - return this.functionLoader; - } } diff --git a/src/main/java/be/ugent/rml/MappingFactory.java b/src/main/java/be/ugent/rml/MappingFactory.java index 0ad1fd97..fe7631d2 100644 --- a/src/main/java/be/ugent/rml/MappingFactory.java +++ b/src/main/java/be/ugent/rml/MappingFactory.java @@ -1,8 +1,11 @@ package be.ugent.rml; +import be.ugent.idlab.knows.functions.agent.Agent; import be.ugent.rml.extractor.ConstantExtractor; +import be.ugent.rml.extractor.HashExtractor; import be.ugent.rml.extractor.ReferenceExtractor; import be.ugent.rml.functions.*; +import be.ugent.rml.store.Quad; import be.ugent.rml.store.QuadStore; import be.ugent.rml.term.Literal; import be.ugent.rml.term.NamedNode; @@ -21,19 +24,37 @@ import java.util.Map; import java.util.function.BiConsumer; +import static be.ugent.rml.Utils.getObjectsFromQuads; import static be.ugent.rml.Utils.isValidrrLanguage; public class MappingFactory { - private final FunctionLoader functionLoader; + private final Agent functionAgent; private MappingInfo subjectMappingInfo; private List graphMappingInfos; private Term triplesMap; private QuadStore store; private List predicateObjectGraphMappings; + // This boolean is true when the double in a reference need to be ignored. + // For example, when accessing data in a RDB. + private boolean ignoreDoubleQuotes; + + // Base IRI to prepend to a relative IRI to make it absolute. + private final String baseIRI; + + // check on logical source is need on more than one place, so better store it + private Term logicalSource; + + // StrictMode determines RMLMapper's behaviour when an IRI for a NamedNode is invalid. + // If set to BEST_EFFORT, RMLMapper will not generate a NamedNode and go on. + // If set to STRICT, RMLMapper will stop execution with an exception. + private final StrictMode strictMode; + protected Logger logger = LoggerFactory.getLogger(this.getClass()); - public MappingFactory(FunctionLoader functionLoader) { - this.functionLoader = functionLoader; + public MappingFactory(final Agent functionAgent, final String baseIRI, final StrictMode strictMode) { + this.functionAgent = functionAgent; + this.baseIRI = baseIRI; + this.strictMode = strictMode; } public Mapping createMapping(Term triplesMap, QuadStore store) throws Exception { @@ -42,20 +63,28 @@ public Mapping createMapping(Term triplesMap, QuadStore store) throws Exception this.subjectMappingInfo = null; this.predicateObjectGraphMappings = new ArrayList<>(); this.graphMappingInfos = null; + this.ignoreDoubleQuotes = this.areDoubleQuotesIgnored(store, triplesMap); + String triplesMapBaseIRI = this.baseIRI; + + /* Override base IRI if specified by the rml:baseIRI predicate in a RML TriplesMap */ + if (!this.store.getQuads(triplesMap, new NamedNode(NAMESPACES.RML2 + "baseIRI"), null).isEmpty()) { + triplesMapBaseIRI = this.store.getQuads(triplesMap, new NamedNode(NAMESPACES.RML2 + "baseIRI"), null).get(0).getObject().getValue(); + } - parseSubjectMap(); - parsePredicateObjectMaps(); - graphMappingInfos = parseGraphMapsAndShortcuts(subjectMappingInfo.getTerm()); + parseSubjectMap(triplesMapBaseIRI); + parsePredicateObjectMaps(triplesMapBaseIRI); + graphMappingInfos = parseGraphMapsAndShortcuts(subjectMappingInfo.getTerm(), triplesMapBaseIRI); //return the mapping return new Mapping(subjectMappingInfo, predicateObjectGraphMappings, graphMappingInfos); } - private void parseSubjectMap() throws Exception { + private void parseSubjectMap(String triplesMapBaseIRI) throws Exception { if (this.subjectMappingInfo == null) { TermGenerator generator; - List subjectmaps = Utils.getObjectsFromQuads(store.getQuads(triplesMap, new NamedNode(NAMESPACES.RR + "subjectMap"), null)); + List subjectmaps = getObjectsFromQuads(store.getQuads(triplesMap, new NamedNode(NAMESPACES.RML2 + "subject"), null)); + subjectmaps.addAll(getObjectsFromQuads(store.getQuads(triplesMap, new NamedNode(NAMESPACES.RML2 + "subjectMap"), null))); if (!subjectmaps.isEmpty()) { if (subjectmaps.size() > 1) { @@ -63,14 +92,19 @@ private void parseSubjectMap() throws Exception { } Term subjectmap = subjectmaps.get(0); - List functionValues = Utils.getObjectsFromQuads(store.getQuads(subjectmap, new NamedNode(NAMESPACES.FNML + "functionValue"), null)); + List functionValues = getObjectsFromQuads(store.getQuads(subjectmap, new NamedNode(NAMESPACES.FNML + "functionValue"), null)); + List termTypes = getObjectsFromQuads(store.getQuads(subjectmap, new NamedNode(NAMESPACES.RML2 + "termType"), null)); - if (functionValues.isEmpty()) { - List termTypes = Utils.getObjectsFromQuads(store.getQuads(subjectmap, new NamedNode(NAMESPACES.RR + "termType"), null)); + if (termTypes.contains(new NamedNode(NAMESPACES.RML2 + "Literal"))) { + throw new Exception(triplesMap + " is a Literal Term Map. Accepted term types for Subject Maps are: IRI, Blank Node"); + } + boolean isBlankNode = !termTypes.isEmpty() && termTypes.get(0).equals(new NamedNode(NAMESPACES.RML2 + "BlankNode")); + + if (functionValues.isEmpty()) { //checking if we are dealing with a Blank Node as subject - if (!termTypes.isEmpty() && termTypes.get(0).equals(new NamedNode(NAMESPACES.RR + "BlankNode"))) { - SingleRecordFunctionExecutor executor = RecordFunctionExecutorFactory.generate(store, subjectmap, true); + if (isBlankNode) { + SingleRecordFunctionExecutor executor = RecordFunctionExecutorFactory.generate(store, subjectmap, true, ignoreDoubleQuotes, strictMode.equals(StrictMode.STRICT)); if (executor != null) { generator = new BlankNodeGenerator(executor); @@ -79,30 +113,39 @@ private void parseSubjectMap() throws Exception { } } else { //we are not dealing with a Blank Node, so we create the template - generator = new NamedNodeGenerator(RecordFunctionExecutorFactory.generate(store, subjectmap, true)); + generator = new NamedNodeGenerator(RecordFunctionExecutorFactory.generate(store, subjectmap, true, ignoreDoubleQuotes, strictMode.equals(StrictMode.STRICT)), triplesMapBaseIRI, strictMode); } } else { - SingleRecordFunctionExecutor functionExecutor = parseFunctionTermMap(functionValues.get(0)); + SingleRecordFunctionExecutor functionExecutor = parseFunctionTermMap(functionValues.get(0), triplesMapBaseIRI); - generator = new NamedNodeGenerator(functionExecutor); + if (isBlankNode) { + generator = new BlankNodeGenerator(functionExecutor); + } else { + generator = new NamedNodeGenerator(functionExecutor, triplesMapBaseIRI, strictMode); + } } - this.subjectMappingInfo = new MappingInfo(subjectmap, generator); + // get targets for subject + // get Target Generators for subject + List targets = getTargets(subjectmap); + List targetGenerators = getTargetGenerators(subjectmap, strictMode, triplesMapBaseIRI); + this.subjectMappingInfo = new MappingInfo(subjectmap, generator, targets, targetGenerators); //get classes - List classes = Utils.getObjectsFromQuads(store.getQuads(subjectmap, new NamedNode(NAMESPACES.RR + "class"), null)); + List classes = getObjectsFromQuads(store.getQuads(subjectmap, new NamedNode(NAMESPACES.RML2 + "class"), null)); //we create predicateobjects for the classes for (Term c : classes) { - // Don't put in graph for rr:class, subject is already put in graph, otherwise double export - NamedNodeGenerator predicateGenerator = new NamedNodeGenerator(new ConstantExtractor(NAMESPACES.RDF + "type")); - NamedNodeGenerator objectGenerator = new NamedNodeGenerator(new ConstantExtractor(c.getValue())); + /* + * Don't put in graph for rr:class, subject is already put in graph, otherwise double export. + * Same holds for targets, the rdf:type triple will be exported to the subject target already. + */ + NamedNodeGenerator predicateGenerator = new NamedNodeGenerator(new ConstantExtractor(NAMESPACES.RDF + "type"), triplesMapBaseIRI, strictMode); + NamedNodeGenerator objectGenerator = new NamedNodeGenerator(new ConstantExtractor(c.getValue()), triplesMapBaseIRI, strictMode); predicateObjectGraphMappings.add(new PredicateObjectGraphMapping( new MappingInfo(subjectmap, predicateGenerator), new MappingInfo(subjectmap, objectGenerator), - null)); - - + null, null)); } } else { throw new Exception(triplesMap + " has no Subject Map. Each Triples Map should have exactly one Subject Map."); @@ -110,31 +153,33 @@ private void parseSubjectMap() throws Exception { } } - private void parsePredicateObjectMaps() throws IOException { - List predicateobjectmaps = Utils.getObjectsFromQuads(store.getQuads(triplesMap, new NamedNode(NAMESPACES.RR + "predicateObjectMap"), null)); + private void parsePredicateObjectMaps(String triplesMapBaseIRI) throws Exception { + List predicateobjectmaps = getObjectsFromQuads(store.getQuads(triplesMap, new NamedNode(NAMESPACES.RML2 + "predicateObjectMap"), null)); for (Term pom : predicateobjectmaps) { - List predicateMappingInfos = parsePredicateMapsAndShortcuts(pom); - List graphMappingInfos = parseGraphMapsAndShortcuts(pom); + List predicateMappingInfos = parsePredicateMapsAndShortcuts(pom, triplesMapBaseIRI); + List graphMappingInfos = parseGraphMapsAndShortcuts(pom, triplesMapBaseIRI); - parseObjectMapsAndShortcutsAndGeneratePOGGenerators(pom, predicateMappingInfos, graphMappingInfos); + parseObjectMapsAndShortcutsAndGeneratePOGGenerators(pom, predicateMappingInfos, graphMappingInfos, triplesMapBaseIRI); } } - private void parseObjectMapsAndShortcutsAndGeneratePOGGenerators(Term termMap, List predicateMappingInfos, List graphMappingInfos) throws IOException { + private void parseObjectMapsAndShortcutsAndGeneratePOGGenerators(Term termMap, List predicateMappingInfos, List graphMappingInfos, String triplesMapBaseIRI) throws IOException { parseObjectMapsAndShortcutsWithCallback(termMap, (oMappingInfo, childOrParent) -> { + MappingInfo lMappingInfo = parseLanguageMappingInfo(oMappingInfo.getTerm(), triplesMapBaseIRI); + predicateMappingInfos.forEach(pMappingInfo -> { if (graphMappingInfos.isEmpty()) { - predicateObjectGraphMappings.add(new PredicateObjectGraphMapping(pMappingInfo, oMappingInfo, null)); + predicateObjectGraphMappings.add(new PredicateObjectGraphMapping(pMappingInfo, oMappingInfo, null, lMappingInfo)); } else { graphMappingInfos.forEach(gMappingInfo -> { - predicateObjectGraphMappings.add(new PredicateObjectGraphMapping(pMappingInfo, oMappingInfo, gMappingInfo)); + predicateObjectGraphMappings.add(new PredicateObjectGraphMapping(pMappingInfo, oMappingInfo, gMappingInfo, lMappingInfo)); }); } }); }, (parentTriplesMap, joinConditionFunctionExecutors) -> { predicateMappingInfos.forEach(pMappingInfo -> { - List pos = getPredicateObjectGraphMappingFromMultipleGraphMappingInfos(pMappingInfo, null, graphMappingInfos); + List pos = getPredicateObjectGraphMappingFromMultipleGraphMappingInfos(pMappingInfo, null, graphMappingInfos, triplesMapBaseIRI); pos.forEach(pogMappingInfo -> { pogMappingInfo.setParentTriplesMap(parentTriplesMap); @@ -146,51 +191,61 @@ private void parseObjectMapsAndShortcutsAndGeneratePOGGenerators(Term termMap, L predicateObjectGraphMappings.add(pogMappingInfo); }); }); - }); + }, triplesMapBaseIRI); } - private void parseObjectMapsAndShortcutsWithCallback(Term termMap, BiConsumer objectMapCallback, BiConsumer> refObjectMapCallback) throws IOException { - List objectmaps = Utils.getObjectsFromQuads(store.getQuads(termMap, new NamedNode(NAMESPACES.RR + "objectMap"), null)); + private void parseObjectMapsAndShortcutsWithCallback(Term termMap, BiConsumer objectMapCallback, BiConsumer> refObjectMapCallback, String triplesMapBaseIRI) throws IOException { + List objectmaps = getObjectsFromQuads(store.getQuads(termMap, new NamedNode(NAMESPACES.RML2 + "objectMap"), null)); for (Term objectmap : objectmaps) { - parseObjectMapWithCallback(objectmap, objectMapCallback, refObjectMapCallback); + parseObjectMapWithCallback(objectmap, objectMapCallback, refObjectMapCallback, triplesMapBaseIRI); } //dealing with rr:object - List objectsConstants = Utils.getObjectsFromQuads(store.getQuads(termMap, new NamedNode(NAMESPACES.RR + "object"), null)); + List objectsConstants = getObjectsFromQuads(store.getQuads(termMap, new NamedNode(NAMESPACES.RML2 + "object"), null)); for (Term o : objectsConstants) { TermGenerator gen; SingleRecordFunctionExecutor fn = new ConstantExtractor(o.getValue()); if (o instanceof Literal) { - gen = new LiteralGenerator(fn); + if (((Literal) o).getDatatype() != null) { + Term datatype = new NamedNode(((Literal) o).getDatatype().toString()); + gen = new LiteralGenerator(fn, datatype); + } else if (((Literal) o).getLanguage().isPresent()) { + SingleRecordFunctionExecutor executor = new ConstantExtractor(((Literal) o).getLanguage().get()); + gen = new LiteralGenerator(fn, executor); + } else { + gen = new LiteralGenerator(fn); + } + } else { - gen = new NamedNodeGenerator(fn); + gen = new NamedNodeGenerator(fn, triplesMapBaseIRI, strictMode); } + // rr:object shortcut can never have targets objectMapCallback.accept(new MappingInfo(termMap, gen), "child"); } } - private void parseObjectMapWithCallback(Term objectmap, BiConsumer objectMapCallback, BiConsumer> refObjectMapCallback) throws IOException { - List functionValues = Utils.getObjectsFromQuads(store.getQuads(objectmap, new NamedNode(NAMESPACES.FNML + "functionValue"), null)); + private void parseObjectMapWithCallback(Term objectmap, BiConsumer objectMapCallback, BiConsumer> refObjectMapCallback, String triplesMapBaseIRI) throws IOException { + List functionValues = getObjectsFromQuads(store.getQuads(objectmap, new NamedNode(NAMESPACES.FNML + "functionValue"), null)); Term termType = getTermType(objectmap, true); - List datatypes = Utils.getObjectsFromQuads(store.getQuads(objectmap, new NamedNode(NAMESPACES.RR + "datatype"), null)); - List parentTriplesMaps = Utils.getObjectsFromQuads(store.getQuads(objectmap, new NamedNode(NAMESPACES.RR + "parentTriplesMap"), null)); - List parentTermMaps = Utils.getObjectsFromQuads(store.getQuads(objectmap, new NamedNode(NAMESPACES.RML + "parentTermMap"), null)); + List datatypes = getObjectsFromQuads(store.getQuads(objectmap, new NamedNode(NAMESPACES.RML2 + "datatype"), null)); + List parentTriplesMaps = getObjectsFromQuads(store.getQuads(objectmap, new NamedNode(NAMESPACES.RML2 + "parentTriplesMap"), null)); + List parentTermMaps = getObjectsFromQuads(store.getQuads(objectmap, new NamedNode(NAMESPACES.RML2 + "parentTermMap"), null)); - List languages = getLanguageExecutorsForObjectMap(objectmap); + List languages = getLanguageExecutorsForObjectMap(objectmap, triplesMapBaseIRI); if (functionValues.isEmpty()) { - boolean encodeIRI = termType != null && termType.getValue().equals(NAMESPACES.RR + "IRI"); - SingleRecordFunctionExecutor executor = RecordFunctionExecutorFactory.generate(store, objectmap, encodeIRI); + boolean encodeIRI = termType != null && termType.getValue().equals(NAMESPACES.RML2 + "IRI"); + SingleRecordFunctionExecutor executor = RecordFunctionExecutorFactory.generate(store, objectmap, encodeIRI, ignoreDoubleQuotes, strictMode.equals(StrictMode.STRICT)); - if (executor != null) { + if (parentTriplesMaps.isEmpty() && parentTermMaps.isEmpty()) { TermGenerator oGen; - if (termType.equals(new NamedNode(NAMESPACES.RR + "Literal"))) { + if (termType.equals(new NamedNode(NAMESPACES.RML2 + "Literal"))) { //check if we need to apply a datatype to the object if (!datatypes.isEmpty()) { oGen = new LiteralGenerator(executor, datatypes.get(0)); @@ -200,68 +255,97 @@ private void parseObjectMapWithCallback(Term objectmap, BiConsumer languageMaps = getObjectsFromQuads(store.getQuads(objectmap, new NamedNode(NAMESPACES.RML2 + "languageMap"), null)); + + // get targets and targetGenerators for object map + List oTargets = getTargets(objectmap); + List oTargetGenerators = getTargetGenerators(objectmap, strictMode, triplesMapBaseIRI); + + objectMapCallback.accept(new MappingInfo(objectmap, oGen, oTargets, oTargetGenerators), "child"); } else if (!parentTriplesMaps.isEmpty()) { if (parentTriplesMaps.size() > 1) { - logger.warn(triplesMap + " has " + parentTriplesMaps.size() + " Parent Triples Maps. You can only have one. A random one is taken."); + logger.warn("{} has {} Parent Triples Maps. You can only have one. A random one is taken.", triplesMap, parentTriplesMaps.size()); } Term parentTriplesMap = parentTriplesMaps.get(0); - List rrJoinConditions = Utils.getObjectsFromQuads(store.getQuads(objectmap, new NamedNode(NAMESPACES.RR + "joinCondition"), null)); - List rmljoinConditions = Utils.getObjectsFromQuads(store.getQuads(objectmap, new NamedNode(NAMESPACES.RML + "joinCondition"), null)); - ArrayList joinConditionFunctionExecutors = new ArrayList<>(); + List rmljoinConditions = getObjectsFromQuads(store.getQuads(objectmap, new NamedNode(NAMESPACES.RML + "joinCondition"), null)); + List joinConditionFunctionExecutors = new ArrayList<>(); + + List joinConditions = getObjectsFromQuads(store.getQuads(objectmap, new NamedNode(NAMESPACES.RML2 + "joinCondition"), null)); - for (Term joinCondition : rrJoinConditions) { + for (Term joinCondition : joinConditions) { - List parents = Utils.getLiteralObjectsFromQuads(store.getQuads(joinCondition, new NamedNode(NAMESPACES.RR + "parent"), null)); - List childs = Utils.getLiteralObjectsFromQuads(store.getQuads(joinCondition, new NamedNode(NAMESPACES.RR + "child"), null)); + List parents = Utils.getLiteralObjectsFromQuads(store.getQuads(joinCondition, new NamedNode(NAMESPACES.RML2 + "parent"), null)); + List childs = Utils.getLiteralObjectsFromQuads(store.getQuads(joinCondition, new NamedNode(NAMESPACES.RML2 + "child"), null)); if (parents.isEmpty()) { throw new Error("One of the join conditions of " + triplesMap + " is missing rr:parent."); } else if (childs.isEmpty()) { throw new Error("One of the join conditions of " + triplesMap + " is missing rr:child."); } else { - FunctionModel equal = functionLoader.getFunction(new NamedNode("http://example.com/idlab/function/equal")); Map parameters = new HashMap<>(); - SingleRecordFunctionExecutor parent = new ReferenceExtractor(parents.get(0)); + boolean ignoreDoubleQuotesInParent = this.areDoubleQuotesIgnored(store, parentTriplesMap); + SingleRecordFunctionExecutor parent = new ReferenceExtractor(parents.get(0), ignoreDoubleQuotesInParent, strictMode.equals(StrictMode.STRICT)); Object[] detailsParent = {"parent", parent}; parameters.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParameter", detailsParent); - SingleRecordFunctionExecutor child = new ReferenceExtractor(childs.get(0)); + SingleRecordFunctionExecutor child = new ReferenceExtractor(childs.get(0), ignoreDoubleQuotes, strictMode.equals(StrictMode.STRICT)); Object[] detailsChild = {"child", child}; parameters.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParameter2", detailsChild); - joinConditionFunctionExecutors.add(new StaticMultipleRecordsFunctionExecutor(equal, parameters)); + joinConditionFunctionExecutors.add(new StaticMultipleRecordsFunctionExecutor(parameters, functionAgent, "https://w3id.org/imec/idlab/function#equal")); } } for (Term joinCondition : rmljoinConditions) { - Term functionValue = Utils.getObjectsFromQuads(store.getQuads(joinCondition, new NamedNode(NAMESPACES.FNML + "functionValue"), null)).get(0); - joinConditionFunctionExecutors.add(parseJoinConditionFunctionTermMap(functionValue)); + // TODO fix this for KGC_fnml + Term functionValue = getObjectsFromQuads(store.getQuads(joinCondition, new NamedNode(NAMESPACES.FNML + "functionValue"), null)).get(0); + joinConditionFunctionExecutors.add(parseJoinConditionFunctionTermMap(functionValue, triplesMapBaseIRI)); } + // get logical source of parentTriplesMap + List logicalSources = getObjectsFromQuads(store.getQuads(this.triplesMap, new NamedNode(NAMESPACES.RML2 + "logicalSource"), null)); + Term logicalSource = null; + if (!logicalSources.isEmpty()) { + logicalSource = logicalSources.get(0); + } + + List parentLogicalSources = getObjectsFromQuads(store.getQuads(parentTriplesMap, new NamedNode(NAMESPACES.RML2 + "logicalSource"), null)); + Term parentLogicalSource = null; + if (!parentLogicalSources.isEmpty()) { + parentLogicalSource = parentLogicalSources.get(0); + } + // Check if there is at least one Logical Source. if (refObjectMapCallback != null) { refObjectMapCallback.accept(parentTriplesMap, joinConditionFunctionExecutors); } } else if (!parentTermMaps.isEmpty()) { parseObjectMapWithCallback(parentTermMaps.get(0), (objectGenerator, childOrParent) -> { objectMapCallback.accept(objectGenerator, "parent"); - }, null); + }, null, triplesMapBaseIRI); } } else { - SingleRecordFunctionExecutor functionExecutor = parseFunctionTermMap(functionValues.get(0)); + SingleRecordFunctionExecutor functionExecutor = parseFunctionTermMap(functionValues.get(0), triplesMapBaseIRI); TermGenerator gen; //TODO is literal the default? - if (termType == null || termType.equals(new NamedNode(NAMESPACES.RR + "Literal"))) { + if (termType == null || termType.equals(new NamedNode(NAMESPACES.RML2 + "Literal"))) { //check if we need to apply a datatype to the object if (!datatypes.isEmpty()) { gen = new LiteralGenerator(functionExecutor, datatypes.get(0)); @@ -272,34 +356,43 @@ private void parseObjectMapWithCallback(Term objectmap, BiConsumer targets = getTargets(objectmap); + List targetGenerators = getTargetGenerators(objectmap, strictMode, triplesMapBaseIRI); + + objectMapCallback.accept(new MappingInfo(objectmap, gen, targets, targetGenerators), "child"); + } } - private List parseGraphMapsAndShortcuts(Term termMap) throws IOException { - ArrayList graphMappingInfos = new ArrayList<>(); + private List parseGraphMapsAndShortcuts(Term termMap, String triplesMapBaseIRI) throws Exception { + List graphMappingInfos = new ArrayList<>(); - List graphMaps = Utils.getObjectsFromQuads(store.getQuads(termMap, new NamedNode(NAMESPACES.RR + "graphMap"), null)); + List graphMaps = getObjectsFromQuads(store.getQuads(termMap, new NamedNode(NAMESPACES.RML2 + "graphMap"), null)); for (Term graphMap : graphMaps) { - List functionValues = Utils.getObjectsFromQuads(store.getQuads(graphMap, new NamedNode(NAMESPACES.FNML + "functionValue"), null)); - List termTypes = Utils.getObjectsFromQuads(store.getQuads(graphMap, new NamedNode(NAMESPACES.RR + "termType"), null)); + List functionValues = getObjectsFromQuads(store.getQuads(graphMap, new NamedNode(NAMESPACES.FNML + "functionValue"), null)); + List termTypes = getObjectsFromQuads(store.getQuads(graphMap, new NamedNode(NAMESPACES.RML2 + "termType"), null)); Term termType = null; if (!termTypes.isEmpty()) { termType = termTypes.get(0); + + if (termType.equals(new NamedNode(NAMESPACES.RML2 + "Literal"))) { + throw new Exception("A Graph Map cannot generate literals."); + } } TermGenerator generator; if (functionValues.isEmpty()) { - SingleRecordFunctionExecutor executor = RecordFunctionExecutorFactory.generate(store, graphMap, true); + SingleRecordFunctionExecutor executor = RecordFunctionExecutorFactory.generate(store, graphMap, true, ignoreDoubleQuotes, strictMode.equals(StrictMode.STRICT)); - if (termType == null || termType.equals(new NamedNode(NAMESPACES.RR + "IRI"))) { - generator = new NamedNodeGenerator(executor); + if (termType == null || termType.equals(new NamedNode(NAMESPACES.RML2 + "IRI"))) { + generator = new NamedNodeGenerator(executor, triplesMapBaseIRI, strictMode); } else { if (executor == null) { generator = new BlankNodeGenerator(); @@ -308,64 +401,76 @@ private List parseGraphMapsAndShortcuts(Term termMap) throws IOExce } } } else { - SingleRecordFunctionExecutor functionExecutor = parseFunctionTermMap(functionValues.get(0)); + SingleRecordFunctionExecutor functionExecutor = parseFunctionTermMap(functionValues.get(0), triplesMapBaseIRI); - if (termType == null || termType.equals(new NamedNode(NAMESPACES.RR + "IRI"))) { - generator = new NamedNodeGenerator(functionExecutor); + if (termType == null || termType.equals(new NamedNode(NAMESPACES.RML2 + "IRI"))) { + generator = new NamedNodeGenerator(functionExecutor, triplesMapBaseIRI, strictMode); } else { generator = new BlankNodeGenerator(functionExecutor); } } - graphMappingInfos.add(new MappingInfo(termMap, generator)); + // get targets and target generators for graph map + List targets = getTargets(graphMap); + List targetGenerators = getTargetGenerators(graphMap, strictMode, triplesMapBaseIRI); + + graphMappingInfos.add(new MappingInfo(termMap, generator, targets, targetGenerators)); + } - List graphShortcuts = Utils.getObjectsFromQuads(store.getQuads(termMap, new NamedNode(NAMESPACES.RR + "graph"), null)); + List graphShortcuts = getObjectsFromQuads(store.getQuads(termMap, new NamedNode(NAMESPACES.RML2 + "graph"), null)); for (Term graph : graphShortcuts) { String gStr = graph.getValue(); - graphMappingInfos.add(new MappingInfo(termMap, - new NamedNodeGenerator(new ConstantExtractor(gStr)))); + // rr:graph shortcut can never have targets + graphMappingInfos.add(new MappingInfo(termMap, new NamedNodeGenerator(new ConstantExtractor(gStr), triplesMapBaseIRI, strictMode))); } return graphMappingInfos; } - private List parsePredicateMapsAndShortcuts(Term termMap) throws IOException { - ArrayList predicateMappingInfos = new ArrayList<>(); + private List parsePredicateMapsAndShortcuts(Term termMap, String triplesMapBaseIRI) throws IOException { + List predicateMappingInfos = new ArrayList<>(); - List predicateMaps = Utils.getObjectsFromQuads(store.getQuads(termMap, new NamedNode(NAMESPACES.RR + "predicateMap"), null)); + List predicateMaps = getObjectsFromQuads(store.getQuads(termMap, new NamedNode(NAMESPACES.RML2 + "predicateMap"), null)); for (Term predicateMap : predicateMaps) { - List functionValues = Utils.getObjectsFromQuads(store.getQuads(predicateMap, new NamedNode(NAMESPACES.FNML + "functionValue"), null)); + // get functionValue for predicate maps + List functionValues = getObjectsFromQuads(store.getQuads(predicateMap, new NamedNode(NAMESPACES.FNML + "functionValue"), null)); + + // get target generators for predicate maps + List targets = getTargets(predicateMap); + List targetGenerators = getTargetGenerators(predicateMap, strictMode, triplesMapBaseIRI); if (functionValues.isEmpty()) { predicateMappingInfos.add(new MappingInfo(predicateMap, - new NamedNodeGenerator(RecordFunctionExecutorFactory.generate(store, predicateMap, false)))); + new NamedNodeGenerator(RecordFunctionExecutorFactory.generate(store, predicateMap, false, ignoreDoubleQuotes, strictMode.equals(StrictMode.STRICT)), triplesMapBaseIRI, strictMode), + targets, targetGenerators)); } else { - SingleRecordFunctionExecutor functionExecutor = parseFunctionTermMap(functionValues.get(0)); + SingleRecordFunctionExecutor functionExecutor = parseFunctionTermMap(functionValues.get(0), triplesMapBaseIRI); - predicateMappingInfos.add(new MappingInfo(predicateMap, new NamedNodeGenerator(functionExecutor))); + predicateMappingInfos.add(new MappingInfo(predicateMap, new NamedNodeGenerator(functionExecutor, triplesMapBaseIRI, strictMode), targets, targetGenerators)); } } - List predicateShortcuts = Utils.getObjectsFromQuads(store.getQuads(termMap, new NamedNode(NAMESPACES.RR + "predicate"), null)); + List predicateShortcuts = getObjectsFromQuads(store.getQuads(termMap, new NamedNode(NAMESPACES.RML2 + "predicate"), null)); for (Term predicate : predicateShortcuts) { String pStr = predicate.getValue(); - predicateMappingInfos.add(new MappingInfo(termMap, new NamedNodeGenerator(new ConstantExtractor(pStr)))); + // rr:predicate shortcut can never have targets + predicateMappingInfos.add(new MappingInfo(termMap, new NamedNodeGenerator(new ConstantExtractor(pStr), triplesMapBaseIRI, strictMode))); } return predicateMappingInfos; } - private SingleRecordFunctionExecutor parseFunctionTermMap(Term functionValue) throws IOException { - List functionPOMs = Utils.getObjectsFromQuads(store.getQuads(functionValue, new NamedNode(NAMESPACES.RR + "predicateObjectMap"), null)); + private SingleRecordFunctionExecutor parseFunctionTermMap(Term functionValue, String triplesMapBaseIRI) throws IOException { + List functionPOMs = getObjectsFromQuads(store.getQuads(functionValue, new NamedNode(NAMESPACES.RML2 + "predicateObjectMap"), null)); ArrayList params = new ArrayList<>(); for (Term pom : functionPOMs) { - List pMappingInfos = parsePredicateMapsAndShortcuts(pom); - List oMappingInfos = parseObjectMapsAndShortcuts(pom); + List pMappingInfos = parsePredicateMapsAndShortcuts(pom, triplesMapBaseIRI); + List oMappingInfos = parseObjectMapsAndShortcuts(pom, triplesMapBaseIRI); List pGenerators = new ArrayList<>(); pMappingInfos.forEach(mappingInfo -> { @@ -380,15 +485,15 @@ private SingleRecordFunctionExecutor parseFunctionTermMap(Term functionValue) th params.add(new ParameterValuePair(pGenerators, oGenerators)); } - return new DynamicSingleRecordFunctionExecutor(params, functionLoader); + return new DynamicSingleRecordFunctionExecutor(params, functionAgent); } - private MultipleRecordsFunctionExecutor parseJoinConditionFunctionTermMap(Term functionValue) throws IOException { - List functionPOMs = Utils.getObjectsFromQuads(store.getQuads(functionValue, new NamedNode(NAMESPACES.RR + "predicateObjectMap"), null)); + private MultipleRecordsFunctionExecutor parseJoinConditionFunctionTermMap(Term functionValue, String triplesMapBaseIRI) throws IOException { + List functionPOMs = getObjectsFromQuads(store.getQuads(functionValue, new NamedNode(NAMESPACES.RML2 + "predicateObjectMap"), null)); ArrayList params = new ArrayList<>(); for (Term pom : functionPOMs) { - List pMappingInfos = parsePredicateMapsAndShortcuts(pom); + List pMappingInfos = parsePredicateMapsAndShortcuts(pom, triplesMapBaseIRI); List pGenerators = new ArrayList<>(); pMappingInfos.forEach(mappingInfo -> { @@ -398,21 +503,40 @@ private MultipleRecordsFunctionExecutor parseJoinConditionFunctionTermMap(Term f ArrayList objectGeneratorOriginPairs = new ArrayList<>(); parseObjectMapsAndShortcutsWithCallback(pom, (oGen, childOrParent) -> { objectGeneratorOriginPairs.add(new TermGeneratorOriginPair(oGen.getTermGenerator(), childOrParent)); - }, null); + }, null, triplesMapBaseIRI); params.add(new ParameterValueOriginPair(pGenerators, objectGeneratorOriginPairs)); } - return new DynamicMultipleRecordsFunctionExecutor(params, functionLoader); + return new DynamicMultipleRecordsFunctionExecutor(params, functionAgent); } - private List parseObjectMapsAndShortcuts(Term pom) throws IOException { + /** + * Generate a join condition that only returns true if the same record hash is encountered + * @return + * @throws IOException + */ + private MultipleRecordsFunctionExecutor generateSameLogicalSourceJoinConditionFunctionTermMap() throws IOException { + Map parameters = new HashMap<>(); + + SingleRecordFunctionExecutor parent = new HashExtractor(); + Object[] detailsParent = {"parent", parent}; + parameters.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParameter", detailsParent); + + SingleRecordFunctionExecutor child = new HashExtractor(); + Object[] detailsChild = {"child", child}; + parameters.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParameter2", detailsChild); + + return new StaticMultipleRecordsFunctionExecutor(parameters, functionAgent, "https://w3id.org/imec/idlab/function#equal"); + } + + private List parseObjectMapsAndShortcuts(Term pom, String triplesMapBaseIRI) throws IOException { List mappingInfos = new ArrayList<>(); parseObjectMapsAndShortcutsWithCallback(pom, (mappingInfo, childOrParent) -> { mappingInfos.add(mappingInfo); }, (term, joinConditionFunctions) -> { - }); + }, triplesMapBaseIRI); return mappingInfos; } @@ -420,13 +544,14 @@ private List parseObjectMapsAndShortcuts(Term pom) throws IOExcepti /** * This method returns all executors for the languages of an Object Map. * @param objectmap the object for which the executors need to be determined. + * @param triplesMapBaseIRI the base IRI to use for this Triples Map. * @return a list of executors that return language tags. */ - private List getLanguageExecutorsForObjectMap(Term objectmap) throws IOException { + private List getLanguageExecutorsForObjectMap(Term objectmap, String triplesMapBaseIRI) throws IOException { ArrayList executors = new ArrayList<>(); // Parse rr:language - List languages = Utils.getObjectsFromQuads(store.getQuads(objectmap, new NamedNode(NAMESPACES.RR + "language"), null)); + List languages = getObjectsFromQuads(store.getQuads(objectmap, new NamedNode(NAMESPACES.RML2 + "language"), null)); // Validate languages. languages.stream().map(Term::getValue).forEach(language -> {if (! isValidrrLanguage(language)) { @@ -438,77 +563,160 @@ private List getLanguageExecutorsForObjectMap(Term } // Parse rml:languageMap - List languageMaps = Utils.getObjectsFromQuads(store.getQuads(objectmap, new NamedNode(NAMESPACES.RML + "languageMap"), null)); + List languageMaps = getObjectsFromQuads(store.getQuads(objectmap, new NamedNode(NAMESPACES.RML2 + "languageMap"), null)); for (Term languageMap : languageMaps) { - List functionValues = Utils.getObjectsFromQuads(store.getQuads(languageMap, new NamedNode(NAMESPACES.FNML + "functionValue"), null)); + List functionValues = getObjectsFromQuads(store.getQuads(languageMap, new NamedNode(NAMESPACES.FNML + "functionValue"), null)); if (functionValues.isEmpty()) { - executors.add(RecordFunctionExecutorFactory.generate(store, languageMap, false)); + executors.add(RecordFunctionExecutorFactory.generate(store, languageMap, false, ignoreDoubleQuotes, strictMode.equals(StrictMode.STRICT))); } else { - executors.add(parseFunctionTermMap(functionValues.get(0))); + executors.add(parseFunctionTermMap(functionValues.get(0), triplesMapBaseIRI)); } } return executors; } + private MappingInfo parseLanguageMappingInfo(Term objectMap, String triplesMapBaseIRI) { + // get optional language map targets for object map + MappingInfo mappingInfo = null; + + if(objectMap == null) { + return mappingInfo; + } + + List languageMaps = getObjectsFromQuads(store.getQuads(objectMap, new NamedNode(NAMESPACES.RML2 + "languageMap"), null)); + if (languageMaps.size() == 1) { + Term l = languageMaps.get(0); + List lTargets = getTargets(l); + List lTargetGenerators = getTargetGenerators(l, strictMode, triplesMapBaseIRI); + mappingInfo = new MappingInfo(l, lTargets, lTargetGenerators); + } + else if (languageMaps.size() > 1) { + logger.warn("Multiple language maps found, a random language map is used"); + } + return mappingInfo; + } + /** * This method returns the TermType of a given Term Map. * If no Term Type is found, a default Term Type is return based on the R2RML specification. **/ private Term getTermType(Term map, boolean isObjectMap) { - List termTypes = Utils.getObjectsFromQuads(store.getQuads(map, new NamedNode(NAMESPACES.RR + "termType"), null)); + List termTypes = getObjectsFromQuads(store.getQuads(map, new NamedNode(NAMESPACES.RML2 + "termType"), null)); Term termType = null; if (!termTypes.isEmpty()) { termType = termTypes.get(0); } else { - List constants = Utils.getObjectsFromQuads(store.getQuads(map, new NamedNode(NAMESPACES.RR + "constant"), null)); + List constants = getObjectsFromQuads(store.getQuads(map, new NamedNode(NAMESPACES.RML2 + "constant"), null)); if (!constants.isEmpty()) { Term constant = constants.get(0); if (constant instanceof Literal) { - termType = new NamedNode(NAMESPACES.RR + "Literal"); + termType = new NamedNode(NAMESPACES.RML2 + "Literal"); } else if (constant instanceof NamedNode) { - termType = new NamedNode(NAMESPACES.RR + "IRI"); + termType = new NamedNode(NAMESPACES.RML2 + "IRI"); } else { - termType = new NamedNode(NAMESPACES.RR + "BlankNode"); + termType = new NamedNode(NAMESPACES.RML2 + "BlankNode"); } } else if (isObjectMap) { - boolean hasReference = !Utils.getObjectsFromQuads(store.getQuads(map, new NamedNode(NAMESPACES.RML + "reference"), null)).isEmpty(); - boolean hasFunctionValues = !Utils.getObjectsFromQuads(store.getQuads(map, new NamedNode(NAMESPACES.FNML + "functionValue"), null)).isEmpty(); - boolean hasLanguage = !Utils.getObjectsFromQuads(store.getQuads(map, new NamedNode(NAMESPACES.RR + "language"), null)).isEmpty() || - !Utils.getObjectsFromQuads(store.getQuads(map, new NamedNode(NAMESPACES.RML + "languageMap"), null)).isEmpty(); - boolean hasDatatype = !Utils.getObjectsFromQuads(store.getQuads(map, new NamedNode(NAMESPACES.RR + "datatype"), null)).isEmpty(); + boolean hasReference = !getObjectsFromQuads(store.getQuads(map, new NamedNode(NAMESPACES.RML2 + "reference"), null)).isEmpty(); + boolean hasFunctionValues = !getObjectsFromQuads(store.getQuads(map, new NamedNode(NAMESPACES.FNML + "functionValue"), null)).isEmpty(); + boolean hasLanguage = !getObjectsFromQuads(store.getQuads(map, new NamedNode(NAMESPACES.RML2 + "language"), null)).isEmpty() || + !getObjectsFromQuads(store.getQuads(map, new NamedNode(NAMESPACES.RML2 + "languageMap"), null)).isEmpty(); + boolean hasDatatype = !getObjectsFromQuads(store.getQuads(map, new NamedNode(NAMESPACES.RML2 + "datatype"), null)).isEmpty(); if (hasReference || hasLanguage || hasDatatype || hasFunctionValues) { - termType = new NamedNode(NAMESPACES.RR + "Literal"); + termType = new NamedNode(NAMESPACES.RML2 + "Literal"); } else { - termType = new NamedNode(NAMESPACES.RR + "IRI"); + termType = new NamedNode(NAMESPACES.RML2 + "IRI"); } } else { - termType = new NamedNode(NAMESPACES.RR + "IRI"); + termType = new NamedNode(NAMESPACES.RML2 + "IRI"); } } return termType; } - private List getPredicateObjectGraphMappingFromMultipleGraphMappingInfos(MappingInfo pMappingInfo, MappingInfo oMappingInfo, List gMappingInfos) { + private List getPredicateObjectGraphMappingFromMultipleGraphMappingInfos(MappingInfo pMappingInfo, MappingInfo oMappingInfo, List gMappingInfos, String triplesMapBaseIRI) { ArrayList list = new ArrayList<>(); + MappingInfo lMappingInfo = null; + if(oMappingInfo != null) { + lMappingInfo = parseLanguageMappingInfo(oMappingInfo.getTerm(), triplesMapBaseIRI); + } - gMappingInfos.forEach(gMappingInfo -> { - list.add(new PredicateObjectGraphMapping(pMappingInfo, oMappingInfo, gMappingInfo)); - }); + for(MappingInfo gMappingInfo: gMappingInfos) { + list.add(new PredicateObjectGraphMapping(pMappingInfo, oMappingInfo, gMappingInfo, lMappingInfo)); + } if (gMappingInfos.isEmpty()) { - list.add(new PredicateObjectGraphMapping(pMappingInfo, oMappingInfo, null)); + list.add(new PredicateObjectGraphMapping(pMappingInfo, oMappingInfo, null, lMappingInfo)); } return list; } + /** + * This function returns true if double quotes should be ignored in references. + * @param store The store with the RML rules. + * @param triplesMap The Triples Map that should be checked. + * @return true if double quotes should be ignored in references, else false. + */ + private boolean areDoubleQuotesIgnored(QuadStore store, Term triplesMap) { + List logicalSources = getObjectsFromQuads(store.getQuads(triplesMap, new NamedNode(NAMESPACES.RML2 + "logicalSource"), null)); + + if (!logicalSources.isEmpty()) { + Term logicalSource = logicalSources.get(0); + + List sources = getObjectsFromQuads(store.getQuads(logicalSource, new NamedNode(NAMESPACES.RML2 + "source"), null)); + + if (!sources.isEmpty()) { + Term source = sources.get(0); + + if (! (sources.get(0) instanceof Literal)) { + List sourceType = getObjectsFromQuads(store.getQuads(source, new NamedNode(NAMESPACES.RDF + "type"), null)); + + return sourceType.get(0).getValue().equals(NAMESPACES.D2RQ + "Database"); + } + } + } + + return false; + } + + private List getTargetGenerators(Term termMap, StrictMode strictMode, String triplesMapBaseIRI) { + List targetGenerators = new ArrayList<>(); + List logicalTargetMaps = Utils.getObjectsFromQuads(store.getQuads(termMap, new NamedNode(NAMESPACES.RMLE + "logicalTargetMap"), null)); + for (Term logicalTargetMap : logicalTargetMaps) { + SingleRecordFunctionExecutor functionExecutor = null; + List functionValues = getObjectsFromQuads(store.getQuads(logicalTargetMap, new NamedNode(NAMESPACES.FNML + "functionValue"), null)); + if (functionValues.isEmpty()) { + //similar to subjects, dynamic targets should always be uri + functionExecutor = RecordFunctionExecutorFactory.generate(store, logicalTargetMap, true, ignoreDoubleQuotes, strictMode.equals(StrictMode.STRICT)); + } else { + try { + functionExecutor = parseFunctionTermMap(functionValues.get(0), triplesMapBaseIRI); + } catch (IOException e) { + logger.error("Parsing function term map failed:" + e); + } + } + if (functionValues != null) { + targetGenerators.add(new NamedNodeGenerator(functionExecutor, triplesMapBaseIRI, strictMode)); + } + } + return targetGenerators; + } + + private List getTargets(Term termMap){ + List targets = new ArrayList<>(); + List logicalTargets = getObjectsFromQuads(store.getQuads(termMap, new NamedNode(NAMESPACES.RML2 + "logicalTarget"), null)); + targets.addAll(logicalTargets); + return targets; + } + } diff --git a/src/main/java/be/ugent/rml/MappingInfo.java b/src/main/java/be/ugent/rml/MappingInfo.java index 5886ab39..506e6c34 100644 --- a/src/main/java/be/ugent/rml/MappingInfo.java +++ b/src/main/java/be/ugent/rml/MappingInfo.java @@ -3,13 +3,28 @@ import be.ugent.rml.term.Term; import be.ugent.rml.termgenerator.TermGenerator; +import java.util.Collections; +import java.util.List; + public class MappingInfo { - private Term term; - private TermGenerator termGenerator; + private final Term term; + private final TermGenerator termGenerator; + private final List targets; + private final List targetGenerators; - public MappingInfo(Term term, TermGenerator termGenerator) { + public MappingInfo(Term term, TermGenerator termGenerator, List targets, List targetGenerators) { this.term = term; this.termGenerator = termGenerator; + this.targets = targets; + this.targetGenerators = targetGenerators; + } + + public MappingInfo(Term term, TermGenerator termGenerator) { + this(term, termGenerator, Collections.emptyList(), Collections.emptyList()); + } + + public MappingInfo(Term term, List targets, List targetGenerators) { + this(term, null, targets, targetGenerators); } public Term getTerm() { @@ -19,4 +34,20 @@ public Term getTerm() { public TermGenerator getTermGenerator() { return termGenerator; } + + public List getTargets() { + return targets; + } + + public List getTargetGenerators() { + return this.targetGenerators; + } + + public void addTargets(List targets) { + this.targets.addAll(targets); + } + + public void addTargetGenerators(List targetGenerators) { + getTargetGenerators().addAll(targetGenerators); + } } diff --git a/src/main/java/be/ugent/rml/MappingOptimizer.java b/src/main/java/be/ugent/rml/MappingOptimizer.java new file mode 100644 index 00000000..70be3760 --- /dev/null +++ b/src/main/java/be/ugent/rml/MappingOptimizer.java @@ -0,0 +1,194 @@ +package be.ugent.rml; + +import be.ugent.rml.extractor.Extractor; +import be.ugent.rml.extractor.ReferenceExtractor; +import be.ugent.rml.store.Quad; +import be.ugent.rml.store.QuadStore; +import be.ugent.rml.term.NamedNode; +import be.ugent.rml.term.Term; + +import java.util.*; +import static be.ugent.rml.Utils.getObjectsFromQuads; + +public class MappingOptimizer { + + private final QuadStore rmlStore; + + public MappingOptimizer(QuadStore rmlStore) { + this.rmlStore = rmlStore; + } + + public QuadStore optimizeMapping() throws Exception { + renameSameLogicalSource(); + eliminateSelfJoins(); + return rmlStore; + } + + private void renameSameLogicalSource() { + List logicalSources = Utils.getObjectsFromQuads(rmlStore.getQuads(null,new NamedNode(NAMESPACES.RML2 + "logicalSource"),null)); + Map, Term> logicalSourcesDict = new HashMap<>(); + for (Term logicalSource : logicalSources){ + // two logical Sources are considered to be identical when they have the same objects at the leaves of their subgraph + Set allObjects = new HashSet<>(); + List objects = Utils.getObjectsFromQuads(rmlStore.getQuads(logicalSource, null, null)); + while (!objects.isEmpty()) { + Term object = objects.remove(objects.size()-1); + if (object.isBNode() || object.isIRI()) { + List newObjects = Utils.getObjectsFromQuads(rmlStore.getQuads(object, null, null)); + if (!newObjects.isEmpty()) { + objects.addAll(newObjects); + } else { + //object is final, not subject of new quads + allObjects.add(object); + } + } else { + //object is final, not subject of new quads + allObjects.add(object); + } + } + Set finalObjectSet = Collections.unmodifiableSet(allObjects); + if (!logicalSourcesDict.keySet().contains(finalObjectSet)) { + logicalSourcesDict.put(finalObjectSet, logicalSource); + } else { + List triplesMaps = Utils.getSubjectsFromQuads(this.rmlStore.getQuads(null, new NamedNode(NAMESPACES.RML2 + "logicalSource"), logicalSource)); + for (Term triplesMap : triplesMaps) { + rmlStore.removeQuads(triplesMap, new NamedNode(NAMESPACES.RML2 + "logicalSource"), logicalSource); + rmlStore.addQuad(triplesMap, new NamedNode(NAMESPACES.RML2 + "logicalSource"), logicalSourcesDict.get(finalObjectSet)); + } + } + } + } + + private void eliminateSelfJoins() { + List refObjectMapsQuads = rmlStore.getQuads(null, new NamedNode(NAMESPACES.RML2 + "parentTriplesMap"), null); + for (Quad refObjectMapQuad : refObjectMapsQuads) { + Term parentTriplesMap = refObjectMapQuad.getObject(); + Term childObjectMap = refObjectMapQuad.getSubject(); + Term parentLogicalSource = Utils.getObjectsFromQuads(rmlStore.getQuads(parentTriplesMap, new NamedNode(NAMESPACES.RML2 + "logicalSource"), null)).get(0); + Term childPredicateObjectMap = Utils.getSubjectsFromQuads(rmlStore.getQuads(null, new NamedNode(NAMESPACES.RML2 + "objectMap"), childObjectMap)).get(0); + Term childTriplesMap = Utils.getSubjectsFromQuads(rmlStore.getQuads(null, new NamedNode(NAMESPACES.RML2 + "predicateObjectMap"), childPredicateObjectMap)).get(0); + Term childLogicalSource = Utils.getObjectsFromQuads(rmlStore.getQuads(childTriplesMap, new NamedNode(NAMESPACES.RML2 + "logicalSource"), null)).get(0); + + // check if the logical sources are the same + if (childLogicalSource.equals(parentLogicalSource)) { + + List joinConditions = Utils.getObjectsFromQuads(rmlStore.getQuads(childObjectMap, new NamedNode(NAMESPACES.RML2 + "joinCondition"), null)); + + List parentSubjectMaps = Utils.getObjectsFromQuads(rmlStore.getQuads(parentTriplesMap, new NamedNode(NAMESPACES.RML2 + "subjectMap"), null)); + Term parentSubjectMap = null; + if (!parentSubjectMaps.isEmpty()) { + parentSubjectMap = parentSubjectMaps.get(0); + } + + boolean safeSelfJoinElimination = true; + + // if no join condition, we can safely eliminate the self-join + // else we need more checks + if (parentSubjectMap != null && !joinConditions.isEmpty()) { + // we can eliminate a self-join when all join conditions have equal references and all references for the parent subject or all reference for the related child triple come back in the join conditions + // 1. check if all join references are equal + List joinReferences = new ArrayList<>(); + for (Term joinCondition : joinConditions) { + String parent = getObjectsFromQuads(rmlStore.getQuads(joinCondition, new NamedNode(NAMESPACES.RML2 + "parent"), null)).get(0).getValue(); + String child = getObjectsFromQuads(rmlStore.getQuads(joinCondition, new NamedNode(NAMESPACES.RML2 + "child"), null)).get(0).getValue(); + if (child.equals(parent)) { + joinReferences.add(child); + } else { + safeSelfJoinElimination = false; + } + } + if (safeSelfJoinElimination) { + // 2. check if all references for the parent subject come back in the join conditions + boolean safeTerms = hasSafeReferences(parentSubjectMap, joinReferences); + if(!safeTerms) { + // if not all references for the parent subject come back in the join conditions, + // 3. check if all references for the related child terms come back in the join conditions + // 3.1 check child subject + List childSubjectMaps = Utils.getObjectsFromQuads(rmlStore.getQuads(parentTriplesMap, new NamedNode(NAMESPACES.RML2 + "subjectMap"), null)); + if(!childSubjectMaps.isEmpty()) { + safeTerms = hasSafeReferences(childSubjectMaps.get(0), joinReferences); + } else { + safeTerms = true; + } + //3.2 check child predicate (only make sense if the child subject was safe, otherwise we cannot eliminate the-self join) + if (safeTerms) { + List childPredicateMaps = Utils.getObjectsFromQuads(rmlStore.getQuads(childPredicateObjectMap, new NamedNode(NAMESPACES.RML2 + "predicateMap"), null)); + if(!childPredicateMaps.isEmpty()) { + safeTerms = hasSafeReferences(childPredicateMaps.get(0), joinReferences); + } + } + } + // 4. if parent subject or all child terms are safe, the self join can be eliminated, else not + if (!safeTerms) { + safeSelfJoinElimination = false; + } + } + } + if (safeSelfJoinElimination) { + // now we rewrite the mapping file to eliminate the self-join + boolean termTypeAdded = false; + List parentSubjectMapQuads = rmlStore.getQuads(parentSubjectMap, null, null); + for (Quad parentSubjectMapQuad : parentSubjectMapQuads) { + Term predicate = parentSubjectMapQuad.getPredicate(); + if (predicate.equals(new NamedNode(NAMESPACES.FNML + "functionValue")) + || predicate.equals(new NamedNode(NAMESPACES.RML2 + "termType")) + || predicate.equals(new NamedNode(NAMESPACES.RML2 + "reference")) + || predicate.equals(new NamedNode(NAMESPACES.RML2 + "template")) + || predicate.equals(new NamedNode(NAMESPACES.RML2 + "constant"))) { + rmlStore.addQuad(childObjectMap, predicate, parentSubjectMapQuad.getObject()); + } + if (predicate.equals(new NamedNode(NAMESPACES.RML2 + "termType"))) { + termTypeAdded = true; + } + } + rmlStore.removeQuads(childObjectMap, new NamedNode(NAMESPACES.RML2 + "parentTriplesMap"), parentTriplesMap); + if (!termTypeAdded) { + rmlStore.addQuad(childObjectMap, new NamedNode(NAMESPACES.RML2 + "termType"), new NamedNode(NAMESPACES.RML2 + "IRI")); + } + } + } + } + } + + private Set getAllLinkedReferences(Term term){ + Set references = new HashSet<>(); + List linkedSubjects = new ArrayList<>(); + linkedSubjects.add(term); + while(!linkedSubjects.isEmpty()) { + Term subject = linkedSubjects.get(0); + List linkedQuads = rmlStore.getQuads(subject, null, null); + for (Quad linkedQuad : linkedQuads) { + Term predicate = linkedQuad.getPredicate(); + if (predicate.equals(new NamedNode(NAMESPACES.RML2 + "reference"))) { + references.add(linkedQuad.getObject().getValue()); + } else if (predicate.equals(new NamedNode(NAMESPACES.RML2 + "template"))) { + String template = linkedQuad.getObject().getValue(); + List extractors = Utils.parseTemplate(template, false, false); + for (Extractor extractor : extractors) { + if (extractor instanceof ReferenceExtractor) { + references.add(((ReferenceExtractor) extractor).getReference()); + } + } + } else { + Term object = linkedQuad.getObject(); + if (object.isBNode() || object.isIRI()) { + linkedSubjects.add(object); + } + } + } + linkedSubjects.remove(0); + } + return references; + } + + private boolean hasSafeReferences(Term term, List joinReferences){ + boolean isSafe = true; + Set termReferences = getAllLinkedReferences(term); + for (String parentReference : termReferences){ + if (!joinReferences.contains(parentReference)){ + isSafe = false; + } + } + return isSafe; + } +} diff --git a/src/main/java/be/ugent/rml/MyFileUtils.java b/src/main/java/be/ugent/rml/MyFileUtils.java index 2d2fef30..f3655840 100644 --- a/src/main/java/be/ugent/rml/MyFileUtils.java +++ b/src/main/java/be/ugent/rml/MyFileUtils.java @@ -1,17 +1,17 @@ package be.ugent.rml; -import org.apache.commons.io.FileUtils; -import org.apache.commons.io.FilenameUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.File; import java.io.IOException; -import java.io.InputStream; -import java.net.URI; import java.net.URISyntaxException; import java.net.URL; -import java.net.URLClassLoader; +import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; class MyFileUtils { + private static Logger logger = LoggerFactory.getLogger(MyFileUtils.class); /** * @param resource @@ -19,104 +19,48 @@ class MyFileUtils { * @throws IOException */ static File getResourceAsFile(String resource) throws IOException { + logger.debug("Searching for '{}' in resources.", resource); ClassLoader cl = MyFileUtils.class.getClassLoader(); - File file; - FileResource fileResource = new URLClassLoaderFileResource(cl, resource); - try { - file = fileResource.getFile(); - } catch (IOException e) { - try { - fileResource = new ClasspathResourceFileResource(cl, resource); - file = fileResource.getFile(); - } catch (Exception e2) { - throw new IOException(e2); - } - } - return file; - } - - public interface FileResource { - File getFile() throws IOException; - } - - public static class ClasspathResourceFileResource implements FileResource { - - private ClassLoader cl; - private String resource; - private String extension; - - /** - * @param cl - * @param resource - */ - ClasspathResourceFileResource(ClassLoader cl, String resource) { - this.cl = cl; - this.resource = resource; - this.extension = FilenameUtils.getExtension(resource); + URL resourceUrl = cl.getResource(resource); + logger.debug("default class loader found '{}'", resourceUrl); + if (resourceUrl == null) { + throw new IOException("Resource file " + resource + " doesn't exist"); } + if ("file".equals(resourceUrl.getProtocol())) { + try { - /** - * @return - * @throws IOException - */ - public File getFile() throws IOException { - String suffix = "temp"; - - if (this.extension != null) { - suffix += "." + this.extension; + String path = resourceUrl.toURI().getRawPath(); + logger.debug("returning file '{}'", path); + path = URLDecoder.decode(path, StandardCharsets.UTF_8); + return new File(path); + } catch (URISyntaxException e) { + throw new IOException("Unable to get file through class loader: " + cl, e); } - InputStream cpResource = cl.getResourceAsStream(resource); - File tmpFile = File.createTempFile("file", suffix); - FileUtils.copyInputStreamToFile(cpResource, tmpFile); - tmpFile.deleteOnExit(); - return tmpFile; + } else { + throw new IOException( + "Unable to get file through class loader: " + cl); + } } - public static class URLClassLoaderFileResource implements FileResource { - - private ClassLoader cl; - private String resource; + /** + * This method returns the path of the parent of a file. + * @param c The class to which the file path is relative. + * @param path The path of the file. + * @return The path of the parent. + */ + public static String getParentPath(Class c, String path) { + ClassLoader classLoader = c.getClassLoader(); + URL url = classLoader.getResource(path); - /** - * @param cl - * @param resourcePath - */ - URLClassLoaderFileResource(ClassLoader cl, String resourcePath) { - this.cl = cl; - this.resource = resourcePath; + if (url != null) { + path = url.getFile(); + path = URLDecoder.decode(path, StandardCharsets.UTF_8); } - /** - * @return - * @throws IOException - */ - public File getFile() throws IOException { - File resourceFile = null; - if (cl instanceof URLClassLoader) { - URLClassLoader urlClassLoader = URLClassLoader.class.cast(cl); - URL resourceUrl = urlClassLoader.findResource(resource); - if (resourceUrl == null) { - throw new IOException("Resource file " + resource + " doesn't exist"); - } - if ("file".equals(resourceUrl.getProtocol())) { - try { - - URI uri = resourceUrl.toURI(); - resourceFile = new File(uri); - } catch (URISyntaxException e) { - throw new IOException("Unable to get file through class loader: " + cl, e); - } - - } - } - if (resourceFile == null) { - throw new IOException( - "Unable to get file through class loader: " + cl); - } - return resourceFile; - } + File outputFile = new File(path); + return outputFile.getParent(); } } diff --git a/src/main/java/be/ugent/rml/NAMESPACES.java b/src/main/java/be/ugent/rml/NAMESPACES.java index c972cae1..bb8900f9 100644 --- a/src/main/java/be/ugent/rml/NAMESPACES.java +++ b/src/main/java/be/ugent/rml/NAMESPACES.java @@ -1,18 +1,39 @@ package be.ugent.rml; public class NAMESPACES { - + public static final String DCAT = "http://www.w3.org/ns/dcat#"; public static final String RML = "http://semweb.mmlab.be/ns/rml#"; + + public static final String RML2 = "http://w3id.org/rml/"; public static final String RR = "http://www.w3.org/ns/r2rml#"; public static final String RDF = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"; public static final String FNML = "http://semweb.mmlab.be/ns/fnml#"; public static final String QL = "http://semweb.mmlab.be/ns/ql#"; public static final String D2RQ = "http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#"; public static final String SD = "http://www.w3.org/ns/sparql-service-description#"; - public static final String FNO = "http://w3id.org/function/ontology#"; public static final String FNO_S = "https://w3id.org/function/ontology#"; + @Deprecated + public static final String FNO = "http://w3id.org/function/ontology#"; + @Deprecated + public static final String FNO_OLD = "http://semweb.datasciencelab.be/ns/function#"; + public static final String FNOI = "https://w3id.org/function/vocabulary/implementation#"; + public static final String FNOM = "https://w3id.org/function/vocabulary/mapping#"; + public static final String DOAP = "http://usefulinc.com/ns/doap#"; + public static final String LIB = "http://example.com/library#"; public static final String PROV = "http://www.w3.org/ns/prov#"; public static final String VOID = "http://rdfs.org/ns/void#"; public static final String XSD = "http://www.w3.org/2001/XMLSchema#"; public static final String CSVW = "http://www.w3.org/ns/csvw#"; + public static final String TD = "https://www.w3.org/2019/wot/td#"; + public static final String HCTL = "https://www.w3.org/2019/wot/hypermedia#"; + public static final String HTV = "http://www.w3.org/2011/http#"; + public static final String WOTSEC = "https://www.w3.org/2019/wot/security#"; + public static final String IDSA = "https://w3id.org/idsa/core/"; + public static final String RMLT = "http://semweb.mmlab.be/ns/rml-target#"; + public static final String FORMATS = "http://www.w3.org/ns/formats/"; + public static final String COMP = "http://semweb.mmlab.be/ns/rml-compression#"; + public static final String LDES = "https://w3id.org/ldes#"; + public static final String TREE = "https://w3id.org/tree#"; + public static final String RMLE = "https://w3id.org/imec/rml/ns/extensions#"; + } diff --git a/src/main/java/be/ugent/rml/POGFunction.java b/src/main/java/be/ugent/rml/POGFunction.java new file mode 100644 index 00000000..cfc463a6 --- /dev/null +++ b/src/main/java/be/ugent/rml/POGFunction.java @@ -0,0 +1,8 @@ +package be.ugent.rml; + +import be.ugent.rml.term.ProvenancedTerm; + +@FunctionalInterface +public interface POGFunction { + void generateQuad(ProvenancedTerm subject, ProvenancedTerm predicate, ProvenancedTerm object, ProvenancedTerm graph, boolean checkMagicValue); +} diff --git a/src/main/java/be/ugent/rml/PredicateObjectGraphMapping.java b/src/main/java/be/ugent/rml/PredicateObjectGraphMapping.java index 5d953478..c49fd0be 100644 --- a/src/main/java/be/ugent/rml/PredicateObjectGraphMapping.java +++ b/src/main/java/be/ugent/rml/PredicateObjectGraphMapping.java @@ -12,14 +12,22 @@ public class PredicateObjectGraphMapping { private final MappingInfo predicateMappingInfo; private final MappingInfo objectMappingInfo; private final MappingInfo graphMappingInfo; + private final MappingInfo languageMappingInfo; private final List joinConditions; private Term parentTriplesMap; - public PredicateObjectGraphMapping(MappingInfo predicateMappingInfo, MappingInfo objectMappingInfo, MappingInfo graphMappingInfo) { + public PredicateObjectGraphMapping(MappingInfo predicateMappingInfo, MappingInfo objectMappingInfo, MappingInfo graphMappingInfo, MappingInfo languageMappingInfo) { this.predicateMappingInfo = predicateMappingInfo; this.graphMappingInfo = graphMappingInfo; this.joinConditions = new ArrayList(); this.objectMappingInfo = objectMappingInfo; + this.languageMappingInfo = languageMappingInfo; + + // Language Maps are tightly connected to the object, merge the target lists + if(this.languageMappingInfo != null) { + this.objectMappingInfo.addTargetGenerators(this.languageMappingInfo.getTargetGenerators()); + this.objectMappingInfo.addTargets(this.languageMappingInfo.getTargets()); + } } public Term getParentTriplesMap() { @@ -49,4 +57,8 @@ public MappingInfo getObjectMappingInfo() { public MappingInfo getGraphMappingInfo() { return graphMappingInfo; } -} + + public MappingInfo getLanguageMappingInfo() { + return this.languageMappingInfo; + } +} \ No newline at end of file diff --git a/src/main/java/be/ugent/rml/RecordFunctionExecutorFactory.java b/src/main/java/be/ugent/rml/RecordFunctionExecutorFactory.java index 7c04c327..7420b6b3 100644 --- a/src/main/java/be/ugent/rml/RecordFunctionExecutorFactory.java +++ b/src/main/java/be/ugent/rml/RecordFunctionExecutorFactory.java @@ -12,18 +12,23 @@ public class RecordFunctionExecutorFactory { - public static SingleRecordFunctionExecutor generate(QuadStore store, Term termMap, boolean encodeURI) { - List references = Utils.getObjectsFromQuads(store.getQuads(termMap, new NamedNode(NAMESPACES.RML + "reference"), null)); - List templates = Utils.getObjectsFromQuads(store.getQuads(termMap, new NamedNode(NAMESPACES.RR + "template"), null)); - List constants = Utils.getObjectsFromQuads(store.getQuads(termMap, new NamedNode(NAMESPACES.RR + "constant"), null)); + public static SingleRecordFunctionExecutor generate(QuadStore store, Term termMap, boolean encodeURI, boolean ignoreDoubleQuotes, boolean strictReferenceResolution) { + List references = Utils.getObjectsFromQuads(store.getQuads(termMap, new NamedNode(NAMESPACES.RML2 + "reference"), null)); + List templates = Utils.getObjectsFromQuads(store.getQuads(termMap, new NamedNode(NAMESPACES.RML2 + "template"), null)); + List constants = Utils.getObjectsFromQuads(store.getQuads(termMap, new NamedNode(NAMESPACES.RML2 + "constant"), null)); - if (!references.isEmpty()) { - return new ReferenceExtractor(references.get(0).getValue()); - } else if (!templates.isEmpty()) { - return new ConcatFunction(Utils.parseTemplate(templates.get(0).getValue()), encodeURI); - } else if (!constants.isEmpty()) { - return new ConstantExtractor(constants.get(0).getValue()); - } else { + try { + if (!references.isEmpty()) { + return new ReferenceExtractor(references.get(0).getValue(), ignoreDoubleQuotes, strictReferenceResolution); + } else if (!templates.isEmpty()) { + return new ConcatFunction(Utils.parseTemplate(templates.get(0).getValue(), ignoreDoubleQuotes, strictReferenceResolution), encodeURI); + } else if (!constants.isEmpty()) { + return new ConstantExtractor(constants.get(0).getValue()); + } else { + return null; + } + } catch (Exception e) { + System.err.println("Extracting constant or references failed: " + e.getMessage()); return null; } } diff --git a/src/main/java/be/ugent/rml/StrictMode.java b/src/main/java/be/ugent/rml/StrictMode.java new file mode 100644 index 00000000..f25d488f --- /dev/null +++ b/src/main/java/be/ugent/rml/StrictMode.java @@ -0,0 +1,15 @@ +package be.ugent.rml; + +/** + * Indicates how the executor will handle IRI-unsafe values. + */ +public enum StrictMode { + /** + * The executor will attempt to skip records that cannot be mapped to IRI-safe values. + */ + BEST_EFFORT, + /** + * The executor will throw an exception when a record cannot be mapped to an IRI-safe triple. + */ + STRICT, +} diff --git a/src/main/java/be/ugent/rml/Utils.java b/src/main/java/be/ugent/rml/Utils.java index a9eed93a..f1723e73 100644 --- a/src/main/java/be/ugent/rml/Utils.java +++ b/src/main/java/be/ugent/rml/Utils.java @@ -8,10 +8,12 @@ import be.ugent.rml.term.Literal; import be.ugent.rml.term.NamedNode; import be.ugent.rml.term.Term; -import com.google.common.escape.Escaper; -import com.google.common.net.UrlEscapers; +import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.IOUtils; import org.eclipse.rdf4j.common.net.ParsedIRI; +import org.eclipse.rdf4j.model.Model; +import org.eclipse.rdf4j.rio.RDFFormat; +import org.eclipse.rdf4j.rio.Rio; import org.rdfhdt.hdt.enums.RDFNotation; import org.rdfhdt.hdt.hdt.HDT; import org.rdfhdt.hdt.hdt.HDTManager; @@ -63,38 +65,91 @@ public static Reader getReaderFromLocation(String location, File basePath, Strin } } - public static InputStream getInputStreamFromLocation(String location) throws IOException { - return getInputStreamFromLocation(location, null, ""); + public static InputStream getInputStreamFromLocation(String location, File basePath, String contentType) throws IOException { + return getInputStreamFromLocation(location, basePath, contentType, new HashMap<>()); } - public static InputStream getInputStreamFromLocation(String location, File basePath, String contentType) throws IOException { + public static InputStream getInputStreamFromLocation(String location, File basePath, String contentType, Map headers) throws IOException { if (isRemoteFile(location)) { - return getInputStreamFromURL(new URL(location), contentType); + return getInputStreamFromURL(new URL(location), contentType, headers); } else { return getInputStreamFromFile(getFile(location, basePath)); } } - public static InputStream getInputStreamFromMOptionValue(String mOptionValue) { + /** + * Get an InputStream from a string. This string is either a path (local or remote) to an RDF file, or a raw RDF text. + * If it's a path, conversion from Windows path separators to UNIX paht separators is performed + * @param mOptionValue input, either RDF file path or raw RDF text + * @return input stream + */ + public static InputStream getInputStreamFromFileOrContentString(String mOptionValue) { InputStream out; + logger.debug("{} mapping file", mOptionValue); + String extension; + try{ + // will throw illegalArgumentException on a windows NTFS if a ":" is present + // on Windows a : is the identifier of an alternate data stream + extension = FilenameUtils.getExtension(mOptionValue); + } + catch (IllegalArgumentException e){ + return IOUtils.toInputStream(mOptionValue, StandardCharsets.UTF_8); + } + if (extension != null) { + // Windows paths 🤷â€â™‚ï¸ + mOptionValue = mOptionValue.replaceAll("\\\\", "/"); + } try { - out = getInputStreamFromLocation(mOptionValue, null, "application/rdf+xml"); - } catch (IOException e) { - try { - // raw mapping input string - out = IOUtils.toInputStream(mOptionValue, "UTF-8"); - } catch (IOException e2) { - logger.error("Cannot read mapping option {}", mOptionValue); - out = new ByteArrayInputStream(new byte[0]); + switch (extension) { + case "n3": + out = getTurtleInputStreamForFormat(mOptionValue, RDFFormat.N3); + break; + case "nt": + out = getTurtleInputStreamForFormat(mOptionValue, RDFFormat.NTRIPLES); + break; + case "nq": + out = getTurtleInputStreamForFormat(mOptionValue, RDFFormat.NQUADS); + break; + case "rdf": + case "xml": + out = getTurtleInputStreamForFormat(mOptionValue, RDFFormat.RDFXML); + break; + case "json": + case "jsonld": + out = getTurtleInputStreamForFormat(mOptionValue, RDFFormat.JSONLD); + break; + case "ttl": + out = getInputStreamFromLocation(mOptionValue, null, RDFFormat.TURTLE.getDefaultMIMEType()); + break; + default: + logger.info("Could not determine extension of file path. Trying Turtle format."); + out = getInputStreamFromLocation(mOptionValue, null, "text/turtle"); + break; } + } catch (IOException e) { + logger.info("Trying to read mapping as raw input string."); + out = IOUtils.toInputStream(mOptionValue, StandardCharsets.UTF_8); } return out; } + private static InputStream getTurtleInputStreamForFormat(String mOptionValue, RDFFormat format) throws IOException { + try (InputStream out = getInputStreamFromLocation(mOptionValue, null, format.getDefaultMIMEType())) { + Model model = Rio.parse(out, "", format); + ByteArrayOutputStream output = new ByteArrayOutputStream(); + Rio.write(model, output, RDFFormat.TURTLE); + return new ByteArrayInputStream(output.toByteArray()); + } + } + public static File getFile(String path) throws IOException { return Utils.getFile(path, null); } + /** + * Get path based on basePath or (if not filled in) the user.dir + * This file assumes UNIX path separators. + */ public static File getFile(String path, File basePath) throws IOException { // Absolute path? File f = new File(path); @@ -114,7 +169,7 @@ public static File getFile(String path, File basePath) throws IOException { } } - logger.debug("Looking for file " + path + " in basePath " + basePath); + logger.debug("Looking for file {} in basePath {}", path, basePath); // Relative from user dir? f = new File(basePath, path); @@ -122,12 +177,20 @@ public static File getFile(String path, File basePath) throws IOException { return f; } + logger.debug("File {} not found in {}", path, basePath); + logger.debug("Looking for file {} in {} /../", path, basePath); + + // Relative from parent of user dir? f = new File(basePath, "../" + path); if (f.exists()) { return f; } + logger.debug("File {} not found in {}", path, basePath); + + logger.debug("Looking for file {} in the resources directory", path); + // Resource path? try { return MyFileUtils.getResourceAsFile(path); @@ -135,6 +198,8 @@ public static File getFile(String path, File basePath) throws IOException { // Too bad } + logger.debug("File {} not found in the resources directory", path); + throw new FileNotFoundException(path); } @@ -159,7 +224,7 @@ public static InputStream getInputStreamFromURL(URL url, String contentType) { try { HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setDoOutput(true); - connection.setInstanceFollowRedirects(false); + connection.setInstanceFollowRedirects(true); connection.setRequestMethod("GET"); connection.setRequestProperty("Accept", contentType); connection.setRequestProperty("charset", "utf-8"); @@ -171,16 +236,94 @@ public static InputStream getInputStreamFromURL(URL url, String contentType) { return inputStream; } + public static InputStream getInputStreamFromURL(URL url, String contentType, Map headers) { + InputStream inputStream = null; + try { + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + connection.setDoOutput(true); + connection.setInstanceFollowRedirects(true); + connection.setRequestMethod("GET"); + connection.setRequestProperty("Accept", contentType); + // Set encoding if not set before + if(!headers.containsKey("charset")) { + headers.put("charset", "utf-8"); + } + // Apply all headers + headers.forEach((name, value) -> { + logger.debug("{}: {}", name, value); + connection.setRequestProperty(name, value); + }); + logger.debug("trying to connect"); + connection.connect(); + logger.debug("getting inputstream"); + inputStream = connection.getInputStream(); + logger.debug("got inputstream"); + } catch (IOException ex) { + ex.printStackTrace(); + } + return inputStream; + } + + public static InputStream getInputStreamFromAuthURL(URL url, String contentType, Map headers) throws Exception { + InputStream inputStream = null; + try { + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + connection.setDoOutput(true); + connection.setInstanceFollowRedirects(true); + connection.setRequestMethod("GET"); + connection.setRequestProperty("Accept", contentType); + // Set encoding if not set before + if(!headers.containsKey("charset")) { + headers.put("charset", "utf-8"); + } + // Apply all headers + headers.forEach((name, value) -> { + logger.debug("{}: {}", name, value); + connection.setRequestProperty(name, value); + }); + logger.debug("trying to connect"); + connection.connect(); + if(connection.getResponseCode() == 401) throw new Exception("not authenticated"); + logger.debug("getting inputstream"); + inputStream = connection.getInputStream(); + logger.debug("got inputstream"); + } catch (IOException ex) { + ex.printStackTrace(); + } + return inputStream; + } + public static InputStream getInputStreamFromFile(File file) throws FileNotFoundException { return new FileInputStream(file); } + public static InputStream getPostRequestResponse(URL url, String contentType, byte[] auth ){ + InputStream inputStream = null; + Map headers = new HashMap<>(); + headers.put("charset", "utf-8"); + + try { + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + connection.setDoOutput(true); + connection.setInstanceFollowRedirects(true); + connection.setRequestMethod("POST"); + connection.setRequestProperty("Accept", contentType); + connection.connect(); + OutputStream outputStream = connection.getOutputStream(); + outputStream.write(auth); + inputStream = connection.getInputStream(); + } catch (IOException ex) { + ex.printStackTrace(); + } + return inputStream; + } + public static boolean isRemoteFile(String location) { return location.startsWith("https://") || location.startsWith("http://"); } public static List getSubjectsFromQuads(List quads) { - ArrayList subjects = new ArrayList<>(); + List subjects = new ArrayList<>(); for (Quad quad : quads) { subjects.add(quad.getSubject()); @@ -190,7 +333,7 @@ public static List getSubjectsFromQuads(List quads) { } public static List getObjectsFromQuads(List quads) { - ArrayList objects = new ArrayList<>(); + List objects = new ArrayList<>(); for (Quad quad : quads) { objects.add(quad.getObject()); @@ -200,7 +343,7 @@ public static List getObjectsFromQuads(List quads) { } public static List getLiteralObjectsFromQuads(List quads) { - ArrayList objects = new ArrayList<>(); + List objects = new ArrayList<>(); for (Quad quad : quads) { objects.add(((Literal) quad.getObject()).getValue()); @@ -243,29 +386,20 @@ public static boolean isValidrrLanguage(String s) { } public static String encodeURI(String url) { - Escaper escaper = UrlEscapers.urlFragmentEscaper(); - String result = escaper.escape(url); - - result = result.replaceAll("!", "%21"); - result = result.replaceAll("#", "%23"); - result = result.replaceAll("\\$", "%24"); - result = result.replaceAll("&", "%26"); - result = result.replaceAll("'", "%27"); - result = result.replaceAll("\\(", "%28"); - result = result.replaceAll("\\)", "%29"); - result = result.replaceAll("\\*", "%2A"); - result = result.replaceAll("\\+", "%2B"); - result = result.replaceAll(",", "%2C"); - result = result.replaceAll("/", "%2F"); - result = result.replaceAll(":", "%3A"); - result = result.replaceAll(";", "%3B"); - result = result.replaceAll("=", "%3D"); - result = result.replaceAll("\\?", "%3F"); - result = result.replaceAll("@", "%40"); - result = result.replaceAll("\\[", "%5B"); - result = result.replaceAll("]", "%5D"); - - return result; + /* Avoid using regex to escape + and * chars for performance */ + final StringBuilder builder = new StringBuilder(); + final String encoded = URLEncoder.encode(url, StandardCharsets.UTF_8); + + for (char c: encoded.toCharArray()) { + if (c == '+') + builder.append("%20"); + else if (c == '*') + builder.append("%2A"); + else + builder.append(c); + } + + return builder.toString(); } public static String fileToString(File file) throws IOException { @@ -346,8 +480,8 @@ public static int getFreePortNumber() throws IOException { * @param template template string * @return list of extractors **/ - public static List parseTemplate(String template) { - ArrayList extractors = new ArrayList<>(); + public static List parseTemplate(String template, boolean ignoreDoubleQuotes, boolean strictReferenceResolution) { + List extractors = new ArrayList<>(); String current = ""; boolean previousWasBackslash = false; boolean variableBusy = false; @@ -375,7 +509,7 @@ public static List parseTemplate(String template) { current += c; previousWasBackslash = false; } else if (variableBusy) { - extractors.add(new ReferenceExtractor(current)); + extractors.add(new ReferenceExtractor(current, ignoreDoubleQuotes, strictReferenceResolution)); current = ""; variableBusy = false; } else { @@ -468,26 +602,48 @@ public static boolean isRelativeIRI(String iri) { } } - public static String getBaseDirectiveTurtle(File file) { - StringBuilder contentBuilder = new StringBuilder(); - try (Stream stream = Files.lines(Paths.get(file.getAbsolutePath()), StandardCharsets.UTF_8)) { - stream.forEach(s -> contentBuilder.append(s).append("\n")); - } catch (IOException e) { - e.printStackTrace(); + public static boolean checkPathParent(String path, String base) { + File f; + File basePath; + if (base == null) { + f = new File(path); + if (f.isAbsolute()) { + return f.getParentFile().exists(); + } + base = System.getProperty("user.dir"); + } + try { + basePath = new File(base); + } catch (Exception e) { + return false; } - String turtle = contentBuilder.toString(); - return Utils.getBaseDirectiveTurtle(turtle); + logger.info("Looking for parent of file {} in basePath {}", path, basePath); + + // Relative from user dir? + f = new File(basePath, path); + return f.getParentFile().exists(); } - public static String getBaseDirectiveTurtle(InputStream is) { - String turtle = null; + /** + * Get the base directive from a turtle file or return the default base + * @param is - input stream of the turtle file + * @param defaultBase - default base to return if no base directive is found + * @return - base directive or default base + */ + public static String getBaseDirectiveTurtleOrDefault(InputStream is, String defaultBase) { + String turtle; try { turtle = IOUtils.toString(is, StandardCharsets.UTF_8); } catch (IOException e) { turtle = ""; } - return Utils.getBaseDirectiveTurtle(turtle); + + String base = getBaseDirectiveTurtle(turtle); + if (base == null) { + base = defaultBase; + } + return base; } public static String getBaseDirectiveTurtle(String turtle) { diff --git a/src/main/java/be/ugent/rml/ValuedJoinCondition.java b/src/main/java/be/ugent/rml/ValuedJoinCondition.java deleted file mode 100644 index 1b0da49b..00000000 --- a/src/main/java/be/ugent/rml/ValuedJoinCondition.java +++ /dev/null @@ -1,22 +0,0 @@ -package be.ugent.rml; - -import java.util.List; - -public class ValuedJoinCondition { - - private Template path; - private List values; - - public ValuedJoinCondition(Template path, List values) { - this.path = path; - this.values = values; - } - - public Template getPath() { - return path; - } - - public List getValues() { - return values; - } -} diff --git a/src/main/java/be/ugent/rml/access/Access.java b/src/main/java/be/ugent/rml/access/Access.java deleted file mode 100644 index 882bbb74..00000000 --- a/src/main/java/be/ugent/rml/access/Access.java +++ /dev/null @@ -1,26 +0,0 @@ -package be.ugent.rml.access; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Map; - -/** - * This interface represents the access to a data source. - * For example, a local file, a remote file, a relational database, and so on. - */ -public interface Access { - - /** - * This method returns an InputStream for the access. - * @return the InputStream corresponding to the access. - * @throws IOException - */ - InputStream getInputStream() throws IOException; - - /** - * This method returns a map of datatypes. - * References to values are mapped to their datatypes, if available. - * @return map of datatypes. - */ - Map getDataTypes(); -} diff --git a/src/main/java/be/ugent/rml/access/AccessFactory.java b/src/main/java/be/ugent/rml/access/AccessFactory.java index e334ca41..0af68240 100644 --- a/src/main/java/be/ugent/rml/access/AccessFactory.java +++ b/src/main/java/be/ugent/rml/access/AccessFactory.java @@ -1,16 +1,24 @@ package be.ugent.rml.access; -import be.ugent.rml.DatabaseType; +import be.ugent.idlab.knows.dataio.access.*; import be.ugent.rml.NAMESPACES; import be.ugent.rml.Utils; +import be.ugent.rml.records.ReferenceFormulation; import be.ugent.rml.records.SPARQLResultFormat; +import be.ugent.rml.store.Quad; import be.ugent.rml.store.QuadStore; import be.ugent.rml.term.Literal; import be.ugent.rml.term.NamedNode; import be.ugent.rml.term.Term; -import org.apache.commons.lang.NotImplementedException; +import org.apache.commons.lang3.NotImplementedException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import java.io.File; +import java.util.Arrays; +import java.util.HashMap; import java.util.List; +import java.util.Map; import static be.ugent.rml.Utils.isRemoteFile; @@ -20,14 +28,23 @@ public class AccessFactory { // The path used when local paths are not absolute. - private String basePath; + private final String basePath; + private final String mappingPath; + final Logger logger = LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); + + private static final Map REF_FORM_MIMETYPE = Map.of( + NAMESPACES.RML2 + "CSV", "text/csv" + ); /** * The constructor of the AccessFactory. + * * @param basePath the base path for the local file system. + * @param mappingPath the path to the used mapping file. */ - public AccessFactory(String basePath) { + public AccessFactory(String basePath, String mappingPath) { this.basePath = basePath; + this.mappingPath = mappingPath; } /** @@ -37,8 +54,8 @@ public AccessFactory(String basePath) { * @return an Access instance based on the RML rules in rmlStore. */ public Access getAccess(Term logicalSource, QuadStore rmlStore) { - List sources = Utils.getObjectsFromQuads(rmlStore.getQuads(logicalSource, new NamedNode(NAMESPACES.RML + "source"), null)); - Access access = null; + List sources = Utils.getObjectsFromQuads(rmlStore.getQuads(logicalSource, new NamedNode(NAMESPACES.RML2 + "source"), null)); + Access access; // check if at least one source is available. if (!sources.isEmpty()) { @@ -46,28 +63,38 @@ public Access getAccess(Term logicalSource, QuadStore rmlStore) { // if we are dealing with a literal, // then it's either a local or remote file. - if (sources.get(0) instanceof Literal) { - String value = sources.get(0).getValue(); - + if (sources.get(0) instanceof Literal literal) { + String value = literal.getValue(); if (isRemoteFile(value)) { - access = new RemoteFileAccess(value); + Term refForm = Utils.getObjectsFromQuads(rmlStore.getQuads(logicalSource, new NamedNode(NAMESPACES.RML2 + "referenceFormulation"), null)).get(0); + String mimeType = REF_FORM_MIMETYPE.get(refForm.toString()); + access = new RemoteFileAccess(value, mimeType); } else { access = new LocalFileAccess(value, this.basePath); } } else { // if not a literal, then we are dealing with a more complex description. List sourceType = Utils.getObjectsFromQuads(rmlStore.getQuads(source, new NamedNode(NAMESPACES.RDF + "type"), null)); + sourceType.remove(new NamedNode(NAMESPACES.RML2 + "Source")); switch(sourceType.get(0).getValue()) { - case NAMESPACES.D2RQ + "Database": // RDBs - // Check if SQL version is given - List sqlVersion = Utils.getObjectsFromQuads(rmlStore.getQuads(logicalSource, new NamedNode(NAMESPACES.RR + "sqlVersion"), null)); - - if (sqlVersion.isEmpty()) { - // TODO see issue #130 - throw new Error("No SQL version identifier found."); + case NAMESPACES.RML2 + "RelativePathSource": + case NAMESPACES.RML2 + "FilePath": + String path = Utils.getObjectsFromQuads(rmlStore.getQuads(source, new NamedNode(NAMESPACES.RML2 + "path"), null)).get(0).getValue(); + List rootNodes = rmlStore.getQuads(source, new NamedNode(NAMESPACES.RML2 + "root"), null); + if (rootNodes.isEmpty()) { + access = new LocalFileAccess(path, null); + } else { + String root = Utils.getObjectsFromQuads(rootNodes).get(0).getValue(); + if (root.equals(NAMESPACES.RML2 + "MappingDirectory")) { + access = new LocalFileAccess(path, this.mappingPath); + } else { + access = new LocalFileAccess(path, this.basePath); + } } + break; + case NAMESPACES.D2RQ + "Database": // RDBs access = getRDBAccess(rmlStore, source, logicalSource); break; @@ -81,20 +108,18 @@ public Access getAccess(Term logicalSource, QuadStore rmlStore) { } // Get query - List query = Utils.getObjectsFromQuads(rmlStore.getQuads(logicalSource, new NamedNode(NAMESPACES.RML + "query"), null)); + List query = Utils.getObjectsFromQuads(rmlStore.getQuads(logicalSource, new NamedNode(NAMESPACES.RML2 + "iterator"), null)); if (query.isEmpty()) { throw new Error("No SPARQL query found"); } - List referenceFormulations = Utils.getObjectsFromQuads(rmlStore.getQuads(logicalSource, new NamedNode(NAMESPACES.RML + "referenceFormulation"), null)); + List referenceFormulations = Utils.getObjectsFromQuads(rmlStore.getQuads(logicalSource, new NamedNode(NAMESPACES.RML2 + "referenceFormulation"), null)); // Get result format List resultFormatObject = Utils.getObjectsFromQuads(rmlStore.getQuads(source, new NamedNode(NAMESPACES.SD + "resultFormat"), null)); SPARQLResultFormat resultFormat = getSPARQLResultFormat(resultFormatObject, referenceFormulations); - String queryString = query.get(0).getValue().replaceAll("[\r\n]+", " ").trim(); - - access = new SPARQLEndpointAccess(resultFormat.getContentType(), endpoint.get(0).getValue(), queryString);; + access = new SPARQLEndpointAccess(resultFormat.getContentType(), endpoint.get(0).getValue(), query.get(0).getValue()); break; case NAMESPACES.CSVW + "Table": // CSVW @@ -107,14 +132,162 @@ public Access getAccess(Term logicalSource, QuadStore rmlStore) { String value = urls.get(0).getValue(); if (isRemoteFile(value)) { - access = new RemoteFileAccess(value); + access = new RemoteFileAccess(value, "text/csvw"); } else { - access = new LocalFileAccess(value, this.basePath); + access = new LocalFileAccess(value, this.basePath, "text/csvw"); } + break; + case NAMESPACES.TD + "Thing": + Map> auth2 = new HashMap<>(); + auth2.put("data", new HashMap<>()); + auth2.put("info", new HashMap<>()); + + try { + Term propertyAffordance = rmlStore.getQuad(source, new NamedNode(NAMESPACES.TD + "hasPropertyAffordance"), null).getObject(); + List form = Utils.getObjectsFromQuads(rmlStore.getQuads(propertyAffordance, new NamedNode(NAMESPACES.TD + "hasForm"), null)); + List targets = Utils.getObjectsFromQuads(rmlStore.getQuads(form.get(0), new NamedNode(NAMESPACES.HCTL + "hasTarget"), null)); + List contentTypes = Utils.getObjectsFromQuads(rmlStore.getQuads(form.get(0), new NamedNode(NAMESPACES.HCTL + "forContentType"), null)); + + // TODO: determine which protocol is used to know which vocabulary is needed for the protocol specific part. + String target = targets.get(0).getValue(); + String contentType = contentTypes.isEmpty() ? null : contentTypes.get(0).getValue(); + + access = new WoTAccess(target, contentType, new HashMap<>(), auth2); + } catch (Exception e) { + logger.error("Cannot create WoT TD:Thing access"); + access = null; + } + break; + case NAMESPACES.TD + "PropertyAffordance": + Map headers = new HashMap<>(); + Map> auth = new HashMap<>(); + auth.put("data", new HashMap<>()); + auth.put("info", new HashMap<>()); + + List form = Utils.getObjectsFromQuads(rmlStore.getQuads(source, new NamedNode(NAMESPACES.TD + "hasForm"), null)); + List targets = Utils.getObjectsFromQuads(rmlStore.getQuads(form.get(0), new NamedNode(NAMESPACES.HCTL + "hasTarget"), null)); + List contentTypes = Utils.getObjectsFromQuads(rmlStore.getQuads(form.get(0), new NamedNode(NAMESPACES.HCTL + "forContentType"), null)); + List headerList = Utils.getObjectsFromQuads(rmlStore.getQuads(form.get(0), new NamedNode(NAMESPACES.HTV + "headers"), null)); + // Security schema & data + try { + Term thing = Utils.getSubjectsFromQuads(rmlStore.getQuads(null, new NamedNode(NAMESPACES.TD + "hasPropertyAffordance"), source)).get(0); + List securityConfiguration = Utils.getObjectsFromQuads(rmlStore.getQuads(thing, new NamedNode(NAMESPACES.TD + "hasSecurityConfiguration"), null)); + logger.debug("Security config: {}", Arrays.toString(securityConfiguration.toArray())); + + for (Term sc : securityConfiguration) { + boolean isOAuth = !Utils.getObjectsFromQuads(rmlStore.getQuads(sc, new NamedNode(NAMESPACES.RDF + "type"), + new NamedNode(NAMESPACES.WOTSEC + "OAuth2SecurityScheme"))).isEmpty(); + boolean isBearer = !Utils.getObjectsFromQuads(rmlStore.getQuads(sc, new NamedNode(NAMESPACES.RDF + "type"), + new NamedNode(NAMESPACES.WOTSEC + "BearerSecurityScheme"))).isEmpty(); + List securityIn = Utils.getObjectsFromQuads(rmlStore.getQuads(sc, new NamedNode(NAMESPACES.WOTSEC + "in"), null)); + List securityName = Utils.getObjectsFromQuads(rmlStore.getQuads(sc, new NamedNode(NAMESPACES.WOTSEC + "name"), null)); + List securityValue = Utils.getObjectsFromQuads(rmlStore.getQuads(sc, new NamedNode(NAMESPACES.IDSA + "tokenValue"), null)); + if (isOAuth || isBearer) { + // BearerSecurityScheme + // OAuth2 specific + if (isOAuth) { + logger.debug("OAuth2 is used"); + Term securityAuth = Utils.getObjectsFromQuads(rmlStore.getQuads(sc, new NamedNode(NAMESPACES.WOTSEC + "authorization"), null)).get(0); + auth.get("info").put("authorization", securityAuth.getValue()); + auth.get("info").put("name", securityName.get(0).getValue()); + + Term securityRefresh = Utils.getObjectsFromQuads(rmlStore.getQuads(sc, new NamedNode(NAMESPACES.IDSA + "refreshValue"), null)).get(0); + Term securityClientID = Utils.getObjectsFromQuads(rmlStore.getQuads(sc, new NamedNode(NAMESPACES.IDSA + "clientID"), null)).get(0); + Term securityClientSecret = Utils.getObjectsFromQuads(rmlStore.getQuads(sc, new NamedNode(NAMESPACES.IDSA + "clientSecret"), null)).get(0); +// Term securityGrantType = Utils.getObjectsFromQuads(rmlStore.getQuads(sc, new NamedNode(NAMESPACES.WOTSEC + "grant_type"), null)).get(0); + + auth.get("data").put("refresh", securityRefresh.getValue()); + auth.get("data").put("client_id", securityClientID.getValue()); + auth.get("data").put("client_secret", securityClientSecret.getValue()); + logger.debug("Refresh token: {}", securityRefresh.getValue()); + logger.debug("Client ID: {}", securityClientID.getValue()); + logger.debug("Client Secret: {}", securityClientSecret.getValue()); +// //can this not be set default? +// auth.get("data").put("grant_type", securityGrantType.getValue()); + } + // both oath and bearer + Term bearerToken = new Literal("Bearer " + securityValue.get(0).getValue()); + securityValue.set(0, bearerToken); + } + try { + if (securityIn.get(0).getValue().equals("header")) { + logger.info("Applying security configuration of {} in header", sc.getValue()); + logger.debug("Name: {}", securityName.get(0).getValue()); + logger.debug("Value: {}", securityValue.get(0).getValue()); + headers.put(securityName.get(0).getValue(), securityValue.get(0).getValue()); + } else { + throw new NotImplementedException(); + } + } catch (IndexOutOfBoundsException e) { + logger.warn("Unable to apply security configuration for {}", sc.getValue()); + } + } + + } + catch (IndexOutOfBoundsException e) { + logger.warn("No td:Thing description, unable to determine security configurations, assuming no security policies apply"); + } + + if (targets.isEmpty()) { + throw new Error("No target found for TD Thing"); + } + + // TODO: determine which protocol is used to know which vocabulary is needed for the protocol specific part. + String target = targets.get(0).getValue(); + String contentType = contentTypes.isEmpty()? null: contentTypes.get(0).getValue(); + + // Retrieve HTTP headers + for (Term headerListItem: headerList) { + try { + List header = Utils.getList(rmlStore, headerListItem); + for(Term h: header) { + String headerName = Utils.getObjectsFromQuads(rmlStore.getQuads(h, new NamedNode(NAMESPACES.HTV + "fieldName"), null)).get(0).getValue(); + String headerValue = Utils.getObjectsFromQuads(rmlStore.getQuads(h, new NamedNode(NAMESPACES.HTV + "fieldValue"), null)).get(0).getValue(); + logger.debug("Retrieved HTTP header: '{}','{}'", headerName, headerValue); + headers.put(headerName, headerValue); + } + } + catch(IndexOutOfBoundsException e) { + logger.warn("Unable to retrieve header name and value for {}", headerListItem.getValue()); + } + } + access = new WoTAccess(target, contentType, headers, auth); + break; + case NAMESPACES.DCAT + "Distribution": + List dcatUrls = Utils.getObjectsFromQuads(rmlStore.getQuads(source, new NamedNode(NAMESPACES.DCAT + "downloadURL"), null)); + + if (dcatUrls.isEmpty()) { + throw new Error("No url found for the DCAT Distribution"); + } + + String dcatValue = dcatUrls.get(0).getValue(); + if (isRemoteFile(dcatValue)) { + + List refFormulationTerms = Utils.getObjectsFromQuads(rmlStore.getQuads(logicalSource, new NamedNode(NAMESPACES.RML2 + "referenceFormulation"), null)); + String mimetype = REF_FORM_MIMETYPE.get(refFormulationTerms.get(0).getValue()); + if (mimetype != null) { + access = new RemoteFileAccess(dcatValue, mimetype); + } else { + access = new RemoteFileAccess(dcatValue); + } + } else { + logger.debug("Local file found `{}`, trying in basePath '{}' and mapping path '{}'", dcatValue, this.basePath, this.mappingPath); + File f1 = new File(this.basePath, dcatValue); + File f2 = new File(this.mappingPath, dcatValue); + File f3 = new File(dcatValue); + if (f1.exists() || f3.exists()) { + access = new LocalFileAccess(dcatValue, this.basePath); + } else if (f2.exists()) { + access = new LocalFileAccess(dcatValue, this.mappingPath); + } + else { + throw new Error("Cannot find " + dcatValue); + } + } break; default: - throw new NotImplementedException(); + throw new NotImplementedException(sourceType.get(0).getValue()); } } @@ -133,9 +306,6 @@ public Access getAccess(Term logicalSource, QuadStore rmlStore) { */ private RDBAccess getRDBAccess(QuadStore rmlStore, Term source, Term logicalSource) { - // - Table - List tables = Utils.getObjectsFromQuads(rmlStore.getQuads(logicalSource, new NamedNode(NAMESPACES.RR + "tableName"), null)); - // Retrieve database information from source object // - Driver URL @@ -145,7 +315,7 @@ private RDBAccess getRDBAccess(QuadStore rmlStore, Term source, Term logicalSour throw new Error("The database source object " + source + " does not include a driver."); } - DatabaseType.Database database = DatabaseType.getDBtype(driverObject.get(0).getValue()); + DatabaseType database = DatabaseType.getDBtype(driverObject.get(0).getValue()); // - DSN List dsnObject = Utils.getObjectsFromQuads(rmlStore.getQuads(source, new NamedNode(NAMESPACES.D2RQ + "jdbcDSN"), null)); @@ -155,22 +325,18 @@ private RDBAccess getRDBAccess(QuadStore rmlStore, Term source, Term logicalSour } String dsn = dsnObject.get(0).getValue(); - dsn = dsn.substring(dsn.indexOf("//") + 2); - // - SQL query - String query; - List queryObject = Utils.getObjectsFromQuads(rmlStore.getQuads(logicalSource, new NamedNode(NAMESPACES.RML + "query"), null)); + String referenceFormulation = Utils.getObjectsFromQuads(rmlStore.getQuads(logicalSource, new NamedNode(NAMESPACES.RML2 + "referenceFormulation"), null)).get(0).getValue(); - if (queryObject.isEmpty()) { - if (tables.isEmpty()) { - // TODO better message (include Triples Map somewhere) + String query; + String iterator = Utils.getObjectsFromQuads(rmlStore.getQuads(logicalSource, new NamedNode(NAMESPACES.RML2 + "iterator"), null)).get(0).getValue(); - throw new Error("The Logical Source does not include a SQL query nor a target table."); - } else { - query = "SELECT * FROM " + tables.get(0).getValue(); - } + if (referenceFormulation.equals(ReferenceFormulation.RDBTable)) { + // rml:iterator contains the table name + query = String.format("SELECT * FROM %s", iterator); } else { - query = queryObject.get(0).getValue(); + // rml:iterator contains the query itself + query = iterator; } // - Username @@ -190,16 +356,20 @@ private RDBAccess getRDBAccess(QuadStore rmlStore, Term source, Term logicalSour password = passwordObject.get(0).getValue(); } - return new RDBAccess(dsn, database, username, password, query, "text/csv"); + // - ContentType + List contentType = Utils.getObjectsFromQuads(rmlStore.getQuads(logicalSource, new NamedNode(NAMESPACES.RML + "referenceFormulation"), null)); + + return new RDBAccess(dsn, database, username, password, query, (contentType.isEmpty() ? "text/csv" : contentType.get(0).getValue())); } /** * This method returns a SPARQLResultFormat based on the result formats and reference formulations. * @param resultFormats the result formats used to determine the SPARQLResultFormat. - * @param referenceFormulations the reference formulations used to to determine the SPARQLResultFormat. + * @param referenceFormulations the reference formulations used to determine the SPARQLResultFormat. * @return a SPARQLResultFormat. */ private SPARQLResultFormat getSPARQLResultFormat(List resultFormats, List referenceFormulations) { + logger.debug("Getting SPARQL result format for result format '{}' and reference formulations '{}'", resultFormats.toString(), referenceFormulations.toString()); if (resultFormats.isEmpty() && referenceFormulations.isEmpty()) { // This will never be called atm but may come in handy later throw new Error("Please specify the sd:resultFormat of the SPARQL endpoint or a rml:referenceFormulation."); } else if (referenceFormulations.isEmpty()) { @@ -224,9 +394,9 @@ private SPARQLResultFormat getSPARQLResultFormat(List resultFormats, List< throw new Error("Unsupported rml:referenceFormulation for a SPARQL source."); } else { for (SPARQLResultFormat format : SPARQLResultFormat.values()) { - - if (resultFormats.get(0).getValue().equals(format.getUri()) - && format.getReferenceFormulations().contains(referenceFormulations.get(0).getValue())) { + logger.debug(format + " " + resultFormats.get(0).getValue().equals(format.getUri()) + " " + format.getReferenceFormulations().contains(referenceFormulations.get(0).getValue())); + logger.debug(format.getReferenceFormulations().toString()); + if (resultFormats.get(0).getValue().equals(format.getUri())) { return format; } } diff --git a/src/main/java/be/ugent/rml/access/LocalFileAccess.java b/src/main/java/be/ugent/rml/access/LocalFileAccess.java deleted file mode 100644 index 00eda2c6..00000000 --- a/src/main/java/be/ugent/rml/access/LocalFileAccess.java +++ /dev/null @@ -1,91 +0,0 @@ -package be.ugent.rml.access; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.util.Map; - -import static be.ugent.rml.Utils.getHashOfString; -import static be.ugent.rml.Utils.getInputStreamFromFile; -import static org.apache.commons.io.FileUtils.getFile; - -/** - * This class represents access to a local file. - */ -public class LocalFileAccess implements Access { - - private String path; - private String basePath; - - /** - * This constructor takes the path and the base path of a file. - * @param path the relative path of the file. - * @param basePath the used base path. - */ - public LocalFileAccess(String path, String basePath) { - this.path = path; - this.basePath = basePath; - } - - /** - * This method returns the InputStream of the local file. - * @return an InputStream. - * @throws IOException - */ - @Override - public InputStream getInputStream() throws IOException { - File file = new File(this.path); - - if (!file.isAbsolute()) { - file = getFile(this.basePath, this.path); - } - - return getInputStreamFromFile(file); - } - - /** - * This methods returns the datatypes of the file. - * This method always returns null, because the datatypes can't be determined from a local file for the moment. - * @return the datatypes of the file. - */ - @Override - public Map getDataTypes() { - return null; - } - - @Override - public boolean equals(Object o) { - if (o instanceof LocalFileAccess) { - LocalFileAccess access = (LocalFileAccess) o; - return path.equals(access.getPath()) && basePath.equals(access.getBasePath()); - } else { - return false; - } - } - - @Override - public int hashCode() { - return getHashOfString(getPath() + getBasePath()); - } - - /** - * This method returns the path of the access. - * @return the relative path. - */ - public String getPath() { - return path; - } - - /** - * This method returns the base path of the access. - * @return the base path. - */ - public String getBasePath() { - return basePath; - } - - @Override - public String toString() { - return this.path; - } -} diff --git a/src/main/java/be/ugent/rml/access/RDBAccess.java b/src/main/java/be/ugent/rml/access/RDBAccess.java deleted file mode 100644 index c742d86a..00000000 --- a/src/main/java/be/ugent/rml/access/RDBAccess.java +++ /dev/null @@ -1,308 +0,0 @@ -package be.ugent.rml.access; - -import be.ugent.rml.DatabaseType; -import org.apache.commons.csv.CSVFormat; -import org.apache.commons.csv.CSVPrinter; - -import java.io.*; -import java.sql.*; -import java.util.HashMap; -import java.util.Map; - -import static be.ugent.rml.Utils.getHashOfString; - -/** - * This class represents the access to a relational database. - */ -public class RDBAccess implements Access { - - private String dsn; - private DatabaseType.Database database; - private String username; - private String password; - private String query; - private String contentType; - private Map datatypes = new HashMap<>(); - - /** - * This constructor takes as arguments the dsn, database, username, password, query, and content type. - * @param dsn the data source name. - * @param database the database type. - * @param username the username of the user that executes the query. - * @param password the password of the above user. - * @param query the SQL query to use. - * @param contentType the content type of the results. - */ - public RDBAccess(String dsn, DatabaseType.Database database, String username, String password, String query, String contentType) { - this.dsn = dsn; - this.database = database; - this.username = username; - this.password = password; - this.query = query; - this.contentType = contentType; - } - - /** - * This method returns an InputStream of the results of the SQL query. - * @return an InputStream with the results. - * @throws IOException - */ - @Override - public InputStream getInputStream() throws IOException { - // JDBC objects - Connection connection = null; - Statement statement = null; - String jdbcDriver = DatabaseType.getDriver(database); - String jdbcDSN = "jdbc:" + database.toString() + "://" + dsn; - InputStream inputStream = null; - - try { - // Register JDBC driver - Class.forName(jdbcDriver); - - // Open connection - String connectionString = jdbcDSN; - if (!connectionString.contains("user=")) { - connectionString += "?user=" + username + "&password=" + password; - } - - if (database == DatabaseType.Database.MYSQL) { - connectionString += "&serverTimezone=UTC&useSSL=false"; - } - - if (database == DatabaseType.Database.SQL_SERVER) { - connectionString = connectionString.replaceAll("\\?|&", ";"); - - if (!connectionString.endsWith(";")) { - connectionString += ";"; - } - } - connection = DriverManager.getConnection(connectionString); - - // Execute query - statement = connection.createStatement(); - ResultSet rs = statement.executeQuery(query); - - // Turn the Results Set into a CSV stream. - inputStream = getCSVInputStream(rs); - - // Clean-up environment - rs.close(); - statement.close(); - connection.close(); - - } catch (Exception sqlE) { - sqlE.printStackTrace(); - } finally { - - // finally block used to close resources - try { - if (statement != null) { - statement.close(); - } - } catch (SQLException se2) { - }// nothing we can do - - try { - if (connection != null) { - connection.close(); - } - } catch (SQLException se) { - se.printStackTrace(); - } - } - - return inputStream; - } - - /** - * This method returns the datatypes used for the columns in the accessed database. - * @return a map of column names and their datatypes. - */ - @Override - public Map getDataTypes() { - return datatypes; - } - - /** - * This method creates an CSV-formatted InputStream from a Result Set. - * @param rs the Result Set that is used. - * @return a CSV-formatted InputStream. - * @throws SQLException - */ - private InputStream getCSVInputStream(ResultSet rs) throws SQLException { - // Get number of requested columns - ResultSetMetaData rsmd = rs.getMetaData(); - int columnCount = rsmd.getColumnCount(); - - boolean filledInDataTypes = false; - StringWriter writer = new StringWriter(); - - try { - CSVPrinter printer = new CSVPrinter(writer, CSVFormat.DEFAULT.withHeader(getCSVHeader(rsmd, columnCount))); - printer.printRecords(); - - // Extract data from result set - while (rs.next()) { - String[] csvRow = new String[columnCount]; - - // Iterate over column names - for (int i = 1; i <= columnCount; i++) { - String columnName = rsmd.getColumnName(i); - - if (!filledInDataTypes) { - String dataType = getColumnDataType(rsmd.getColumnTypeName(i)); - - if (dataType != null) { - datatypes.put(columnName, dataType); - } - } - - // Add value to CSV row. - csvRow[i - 1] = rs.getString(columnName); - } - - // Add CSV row to CSVPrinter. - // non-varargs call - printer.printRecord((Object[]) csvRow); - filledInDataTypes = true; - } - } catch (IOException e) { - e.printStackTrace(); - } - - // Get InputStream from StringWriter. - return new ByteArrayInputStream(writer.toString().getBytes()); - } - - /** - * This method returns the corresponding datatype for a SQL datatype. - * @param type the SQL datatype. - * @return the url of the corresponding datatype. - */ - private String getColumnDataType(String type) { - switch (type.toUpperCase()) { - case "BYTEA": - case "BINARY": - case "BINARY VARYING": - case "BINARY LARGE OBJECT": - case "VARBINARY": - return "http://www.w3.org/2001/XMLSchema#hexBinary"; - case "NUMERIC": - case "DECIMAL": - return "http://www.w3.org/2001/XMLSchema#decimal"; - case "SMALLINT": - case "INT": - case "INT4": - case "INT8": - case "INTEGER": - case "BIGINT": - return "http://www.w3.org/2001/XMLSchema#integer"; - case "FLOAT": - case "FLOAT4": - case "FLOAT8": - case "REAL": - case "DOUBLE": - case "DOUBLE PRECISION": - return "http://www.w3.org/2001/XMLSchema#double"; - case "BIT": - case "BOOL": - case "BOOLEAN": - return "http://www.w3.org/2001/XMLSchema#boolean"; - case "DATE": - return "http://www.w3.org/2001/XMLSchema#date"; - case "TIME": - return "http://www.w3.org/2001/XMLSchema#time"; - case "TIMESTAMP": - case "DATETIME": - return "http://www.w3.org/2001/XMLSchema#dateTime"; - } - return null; - } - - /** - * This method returns the header of the CSV. - * @param rsmd metdata of the Result Set - * @param columnCount the number of columns. - * @return a String array with the headers. - * @throws SQLException - */ - private String[] getCSVHeader(final ResultSetMetaData rsmd, final int columnCount) throws SQLException { - String[] headers = new String[columnCount]; - - for (int i = 1; i <= columnCount; i++) { - headers[i - 1] = rsmd.getColumnName(i); - } - - return headers; - } - - @Override - public boolean equals(Object o) { - if (o instanceof RDBAccess) { - RDBAccess access = (RDBAccess) o; - - return dsn.equals(access.getDSN()) - && database.equals(access.getDatabase()) - && username.equals(access.getUsername()) - && password.equals(access.getPassword()) - && query.equals(access.getQuery()) - && contentType.equals(access.getContentType()); - } else { - return false; - } - } - - @Override - public int hashCode() { - return getHashOfString(getDSN() + getDatabase() + getUsername() + getPassword() + getQuery() + getContentType()); - } - - /** - * This method returns the DNS. - * @return the DNS. - */ - public String getDSN() { - return dsn; - } - - /** - * This method returns the database type. - * @return the database type. - */ - public DatabaseType.Database getDatabase() { - return database; - } - - /** - * This method returns the username. - * @return the username. - */ - public String getUsername() { - return username; - } - - /** - * This method returns the password. - * @return the password. - */ - public String getPassword() { - return password; - } - - /** - * This method returns the SQL query. - * @return the SQL query. - */ - public String getQuery() { - return query; - } - - /** - * This method returns the content type. - * @return the content type. - */ - public String getContentType() { - return contentType; - } -} diff --git a/src/main/java/be/ugent/rml/access/RemoteFileAccess.java b/src/main/java/be/ugent/rml/access/RemoteFileAccess.java deleted file mode 100644 index 49666b2e..00000000 --- a/src/main/java/be/ugent/rml/access/RemoteFileAccess.java +++ /dev/null @@ -1,78 +0,0 @@ -package be.ugent.rml.access; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.util.Map; - -import static be.ugent.rml.Utils.getHashOfString; -import static be.ugent.rml.Utils.getInputStreamFromURL; - -/** - * This class represents access to a remote file. - */ -public class RemoteFileAccess implements Access { - - private String location; - private String contentType; - - public RemoteFileAccess(String location) { - this(location, ""); - } - - /** - * This constructor of RemoteFileAccess taking location and content type as arguments. - * @param location the location of the remote file. - * @param contentType the content type of the remote file. - */ - public RemoteFileAccess(String location, String contentType) { - this.location = location; - this.contentType = contentType; - } - - @Override - public InputStream getInputStream() throws IOException { - return getInputStreamFromURL(new URL(location), contentType); - } - - /** - * This methods returns the datatypes of the file. - * This method always returns null, because the datatypes can't be determined from a remote file for the moment. - * @return the datatypes of the file. - */ - @Override - public Map getDataTypes() { - return null; - } - - @Override - public boolean equals(Object o) { - if (o instanceof RemoteFileAccess) { - RemoteFileAccess access = (RemoteFileAccess) o; - return location.equals(access.getLocation()) && contentType.equals(access.getContentType()); - } else { - return false; - } - } - - @Override - public int hashCode() { - return getHashOfString(getLocation() + getContentType()); - } - - /** - * The method returns the location of the remote file. - * @return the location. - */ - public String getLocation() { - return location; - } - - /** - * This method returns the content type of the remote file. - * @return the content type. - */ - public String getContentType() { - return contentType; - } -} diff --git a/src/main/java/be/ugent/rml/access/SPARQLEndpointAccess.java b/src/main/java/be/ugent/rml/access/SPARQLEndpointAccess.java deleted file mode 100644 index 62c371cf..00000000 --- a/src/main/java/be/ugent/rml/access/SPARQLEndpointAccess.java +++ /dev/null @@ -1,114 +0,0 @@ -package be.ugent.rml.access; - -import be.ugent.rml.Utils; - -import java.io.*; -import java.net.HttpURLConnection; -import java.net.URL; -import java.util.HashMap; -import java.util.Map; - -import static be.ugent.rml.Utils.getHashOfString; - -/** - * This class represents the access to a SPARQL endpoint. - */ -public class SPARQLEndpointAccess implements Access { - - private String contentType; - private String endpoint; - private String query; - - /** - * This constructor takes a content type, url of the endpoint, and a SPARQL query as arguments. - * @param contentType the content type of the results. - * @param endpoint the url of the SPARQL endpoint. - * @param query the SPARQL query used on the endpoint. - */ - public SPARQLEndpointAccess(String contentType, String endpoint, String query) { - this.contentType = contentType; - this.endpoint = endpoint; - this.query = query; - } - - /** - * This method returns an InputStream of the results of the SPARQL endpoint. - * @return an InputStream. - * @throws IOException - */ - @Override - public InputStream getInputStream() throws IOException { - // Query the endpoint - URL url = new URL(endpoint); - HttpURLConnection connection = (HttpURLConnection) url.openConnection(); - connection.setRequestMethod("GET"); - - // Set 'Accept' header - connection.setRequestProperty("Accept", contentType); - - // Set 'query' parameter - Map urlParams = new HashMap() {{ - put("query", query); - }}; - - connection.setDoOutput(true); - DataOutputStream out = new DataOutputStream(connection.getOutputStream()); - out.writeBytes(Utils.getURLParamsString(urlParams)); - out.flush(); - out.close(); - - // TODO check this code - int status = connection.getResponseCode(); - - return connection.getInputStream(); - } - - @Override - public boolean equals(Object o) { - if (o instanceof SPARQLEndpointAccess) { - SPARQLEndpointAccess access = (SPARQLEndpointAccess) o; - return endpoint.equals(access.getEndpoint()) && contentType.equals(access.getContentType()) && query.equals(access.getQuery()); - } else { - return false; - } - } - - @Override - public int hashCode() { - return getHashOfString(getEndpoint() + getQuery() + getContentType()); - } - - /** - * This methods returns the datatypes of the results of the SPARQL query. - * This method always returns null at the moment. - * @return the datatypes of the results of the SPARQL query. - */ - @Override - public Map getDataTypes() { - return null; - } - - /** - * This method returns the content type of the results. - * @return the content type of the results. - */ - public String getContentType() { - return contentType; - } - - /** - * This method returns the url of the endpoint. - * @return the url of the endpoint. - */ - public String getEndpoint() { - return endpoint; - } - - /** - * This method returns the SPARQL query that is used to get the results. - * @return the SPARQL query that is used to get the results. - */ - public String getQuery() { - return query; - } -} diff --git a/src/main/java/be/ugent/rml/cli/Main.java b/src/main/java/be/ugent/rml/cli/Main.java index 60bd9125..7faf67c7 100644 --- a/src/main/java/be/ugent/rml/cli/Main.java +++ b/src/main/java/be/ugent/rml/cli/Main.java @@ -1,53 +1,86 @@ package be.ugent.rml.cli; +import be.ugent.idlab.knows.functions.agent.Agent; +import be.ugent.idlab.knows.functions.agent.AgentFactory; +import be.ugent.knows.idlabFunctions.IDLabFunctions; import be.ugent.rml.Executor; +import be.ugent.rml.NAMESPACES; +import be.ugent.rml.StrictMode; import be.ugent.rml.Utils; import be.ugent.rml.conformer.MappingConformer; -import be.ugent.rml.functions.FunctionLoader; -import be.ugent.rml.functions.lib.GrelProcessor; -import be.ugent.rml.functions.lib.IDLabFunctions; import be.ugent.rml.metadata.MetadataGenerator; import be.ugent.rml.records.RecordsFactory; +import be.ugent.rml.store.Quad; import be.ugent.rml.store.QuadStore; import be.ugent.rml.store.RDF4JStore; -import be.ugent.rml.store.SimpleQuadStore; +import be.ugent.rml.target.Target; +import be.ugent.rml.target.TargetFactory; import be.ugent.rml.term.NamedNode; import be.ugent.rml.term.Term; import ch.qos.logback.classic.Level; import org.apache.commons.cli.*; import org.eclipse.rdf4j.rio.RDFFormat; +import org.eclipse.rdf4j.rio.RDFParseException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.Marker; import org.slf4j.MarkerFactory; import java.io.*; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; import java.time.Instant; import java.util.*; import java.util.stream.Collectors; +import static be.ugent.rml.StrictMode.BEST_EFFORT; +import static be.ugent.rml.StrictMode.STRICT; + public class Main { private static final Logger logger = LoggerFactory.getLogger(Main.class); private static final Marker fatal = MarkerFactory.getMarker("FATAL"); + private static final String defaultBaseIRI = "http://example.com"; + public static void main(String[] args) { - main(args, System.getProperty("user.dir")); + try { + run(args, System.getProperty("user.dir")); + } catch (Exception e) { + System.out.println(e); + System.exit(1); + } + } + + public static void run(String[] args) throws Exception { + run(args, System.getProperty("user.dir")); } /** - * Main method use for the CLI. Allows to also set the current working directory via the argument basePath. - * @param args the CLI arguments + * Main method use for the CLI. Allows to also set the current working directory + * via the argument basePath. + * + * @param args the CLI arguments * @param basePath the basePath used during the execution. */ - public static void main(String[] args, String basePath) { + public static void run(String[] args, String basePath) throws Exception { Options options = new Options(); + boolean onlyConvertMapping = false; Option mappingdocOption = Option.builder("m") .longOpt("mappingfile") .hasArg() .numberOfArgs(Option.UNLIMITED_VALUES) .desc("one or more mapping file paths and/or strings (multiple values are concatenated). " + - "r2rml is converted to rml if needed using the r2rml arguments.") + "r2rml is converted to rml if needed using the r2rml arguments." + + "RDF Format is determined based on extension.") + .build(); + Option privateSecurityDataOption = Option.builder("psd") + .longOpt("privatesecuritydata") + .hasArg() + .numberOfArgs(Option.UNLIMITED_VALUES) + .desc("one or more private security files containing all private security information such as " + + "usernames, passwords, certificates, etc.") .build(); Option outputfileOption = Option.builder("o") .longOpt("outputfile") @@ -57,7 +90,8 @@ public static void main(String[] args, String basePath) { Option functionfileOption = Option.builder("f") .longOpt("functionfile") .hasArg() - .desc("path to functions.ttl file (dynamic functions are found relative to functions.ttl)") + .numberOfArgs(Option.UNLIMITED_VALUES) + .desc("one or more function file paths (dynamic functions with relative paths are found relative to the cwd)") .build(); Option triplesmapsOption = Option.builder("t") .longOpt("triplesmaps") @@ -66,7 +100,7 @@ public static void main(String[] args, String basePath) { .build(); Option removeduplicatesOption = Option.builder("d") .longOpt("duplicates") - .desc("remove duplicates in the output") + .desc("remove duplicates in the HDT, N-Triples, or N-Quads output") .build(); Option configfileOption = Option.builder("c") .longOpt("configfile") @@ -93,7 +127,7 @@ public static void main(String[] args, String basePath) { .build(); Option serializationFormatOption = Option.builder("s") .longOpt("serialization") - .desc("serialization format (nquads (default), turtle, trig, trix, jsonld, hdt)") + .desc("serialization format (nquads (default), turtle, trig, trix, jsonld, hdt, jelly)") .hasArg() .build(); Option jdbcDSNOption = Option.builder("dsn") @@ -111,8 +145,27 @@ public static void main(String[] args, String basePath) { .desc("username of the database when using R2RML rules") .hasArg() .build(); + Option strictModeOption = Option.builder() + .longOpt("strict") + .desc("Enable strict mode. In strict mode, the mapper will fail on invalid IRIs instead of skipping them.") + .build(); + Option baseIriOption = Option.builder("b") + .longOpt("base-iri") + .desc("Base IRI used to expand relative IRIs in generated terms in the output.") + .hasArg() + .build(); + Option provideOwnEOFMarkerOption = Option.builder() + .longOpt("disable-automatic-eof-marker") + .desc("Setting this option assumes input data has a kind of End-of-File marker. " + + "Don't use unless you're absolutely sure what you're doing!") + .build(); + Option convertMapping = Option.builder() + .longOpt("convert-mapping") + .desc("Only convert the mapping to the latest RML specification by the W3C Community Group") + .build(); options.addOption(mappingdocOption); + options.addOption(privateSecurityDataOption); options.addOption(outputfileOption); options.addOption(functionfileOption); options.addOption(removeduplicatesOption); @@ -126,6 +179,10 @@ public static void main(String[] args, String basePath) { options.addOption(jdbcDSNOption); options.addOption(passwordOption); options.addOption(usernameOption); + options.addOption(strictModeOption); + options.addOption(baseIriOption); + options.addOption(provideOwnEOFMarkerOption); + options.addOption(convertMapping); CommandLineParser parser = new DefaultParser(); try { @@ -136,7 +193,9 @@ public static void main(String[] args, String basePath) { Properties configFile = null; if (lineArgs.hasOption("c")) { configFile = new Properties(); - configFile.load(Utils.getReaderFromLocation(lineArgs.getOptionValue("c"))); + try (Reader reader = Utils.getReaderFromLocation(lineArgs.getOptionValue("c"))) { + configFile.load(reader); + } } if (checkOptionPresence(helpOption, lineArgs, configFile)) { @@ -150,164 +209,358 @@ public static void main(String[] args, String basePath) { setLoggerLevel(Level.ERROR); } + if (checkOptionPresence(convertMapping, lineArgs, configFile)) { + onlyConvertMapping = true; + } + String[] mOptionValue = getOptionValues(mappingdocOption, lineArgs, configFile); - if (mOptionValue == null) { + List lis = new ArrayList<>(); + + if (mOptionValue == null && System.console() != null) { printHelp(options); - } else { + throw new IllegalArgumentException("No mapping file nor via stdin found!"); + } + + String outputFile = getPriorityOptionValue(outputfileOption, lineArgs, configFile); + // If output path exists and contains 'directory-like' characters + if (outputFile != null) { + // Windows paths 🤷â€â™‚ï¸ + outputFile = outputFile.replaceAll("\\\\", "/"); + if (!Utils.checkPathParent(outputFile, null)) { + logger.error(fatal, "The given output path does not exist."); + throw new IllegalArgumentException("The given output path does not exist."); + } + } + + if (mOptionValue != null) { // Concatenate all mapping files - List lis = Arrays.stream(mOptionValue) - .map(Utils::getInputStreamFromMOptionValue) + lis = Arrays.stream(mOptionValue) + .map(Utils::getInputStreamFromFileOrContentString) .collect(Collectors.toList()); - InputStream is = new SequenceInputStream(Collections.enumeration(lis)); + } - Map mappingOptions = new HashMap<>(); - for (Option option : new Option[]{jdbcDSNOption, passwordOption, usernameOption}) { - if (checkOptionPresence(option, lineArgs, configFile)) { - mappingOptions.put(option.getLongOpt().replace("r2rml-", ""), getOptionValues(option, lineArgs, configFile)[0]); + try { + BufferedInputStream bis = new BufferedInputStream(System.in); + int available = bis.available(); + if (available > 0) { + // This little hack solves Maven tests: if the console is detached + // the normal System.in could send EOT bytes to indicate that there is no + // input. + // So we check if there are other bytes than the (EOT) / End of File (EOF) bytes: 04 + byte[] firstBytes = new byte[32]; + bis.mark(32); + int bytesRead = bis.read(firstBytes); + bis.reset(); + if (bytesRead > 0) { + boolean addStream = false; + for (byte aByte : firstBytes) { + if (aByte != 0 && aByte != 4) { // 4 is the EOF / EOT byte + addStream = true; + break; + } + } + if (addStream) { + lis.add(bis); + } } } + } catch (IOException ex) { + logger.warn("Error trying to check System.in: {}", ex.getMessage()); + // The inputstream is closed when read. Leads to IOExceptions for tests that don't provide their own inputstream + } - // Read mapping file. - RDF4JStore rmlStore = new RDF4JStore(); - rmlStore.read(is, null, RDFFormat.TURTLE); + InputStream is = new SequenceInputStream(Collections.enumeration(lis));; - // Convert mapping file to RML if needed. - MappingConformer conformer = new MappingConformer(rmlStore, mappingOptions); + Map mappingOptions = new HashMap<>(); + for (Option option : new Option[]{jdbcDSNOption, passwordOption, usernameOption}) { + if (checkOptionPresence(option, lineArgs, configFile)) { + mappingOptions.put(option.getLongOpt().replace("r2rml-", ""), getOptionValues(option, lineArgs, configFile)[0]); + } + } - try { - boolean conversionNeeded = conformer.conform(); + // Read mapping file. + RDF4JStore rmlStore = new RDF4JStore(); + try { + rmlStore.read(is, null, RDFFormat.TURTLE); + } + catch (RDFParseException e) { + logger.error(fatal, "Unable to parse mapping rules as Turtle. Does the file exist and is it valid Turtle?", e); + throw new IllegalArgumentException("Unable to parse mapping rules as Turtle. Does the file exist and is it valid Turtle?"); + } - if (conversionNeeded) { - logger.info("Conversion to RML was needed."); - } - } catch (Exception e) { - logger.error(fatal, "Failed to make mapping file conformant to RML spec.", e); - } + // Private security data is optionally + if (lineArgs.hasOption("psd")) { + // Read the private security data. + String[] mOptionValuePrivateSecurityData = getOptionValues(privateSecurityDataOption, lineArgs, configFile); + List lisPrivateSecurityData = Arrays.stream(mOptionValuePrivateSecurityData) + .map(Utils::getInputStreamFromFileOrContentString) + .collect(Collectors.toList()); - RecordsFactory factory = new RecordsFactory(basePath); + try (InputStream isPrivateSecurityData = new SequenceInputStream(Collections.enumeration(lisPrivateSecurityData))) { + rmlStore.read(isPrivateSecurityData, null, RDFFormat.TURTLE); + } catch (RDFParseException e) { + logger.debug(e.getMessage()); + logger.error(fatal, "Unable to parse private security data as Turtle. Does the file exist and is it valid Turtle?"); + throw new IllegalArgumentException("Unable to parse private security data as Turtle. Does the file exist and is it valid Turtle?"); + } + } + + String mappingPath = ""; + try { + mappingPath = Utils.getFile(lineArgs.getOptionValue('m')).getParent(); + } catch (Exception e) { + logger.debug("Mapping path unknown as mapping file supplied via stdin"); + } + RecordsFactory factory = new RecordsFactory(basePath, mappingPath); + + String outputFormat = getPriorityOptionValue(serializationFormatOption, lineArgs, configFile); + QuadStore outputStore = getStoreForFormat(outputFormat); + + Executor executor; + + // Extract required information and create the MetadataGenerator + MetadataGenerator metadataGenerator = null; + String metadataFile = getPriorityOptionValue(metadataOption, lineArgs, configFile); + String requestedDetailLevel = getPriorityOptionValue(metadataDetailLevelOption, lineArgs, configFile); + + if (checkOptionPresence(metadataOption, lineArgs, configFile)) { + if (requestedDetailLevel != null) { + MetadataGenerator.DETAIL_LEVEL detailLevel; + switch (requestedDetailLevel) { + case "dataset": + detailLevel = MetadataGenerator.DETAIL_LEVEL.DATASET; + break; + case "triple": + detailLevel = MetadataGenerator.DETAIL_LEVEL.TRIPLE; + break; + case "term": + detailLevel = MetadataGenerator.DETAIL_LEVEL.TERM; + break; + default: + logger.error("Unknown metadata detail level option. Use the -h flag for more info."); + return; + } - String outputFormat = getPriorityOptionValue(serializationFormatOption, lineArgs, configFile); - QuadStore outputStore; + QuadStore metadataStore = getStoreForFormat(outputFormat); - if (outputFormat == null || outputFormat.equals("nquads") || outputFormat.equals("hdt")) { - outputStore = new SimpleQuadStore(); + metadataGenerator = new MetadataGenerator( + detailLevel, + getPriorityOptionValue(metadataOption, lineArgs, configFile), + mOptionValue, + rmlStore, + metadataStore + ); } else { - outputStore = new RDF4JStore(); + logger.error("Please specify the detail level when requesting metadata generation. Use the -h flag for more info."); } + } - Executor executor; - - // Extract required information and create the MetadataGenerator - MetadataGenerator metadataGenerator = null; - String metadataFile = getPriorityOptionValue(metadataOption, lineArgs, configFile); - String requestedDetailLevel = getPriorityOptionValue(metadataDetailLevelOption, lineArgs, configFile); + boolean strict = checkOptionPresence(strictModeOption, lineArgs, configFile); + StrictMode strictMode = strict ? STRICT : BEST_EFFORT; - if (checkOptionPresence(metadataOption, lineArgs, configFile)) { - if (requestedDetailLevel != null) { - MetadataGenerator.DETAIL_LEVEL detailLevel; - switch (requestedDetailLevel) { - case "dataset": - detailLevel = MetadataGenerator.DETAIL_LEVEL.DATASET; - break; - case "triple": - detailLevel = MetadataGenerator.DETAIL_LEVEL.TRIPLE; - break; - case "term": - detailLevel = MetadataGenerator.DETAIL_LEVEL.TERM; - break; - default: - logger.error("Unknown metadata detail level option. Use the -h flag for more info."); - return; - } - metadataGenerator = new MetadataGenerator( - detailLevel, - getPriorityOptionValue(metadataOption, lineArgs, configFile), - mOptionValue, - rmlStore - ); - } else { - logger.error("Please specify the detail level when requesting metadata generation. Use the -h flag for more info."); + // get the base IRI + String baseIRI = getPriorityOptionValue(baseIriOption, lineArgs, configFile); + if (baseIRI == null || baseIRI.isEmpty()) { + // if no explicit base IRI is set + if (strictMode.equals(STRICT)) { + throw new Exception("When running in strict mode, a base IRI argument must be set."); + } else { + if (mOptionValue != null) { + /* + * We have to get the InputStreams of the RML documents again, + * because we can only use an InputStream once + */ + lis = Arrays.stream(mOptionValue) + .map(Utils::getInputStreamFromFileOrContentString) + .collect(Collectors.toList()); + } + // Best-effort mode, use the @base directive as a fallback + try (InputStream is2 = new SequenceInputStream(Collections.enumeration(lis))) { + baseIRI = Utils.getBaseDirectiveTurtleOrDefault(is2, defaultBaseIRI); } } + } - String fOptionValue = getPriorityOptionValue(functionfileOption, lineArgs, configFile); - FunctionLoader functionLoader; + String[] fOptionValue = getOptionValues(functionfileOption, lineArgs, configFile); + final Agent functionAgent; - Map libraryMap = new HashMap<>(); - libraryMap.put("GrelFunctions", GrelProcessor.class); - libraryMap.put("IDLabFunctions", IDLabFunctions.class); + List triplesMaps = new ArrayList<>(); - if (fOptionValue == null) { - functionLoader = new FunctionLoader(null, null, libraryMap); - } else { - functionLoader = new FunctionLoader(Utils.getFile(fOptionValue), null, libraryMap); - } + String tOptionValue = getPriorityOptionValue(triplesmapsOption, lineArgs, configFile); + if (tOptionValue != null) { + List triplesMapsIRI = Arrays.asList(tOptionValue.split(",")); + triplesMapsIRI.forEach(iri -> { + triplesMaps.add(new NamedNode(iri)); + }); + } - // We have to get the InputStreams of the RML documents again, - // because we can only use an InputStream once. - lis = Arrays.stream(mOptionValue) - .map(Utils::getInputStreamFromMOptionValue) - .collect(Collectors.toList()); - is = new SequenceInputStream(Collections.enumeration(lis)); + // Read function description files. + if (fOptionValue == null) { + // default initialisation with IDLab functions and GREL functions... + functionAgent = AgentFactory.createFromFnO( + "fno/functions_idlab.ttl", "fno/functions_idlab_classes_java_mapping.ttl", + "fno_idlab_old/functions_idlab.ttl", "fno_idlab_old/functions_idlab_classes_java_mapping.ttl", + "functions_grel.ttl", + "grel_java_mapping.ttl"); + } else { + logger.debug("Using custom path to functions.ttl file: {}", Arrays.toString(fOptionValue)); + String[] optionWithIDLabFunctionArgs = new String[fOptionValue.length + 4]; + optionWithIDLabFunctionArgs[0] = "fno/functions_idlab.ttl" ; + optionWithIDLabFunctionArgs[1] = "fno/functions_idlab_classes_java_mapping.ttl" ; + optionWithIDLabFunctionArgs[2] = "fno_idlab_old/functions_idlab.ttl" ; + optionWithIDLabFunctionArgs[3] = "fno_idlab_old/functions_idlab_classes_java_mapping.ttl" ; + System.arraycopy(fOptionValue, 0, optionWithIDLabFunctionArgs, 4, fOptionValue.length); + functionAgent = AgentFactory.createFromFnO(optionWithIDLabFunctionArgs); + } - executor = new Executor(rmlStore, factory, functionLoader, outputStore, Utils.getBaseDirectiveTurtle(is)); + executor = new Executor(rmlStore, factory, outputStore, baseIRI, strictMode, functionAgent, mappingOptions); - List triplesMaps = new ArrayList<>(); + if (onlyConvertMapping) { + logger.debug("Outputting converted mapping following the latest RML specification"); + writeOutput(rmlStore, outputFile, "turtle"); + System.exit(0); + } - String tOptionValue = getPriorityOptionValue(triplesmapsOption, lineArgs, configFile); - if (tOptionValue != null) { - List triplesMapsIRI = Arrays.asList(tOptionValue.split(",")); - triplesMapsIRI.forEach(iri -> { - triplesMaps.add(new NamedNode(iri)); - }); - } + if (checkOptionPresence(provideOwnEOFMarkerOption, lineArgs, configFile)) { + logger.warn("Automatic EOF marker disabled!"); + executor.setEOFProvidedInData(); + } - if (metadataGenerator != null) { - metadataGenerator.preMappingGeneration(triplesMaps.isEmpty() ? - executor.getTriplesMaps() : triplesMaps, rmlStore); - } + executor.verifySources(basePath, mappingPath); + if (metadataGenerator != null) { + metadataGenerator.preMappingGeneration(triplesMaps.isEmpty() ? + executor.getTriplesMaps() : triplesMaps, rmlStore); + } - // Get start timestamp for post mapping metadata - String startTimestamp = Instant.now().toString(); + // Get start timestamp for post mapping metadata + String startTimestamp = Instant.now().toString(); + QuadStore result = null; - try { - QuadStore result = executor.execute(triplesMaps, checkOptionPresence(removeduplicatesOption, lineArgs, configFile), - metadataGenerator); + try { + Map targets = executor.execute(triplesMaps, checkOptionPresence(removeduplicatesOption, lineArgs, configFile), metadataGenerator); + } catch (Exception e) { + logger.error(e.getMessage()); + throw e; + } finally { + functionAgent.close(); + } - // Get stop timestamp for post mapping metadata - String stopTimestamp = Instant.now().toString(); + Map targets = executor.getTargets(); + if (targets != null) { + result = targets.get(new NamedNode("rmlmapper://default.store")); + if(result != null) { + result.copyNameSpaces(rmlStore); + } - // Generate post mapping metadata and output all metadata - if (metadataGenerator != null) { - metadataGenerator.postMappingGeneration(startTimestamp, stopTimestamp, - result); + result.copyNameSpaces(rmlStore); - writeOutput(metadataGenerator.getResult(), metadataFile, outputFormat); - } + IDLabFunctions.saveState(); - String outputFile = getPriorityOptionValue(outputfileOption, lineArgs, configFile); + writeOutputTargets(targets, rmlStore, basePath, outputFile, outputFormat, mappingPath); - if (result.isEmpty()) { - logger.info("No results!"); - // Write even if no results - } - result.copyNameSpaces(rmlStore); - writeOutput(result, outputFile, outputFormat); - } catch (Exception e) { - logger.error(e.getMessage()); - } } + // Get stop timestamp for post mapping metadata + String stopTimestamp = Instant.now().toString(); + + // Generate post mapping metadata and output all metadata + if (metadataGenerator != null && targets != null) { + metadataGenerator.postMappingGeneration(startTimestamp, stopTimestamp, result); + writeOutput(metadataGenerator.getResult(), metadataFile, outputFormat); + } + } catch (ParseException exp) { // oops, something went wrong - logger.error("Parsing failed. Reason: " + exp.getMessage()); + logger.error("Parsing failed. Reason: {}", exp.getMessage()); printHelp(options); + } catch (IllegalArgumentException exp) { + throw exp; } catch (Exception e) { logger.error(e.getMessage(), e); + throw e; + } + } + + private static void writeOutputTargets(Map targets, QuadStore rmlStore, String basePath, String outputFileDefault, String outputFormatDefault, String mappingPath) throws Exception { + boolean hasNoResults = true; + + logger.debug("Writing to Targets: {}", targets.keySet()); + TargetFactory targetFactory = new TargetFactory(basePath, mappingPath); + + // check if anything needs to be added to the rmlstore (e.g. dynamic targets) + if (targets.containsKey(new NamedNode(NAMESPACES.RMLE + "ThisMapping"))){ + rmlStore.addQuads(targets.get(new NamedNode(NAMESPACES.RMLE + "ThisMapping")).getQuads(null, null, null)); + // The generated dynamic logical targets have been added to the RML store. + // It is possible that they are written using the old RML terminology. + // Therefore, the mapping conformer needs to conform the RML store again. + MappingConformer conformer = new MappingConformer(rmlStore, null); + try { + boolean conversionNeeded = conformer.conform(); + + if (conversionNeeded) { + logger.info("Conversion to RML was needed."); + } + } catch (Exception e) { + logger.error("Failed to make dynamic targets conformant to RML spec.", e); + } + targets.remove(new NamedNode(NAMESPACES.RMLE + "ThisMapping")); + } + + // Go over each term and export to the Target if needed + for (Map.Entry termTargetMapping: targets.entrySet()) { + Term term = termTargetMapping.getKey(); + QuadStore store = termTargetMapping.getValue(); + + if (!store.isEmpty()) { + hasNoResults = false; + logger.info("Target: {} has {} results", term, store.size()); + } + + /* Remove magic marker from output */ + List quads = store.getQuads(null, null, null, null); + for (Quad q: quads) { + String subject = q.getSubject().toString(); + String object = q.getObject().toString(); + if (subject.contains(IDLabFunctions.MAGIC_MARKER_ENCODED) + || subject.contains(IDLabFunctions.MAGIC_MARKER) + || object.contains(IDLabFunctions.MAGIC_MARKER_ENCODED) + || object.contains(IDLabFunctions.MAGIC_MARKER) ) { + store.removeQuads(q.getSubject(), q.getPredicate(), q.getObject(), q.getGraph()); + } + } + + // Default target is exported separately for backwards compatibility reasons + if (term.getValue().equals("rmlmapper://default.store")) { + logger.debug("Exporting to default Target"); + writeOutput(store, outputFileDefault, outputFormatDefault); + } + else { + logger.debug("Exporting to Target: {}", term); + Target target = targetFactory.getTarget(term, rmlStore, store); + if (store.size() > 1) { + logger.info("{} quads were generated for {} Target", store.size(), target); + } else { + logger.info("{} quad was generated {} Target", store.size(), target); + } + + String serializationFormat = target.getSerializationFormat(); + OutputStream output = target.getOutputStream(); + store.addQuads(target.getMetadata()); + store.write(output, serializationFormat); + // Close OS resources + target.close(); + logger.debug("Exporting to Target: {}", target); + } + } + + if (hasNoResults) { + logger.info("No results!"); } } private static boolean checkOptionPresence(Option option, CommandLine lineArgs, Properties properties) { - return lineArgs.hasOption(option.getOpt()) || (properties != null + return (option.getOpt() != null && lineArgs.hasOption(option.getOpt())) + || (option.getLongOpt() != null && lineArgs.hasOption(option.getLongOpt())) + || (properties != null && properties.getProperty(option.getLongOpt()) != null && !properties.getProperty(option.getLongOpt()).equals("false")); // ex: 'help = false' in the config file shouldn't return the help text } @@ -374,19 +627,20 @@ private static File writeOutputUncompressed(QuadStore store, String outputFile, File targetFile = null; if (store.size() > 1) { - logger.info(store.size() + " quads were generated"); + logger.info("{} quads were generated for default Target", store.size()); } else { - logger.info(store.size() + " quad was generated"); + logger.info("{} quad was generated for default Target", store.size()); } + OutputStream out = null; try { - Writer out; - String doneMessage = null; + String doneMessage = null; + boolean isSystemOut = false; //if output file provided, write to triples output file if (outputFile != null) { targetFile = new File(outputFile); - logger.info("Writing quads to " + targetFile.getPath() + "..."); + logger.info("Writing quads to {}...", targetFile.getPath()); if (!targetFile.isAbsolute()) { targetFile = new File(System.getProperty("user.dir") + "/" + outputFile); @@ -394,22 +648,39 @@ private static File writeOutputUncompressed(QuadStore store, String outputFile, doneMessage = "Writing to " + targetFile.getPath() + " is done."; - out = new BufferedWriter(new FileWriter(targetFile)); + out = Files.newOutputStream(targetFile.toPath()); } else { - out = new BufferedWriter(new OutputStreamWriter(System.out)); + isSystemOut = true; + out = System.out; } store.write(out, format); - out.close(); + if (isSystemOut) { + out.flush(); // flush System.out stream + out = null; // replace with null, so it won't be closed later; + } if (doneMessage != null) { logger.info(doneMessage); } } catch (Exception e) { - System.err.println("Writing output failed. Reason: " + e.getMessage()); + logger.error("Writing output failed. Reason: " + e.getMessage()); + } finally { + if (out != null) { + try { + out.close(); + } catch (IOException e) { + logger.error("Could not close writer. ", e); + } + } + } return targetFile; } + + private static QuadStore getStoreForFormat(String outputFormat) { + return new RDF4JStore(); + } } diff --git a/src/main/java/be/ugent/rml/conformer/Converter.java b/src/main/java/be/ugent/rml/conformer/Converter.java index f31f49bc..a886a197 100644 --- a/src/main/java/be/ugent/rml/conformer/Converter.java +++ b/src/main/java/be/ugent/rml/conformer/Converter.java @@ -1,7 +1,5 @@ package be.ugent.rml.conformer; -import be.ugent.rml.term.Term; - import java.util.Map; /** @@ -10,16 +8,8 @@ */ interface Converter { /** - * Detection logic needed to determine mapping format of TriplesMap. - * @param tm TriplesMap - * @return true if is specific mapping format false if not - */ - boolean detect(Term tm); - - /** - * Try to convert mapping language TriplesMap to RML. + * Try to convert R2RML and old RML to new RML. * Has to be atomic. Original model must be recovered if conversion fails. - * @param tm TriplesMap */ - void convert(Term tm, Map mappingOptions) throws Exception; + void convert(Map mappingOptions) throws Exception; } diff --git a/src/main/java/be/ugent/rml/conformer/MappingConformer.java b/src/main/java/be/ugent/rml/conformer/MappingConformer.java index 63ba77f1..aaa8a442 100644 --- a/src/main/java/be/ugent/rml/conformer/MappingConformer.java +++ b/src/main/java/be/ugent/rml/conformer/MappingConformer.java @@ -5,8 +5,7 @@ import be.ugent.rml.term.NamedNode; import be.ugent.rml.term.Term; -import java.io.*; -import java.util.ArrayList; +import java.io.FileNotFoundException; import java.util.List; import java.util.Map; @@ -14,21 +13,27 @@ /** * Only validates by checking for at least one TriplesMap. - * Converts mapping files to RML. Currently only R2RML converter is implemented. + * Converts mapping files to W3C's Knowledge Graph Community Group RML from RML and R2RML. * InputStream of mapping file is used to create a store. TriplesMaps in store that need conversion * are detected by applying the converters detection methods and saved. convert tries to convert these - * to RML. Exceptions can be raised during validation and conversion, which the caller has to handle. - * Output of detect() informs if convert() should be used to convert to valid RML. + * to W3C RML. Exceptions can be raised during validation and conversion, which the caller has to handle. + * Output of detect() informs if convert() should be used to convert to valid W3C RML. * The validated RML can be returned as a QuadStore with getStore(). */ public class MappingConformer { + public enum Dialect { + RML, // Old RML + R2RML, // W3C's R2RML + RML2 // W3C's Knowledge Graph Construction Community Group RML + } + private QuadStore store; - private List unconvertedTriplesMaps = new ArrayList<>(); private Map mappingOptions; /** * Create MappingConformer from InputStream of mapping file in RDF. + * * @param store A QuadStore with the mapping rules. * @throws FileNotFoundException */ @@ -38,6 +43,7 @@ public MappingConformer(QuadStore store) throws Exception { /** * Create MappingConformer from InputStream of mapping file in RDF. + * * @param store A QuadStore with the mapping rules. * @throws FileNotFoundException */ @@ -48,65 +54,45 @@ public MappingConformer(QuadStore store, Map mappingOptions) thr /** * This method makes the QuadStore conformant to the RML spec. + * * @return True if the store had to be updated, else false. * @throws Exception if something goes wrong during detection or conversion. */ public boolean conform() throws Exception { - boolean conversionNeeded = this.detect(); - - if (conversionNeeded) { - this.convert(); - } - - return conversionNeeded; + this.detect(); + return false; } /** - * Detect if mapping file is valid RML. - * @return true if valid RML, false if conversion is needed + * Detect if mapping file is valid W3C RML. + * + * @return Dialect of the mapping file. Null if invalid. * @throws Exception if invalid or unconvertable */ - private boolean detect() throws Exception { - // TODO generalise for multiple converters - Converter converter = new R2RMLConverter(store); - - List triplesMaps = Utils.getSubjectsFromQuads(store - .getQuads( - null, - new NamedNode(RDF + "type"), - new NamedNode(RR + "TriplesMap"))); + private void detect() throws Exception { + // convert rml + RMLConverterNew converter = new RMLConverterNew(store); + converter.convert(mappingOptions); + // Check if we have a valid TriplesMap. + List triplesMaps = Utils.getSubjectsFromQuads(store.getQuads(null, new NamedNode(RML2 + "logicalSource"), null)); if (triplesMaps.isEmpty()) { throw new Exception("Mapping requires at least one TriplesMap"); } - // Find all triples maps - // This could be more efficient with a while loop, - // but these TriplesMaps are needed in any case when calling convert(). - for (Term triplesMap : triplesMaps) { - if (converter.detect(triplesMap)) { - unconvertedTriplesMaps.add(triplesMap); + // Triples Maps need a subject Map + List triplesMaps2 = Utils.getSubjectsFromQuads(store.getQuads(null, null, new NamedNode(RML2 + "TriplesMap"))); + for (Term triplesMap : triplesMaps2) { + if (!store.contains(triplesMap, new NamedNode(RML2 + "subjectMap"), null)) { + throw new Exception("TriplesMap requires a subject map"); } } - - return ! unconvertedTriplesMaps.isEmpty(); } - /** - * Tries to convert to RML. Model should still be valid on failure - * @throws Exception conversion failed - */ - private void convert() throws Exception { - // TODO generalise for multiple converters - Converter converter = new R2RMLConverter(store); - - for (Term unconvertedTriplesMap : unconvertedTriplesMaps) { - converter.convert(unconvertedTriplesMap, mappingOptions); - } - } /** * Debugging helper function to check difference of models + * * @param store QuadStore which subtracts * @return boolean this.store isSubset of given store */ @@ -116,6 +102,7 @@ boolean differenceInConformer(QuadStore store) { /** * Debugging helper function to check difference of models + * * @param store QuadStore which subtracts * @return boolean given store isSubset of store */ @@ -125,6 +112,7 @@ boolean differenceInGivenStore(QuadStore store) { /** * Get a valid QuadStore + * * @return a valid QuadStore */ public QuadStore getStore() { diff --git a/src/main/java/be/ugent/rml/conformer/R2RMLConverter.java b/src/main/java/be/ugent/rml/conformer/R2RMLConverter.java index 99530878..3b6b0ab3 100644 --- a/src/main/java/be/ugent/rml/conformer/R2RMLConverter.java +++ b/src/main/java/be/ugent/rml/conformer/R2RMLConverter.java @@ -1,6 +1,8 @@ package be.ugent.rml.conformer; +import be.ugent.idlab.knows.dataio.access.DatabaseType; import be.ugent.rml.NAMESPACES; +import be.ugent.rml.Utils; import be.ugent.rml.store.QuadStore; import be.ugent.rml.term.Literal; @@ -25,85 +27,74 @@ public class R2RMLConverter implements Converter { this.store = store; } - /** - * TriplesMap is R2RML if RR:logicalTable property is found - * - * @param triplesMap - * @return true if triplesMap is R2RML (tripleMap contains a rr:logicalTable) - */ - public boolean detect(Term triplesMap) { - return store.contains(triplesMap, new NamedNode(RR + "logicalTable"), null); - } - /** * Tries to convert R2RML TriplesMap to rml by: - * - renaming logicalTable -> logicalSource + * - renaming logicalTable to logicalSource * - adding referenceFormulation: CSV * - adding sqlVersion: SQL2008 - * - renaming rr:sqlQuery -> rml:query + * - renaming rr:sqlQuery to rml:query * - renaming all rr:column properties to rml:reference * - removing all rr:logicalTable nodes, leaving rml:logicalSource to take their place * - moving rest over from logicalTable to logicalSource * * @param triplesMap rr:TriplesMap */ - public void convert(Term triplesMap, Map mappingOptions) throws Exception { - // UNSAFE store changes not yet allowed; check if all required properties are present - Term logicalTable; - - // Get logical table - try { - logicalTable = store - .getQuad(triplesMap, new NamedNode(RR + "logicalTable"), null) - .getObject(); - } catch (Exception e) { - // Also not R2RML - throw new UnsupportedOperationException("Mapping is either RML without logicalSource or R2RML without logicalTable"); - } + public void convert(Map mappingOptions) throws Exception { + for (Term triplesMap: Utils.getSubjectsFromQuads(store.getQuads(null, new NamedNode(RML2 + "subjectMap"), null))) { + // UNSAFE store changes not yet allowed; check if all required properties are present + Term logicalTable; + + // Get logical table + try { + logicalTable = store + .getQuad(triplesMap, new NamedNode(RR + "logicalTable"), null) + .getObject(); + } catch (Exception e) { + // Also not R2RML + throw new UnsupportedOperationException("Mapping is either RML without logicalSource or R2RML without logicalTable"); + } - Term database; + Term database; - // SAFE store changes allowed + // SAFE store changes allowed + database = new NamedNode(triplesMap.getValue() + "_database"); -// if (! store.contains(null, null, new NamedNode(D2RQ + "Database"))) { - database = new NamedNode(triplesMap.getValue() + "_database"); + if (mappingOptions != null) { + store.addQuad(database, new NamedNode(RDF + "type"), new NamedNode(D2RQ + "Database")); - if (mappingOptions != null) { - store.addQuad(database, new NamedNode(RDF + "type"), new NamedNode(D2RQ + "Database")); + for (Map.Entry entry : mappingOptions.entrySet()) { + String removePrefix = entry.getKey(); + store.addQuad(database, new NamedNode(D2RQ + removePrefix), new Literal(entry.getValue())); - for (Map.Entry entry : mappingOptions.entrySet()) { - String removePrefix = entry.getKey(); - store.addQuad(database, new NamedNode(D2RQ + removePrefix), new Literal(entry.getValue())); + if (removePrefix.equals("jdbcDSN")) { + DatabaseType type = DatabaseType.getDBtype(entry.getValue()); + String driver = type.getDriver(); + + store.addQuad(database, new NamedNode(D2RQ + "jdbcDriver"), new Literal(driver)); + } + } } + + // Add logical source + String logicalSourceIRI = triplesMap.getValue() + "_logicalSource"; + Term logicalSource = new NamedNode(logicalSourceIRI); + + store.addQuad(triplesMap, new NamedNode(RML + "logicalSource"), logicalSource, null); + store.addQuad(logicalSource, new NamedNode(RML + "referenceFormulation"), + new NamedNode(NAMESPACES.QL + "CSV") + ); + + // Also add old R2RML for AccessFactory property + store.addQuad(logicalSource, new NamedNode(RML + "source"), + database + ); + store.tryPropertyTranslation(logicalTable, new NamedNode(RR + "sqlQuery"), logicalSource, new NamedNode(RML + "query")); + store.tryPropertyTranslation(logicalTable, new NamedNode(RR + "tableName"), logicalSource, new NamedNode(RR + "tableName")); + store.tryPropertyTranslation(logicalTable, new NamedNode(RR + "sqlVersion"), logicalSource, new NamedNode(RR + "sqlVersion")); + + // Rename on whole store instead of deep search in TriplesMap Resource + store.renameAllPredicates(new NamedNode(RR + "column"), new NamedNode(RML + "reference")); + store.removeQuads(triplesMap, new NamedNode(RR + "logicalTable"), null); } -// } -// else { -// database = store.getQuad(null, null, new NamedNode(D2RQ + "Database")).getSubject(); -// } - - // Add logical source - String logicalSourceIRI = triplesMap.getValue() + "_logicalSource"; - Term logicalSource = new NamedNode(logicalSourceIRI); - - store.addQuad(triplesMap, new NamedNode(RML + "logicalSource"), logicalSource, null); - store.addQuad(logicalSource, new NamedNode(RML + "referenceFormulation"), - new NamedNode(NAMESPACES.QL + "CSV") - ); - - // Also add old R2RML for AccessFactory property - // TODO issue #130 - store.addQuad(logicalSource, new NamedNode(RR + "sqlVersion"), - new NamedNode(RR + "SQL2008") - ); - store.addQuad(logicalSource, new NamedNode(RML + "source"), - database - ); - store.tryPropertyTranslation(logicalTable, new NamedNode(RR + "sqlQuery"), logicalSource, new NamedNode(RML + "query")); - store.tryPropertyTranslation(logicalTable, new NamedNode(RR + "tableName"), logicalSource, new NamedNode(RR + "tableName")); - store.tryPropertyTranslation(logicalTable, new NamedNode(RR + "sqlVersion"), logicalSource, new NamedNode(RR + "sqlVersion")); - - // Rename on whole store instead of deep search in TriplesMap Resource - store.renameAll(new NamedNode(RR + "column"), new NamedNode(RML + "reference")); - store.removeQuads(null, new NamedNode(RR + "logicalTable"), null); } } diff --git a/src/main/java/be/ugent/rml/conformer/RMLConverterNew.java b/src/main/java/be/ugent/rml/conformer/RMLConverterNew.java new file mode 100644 index 00000000..1fadaec4 --- /dev/null +++ b/src/main/java/be/ugent/rml/conformer/RMLConverterNew.java @@ -0,0 +1,344 @@ +package be.ugent.rml.conformer; + +import be.ugent.idlab.knows.dataio.access.DatabaseType; +import be.ugent.rml.records.ReferenceFormulation; +import be.ugent.rml.store.Quad; +import be.ugent.rml.store.QuadStore; +import be.ugent.rml.term.BlankNode; +import be.ugent.rml.term.Literal; +import be.ugent.rml.term.NamedNode; +import be.ugent.rml.term.Term; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.*; + +import static be.ugent.rml.NAMESPACES.*; + +public class RMLConverterNew implements Converter { + + private final static Logger logger = LoggerFactory.getLogger(RMLConverterNew.class); + + private final Map replacementsObjects = new HashMap<>() {{ + /* Old RML */ + put(RML + "BaseSource", new ReplacementEntry(RML2 + "LogicalSource", null)); + /* R2RML */ + put(RR + "BaseTableOrView", new ReplacementEntry(RML2 + "LogicalSource", null)); + put(RR + "Literal", new ReplacementEntry(RML2 + "Literal", null)); + put(RR + "R2RMLView", new ReplacementEntry(RML2 + "LogicalSource", null)); + put(RR + "SQL2008", new ReplacementEntry(RML2 + "SQL2008", null)); + + }}; + + private final Map replacementsPredicates = new HashMap<>() {{ + put(RML + "source", new ReplacementEntry(RML2 + "source", (quad, quadStore) -> processSources(quad, quadStore))); + put(RML + "query", new ReplacementEntry(RML2 + "query", (quad, quadStore) -> processQueries(quad, quadStore))); + put(RR + "column", new ReplacementEntry(RML2 + "reference", null)); + put(RR + "SQL2008", new ReplacementEntry(RML2 + "SQL2008", null)); + put(RR + "logicalTable", new ReplacementEntry(RML2 + "logicalSource", (quad, quadStore) -> processLogicalTable(quad, quadStore))); + put(RR + "sqlVersion", new ReplacementEntry(RML2 + "referenceFormulation", null)); + put(RR + "tableName", new ReplacementEntry(RML2 + "source", RMLConverterNew::processTableName)); + put(RR + "Literal", new ReplacementEntry(RML2 + "Literal", RMLConverterNew::processTableName)); + }}; + + private final Map objectRenames = new HashMap<>() {{ + put(QL + "CSV", ReferenceFormulation.CSV); + put(QL + "JSONPath", ReferenceFormulation.JSONPath); + put(QL + "XPath", ReferenceFormulation.XPath); + put(RML + "LogicalSource", RML2 + "LogicalSource"); + put(RR + "Literal", RML2 + "Literal"); + put(RML + "TriplesMap", RML2 + "TriplesMap"); + put(RR + "BlankNode", RML2 + "BlankNode"); + put(RR + "IRI", RML2 + "IRI"); + put(RR + "Join", RML2 + "Join"); + put(RR + "PredicateMap", RML2 + "PredicateMap"); + put(RR + "PredicateObjectMap", RML2 + "PredicateObjectMap"); + put(RR + "RefObjectMap", RML2 + "RefObjectMap"); + put(RR + "SubjectMap", RML2 + "SubjectMap"); + put(RR + "ObjectMap", RML2 + "ObjectMap"); + put(RR + "TermMap", RML2 + "TermMap"); + put(RR + "TriplesMap", RML2 + "TriplesMap"); + put(RR + "GraphMap", RML2 + "GraphMap"); + put(RR + "defaultGraph", RML2 + "defaultGraph"); + put(RML + "LanguageMap", RML2 + "LanguageMap"); + put(RMLT + "LogicalTarget", RML2 + "LogicalTarget"); + put(RMLT + "Target", RML2 + "Target"); + }}; + + /* + TODO: figure out not included entries: + - rr:inverseExpression: what to do with the deprecated tag? + */ + private final Map predicateRenames = new HashMap<>() {{ + /* Old RML */ + put(RML + "iterator", RML2 + "iterator"); + put(RML + "logicalSource", RML2 + "logicalSource"); + put(RML + "logicalTarget", RML2 + "logicalTarget"); + put(RML + "reference", RML2 + "reference"); + put(RML + "referenceFormulation", RML2 + "referenceFormulation"); + put(RML + "languageMap", RML2 + "languageMap"); + put(RML + "parentTermMap", RML2 + "parentTermMap"); + + /* Old RMLT */ + put(RMLT + "target", RML2 + "target"); + put(RMLT + "serialization", RML2 + "serialization"); + put(RMLT + "compression", RML2 + "compression"); + + /* R2RML */ + put(RR + "joinCondition", RML2 + "joinCondition"); + put(RR + "parent", RML2 + "parent"); + put(RR + "child", RML2 + "child"); + put(RR + "parentTriplesMap", RML2 + "parentTriplesMap"); + + put(RR + "column", RML2 + "reference"); + put(RR + "class", RML2 + "class"); + put(RR + "constant", RML2 + "constant"); + put(RR + "datatype", RML2 + "datatype"); + put(RR + "graph", RML2 + "graph"); + put(RR + "graphMap", RML2 + "graphMap"); + put(RR + "language", RML2 + "language"); + put(RR + "object", RML2 + "object"); + put(RR + "objectMap", RML2 + "objectMap"); + put(RR + "predicate", RML2 + "predicate"); + put(RR + "predicateMap", RML2 + "predicateMap"); + put(RR + "predicateObjectMap", RML2 + "predicateObjectMap"); + put(RR + "subject", RML2 + "subject"); + put(RR + "subjectMap", RML2 + "subjectMap"); + put(RR + "termType", RML2 + "termType"); + put(RR + "template", RML2 + "template"); + put(RR + "logicalTable", RML2 + "logicalSource"); + }}; + private final Set obsoletes = new HashSet<>() {{ + add(RR + "sqlVersion"); + }}; + private final QuadStore store; + + public RMLConverterNew(QuadStore store) { + this.store = store; + } + + private static void processTableName(Quad tableName, QuadStore store) { + store.addQuad(tableName.getSubject(), new NamedNode(RML2 + "referenceFormulation"), new NamedNode(RML2 + "SQL2008Table")); + store.removeQuads(tableName.getSubject(), new NamedNode(RML2 + "referenceFormulation"), null); + } + + /** + * Replace a logical table quad with a proper logical source + * @param logicalTableQuad + * @param quadStore + */ + private void processLogicalTable(Quad logicalTableQuad, QuadStore quadStore) { + BlankNode blank = new BlankNode(); + quadStore.addQuad(logicalTableQuad.getSubject(), new NamedNode(RML2 + "logicalSource"), blank); + + // add the reference formulation of the logical source + quadStore.removeQuads(logicalTableQuad.getSubject(), new NamedNode(RML2 + "referenceFormulation"), new NamedNode(ReferenceFormulation.RDBTable)); + + // now have blank contain all required fields + // translate the table name as rml:source + Term logicalTable = logicalTableQuad.getObject(); + Term tableName = quadStore.getQuads(logicalTable, new NamedNode(RR + "tableName"), null) + .get(0) + .getObject(); + + quadStore.addQuad(blank, new NamedNode(RML2 + "source"), tableName); + quadStore.addQuad(blank, new NamedNode(RML2 + "referenceFormulation"), new NamedNode(ReferenceFormulation.RDBTable)); + quadStore.removeQuads(logicalTableQuad); + } + + @Override + public void convert(Map mappingOptions) throws Exception { + // inject DB sources for every triple map that has a logicalTable as source + if (mappingOptions != null) { + // R2RML conversion + // convert all logical tables into proper logical sources + List logicalTableMaps = this.store.getQuads(null, new NamedNode(RR + "logicalTable"), null); + for (Quad map : logicalTableMaps) { + // insert the database for the logical source + Term database = new NamedNode(map.getSubject().getValue() + "_database"); + this.store.addQuad(database, new NamedNode(RDF + "type"), new NamedNode(D2RQ + "Database")); + for (Map.Entry entry : mappingOptions.entrySet()) { + this.store.addQuad(database, new NamedNode(D2RQ + entry.getKey()), new Literal(entry.getValue())); + + if (entry.getKey().equals("jdbcDSN")) { + DatabaseType type = DatabaseType.getDBtype(entry.getValue()); + this.store.addQuad(database, new NamedNode(D2RQ + "jdbcDriver"), new Literal(type.getDriver())); + } + } + + Term logicalSource = new NamedNode(map.getSubject().getValue() + "_logicalSource"); + this.store.addQuad(logicalSource, new NamedNode(RML2+"source"), database); + + // translate rr:logicalTable to rml:source + // grab the logical table + Term logicalTable = map.getObject(); + List tableNames = this.store.getQuads(logicalTable, new NamedNode(RR + "tableName"), null); + if (tableNames.isEmpty()) { + // no tableNames present, SQL query must be present + List queries = this.store.getQuads(logicalTable, new NamedNode(RR + "sqlQuery"), null); + if (queries.isEmpty()) { + throw new IllegalArgumentException("Logical table contains neither a tableName, nor a SQL query"); + } + this.store.addQuad(logicalSource, new NamedNode(RML2 + "referenceFormulation"), new NamedNode(ReferenceFormulation.RDBQuery)); + this.store.addQuad(logicalSource, new NamedNode(RML2 + "iterator"), new Literal(queries.get(0).getObject().getValue())); + + this.store.removeQuads(logicalTable, new NamedNode(RR + "sqlQuery"), null); + } else { + this.store.addQuad(logicalSource, new NamedNode(RML2 + "referenceFormulation"), new NamedNode(ReferenceFormulation.RDBTable)); + this.store.addQuad(logicalSource, new NamedNode(RML2 + "iterator"), new Literal(tableNames.get(0).getObject().getValue())); + + this.store.removeQuads(logicalTable, new NamedNode(RR + "tableName"), null); + } + + + // connect the logical source to the map + this.store.addQuad(map.getSubject(), new NamedNode(RML2 + "logicalSource"), logicalSource); + + // clean up the store: remove logicalTable and tableName + this.store.removeQuads(map.getSubject(), new NamedNode(RR + "logicalTable"), null); + + } + + // convert all logical sources that have a rr:tableName into proper sources + List tableNameLogicalSources = this.store.getQuads(null, new NamedNode(RR + "tableName"), null); + for (Quad ls : tableNameLogicalSources) { + // drop the sql version + // set the correct reference formulation + this.store.addQuad(ls.getSubject(), new NamedNode(RML2 + "referenceFormulation"), new NamedNode(ReferenceFormulation.RDBTable)); + // put table name in rml:iterator + String tableName = ls.getObject().getValue(); + this.store.addQuad(ls.getSubject(), new NamedNode(RML2 + "iterator"), new Literal(tableName)); + // drop obsolete fields + this.store.removeQuads(ls.getSubject(), new NamedNode(RR + "sqlVersion"), null); + this.store.removeQuads(ls); + } + + // convert all logical sources that have a rml:query to proper sources + List queryLogicalSources = this.store.getQuads(null, new NamedNode(RML + "query"), null); + for (Quad ls : queryLogicalSources) { + Term source = null; + if (this.store.contains(ls.getSubject(), new NamedNode(RML + "source"), null)) { + source = this.store.getQuad(ls.getSubject(), new NamedNode(RML + "source"), null).getObject(); + } + // drop any obsolete reference formulations + this.store.removeQuads(ls.getSubject(), new NamedNode(RML + "referenceFormulation"), null); + // set the proper reference formulation + if (source != null && this.store.contains(source, new NamedNode(SD + "resultFormat"), null)) { + Term resultsFormat = this.store.getQuad(source, new NamedNode(SD + "resultFormat"), null).getObject(); + this.store.addQuad(ls.getSubject(), new NamedNode(RML2 + "referenceFormulation"), resultsFormat); + } else { + this.store.addQuad(ls.getSubject(), new NamedNode(RML2 + "referenceFormulation"), new NamedNode(ReferenceFormulation.RDBQuery)); + } + // set the query into the iterator + this.store.addQuad(ls.getSubject(), new NamedNode(RML2 + "iterator"), ls.getObject()); + + // drop the obsolete quads + this.store.removeQuads(ls.getSubject(), new NamedNode(RR + "sqlVersion"), null); + this.store.removeQuads(ls); + } + } + + + for (Map.Entry e : this.replacementsPredicates.entrySet()) { + List quads = this.store.getQuads(null, new NamedNode(e.getKey()), null); + ReplacementEntry entry = e.getValue(); + for (Quad q : quads) { + if (entry.function != null) { + entry.function.call(q, this.store); + } else { + // apply the replace and warn + this.store.renameAllPredicates(new NamedNode(e.getKey()), new NamedNode(entry.replacementTerm)); + logger.warn("Predicate replacement function for term {} is not yet defined!", e.getKey()); + } + } + } + + for (Map.Entry e : this.replacementsObjects.entrySet()) { + // find all quads that carry this object + List quads = this.store.getQuads(null, null, new NamedNode(e.getKey())); + ReplacementEntry entry = e.getValue(); + for (Quad q : quads) { + this.store.addQuad(q.getSubject(), q.getPredicate(), new NamedNode(entry.replacementTerm)); + if (entry.function != null) { + entry.function.call(q, store); + } else { + logger.warn("Object replacement function for term {} is not yet defined!", e.getKey()); + } + } + this.store.removeQuads(quads); + } + + // apply simple renames first + for (Map.Entry e : this.predicateRenames.entrySet()) { + String old = e.getKey(); + String _new = e.getValue(); + + this.store.renameAllPredicates(new NamedNode(old), new NamedNode(_new)); + } + + for (Map.Entry e : this.objectRenames.entrySet()) { + String old = e.getKey(); + String _new = e.getValue(); + + this.store.renameAllObjects(new NamedNode(old), new NamedNode(_new)); + } + + /* Replace namespaces */ + this.store.removeNameSpace("rml"); + this.store.removeNameSpace("rr"); + this.store.removeNameSpace("ql"); + this.store.addNameSpace("rml", "http://w3id.org/rml/"); + + dropObsolete(); + } + + private void processSources(Quad source, QuadStore store) { + if (source.getObject().isLiteral()) { + String path = source.getObject().getValue(); + BlankNode node = new BlankNode(); + store.addQuad(node, new NamedNode(RDF + "type"), new NamedNode(DCAT + "Distribution")); + store.addQuad(node, new NamedNode(RDF + "type"), new NamedNode(RML2 + "Source")); + store.addQuad(node, new NamedNode(DCAT + "downloadURL"), new Literal(path)); // TODO: file:// prefix + store.addQuad(source.getSubject(), new NamedNode(RML2 + "source"), node); + store.removeQuads(source.getSubject(), source.getPredicate(), source.getObject()); + } + store.renameAllPredicates(new NamedNode(RML + "source"), new NamedNode(RML2 + "source")); + } + + private void processQueries(Quad query, QuadStore store) throws Exception { + Term source = store.getQuad(query.getSubject(), new NamedNode(RML2 + "source"), null).getObject(); + if (store.contains(source, new NamedNode(SD + "resultFormat"), null)) { + Term supportedLanguage = store.getQuad(source, new NamedNode(SD + "resultFormat"), null).getObject(); + store.addQuad(query.getSubject(), new NamedNode(RML2 + "referenceFormulation"), supportedLanguage); + } + else { + store.addQuad(query.getSubject(), new NamedNode(RML2 + "referenceFormulation"), new NamedNode(RML2 + "SQL2008Query")); + } + + store.removeQuads(query.getSubject(), new NamedNode(RML + "referenceFormulation"), null); + store.removeQuads(query.getSubject(), new NamedNode(RML + "iterator"), null); + store.renameAllPredicates(new NamedNode(RML + "query"), new NamedNode(RML2 + "iterator")); + } + + private void dropObsolete() { + for (String obsolete : obsoletes) { + this.store.removeQuads(null, new NamedNode(obsolete), null); + } + } + + /** + * Serves as a function to run when converting terms that are replaced by another term + */ + @FunctionalInterface + private interface ReplaceFunction { + void call(Quad quad, QuadStore store) throws Exception; + } + + /** + * Private record to contain the term to replace and a function to further execute on the QuadStore + * @param replacementTerm term to be put instead of the previous one + * @param function function to run at replacement time + */ + private record ReplacementEntry(String replacementTerm, ReplaceFunction function) { + } +} diff --git a/src/main/java/be/ugent/rml/extractor/ConstantExtractor.java b/src/main/java/be/ugent/rml/extractor/ConstantExtractor.java index a7854e0c..deec2645 100644 --- a/src/main/java/be/ugent/rml/extractor/ConstantExtractor.java +++ b/src/main/java/be/ugent/rml/extractor/ConstantExtractor.java @@ -1,30 +1,55 @@ package be.ugent.rml.extractor; +import be.ugent.idlab.knows.dataio.record.Record; import be.ugent.rml.functions.SingleRecordFunctionExecutor; -import be.ugent.rml.records.Record; import java.io.IOException; -import java.util.ArrayList; import java.util.List; public class ConstantExtractor implements Extractor, SingleRecordFunctionExecutor { - private String constant; + private final String constant; + private final List constantList; + + /** + * Becomes true when a function is detected that needs a special marker to indicate "End-of-File" (EOF). + */ + private final boolean needsEOFMarker; public ConstantExtractor(String constant) { + this. constantList = List.of(constant); this.constant = constant; + needsEOFMarker = constant.equals("https://w3id.org/imec/idlab/function#implicitDelete") + || constant.equals("http://example.com/idlab/function/implicitDelete"); } @Override public List extract(Record record) { - ArrayList result = new ArrayList<>(); - result.add(constant); - - return result; + return this.constantList; } @Override public Object execute(Record record) throws IOException { - return extract(record); + return this.constant; + } + + /** + * Returns {@code true} if this extractor needs an End-of-File (EOF) marker the end of the dataset. + * At this moment only required if function https://w3id.org/imec/idlab/function#implicitDelete is used. + * @return {@code true} if an EOF marker is required. + */ + @Override + public boolean needsEOFMarker() { + return needsEOFMarker; + } + + /** + * to String method + * + * @return string + */ + @Override + public String toString() { + return "\"" + constant + '\"'; } } diff --git a/src/main/java/be/ugent/rml/extractor/Extractor.java b/src/main/java/be/ugent/rml/extractor/Extractor.java index 883fe098..5ea0f4d1 100644 --- a/src/main/java/be/ugent/rml/extractor/Extractor.java +++ b/src/main/java/be/ugent/rml/extractor/Extractor.java @@ -1,6 +1,7 @@ package be.ugent.rml.extractor; -import be.ugent.rml.records.Record; + +import be.ugent.idlab.knows.dataio.record.Record; import java.util.List; diff --git a/src/main/java/be/ugent/rml/extractor/HashExtractor.java b/src/main/java/be/ugent/rml/extractor/HashExtractor.java new file mode 100644 index 00000000..8ad6e808 --- /dev/null +++ b/src/main/java/be/ugent/rml/extractor/HashExtractor.java @@ -0,0 +1,34 @@ +package be.ugent.rml.extractor; + +import be.ugent.idlab.knows.dataio.record.Record; +import be.ugent.rml.functions.SingleRecordFunctionExecutor; + +import java.io.IOException; +import java.util.Collections; +import java.util.List; + +public class HashExtractor implements Extractor, SingleRecordFunctionExecutor { + + public HashExtractor() { + } + + @Override + public List extract(Record record) { + return Collections.singletonList(Integer.toString(record.hashCode())); + } + + @Override + public Object execute(Record record) throws IOException { + return extract(record); + } + + /** + * to String method + * + * @return string + */ + @Override + public String toString() { + return "HashExtractor"; + } +} diff --git a/src/main/java/be/ugent/rml/extractor/ReferenceExtractor.java b/src/main/java/be/ugent/rml/extractor/ReferenceExtractor.java index c7d9631d..a2baa185 100644 --- a/src/main/java/be/ugent/rml/extractor/ReferenceExtractor.java +++ b/src/main/java/be/ugent/rml/extractor/ReferenceExtractor.java @@ -1,22 +1,49 @@ package be.ugent.rml.extractor; +import be.ugent.idlab.knows.dataio.record.Record; +import be.ugent.idlab.knows.dataio.record.RecordValue; import be.ugent.rml.functions.SingleRecordFunctionExecutor; -import be.ugent.rml.records.Record; import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; import java.util.List; public class ReferenceExtractor implements Extractor, SingleRecordFunctionExecutor { public String reference; + private final boolean ignoreDoubleQuotes; + private final boolean strictReferenceResolution; - public ReferenceExtractor(String reference) { + public ReferenceExtractor(String reference, boolean ignoreDoubleQuotes, boolean strictReferenceResolution) { this.reference = reference; + this.ignoreDoubleQuotes = ignoreDoubleQuotes; + this.strictReferenceResolution = strictReferenceResolution; } @Override public List extract(Record record) { - return record.get(reference); + String temp = this.reference; + + if (ignoreDoubleQuotes && temp.startsWith("\"") && temp.endsWith("\"")) { + temp = temp.substring(1, temp.length() - 1); + } + + RecordValue recordValue = record.get(temp); + + if (recordValue.isOk()) { // This means no error occurred during reference resolving and the value is not a null value + Object value = recordValue.getValue(); + if (value instanceof Iterable) { + return new ArrayList<>((Collection) value); + } else { + return List.of(value); + } + } else if (recordValue.isEmpty() || // The record has a null value + recordValue.isNotFound() && !strictReferenceResolution) { // The reference has not been found (e.g. nu field with that name) + return List.of(); + } else { + throw new IllegalArgumentException(recordValue.getMessage()); + } } @Override @@ -28,4 +55,8 @@ public String toString() { public Object execute(Record record) throws IOException { return extract(record); } + + public String getReference(){ + return this.reference; + } } diff --git a/src/main/java/be/ugent/rml/functions/AbstractSingleRecordFunctionExecutor.java b/src/main/java/be/ugent/rml/functions/AbstractSingleRecordFunctionExecutor.java index 6a02bb54..5073d892 100644 --- a/src/main/java/be/ugent/rml/functions/AbstractSingleRecordFunctionExecutor.java +++ b/src/main/java/be/ugent/rml/functions/AbstractSingleRecordFunctionExecutor.java @@ -1,18 +1,23 @@ package be.ugent.rml.functions; -import be.ugent.rml.records.Record; +import be.ugent.idlab.knows.dataio.record.Record; -import java.io.IOException; import java.util.HashMap; +import java.util.Map; public abstract class AbstractSingleRecordFunctionExecutor implements SingleRecordFunctionExecutor { protected MultipleRecordsFunctionExecutor functionExecutor; public Object execute(Record record) throws Exception { - HashMap recordsMap = new HashMap<>(); + Map recordsMap = new HashMap<>(); recordsMap.put("_default", record); return this.functionExecutor.execute(recordsMap); } + + @Override + public boolean needsEOFMarker() { + return functionExecutor.needsEOFMarker(); + } } diff --git a/src/main/java/be/ugent/rml/functions/ConcatFunction.java b/src/main/java/be/ugent/rml/functions/ConcatFunction.java index ed63aeb4..d6c0cf60 100644 --- a/src/main/java/be/ugent/rml/functions/ConcatFunction.java +++ b/src/main/java/be/ugent/rml/functions/ConcatFunction.java @@ -1,16 +1,17 @@ package be.ugent.rml.functions; +import be.ugent.idlab.knows.dataio.record.Record; import be.ugent.rml.Utils; import be.ugent.rml.extractor.ConstantExtractor; import be.ugent.rml.extractor.Extractor; import be.ugent.rml.extractor.ReferenceExtractor; -import be.ugent.rml.records.Record; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.List; + public class ConcatFunction implements SingleRecordFunctionExecutor { private static final Logger logger = LoggerFactory.getLogger(ConcatFunction.class); @@ -22,55 +23,41 @@ public ConcatFunction(List extractors, boolean encodeURI) { this.encodeURI = encodeURI; } - public ConcatFunction(List extractors) { - this(extractors, false); - } - @Override public List execute(Record record) { return concat(record); } private List concat(Record record) { - ArrayList results = new ArrayList<>(); + List results = new ArrayList<>(); results.add(""); //we only return a result when all elements of the template are found boolean allValuesFound = true; int referenceCount = 0; - String onlyConstants = ""; + StringBuilder onlyConstants = new StringBuilder(); //we iterate over all elements of the template, unless one is not found for (int i = 0; allValuesFound && i < extractors.size(); i++) { Extractor extractor = extractors.get(i); - - List extractedValues = new ArrayList<>(); - FunctionUtils.functionObjectToList(extractor.extract(record), extractedValues); + final boolean isReferenceExtractor = extractor instanceof ReferenceExtractor; + final boolean isConstantExtractor = extractor instanceof ConstantExtractor; + List extractedValues = FunctionUtils.functionObjectToList(extractor.extract(record)); if (!extractedValues.isEmpty()) { - ArrayList temp = new ArrayList<>(); - - for (int k = 0; k < results.size(); k ++) { - - for (int j = 0; j < extractedValues.size(); j ++) { - String result = results.get(k); - String value = extractedValues.get(j); - - if (encodeURI && extractor instanceof ReferenceExtractor) { - value = Utils.encodeURI(value); + List temp = new ArrayList<>(); + + for (String result : results) { + for (String value : extractedValues) { + if (isReferenceExtractor) { + if (encodeURI) + value = Utils.encodeURI(value); + referenceCount ++; + } else if (isConstantExtractor) { + onlyConstants.append(value); } - result += value; - - if (extractor instanceof ConstantExtractor) { - onlyConstants += value; - } - - temp.add(result); - } - - if (extractor instanceof ReferenceExtractor) { - referenceCount ++; + temp.add(result + value); } } @@ -78,14 +65,13 @@ private List concat(Record record) { } if (extractedValues.isEmpty()) { - logger.warn("Not all values for a template where found. More specific, the variable " + extractor + " did not provide any results."); + logger.warn("Not all values for a template where found. More specific, the variable {} did not provide any results.", extractor); allValuesFound = false; } } - if ((allValuesFound && referenceCount > 0 && results.contains(onlyConstants)) || !allValuesFound) { - results = new ArrayList<>(); - } + if (!allValuesFound || (referenceCount > 0 && results.contains(onlyConstants.toString()))) + return new ArrayList<>(); return results; } diff --git a/src/main/java/be/ugent/rml/functions/DynamicMultipleRecordsFunctionExecutor.java b/src/main/java/be/ugent/rml/functions/DynamicMultipleRecordsFunctionExecutor.java index 99ead186..144c534f 100644 --- a/src/main/java/be/ugent/rml/functions/DynamicMultipleRecordsFunctionExecutor.java +++ b/src/main/java/be/ugent/rml/functions/DynamicMultipleRecordsFunctionExecutor.java @@ -1,41 +1,57 @@ package be.ugent.rml.functions; +import be.ugent.idlab.knows.dataio.record.Record; +import be.ugent.idlab.knows.functions.agent.Agent; +import be.ugent.idlab.knows.functions.agent.Arguments; import be.ugent.rml.NAMESPACES; -import be.ugent.rml.records.Record; import be.ugent.rml.term.NamedNode; import be.ugent.rml.term.Term; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.IOException; -import java.util.*; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; public class DynamicMultipleRecordsFunctionExecutor implements MultipleRecordsFunctionExecutor { private static final Logger logger = LoggerFactory.getLogger(DynamicMultipleRecordsFunctionExecutor.class); - private List parameterValuePairs; - private FunctionLoader functionLoader; + private final List parameterValuePairs; + private final Agent functionAgent; - public DynamicMultipleRecordsFunctionExecutor(List parameterValuePairs, FunctionLoader functionLoader) { + + private boolean needsEOFMarker = false; + + public DynamicMultipleRecordsFunctionExecutor(final List parameterValuePairs, final Agent functionAgent) { this.parameterValuePairs = parameterValuePairs; - this.functionLoader = functionLoader; + this.functionAgent = functionAgent; + // check if executor contains term generator that needs an EOF marker + for (ParameterValueOriginPair parameterValuePair : parameterValuePairs) { + for (TermGeneratorOriginPair valueGeneratorPair : parameterValuePair.getValueGeneratorPairs()) { + if (valueGeneratorPair.getTermGenerator().needsEOFMarker()) { + needsEOFMarker = true; + return; + } + } + } } @Override public Object execute(Map records) throws Exception { - final ArrayList fnTerms = new ArrayList<>(); - final HashMap args = new HashMap<>(); + final List fnTerms = new ArrayList<>(); + final Arguments arguments = new Arguments(); + final Record child = records.get("child"); parameterValuePairs.forEach(pv -> { - ArrayList parameters = new ArrayList<>(); - ArrayList values = new ArrayList<>(); + List parameters = new ArrayList<>(); + List values = new ArrayList<>(); pv.getParameterGenerators().forEach(parameterGen -> { try { - parameters.addAll(parameterGen.generate(records.get("child"))); + parameters.addAll(parameterGen.generate(child)); } catch (Exception e) { - //todo be more nice and gentle - e.printStackTrace(); + logger.error(e.getMessage(), e); } }); @@ -43,35 +59,39 @@ public Object execute(Map records) throws Exception { try { values.addAll(pair.getTermGenerator().generate(records.get(pair.getOrigin()))); } catch (Exception e) { - //todo be more nice and gentle - e.printStackTrace(); + logger.error(e.getMessage(), e); } }); - if (parameters.contains(new NamedNode(NAMESPACES.FNO + "executes")) || parameters.contains(new NamedNode(NAMESPACES.FNO_S + "executes"))){ + if (parameters.contains(new NamedNode(NAMESPACES.FNO + "executes")) || parameters.contains(new NamedNode(NAMESPACES.FNO_S + "executes"))) { if (parameters.contains(new NamedNode(NAMESPACES.FNO + "executes"))) { - logger.warn("http is used instead of https for " + NAMESPACES.FNO_S + ". " + - "Still works for now, but will be deprecated in the future."); + logger.warn("http is used instead of https for {}. Still works for now, but will be deprecated in the future.", NAMESPACES.FNO_S); } - fnTerms.add(values.get(0)); } else { - parameters.forEach(parameter -> { - ArrayList temp = new ArrayList<>(); - - values.forEach(value -> { - temp.add(value.getValue()); - }); - - args.put(parameter.getValue(), temp); - }); + for (Term parameter : parameters) { + for (Term value : values) { + arguments.add(parameter.getValue(), value.getValue()); + } + } } }); if (fnTerms.isEmpty()) { - throw new Exception("No function was defined for parameters: " + args.keySet()); + throw new Exception("No function was defined for parameters: " + arguments.getArgumentNames()); } else { - return functionLoader.getFunction(fnTerms.get(0)).execute(args); + final String functionId = fnTerms.get(0).getValue(); + try { + return functionAgent.execute(functionId, arguments); + } catch (InvocationTargetException e) { + logger.error("Function '{}' failed to execute with {}", functionId, e.getTargetException().getMessage()); + return null; + } } } -} + + @Override + public boolean needsEOFMarker() { + return needsEOFMarker; + } +} \ No newline at end of file diff --git a/src/main/java/be/ugent/rml/functions/DynamicSingleRecordFunctionExecutor.java b/src/main/java/be/ugent/rml/functions/DynamicSingleRecordFunctionExecutor.java index 0d8f6393..294c31e5 100644 --- a/src/main/java/be/ugent/rml/functions/DynamicSingleRecordFunctionExecutor.java +++ b/src/main/java/be/ugent/rml/functions/DynamicSingleRecordFunctionExecutor.java @@ -1,23 +1,23 @@ package be.ugent.rml.functions; +import be.ugent.idlab.knows.functions.agent.Agent; + import java.util.ArrayList; import java.util.List; public class DynamicSingleRecordFunctionExecutor extends AbstractSingleRecordFunctionExecutor { - public DynamicSingleRecordFunctionExecutor(List parameterValuePairs, FunctionLoader functionLoader) { - ArrayList pairs = new ArrayList<>(); + public DynamicSingleRecordFunctionExecutor(List parameterValuePairs, final Agent functionAgent) { + List pairs = new ArrayList<>(); parameterValuePairs.forEach(pair -> { - ArrayList objectGeneratorOriginPairs = new ArrayList<>(); + List objectGeneratorOriginPairs = new ArrayList<>(); - pair.getValueGenerators().forEach(vGen -> { - objectGeneratorOriginPairs.add(new TermGeneratorOriginPair(vGen, "_default")); - }); + pair.getValueGenerators().forEach(vGen -> objectGeneratorOriginPairs.add(new TermGeneratorOriginPair(vGen, "_default"))); pairs.add(new ParameterValueOriginPair(pair.getParameterGenerators(), objectGeneratorOriginPairs)); }); - functionExecutor = new DynamicMultipleRecordsFunctionExecutor(pairs, functionLoader); + functionExecutor = new DynamicMultipleRecordsFunctionExecutor(pairs, functionAgent); } } \ No newline at end of file diff --git a/src/main/java/be/ugent/rml/functions/FunctionLoader.java b/src/main/java/be/ugent/rml/functions/FunctionLoader.java deleted file mode 100644 index 410846bd..00000000 --- a/src/main/java/be/ugent/rml/functions/FunctionLoader.java +++ /dev/null @@ -1,160 +0,0 @@ -package be.ugent.rml.functions; - -import be.ugent.rml.store.QuadStoreFactory; -import be.ugent.rml.store.RDF4JStore; -import be.ugent.rml.term.NamedNode; -import be.ugent.rml.term.Term; -import be.ugent.rml.Utils; -import be.ugent.rml.functions.lib.UtilFunctions; -import be.ugent.rml.store.QuadStore; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.io.IOException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class FunctionLoader { - - private static final Logger logger = LoggerFactory.getLogger(FunctionLoader.class); - private static String libraryNamespace = "http://example.com/library#"; - private static String defaultFunctionsPath = "functions.ttl"; - - private final File functionsFile; - private final File basePath; - private final QuadStore functionDescriptionTriples; - - // updated dynamically - /** - * Cache for loaded classes - */ - private Map classMap; - /** - * Cache for library paths - */ - private Map libraryMap; - /** - * Cache for loaded functions - */ - private Map loadedMethods; - - public FunctionLoader() throws Exception { - this(null, null, null); - } - - public FunctionLoader(File functionsFile) throws Exception { - this(functionsFile, null, null); - } - - public FunctionLoader(File functionsFile, QuadStore functionDescriptionTriples, Map libraryMap) throws Exception { - if (functionsFile == null) { - try { - functionsFile = Utils.getFile(defaultFunctionsPath); - } catch (IOException e) { - logger.warn(e.getMessage(), e); - } - this.functionsFile = functionsFile; - if (functionsFile == null) { - this.basePath = null; - } else { - this.basePath = this.functionsFile.getParentFile(); - } - } else { - this.functionsFile = functionsFile; - this.basePath = this.functionsFile.getParentFile(); - logger.debug("Using custom path to functions.ttl file: " + this.functionsFile.toString()); - } - - if (functionDescriptionTriples == null) { - if (functionsFile == null) { - this.functionDescriptionTriples = new RDF4JStore(); - } else { - this.functionDescriptionTriples = QuadStoreFactory.read(functionsFile); - } - } else { - this.functionDescriptionTriples = functionDescriptionTriples; - } - - this.libraryMap = new HashMap<>(); - - if (libraryMap == null) { - this.classMap = new HashMap<>(); - } else { - this.classMap = libraryMap; - for (String key : libraryMap.keySet()) { - this.libraryMap.put(key, "__local"); - } - } - - this.classMap.put("UtilFunctions", UtilFunctions.class); - this.libraryMap.put("UtilFunctions.jar", "__local"); - - this.loadedMethods = new HashMap<>(); - } - - public FunctionModel getFunction(Term iri) throws IOException { - if (!this.loadedMethods.containsKey(iri.getValue())) { - List libraries = Utils.getObjectsFromQuads(this.functionDescriptionTriples.getQuads(iri, new NamedNode(libraryNamespace + "providedBy"), null)); - - if (libraries.size() > 0) { - List pathNames = Utils.getObjectsFromQuads(this.functionDescriptionTriples.getQuads(libraries.get(0), new NamedNode(libraryNamespace + "localLibrary"), null)); - List classes = Utils.getObjectsFromQuads(this.functionDescriptionTriples.getQuads(libraries.get(0), new NamedNode(libraryNamespace + "class"), null)); - - if (pathNames.size() > 0 && classes.size() > 0) { - String pathName = pathNames.get(0).getValue(); - String className = classes.get(0).getValue(); - Class cls; - if (this.classMap.containsKey(className)) { - cls = this.classMap.get(className); - } else { - File functionFile = Utils.getFile(pathName, this.basePath); - cls = FunctionUtils.functionRequire(functionFile, className); - this.classMap.put(className, cls); - this.libraryMap.put(className, functionFile.getCanonicalPath()); - } - - List parameters = new ArrayList<>(); - List expectList = Utils.getObjectsFromQuads(this.functionDescriptionTriples.getQuads(iri, new NamedNode("http://semweb.datasciencelab.be/ns/function#expects"), null)); - - if (expectList.size() > 0) { - parameters = Utils.getList(this.functionDescriptionTriples, expectList.get(0)); - } - - Class[] orderedParameters = FunctionUtils.parseFunctionParameters(this.functionDescriptionTriples, parameters); - List methods = Utils.getObjectsFromQuads(this.functionDescriptionTriples.getQuads(libraries.get(0), new NamedNode(libraryNamespace + "method"), null)); - - List outputs = Utils.getList(this.functionDescriptionTriples, Utils.getObjectsFromQuads(this.functionDescriptionTriples.getQuads(iri, new NamedNode("http://semweb.datasciencelab.be/ns/function#returns"), null)).get(0)); - List fnParameterUris = FunctionUtils.getFunctionParameterUris(this.functionDescriptionTriples, parameters); - List fnOutputUris = FunctionUtils.getFunctionParameterUris(this.functionDescriptionTriples, outputs); - - if (methods.size() > 0) { - Method fn = null; - try { - fn = cls.getDeclaredMethod(methods.get(0).getValue(), orderedParameters); - } catch (NoSuchMethodException e) { - throw new IOException("Declared method " + methods.get(0) + " does not exist for class " + classes.get(0) + "."); - } - - FunctionModel fnm = new FunctionModel(iri, fn, fnParameterUris, fnOutputUris); - - this.loadedMethods.put(iri, fnm); - } - } else { - throw new IOException("No library or class was found for the function with IRI " + iri + " in the function descriptions."); - } - } else { - throw new IOException("No library or class was found for the function with IRI " + iri + " in the function descriptions."); - } - } - - return this.loadedMethods.get(iri); - } - - public String getLibraryPath(String className) { - return this.libraryMap.get(className); - } -} diff --git a/src/main/java/be/ugent/rml/functions/FunctionModel.java b/src/main/java/be/ugent/rml/functions/FunctionModel.java index 996a2541..aabd5840 100644 --- a/src/main/java/be/ugent/rml/functions/FunctionModel.java +++ b/src/main/java/be/ugent/rml/functions/FunctionModel.java @@ -3,16 +3,16 @@ import be.ugent.rml.term.Term; import net.minidev.json.parser.JSONParser; import net.minidev.json.parser.ParseException; -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.Value; -import org.eclipse.rdf4j.model.impl.SimpleValueFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Collection; +import java.lang.reflect.Type; +import java.time.*; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * Function Model @@ -26,6 +26,8 @@ public class FunctionModel { private Term URI; private Method method; + protected Logger logger = LoggerFactory.getLogger(this.getClass()); + public FunctionModel(Term URI, Method m, List parameters, List outputs) { this.URI = URI; this.method = m; @@ -36,7 +38,7 @@ public FunctionModel(Term URI, Method m, List parameters, List outpu public Object execute(Map args) { Object[] parameters = this.getParameters(args); try { - return this.method.invoke(null, parameters); + return this.method.invoke(null, parameters); // ArrayList result = this.toValue(object, this.getDataType(args)); } catch (IllegalAccessException | InvocationTargetException e) { // Nothing to do? @@ -50,82 +52,15 @@ public Term getURI() { return URI; } - private ArrayList toValue(Object result, IRI type) { - SimpleValueFactory vf = SimpleValueFactory.getInstance(); - ArrayList values = new ArrayList<>(); - if (!(result instanceof Collection)) { - ArrayList arr = new ArrayList<>(); - arr.add(result); - result = arr; - } - ArrayList arr = new ArrayList<>(); - for (Object res : (List) result) { - if (res != null) { - arr.add(res); - } - } - result = arr; - switch (type.toString()) { - case "http://www.w3.org/2001/XMLSchema#string": - for (Object res : (List) result) { - values.add(vf.createLiteral((String) res)); - } - break; - case "http://www.w3.org/2001/XMLSchema#boolean": - for (Object res : (List) result) { - values.add(vf.createLiteral((Boolean) res)); - } - break; - case "http://www.w3.org/2001/XMLSchema#anyURI": - for (Object res : (List) result) { - values.add(vf.createIRI((String) res)); - } - break; - default: - for (Object res : (List) result) { - values.add(vf.createLiteral(res.toString(), type)); - } - } - return values; - } - - private IRI getDataType(Map args) { - SimpleValueFactory vf = SimpleValueFactory.getInstance(); - String type = null; - if (this.outputs.size() > 0) { - if (this.outputs.get(0).getValue().startsWith("xsd:")) { - type = this.outputs.get(0).getValue().replace("xsd:", "http://www.w3.org/2001/XMLSchema#"); - } - if (this.outputs.get(0).getValue().startsWith("owl:")) { - type = this.outputs.get(0).getValue().replace("owl:", "http://www.w3.org/2002/07/owl#"); - } - } - if ((type == null) && args.containsKey("http://dbpedia.org/function/unitParameter")) { - type = "http://dbpedia.org/datatype/" + args.get("http://dbpedia.org/function/unitParameter"); - } - if ((type == null) && args.containsKey("http://dbpedia.org/function/dataTypeParameter")) { - if (args.get("http://dbpedia.org/function/dataTypeParameter").toString().equals("owl:Thing")) { - type = "http://www.w3.org/2001/XMLSchema#anyURI"; - } - } - if ((type == null) && args.containsKey("http://dbpedia.org/function/equals/valueParameter")) { - type = "http://www.w3.org/2001/XMLSchema#boolean"; - } - if (type == null) { - type = "http://www.w3.org/2001/XMLSchema#string"; - } - - return vf.createIRI(type); - } - private Object[] getParameters(Map parameters) { Object[] args = new Object[this.parameters.size()]; - Class[] paramTypes = this.method.getParameterTypes(); + Type[] paramTypes = this.method.getGenericParameterTypes(); for (int i = 0; i < this.parameters.size(); i++) { if (parameters.get(this.parameters.get(i).getValue()) != null) { - args[i] = parseParameter(parameters.get(this.parameters.get(i).getValue()), paramTypes[i]); + args[i] = parseParameter(parameters.get(this.parameters.get(i).getValue()), paramTypes[i].getTypeName()); } else { + logger.debug("No argument was found for following parameter: {}", this.parameters.get(i).getValue()); args[i] = null; } } @@ -133,39 +68,70 @@ private Object[] getParameters(Map parameters) { return args; } - private Object parseParameter(Object parameter, Class type) { - switch (type.getName()) { - case "java.lang.String": - if (parameter instanceof List) { - List l = (List) parameter; - - if (l.isEmpty()) { - return null; - } else { - return l.get(0); - } - } else { - return parameter.toString(); + private Object parseParameter(Object parameter, String typeName) { + String javaList = "java.util.List"; + if (typeName.contains(javaList)) { + if (parameter instanceof String) { + JSONParser parser = new JSONParser(JSONParser.MODE_PERMISSIVE); + try { + //this should return a JSONArray, which implements java.util.List + return parser.parse((String) parameter); + } catch (ParseException e) { + e.printStackTrace(); + throw new Error("Could not get a List from " + parameter); } + } else if(parameter instanceof List && typeName.contains("<") && typeName.contains(">")) { + // Must have contents to be able to recursively parse + String listElementType = typeName.substring(javaList.length() + 1, typeName.length() - 1); + return ((List) parameter).stream() + .map(o -> parseParameter(o, listElementType)) // recursively convert List elements + .collect(Collectors.toList()); + } else { + return parameter; + } + } + if (parameter instanceof List) { + List l = (List) parameter; + + if (l.isEmpty()) { + return null; + } else { + parameter = l.get(0); + } + } + switch (typeName) { + case "java.lang.Object": + case "java.lang.String": + return parameter.toString(); case "int": + case "java.lang.Integer": return Integer.parseInt(parameter.toString()); case "double": + case "java.lang.Double": return Double.parseDouble(parameter.toString()); - case "java.util.List": - if (parameter instanceof String) { - JSONParser parser = new JSONParser(JSONParser.MODE_PERMISSIVE); - try { - //this should return a JSONArray, which implements java.util.List - return parser.parse((String) parameter); - } catch (ParseException e) { - e.printStackTrace(); - } - } else { - return parameter; - } - + case "long": + case "java.lang.Long": + return Long.parseLong(parameter.toString()); + case "java.lang.Boolean": + return Boolean.parseBoolean(parameter.toString()); + case "java.time.LocalDate": + return LocalDate.parse(parameter.toString()); + case "java.time.LocalDateTime": + return LocalDateTime.parse(parameter.toString()); + case "java.time.ZonedDateTime": + return ZonedDateTime.parse(parameter.toString()); + case "java.time.Duration": + return Duration.parse(parameter.toString()); + case "java.time.Month": + return Month.valueOf(parameter.toString()); + case "java.time.MonthDay": + return MonthDay.parse(parameter.toString()); + case "java.time.Year": + return Year.parse(parameter.toString()); + case "java.time.YearMonth": + return YearMonth.parse(parameter.toString()); default: - throw new Error("Couldn't derive " + type.getName() + " from " + parameter); + throw new Error("Couldn't derive " + typeName + " from " + parameter); } } } diff --git a/src/main/java/be/ugent/rml/functions/FunctionUtils.java b/src/main/java/be/ugent/rml/functions/FunctionUtils.java index ba816b21..eae47a12 100644 --- a/src/main/java/be/ugent/rml/functions/FunctionUtils.java +++ b/src/main/java/be/ugent/rml/functions/FunctionUtils.java @@ -1,142 +1,38 @@ package be.ugent.rml.functions; -import be.ugent.rml.term.NamedNode; -import be.ugent.rml.term.Term; -import be.ugent.rml.Utils; -import be.ugent.rml.store.QuadStore; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.tools.JavaCompiler; -import javax.tools.ToolProvider; -import java.io.File; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLClassLoader; import java.util.ArrayList; import java.util.List; public class FunctionUtils { - private static final Logger logger = LoggerFactory.getLogger(FunctionUtils.class); - - public static Class functionRequire(File file, String className) throws IOException { - String path = file.getPath(); - if (path.endsWith(".jar")) { - return FunctionUtils.getClass(file, className, "application/java-archive"); - } else if (path.endsWith(".java")) { - return FunctionUtils.getClass(file, className, "text/x-java-source"); - } - - throw new IOException("Not a valid path for a JAVA implementation: " + path); - } - - public static List getFunctionParameterUris(QuadStore store, List parameterResources) { - List parameterPredicates = new ArrayList<>(); - - for (Term subject : parameterResources) { - parameterPredicates.add(Utils.getObjectsFromQuads(store.getQuads(subject, new NamedNode("http://semweb.datasciencelab.be/ns/function#predicate"), null)).get(0)); - } - - return parameterPredicates; - } - - public static Class[] parseFunctionParameters(QuadStore store, List parameterResources) { - Class[] args = new Class[parameterResources.size()]; - - for (int i = 0; i < parameterResources.size(); i++) { - Term subject = parameterResources.get(i); - Term type = Utils.getObjectsFromQuads(store.getQuads(subject, new NamedNode("http://semweb.datasciencelab.be/ns/function#type"), null)).get(0); - - try { - args[i] = FunctionUtils.getParamType(type); - } catch (Exception e) { - args[i] = String.class; - } - } - return args; - } - - public static void functionObjectToList(Object o, List result) { + /** + * Generates strings from a function object. Possible lists/sets/bags/... in the object are unrolled recursively + * and a string value is generated from each "simple" (i.e., not a list/set/bag/...) child object. + * + * @param o Function object, can be iterable. + * @param result A string list to which string values of objects are added + */ + public static List functionObjectToList(Object o) { + final List result = new ArrayList<>(); if (o != null) { - if (o instanceof String) { - result.add((String) o); - } else if (o instanceof List) { - ((List) o).forEach(item -> { - functionObjectToList(item, result); + // if o has child objects, recursively call this function on each child + if (o instanceof Iterable) { + ((Iterable) o).forEach(item -> { + result.addAll(functionObjectToList(item)); }); - } else if (o instanceof Boolean) { + // Some functions return a regular Array, not an Iterable, handle those as well. + } else if (o instanceof Object[]) { + for (Object item: (Object[])o) + result.addAll(functionObjectToList(item)); + } + // if o has no children, call toString() to serialize it into a string + else { + // numeric and boolean types are trivially serialized correctly + // times/dates objects in the java.time package use the relevant ISO-8601 standard, + // which is also used by xsd types and thus RDF types result.add(o.toString()); } } - } - - private static Class getParamType(Term type) { - String typeStr = type.getValue(); - - switch (typeStr) { - case "http://www.w3.org/2001/XMLSchema#string": - return String.class; - case "http://www.w3.org/2001/XMLSchema#integer": - return int.class; - case "http://www.w3.org/2001/XMLSchema#decimal": - return double.class; - case "http://www.w3.org/1999/02/22-rdf-syntax-ns#List": - return List.class; - default: - throw new Error("Couldn't derive type from " + type); - } - } - - private static Class getClass(File sourceFile, String className, String mime) throws IOException { - logger.info("Found class on path " + sourceFile.getCanonicalPath()); - - switch (mime) { - case "text/x-java-source": - return FunctionUtils.getClassFromJAVA(sourceFile, className); - case "application/java-archive": - return FunctionUtils.getClassFromJAR(sourceFile, className); - } - - return null; - } - - private static Class getClassFromJAVA(File sourceFile, String className) { - Class cls = null; - - // TODO let's not recompile every time - // Compile source file. - JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); - int res = compiler.run(null, null, null, sourceFile.getPath()); - - if (res != 0) { - return null; - } - - // Load and instantiate compiled class. - URLClassLoader classLoader = null; - try { - classLoader = URLClassLoader.newInstance(new URL[]{(new File(sourceFile.getParent())).toURI().toURL()}); - cls = Class.forName(className, true, classLoader); - } catch (MalformedURLException | ClassNotFoundException e) { - e.printStackTrace(); - } - - return cls; - } - - private static Class getClassFromJAR(File sourceFile, String className) { - Class cls = null; - - URLClassLoader child = null; - try { - child = URLClassLoader.newInstance(new URL[]{sourceFile.toURI().toURL()}); - cls = Class.forName(className, true, child); - } catch (MalformedURLException | ClassNotFoundException e) { - e.printStackTrace(); - } - - return cls; + return result; } } diff --git a/src/main/java/be/ugent/rml/functions/MultipleRecordsFunctionExecutor.java b/src/main/java/be/ugent/rml/functions/MultipleRecordsFunctionExecutor.java index 30ea29b0..fed8cbe6 100644 --- a/src/main/java/be/ugent/rml/functions/MultipleRecordsFunctionExecutor.java +++ b/src/main/java/be/ugent/rml/functions/MultipleRecordsFunctionExecutor.java @@ -1,11 +1,16 @@ package be.ugent.rml.functions; -import be.ugent.rml.records.Record; +import be.ugent.idlab.knows.dataio.record.Record; -import java.io.IOException; import java.util.Map; public interface MultipleRecordsFunctionExecutor { Object execute(Map records) throws Exception; + + /** + * Returns {@code true} when a function is used in this executor that needs a special marker + * to indicate "End-of-File" (EOF). + */ + default boolean needsEOFMarker() {return false;} } diff --git a/src/main/java/be/ugent/rml/functions/ParameterValuePair.java b/src/main/java/be/ugent/rml/functions/ParameterValuePair.java index ffbb3a11..4ecb7306 100644 --- a/src/main/java/be/ugent/rml/functions/ParameterValuePair.java +++ b/src/main/java/be/ugent/rml/functions/ParameterValuePair.java @@ -21,4 +21,14 @@ public List getParameterGenerators() { public List getValueGenerators() { return valueGenerators; } + + /** + * To string method + * + * @return string + */ + @Override + public String toString() { + return parameterGenerators + "=" + valueGenerators; + } } diff --git a/src/main/java/be/ugent/rml/functions/SingleRecordFunctionExecutor.java b/src/main/java/be/ugent/rml/functions/SingleRecordFunctionExecutor.java index d892d10c..d15880f8 100644 --- a/src/main/java/be/ugent/rml/functions/SingleRecordFunctionExecutor.java +++ b/src/main/java/be/ugent/rml/functions/SingleRecordFunctionExecutor.java @@ -1,10 +1,17 @@ package be.ugent.rml.functions; -import be.ugent.rml.records.Record; -import java.io.IOException; +import be.ugent.idlab.knows.dataio.record.Record; public interface SingleRecordFunctionExecutor { Object execute(Record record) throws Exception; + + /** + * Returns {@code true} when a function is used in this extractor that needs a special marker + * to indicate "End-of-File" (EOF). + */ + default boolean needsEOFMarker() { + return false; + } } diff --git a/src/main/java/be/ugent/rml/functions/StaticMultipleRecordsFunctionExecutor.java b/src/main/java/be/ugent/rml/functions/StaticMultipleRecordsFunctionExecutor.java index c0042500..35074fd0 100644 --- a/src/main/java/be/ugent/rml/functions/StaticMultipleRecordsFunctionExecutor.java +++ b/src/main/java/be/ugent/rml/functions/StaticMultipleRecordsFunctionExecutor.java @@ -1,24 +1,27 @@ package be.ugent.rml.functions; -import be.ugent.rml.records.Record; +import be.ugent.idlab.knows.dataio.record.Record; +import be.ugent.idlab.knows.functions.agent.Agent; +import be.ugent.idlab.knows.functions.agent.Arguments; -import java.io.IOException; -import java.util.HashMap; import java.util.Map; public class StaticMultipleRecordsFunctionExecutor implements MultipleRecordsFunctionExecutor { - private final FunctionModel functionModel; private final Map parameters; - public StaticMultipleRecordsFunctionExecutor(FunctionModel model, Map parameters) { - this.functionModel = model; + private final Agent functionAgent; + private final String functionId; + + public StaticMultipleRecordsFunctionExecutor(final Map parameters, Agent functionAgent, String functionId) { this.parameters = parameters; + this.functionAgent = functionAgent; + this.functionId = functionId; } @Override public Object execute(Map records) throws Exception { - Map filledInParameters = new HashMap<>(); + final Arguments functionArguments = new Arguments(); for (Map.Entry entry : this.parameters.entrySet()) { SingleRecordFunctionExecutor executor = (SingleRecordFunctionExecutor) entry.getValue()[1]; @@ -26,14 +29,10 @@ public Object execute(Map records) throws Exception { Object o = executor.execute(records.get(recordType)); - if (o != null) { - filledInParameters.put(entry.getKey(), o); - } else { - // TODO check whether key is actually optional! - filledInParameters.put(entry.getKey(), null); - } + // TODO check whether key is actually optional! + functionArguments.add(entry.getKey(), o); } - return this.functionModel.execute(filledInParameters); + return functionAgent.execute(functionId, functionArguments); } } diff --git a/src/main/java/be/ugent/rml/functions/StaticSingleRecordFunctionExecutor.java b/src/main/java/be/ugent/rml/functions/StaticSingleRecordFunctionExecutor.java deleted file mode 100644 index 18ebec0e..00000000 --- a/src/main/java/be/ugent/rml/functions/StaticSingleRecordFunctionExecutor.java +++ /dev/null @@ -1,25 +0,0 @@ -package be.ugent.rml.functions; - -import be.ugent.rml.Template; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class StaticSingleRecordFunctionExecutor extends AbstractSingleRecordFunctionExecutor { - - public StaticSingleRecordFunctionExecutor(FunctionModel model, Map> parameters) { - HashMap parametersForOtherExecutor = new HashMap<>(); - - parameters.keySet().forEach(parameter -> { - List