RMLio / RMLStreamer

The RMLStreamer executes RML rules to generate high quality Linked Data from multiple originally (semi-)structured data sources in a streaming way.
http://rml.io/
MIT License
48 stars 18 forks source link

Joins without conditions #43

Open lars-vc opened 2 years ago

lars-vc commented 2 years ago

It appears that currently conditionless joins are not supported in the RMLStreamer, however these do work in the RMLMapper. Example yarrrml file that uses conditionless joins:

prefixes:
 ex: "http://example.com/"
 schema: "https://schema.org/"
 dct: "http://purl.org/dc/terms/"
 xsd: "http://www.w3.org/2001/XMLSchema#"
 sosa: "http://www.w3.org/ns/sosa/"
 tm: "https://w3id.org/transportmode#"
 rdfs: "http://www.w3.org/2000/01/rdf-schema#"
 geo: "http://www.opengis.net/ont/geosparql#"
 tree: "https://w3id.org/tree#"
 ldes: "https://w3id.org/ldes#"
 wgs84: "http://www.w3.org/2003/01/geo/wgs84_pos#"

mappings:
  observation:
    sources:
      - [../../../data/test.xml~xpath, /gpx/trk/trkseg/trkpt]
    subject: http://location.example.com/tracks/observation/$(time)
    predicateobjects: 
      - [sosa:hasFeatureOfInterest, PERSONURL~iri]
      - [sosa:resultTime, $(time), xsd:dateTime]
      - [a, sosa:Observation]
      - [sosa:hasResult, http://location.example.com/tracks/observation/result/$(time)~iri]
      - [sosa:observedProperty, http://location.example.com/location~iri]
      - [sosa:hasSimpleResult, POINT($(@lon) $(@lat)), geo:wktLiteral]
      - [dct:isVersionOf, VERSIONURL~iri]
      - [sosa:madeBySensor, SENSORURL~iri]
  result:
    sources:
      - [../../../data/test.xml~xpath, /gpx/trk/trkseg/trkpt]
    subject: http://location.example.com/tracks/observation/result/$(time)
    predicateobjects: 
      - [wgs84:latitude, $(@lat)]
      - [wgs84:longitude, $(@lon)]
      - [wgs84:elevation, $(ele)]
      - [a, sosa:Result]
      - [tm:transportMode, TRANSPORTMODE~iri]
  location:
    sources:
      - [../../../data/test.xml~xpath, /gpx]
    subject: http://location.example.com/location
    predicateobjects:
      - [a, sosa:observedProperty]
      - [rdfs:comment, "The Geographic location observed by a sensor.", en~lang]
      - [rdfs:label, "Location", en~lang]
  person:
    sources:
      - [../../../data/test.xml~xpath, /gpx]
    subject: PERSONURL
    predicateobjects:
      - [a, sosa:FeatureOfInterest]
  sensor:
    sources:
      - [../../../data/test.xml~xpath, /gpx]
    subject: SENSORURL
    predicateobjects:
      - [a, sosa:Sensor]
      - [sosa:observes, http://location.example.com/location~iri]
      - [sosa:isHostedBy, DEVICEURL~iri]
      - predicates: sosa:madeObservation
        objects:
          - mapping: observation
  platform:
    sources:
      - [../../../data/test.xml~xpath, /gpx]
    subject: DEVICEURL
    predicateobjects:
      - [a, sosa:Platform]
      - [sosa:hosts, SENSORURL~iri]

The sensor makes all the observations and is therefore joined without condition ref: @s-minoo

s-minoo commented 2 years ago

Current implementation of joining in RMLStreamer requires a join condition to be defined for streaming data sources.

One solution to solve this would be to annotate the data with a "marker" condition attribute matching all pairs with each other.

We'll look into supporting this.