RMLio / rmlmapper-java

The RMLMapper executes RML rules to generate high quality Linked Data from multiple originally (semi-)structured data sources
http://rml.io
MIT License
147 stars 61 forks source link

Add test case for referencing the relative JSONPath (@) #110

Closed vemonet closed 3 years ago

vemonet commented 3 years ago

Related to the issue discussed in pull request https://github.com/kg-construct/mapping-challenges/pull/33 and issue https://github.com/RMLio/rmlmapper-java/issues/95

I used those YARRRML mappings to generate the RML using Matey:

prefixes:
  grel: "http://users.ugent.be/~bjdmeest/function/grel.ttl#"
  rdfs: "http://www.w3.org/2000/01/rdf-schema#"
  ex: "http://example.com/"
mappings:
  ingredients:
    sources:
      - ['data.json~jsonpath', "$.[*].ingredients[*]"]
    s: ex:$(@)
    po:
      - [rdfs:label, $(@)]

  recipes:
    sources:
      - ['data.json~jsonpath', "$.[*]"]
    s: ex:$(id)
    po:
      - [ex:ingredients, ex:$(ingredients)~iri]
pheyvaer commented 3 years ago

@vemonet Thanks! We're having a look at it.

pheyvaer commented 3 years ago

@vemonet Regarding the output, the output.nq has IRIs as objects for the predicate ex:ingredients, but in YARRRML you define it as a Literal. What exactly do you expect?

vemonet commented 3 years ago

@pheyvaer indeed, I fixed the mappings to use an IRI

pheyvaer commented 3 years ago

@vemonet This test case have been included and succeed in the latest release. 😄