Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rdf-writer defined within the Ldio:HttpOut component seemingly does not apply a specified frame to the output #655

Closed
StijnDenisSirus opened this issue Jun 25, 2024 · 1 comment
Assignees
Labels
needs triage Issue needs to be evaluated by team

Comments

@StijnDenisSirus
Copy link

Versions
ldes/ldi-orchestrator:2.3.0-SNAPSHOT and onwards

Describe the bug
An rdf-writer defined within the Ldio:HttpOut component seemingly does not apply a specified frame to the output. This issue seems to occur from ldes/ldi-orchestrator:2.3.0-SNAPSHOT onwards (only verified myself in 2.3.0-SNAPSHOT, 2.5.1 and 2.7.0-SNAPSHOT).

To Reproduce
Steps to reproduce the behavior:

  1. ldes/ldi-orchestrator:2.3.0-SNAPSHOT (or later) is running with the following configuration:

server: port: 80

  1. A pipeline with the following configuration is successfully sent to the LDIO:
name: telraam_observations
description: This pipeline will take data from the Telraam ldes server and send to an Azure function
input:
  name: Ldio:LdesClient
  config:
    urls: https://telraam-api.net/ldes/observations/by-location?tile=14%2F8361%2F5484
    sourceFormat: text/turtle
    retries:
      enabled: true
transformers:
  - name: Ldio:SparqlConstructTransformer
    config:
      query: |
        PREFIX geojson: <https://purl.org/geojson/vocab#>
        PREFIX location: <http://sw.deri.org/2006/07/location/loc#>
        PREFIX locn: <http://www.w3.org/ns/locn#>
        PREFIX terms: <http://purl.org/dc/terms/>
        PREFIX ngsi-ld: <https://uri.etsi.org/ngsi-ld/>
        PREFIX OM: <http://def.isotc211.org/iso19156/2011/Observation#>
        PREFIX time: <http://www.w3.org/2006/time#>
        PREFIX sosa: <http://www.w3.org/ns/sosa/>
        PREFIX seb: <https://data.vlaanderen.be/ns/sensoren-en-bemonstering#>
        PREFIX schema: <https://schema.org/>
        PREFIX prov: <http://www.w3.org/ns/prov#>
        PREFIX verkeersmetingen: <https://data.vlaanderen.be/ns/verkeersmetingen#>
        PREFIX sf: <http://www.opengis.net/ont/sf#>
        PREFIX geosparql: <http://www.opengis.net/ont/geosparql#>
        PREFIX geojson: <https://purl.org/geojson/vocab#>

        CONSTRUCT {
          ?obs a verkeersmetingen:Verkeersmeting ;
          
          verkeersmetingen:kenmerkType [
            a ngsi-ld:Property;
            ngsi-ld:hasValue ?strkenmerktype
            ];
          
          verkeersmetingen:voertuigType [
            a ngsi-ld:Property;
            ngsi-ld:hasValue ?strvoertuigtype          
            ];
          
          OM:OM_Observation.result [
            a ngsi-ld:Property;
            ngsi-ld:hasValue ?strvalue
            ];
            
          schema:unitCode [
            a ngsi-ld:Property;
            ngsi-ld:hasValue ?strunit
            ];
            
          OM:OM_Observation.phenomenonTime [
            a ngsi-ld:Property;
            ngsi-ld:hasValue ?strbeginTime 
            ];
            
          ngsi-ld:location [
            a ngsi-ld:GeoProperty;
            ngsi-ld:hasValue [
              a geojson:Point;
              geojson:coordinates (
                ?lat
                ?lon
            )
            ]
          ]}

        WHERE {
          ?versieObs a verkeersmetingen:Verkeersmeting ;
          terms:isVersionOf ?obs ; 
          <https://implementatie.data.vlaanderen.be/ns/vsds-verkeersmetingen#Verkeerssnelheidsmeting.geobserveerdKenmerk>|<https://implementatie.data.vlaanderen.be/ns/vsds-verkeersmetingen#Verkeerstelling.geobserveerdKenmerk> [ 
            verkeersmetingen:voertuigType  ?voertuigtype ;
            <https://implementatie.data.vlaanderen.be/ns/vsds-verkeersmetingen#Verkeerssnelheidsmetingkenmerk.kenmerktype>|<https://implementatie.data.vlaanderen.be/ns/vsds-verkeersmetingen#Verkeerstellingkenmerk.kenmerktype>  ?kenmerktype
          ] ;
          verkeersmetingen:geobserveerdObject [ 
            a  verkeersmetingen:Verkeersmeetpunt;
            <http://def.isotc211.org/iso19156/2011/SamplingPoint#SF_SamplingPoint.shape> [ 
              a sf:Point;
              geosparql:asWKT  ?wkt
            ];
          ];
                    
          OM:OM_Observation.phenomenonTime/time:hasBeginning/time:inXSDDateTimeStamp ?beginTime ;
          #OM:OM_Observation.phenomenonTime/time:hasXSDDuration ?duration ;
          OM:OM_Observation.result/schema:value | <https://implementatie.data.vlaanderen.be/ns/vsds-verkeersmetingen#Verkeerstelling.tellingresultaat> ?value .
          
        OPTIONAL {
          ?versieObs OM:OM_Observation.result/schema:unitCode ?unit .
          }
        
        BIND (strafter(strbefore(str(?wkt), ' '), 'POINT(') as ?lat)
        BIND (strafter(strbefore(str(?wkt), ')'), ' ') as ?lon)
        BIND (str(?kenmerktype) as ?strkenmerktype)
        BIND (str(?voertuigtype) as ?strvoertuigtype)
        BIND (str(?value) as ?strvalue)
        #BIND (str(?unit) as ?strunit)
        BIND (IF(BOUND(?unit), str(?unit), 'aantal') as ?strunit)
        BIND (str(?beginTime) as ?strbeginTime)
        }
outputs:
  - name: Ldio:HttpOut
    config:
      endpoint: http://host.docker.internal:7071/api/http_trigger_reformat
      content-type: application/ld+json
      rdf-writer:
        content-type: application/ld+json
        frame: |
          {
            "@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld",
            "@type": "https://data.vlaanderen.be/ns/verkeersmetingen#Verkeersmeting"
          }

  1. The output sent to the Ldio:HttpOut endpoint will not have the specified frame applied (see screenshots).

Expected behavior
The frame specified in the rdf-writer should be applied to the data sent to the endpoint (see screenshots).

Screenshots
Output for ldes/ldi-orchestrator:2.2.0-SNAPSHOT (reference)
HttpOut_2 2 0-SNAPSHOT

Output for ldes/ldi-orchestrator:2.3.0-SNAPSHOT or later
HttpOut_2 3 0-SNAPSHOT_1
HttpOut_2 3 0-SNAPSHOT_2

@StijnDenisSirus StijnDenisSirus added the needs triage Issue needs to be evaluated by team label Jun 25, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in VSDS Backlog Jun 25, 2024
@pj-cegeka pj-cegeka assigned pj-cegeka and unassigned pj-cegeka Jun 28, 2024
@Yalz Yalz assigned Yalz and unassigned Yalz Nov 27, 2024
@Yalz
Copy link
Collaborator

Yalz commented Nov 28, 2024

@StijnDenisSirus with the latest 2.11.0-SNAPSHOT version of LDIO, this is fixed again.
Using the frames gives you the correct format

@Yalz Yalz closed this as completed Nov 28, 2024
@github-project-automation github-project-automation bot moved this from 📋 Backlog to 👀 In review in VSDS Backlog Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue needs to be evaluated by team
Projects
Status: 👀 In review
Development

No branches or pull requests

3 participants