Conversation
12cec5c to
0f355a6
Compare
0f355a6 to
cdd3d2d
Compare
s-pipes-core/src/main/java/cz/cvut/spipes/constants/SPIPES.java
Outdated
Show resolved
Hide resolved
s-pipes-core/src/main/java/cz/cvut/spipes/logging/AdvancedLoggingProgressListener.java
Outdated
Show resolved
Hide resolved
s-pipes-core/src/main/java/cz/cvut/spipes/logging/AdvancedLoggingProgressListener.java
Outdated
Show resolved
Hide resolved
s-pipes-core/src/main/java/cz/cvut/spipes/logging/AdvancedLoggingProgressListener.java
Outdated
Show resolved
Hide resolved
s-pipes-core/src/main/java/cz/cvut/spipes/logging/AdvancedLoggingProgressListener.java
Outdated
Show resolved
Hide resolved
s-pipes-core/src/main/java/cz/cvut/spipes/engine/ExecutionEngineImpl.java
Outdated
Show resolved
Hide resolved
s-pipes-core/src/main/java/cz/cvut/spipes/logging/AdvancedLoggingProgressListener.java
Outdated
Show resolved
Hide resolved
s-pipes-core/src/main/java/cz/cvut/spipes/logging/AdvancedLoggingProgressListener.java
Outdated
Show resolved
Hide resolved
s-pipes-debug/src/main/java/cz/cvut/spipes/debug/dto/PipelineExecutionDto.java
Outdated
Show resolved
Hide resolved
s-pipes-core/src/main/java/cz/cvut/spipes/logging/AdvancedLoggingProgressListener.java
Outdated
Show resolved
Hide resolved
s-pipes-core/src/main/java/cz/cvut/spipes/logging/AdvancedLoggingProgressListener.java
Outdated
Show resolved
Hide resolved
| addProperty(moduleExecution, SPIPES.has_script, module.getResource().toString().replaceAll("\\/[^.]*$", "")); | ||
| if(!metadataMap.containsKey(SPIPES.has_script.toString())){ | ||
| metadataMap.put(SPIPES.has_script.toString(), module.getResource().toString().replaceAll("\\/[^.]*$", "")); |
There was a problem hiding this comment.
| addProperty(moduleExecution, SPIPES.has_script, module.getResource().toString().replaceAll("\\/[^.]*$", "")); | |
| if(!metadataMap.containsKey(SPIPES.has_script.toString())){ | |
| metadataMap.put(SPIPES.has_script.toString(), module.getResource().toString().replaceAll("\\/[^.]*$", "")); | |
| String script = module.getResource().toString().replaceAll("\\/[^.]*$", ""); | |
| addProperty(moduleExecution, SPIPES.has_script, script); | |
| if(!metadataMap.containsKey(SPIPES.has_script.toString())){ | |
| metadataMap.put(SPIPES.has_script.toString(), script); |
There was a problem hiding this comment.
duplicate code but i still do not understand why we need to do this ... can you explain me whole this part what is doing, why we need it ?
There was a problem hiding this comment.
Done. It saves the script's name as a property to be added to the database, then saves it to metadataMap if it's not there. We need to have it there so we'll have access to it from any function in the logger. E.g. right now I have a code like:
private void persistPipelineExecutionStarted(final EntityManager em, long pipelineExecutionId, Thing pipelineExecution, final String functionName, final String scriptPath)
Where functionName and scriptPath are parameters of the function I've added. To avoid using them as inputs of the function, I should use metadataMap and put these parameters there. It will also allow for easy access to these parameters from any other function if needed.
s-pipes-core/src/main/java/cz/cvut/spipes/constants/SPIPES.java
Outdated
Show resolved
Hide resolved
s-pipes-core/src/main/java/cz/cvut/spipes/logging/AdvancedLoggingProgressListener.java
Outdated
Show resolved
Hide resolved
s-pipes-core/src/main/java/cz/cvut/spipes/logging/AdvancedLoggingProgressListener.java
Outdated
Show resolved
Hide resolved
3f011cc to
adc41d3
Compare
0412d55 to
516ae21
Compare
516ae21 to
b7be03e
Compare
s-pipes-core/src/main/java/cz/cvut/spipes/constants/SPIPES.java
Outdated
Show resolved
Hide resolved
s-pipes-core/src/main/java/cz/cvut/spipes/engine/ExecutionEngineImpl.java
Outdated
Show resolved
Hide resolved
s-pipes-core/src/main/java/cz/cvut/spipes/modules/AbstractModule.java
Outdated
Show resolved
Hide resolved
s-pipes-core/src/main/java/cz/cvut/spipes/engine/ExecutionEngineImpl.java
Outdated
Show resolved
Hide resolved
| } else { | ||
| scriptPath = module.getScriptPath(); | ||
| } | ||
| String script = module.getResource().toString().replaceAll("\\/[^.]*$", ""); |
There was a problem hiding this comment.
I have no idea what following is doing ..
There was a problem hiding this comment.
I refactored, so it would be more readable
s-pipes-core/src/main/java/cz/cvut/spipes/logging/AdvancedLoggingProgressListener.java
Outdated
Show resolved
Hide resolved
| addProperty(pipelineExecution, SPIPES.has_pipeline_execution_duration, computeDuration(startDate, finishDate)); | ||
| addProperty(pipelineExecution, SPIPES.has_pipeline_name, pipelineName); | ||
| // addScript(pipelineExecution, scriptManager.getScriptByContextId(pipelineName)); | ||
| pipelineExecution.setTypes(Collections.singleton(Vocabulary.s_c_finished_pipeline_execution)); |
There was a problem hiding this comment.
why we replace? ... not sure if we do not want to addTypes instead of setTypes ... multiple types should coexist
There was a problem hiding this comment.
Moreover, why we had to add em.getTransaction().commit() now? How about using addProperty(pipelineExecution, RDF_TYPE, Vocabulary.s_c_finished_pipeline_execution) instead
There was a problem hiding this comment.
We didn't have to add em.getTransaction().commit(), as git shows it as a difference, even though it was already there.
We're setting type with pipelineExecution.setTypes in other places, so I decided to follow the same path. I've introduced the new function, addTypes, which allows us to add a new type to the pipeline without replacing it.

0300743 to
644775c
Compare
|
@blcham it is needed to review: |
| return getLocation(resourceContextUri); | ||
| String location = getLocation(resourceContextUri); | ||
|
|
||
| return Paths.get(location).toUri().toString(); |
There was a problem hiding this comment.
This is weird, why do we need to do this? What is the difference between scriptPath and scriptURI?
There was a problem hiding this comment.
I'm getting exceptions like this:
ERROR c.c.s.l.AdvancedLoggingProgressListener - Transaction handling error: Not a valid (absolute) IRI: /host_mnt/c/Users/MSattrtand/IntelliJProjects/s-pipes/doc/examples/hello-world/hello-world.sms.ttl [line 21]
The call chain is:
runService -> createFunctionContext -> getFunctionLocation -> getLocation -> OntDocumentManager.doAltURLMapping
According to the latest function Javadoc, it returns "The resolvable location of the alternative copy, if known, or uri otherwise". We know its local path, so we return it, not URI.
context.setScriptUri sets this local path as "_pScriptURI" parameter.
During the pipeline excecution we're getting to this call chain:
moduleExecutionFinished -> writeRawData.
Model, created from our context, contains this triple:
http://onto.fel.cvut.cz/ontologies/s-pipes/query_solution_1763649074917/_pScriptURI http://onto.fel.cvut.cz/ontologies/s-pipes/has_bound_value /host_mnt/c/Users/MSattrtand/IntelliJProjects/s-pipes-editor-ui/deploy/../../s-pipes/doc/examples/hello-world/hello-world.sms.ttl;, so the triple with the absolute path, not URI.
connection.add(
new StringReader(w.getBuffer().toString()),
"",
RDFFormat.N3,
connection.getValueFactory().createIRI(contextUri.toString()));
Will throw the exception I've described before.
"_pScriptPath" parameter is not used anywhere, since executionContext was introduced, so I'll delete it.
The best solution IMO would be to modify getLocation, so it would return URI, even if it doAltURLMapping returns just a path.
| if (inputContext.getScriptUri() != null) { | ||
| scriptPath = inputContext.getScriptFile().toString(); | ||
| } else { | ||
| scriptPath = "not defined"; |
There was a problem hiding this comment.
Changed to null

Resolves partially kbss-cvut/s-pipes-editor-ui#195
Resolves kbss-cvut/s-pipes-editor-ui#206