OpenRefine / SparqlExtension

Extension which lets you create an OpenRefine project from a SPARQL query
BSD 3-Clause "New" or "Revised" License
5 stars 3 forks source link

Issue 3 skip record level selection #21

Closed WaltonG closed 1 year ago

WaltonG commented 1 year ago

Fixes #3

Changes proposed in this pull request:

WaltonG commented 1 year ago

@antoine2711 @wetneb This PR produces OutOfMemoryError when creating a project. At first it was caused by https://github.com/OpenRefine/SparqlExtension/blob/47121b2532a90e40c73d76bb12b04013074dc1ec/src/main/java/org/openrefine/extensions/sparql/utils/SPARQLQueryResultPreviewReader.java#L141

I changed the declaration to List<Object> rowOfCells = null; and added values to the list using rowOfCells = Collections.singletonList(jsonRows.get(index++)) This moved the cause to line and I applied the same solution

https://github.com/OpenRefine/SparqlExtension/blob/47121b2532a90e40c73d76bb12b04013074dc1ec/src/main/java/org/openrefine/extensions/sparql/utils/SPARQLQueryResultPreviewReader.java#L137

The cause was then moved to line https://github.com/OpenRefine/SparqlExtension/blob/47121b2532a90e40c73d76bb12b04013074dc1ec/src/main/java/org/openrefine/extensions/sparql/utils/SPARQLQueryResultPreviewReader.java#L162

I commented out the line and now the current error is Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "OkHttp TaskRunner" Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "pool-2-thread-2"

The code was succesfull in fetching the preview data and displaying it but on using the same code to create a project it results to OutOfMemoryError

wetneb commented 1 year ago

@antoine2711 can I leave this to you first? Ping me if you are stuck.

antoine2711 commented 1 year ago

@antoine2711 can I leave this to you first? Ping me if you are stuck.

Sure. I was already looking into it.

Regards, Antoine

WaltonG commented 1 year ago

Just realised that in the database extension two classes that implement TableDataReader were used. One for the preview data and the other for the whole result set that creates the project. I will implement that and see the outcome

antoine2711 commented 1 year ago

Just realised that in the database extension two classes that implement TableDataReader were used. One for the preview data and the other for the whole result set that creates the project. I will implement that and see the outcome

K. You might also have seen this: image

java.lang.Error: Unresolved compilation problem: 
    SPARQLQueryResultPreviewReader cannot be resolved to a type

Regards, Antoine

WaltonG commented 1 year ago

The error still persists even after implementing create project TableDataReader in a separate java class. Using a small dataset of less that 50 rows gave me a false postive that the error is fixed.