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

Add examples of how to use each interactors/components in the doc #245

Closed xdxxxdx closed 11 months ago

xdxxxdx commented 1 year ago

In the doc https://informatievlaanderen.github.io/VSDS-Linked-Data-Interactions. There are clear explanations of each configurable parameter, I feel it might be a good /practical idea to add an example with an explanation for each interactor just right below the configuration table.

e.g. https://informatievlaanderen.github.io/VSDS-Linked-Data-Interactions/ldio/ldio-inputs/ldio-http-in-poller An example to show how to use this component with its configurations.

e.g. https://informatievlaanderen.github.io/VSDS-Linked-Data-Interactions/ldio/ldio-transformers/ldio-geojson-to-wkt An example to explain how to use this component with HTTP in and HTTP out

e.g. https://informatievlaanderen.github.io/VSDS-Linked-Data-Interactions/ldio/ldio-transformers/ldio-sparql-construct An example as:


orchestrator:
  pipelines:
    - name: gipod-replicator
      description: "HTTP polling,Geojson to wkt, HTTP sending."
      input:
        name: be.vlaanderen.informatievlaanderen.ldes.ldi.client.LdioLdesClient
        config:
          url: https://xx.xx/ldes/devices/devices-by-time?pageNumber=1
          source-format: "text/turtle"
      transformers:
        - name: be.vlaanderen.informatievlaanderen.ldes.ldi.SparqlConstructTransformer
          config:
            query: "devices.rq"
      outputs:
        - name: be.vlaanderen.informatievlaanderen.ldes.ldio.LdioHttpOut
          config:
            endpoint: http://host.docker.internal:8080/devices
            content-type: application/n-quads

Content of devices.rq

PREFIX rdf:             <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX sosa:            <http://www.w3.org/ns/sosa/>
PREFIX rdfs:            <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xs:              <http://www.w3.org/2001/XMLSchema#>
PREFIX default-context: <https://uri.etsi.org/ngsi-ld/default-context/>
PREFIX ldes:            <https://w3id.org/ldes#>
PREFIX ngsi-ld:         <https://uri.etsi.org/ngsi-ld/>
PREFIX prov:            <http://www.w3.org/ns/prov#>
PREFIX rdf:             <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX terms:           <http://purl.org/dc/terms/>
PREFIX tree:            <https://w3id.org/tree#>
PREFIX vocab:           <https://purl.org/geojson/vocab#>
PREFIX geo:             <http://www.opengis.net/ont/geosparql#>
CONSTRUCT {
    ?devices rdf:type default-context:Device.
    ?devices terms:isVersionOf ?devicesversion.
    ?devices prov:generatedAtTime ?generattime.
    ?devices geo:asWKT ?wktl
} WHERE {
    ?devices rdf:type default-context:Device.
    ?devices terms:isVersionOf ?devicesversion.
    ?devices prov:generatedAtTime ?generattime.
    ?devices ngsi-ld:location ?location .
    ?location ngsi-ld:hasValue ?value.
    ?value rdf:type ?type.
    ?value vocab:coordinates (?x ?y).

    BIND(SUBSTR(STR(?x), 1, 13) AS ?lon)
    BIND(SUBSTR(STR(?y), 1, 13) AS ?lat)
    BIND(CONCAT("POINT(", STR(?lon), " ", STR(?lat), ")") AS ?wkt)
    BIND(STRDT(?wkt, geo:wktLiteral) AS ?wktl)
}

Explanation (for example): In the current example. Sparql construct component is configured with HTTP in and HTTP out components. HTTP In fetches the LDES Stream from the input endpoint. Sparql construct transforms the data type from NGSI-LD to wkt with devices.rq.. etc...(please fledge it accordingly)

Please feel free to leave you comment

Yalz commented 11 months ago

Documentation effort on LDIO has been performed, please check out https://informatievlaanderen.github.io/VSDS-Linked-Data-Interactions/ldio/index