Informatievlaanderen / VSDS-Linked-Data-Interactions

https://informatievlaanderen.github.io/VSDS-Linked-Data-Interactions/
European Union Public License 1.2
4 stars 6 forks source link

LdesClientRunner FAILURE, org.apache.jena.riot.RiotException: [line: 1, col: 1 ] The document could not be loaded or parsed [code=LOADING_DOCUMENT_FAILED]. #164

Closed xdxxxdx closed 1 year ago

xdxxxdx commented 1 year ago

Prerequisites:

The version is : LDI_ORCHESTRATOR_TAG=20230407T130529 I am trying to configure LDES-Client to replicate the LDES stream from the endpoint:https://apim-iow-apimanagement.azure-api.net/ldes/water-quality-observations-by-time

The configuration in the ldio-workflow is:

server:
  port: 8082
orchestrator:
  pipelines:
    - name: simulator-to-server-pipeline
      description: "This pipeline uses an LDES client to read an existing LDES and send the members as N-Quads to a LDES Server"
      input:
        name: be.vlaanderen.informatievlaanderen.ldes.ldi.client.LdioLdesClient
        config:
          url: https://apim-iow-apimanagement.azure-api.net/ldes/water-quality-observations/water-quality-observations-by-time
        # TODO: remove this TEMP workaround (adapter | name)
        adapter:
          name: be.vlaanderen.informatievlaanderen.ldes.ldi.RdfAdapter
      outputs:
        - name: be.vlaanderen.informatievlaanderen.ldes.ldio.LdioHttpOut
          config:
            endpoint: http://ldes-server-observations:8080/water-quality-observations
            content-type: application/n-quads

please see: ldio-workflow.config.yml in water-quality-observations.zip

Scenario: run:docker compose --user-file .env  up ldio-workflow -d to start the ldio-workflow

Current result:

2023-04-26 10:25:16 2023-04-26T08:25:16.346Z  INFO 1 --- [pool-4-thread-1] b.v.i.ldes.ldio.LdesClientRunner         : LdesClientRunner setup finished
2023-04-26 10:25:16 JsonLdError[code=The document could not be loaded or parsed [code=LOADING_DOCUMENT_FAILED]., message=The document could not be loaded or parsed [code=LOADING_DOCUMENT_FAILED].]

failure.txt

Expected result: The LdesClient should be able to parse/replicate an LDES stream in JSON-LD format.

Yalz commented 1 year ago

Hi @xdxxxdx ,

By default, the LDES Client is expecting JSON-LD input (docs can be found here), however if I go to your datasource, I can clearly see Turtle format. So either you have to request the datasource in JSON-LD format, or you configure the LDES Client property "source-format" to expect "text/turtle".

If you have any further questions, feel free to let us know.

xdxxxdx commented 1 year ago

@Yalz ,

Thanks for the info.

Just to understand how to change the configuration to support turtle file, is it like ?

server:
  port: 8082
orchestrator:
  pipelines:
    - name: simulator-to-server-pipeline
      description: "This pipeline uses an LDES client to read an existing LDES and send the members as N-Quads to a LDES Server"
      input:
        name: be.vlaanderen.informatievlaanderen.ldes.ldi.client.LdioLdesClient
        config:
          url: https://apim-iow-apimanagement.azure-api.net/ldes/water-quality-observations/water-quality-observations-by-time
          source-format: "text/turtle"
        # TODO: remove this TEMP workaround (adapter | name)
        adapter:
          name: be.vlaanderen.informatievlaanderen.ldes.ldi.RdfAdapter
      outputs:
        - name: be.vlaanderen.informatievlaanderen.ldes.ldio.LdioHttpOut
          config:
            endpoint: http://ldes-server-observations:8080/water-quality-observations
            content-type: application/n-quads

The doc link doesn't work in your comment, please point it. Thanks

Yalz commented 1 year ago

Hi @xdxxxdx , Yes, this should do it. The link just referred to your data source as mentioned in your ticket

xdxxxdx commented 1 year ago

Hello @Yalz,

Thanks for the reply. Actually I mean this "(docs can be found here)", just to know where is the doc?

Thanks

Yalz commented 1 year ago

https://github.com/Informatievlaanderen/VSDS-Linked-Data-Interactions/tree/main/ldi-orchestrator/ldio-connectors/ldio-ldes-client

xdxxxdx commented 1 year ago

Modified configuration. LDIO client works as expected. Thanks