Skip to content
Keven Ates edited this page Nov 8, 2022 · 7 revisions

Documentation

The code has been commented throughout to indicate detailed issues that could, otherwise, cause general logic errors...particularly with the JavaScript code.

OpenRefine Dependency

The RDF Transform project's POM file depends on OpenRefine. To include the OpenRefine dependency, OpenRefine's main JAR file (openrefine-main.jar) must be added to the RDF Transform project. To get this JAR file, the OpenRefine project must be downloaded to your development environment and built.

In the OpenRefine project directory:

./refine -h  # ...for help on the following commands
./refine clean
./refine build
./refine dist 3.6-SNAPSHOT  # ...or other version

The "dist" command constructs all of the distribution JAR files.

In RDF Transform project directory:

mvn install:install-file -Dfile=<path/to>/OpenRefine/main/target/openrefine-main.jar -DpomFile=openrefine-shim-pom.xml -DcreateChecksum=true -DlocalRepositoryPath=./project-repository

JavaScript Classes

The JavaScript code uses classes to manage all the pertinent functionality. However, the code relies on base OpenRefine code for several feature concerning widget popups. A class extension technique has been used to manage the matching non-class OpenRefine code.

See the rdf-data-table-view.js file to review the class extension technique.

Client Server Calls

In several instances, client JavaScript code was duplicating server Java code. Since the Java code is inherently more stable than the JavaScript code (JavaScript has, in general, a brittle code base where changes may affect the code drastically due to untracked dependencies and the lack of type tracking by the various IDEs--linters help).

Therefore, the client favors server calls to fulfill this functionality. In general, this requires synchronous interaction and is managed by "async" and "await" on the client-side code.

Developer Testing and Debugging

Here are some tips on testing and debugging...

Java

Tinker with the "RDFTransform.verbose" and "RDFTransform.debug" configurations settings for RDF Transform to get plenty 'o feedback. Generally, setting the debug configuration to "true" will do the trick.

Javascript

Use the built-in Developer Tools in your preferred browser. Use code breaks to examine state and step through code. Use "console.log()" judiciously.

HTML Web Pages

The HTML documentation can be debugged via the Docs link in the RDF Transform main dialog and using built-in Developer Tools.

If you need to test or debug the HTML web pages separately, you'll need to set up a "server".

Change directories to project's website source:

cd rdf-transform/website

Start the simple python HTTP server:

python3 -m http.server

Load the "index.html" file in a browser. You may need to adjust your browser security setting to allow LocalHost access to local files. That issues is beyond this documentation.

http://localhost:8000