Skip to content

Branch kgc-2025-conformance: explicit rml:TriplesMap statement needed to use TriplesMap as ParentTriplesMap #21

Description

@elsdvlee

When using Burp from branch kgc-2025-conformance with this mapping

@prefix rml: <http://w3id.org/rml/> .
@prefix dbo: <http://dbpedia.org/ontology/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .

<#AuthorMapping>
    rml:logicalSource <#AuthorsSource> ;
    rml:subjectMap [
        rml:template "http://example.com/author/{id}"
    ] ;
    rml:predicateObjectMap [
        rml:predicate foaf:name ;
        rml:objectMap [
            rml:reference "name"
        ]
    ] .

<#BookMapping>
    rml:logicalSource <#BooksSource> ;
    rml:subjectMap [
        rml:template "http://example.com/book/{id}"
    ] ;
    rml:predicateObjectMap 
        [
            rml:predicate dbo:title ;
            rml:objectMap [
                rml:reference "title"
            ]
        ],
        [
            rml:predicate dbo:author ;
            rml:objectMap [
                rml:parentTriplesMap <#AuthorMapping> ;
                rml:joinCondition [
                    rml:child "author_id" ;
                    rml:parent "id"
                ]
            ]
        ] .

<#AuthorsSource>
    a rml:LogicalSource ;
    rml:source [
        a rml:RelativePathSource ;
        rml:root rml:MappingDirectory ;
        rml:path "authors.json" ;
    ] ;
    rml:referenceFormulation rml:JSONPath ;
    rml:iterator "$[*]" .

<#BooksSource>
    a rml:LogicalSource ;
    rml:source [
        a rml:RelativePathSource ;
        rml:root rml:MappingDirectory ;
        rml:path "books.json" ;
    ] ;
    rml:referenceFormulation rml:JSONPath ;
    rml:iterator "$[*]" .

and inputdata authors.json:

[
  {
    "id": 1,
    "name": "Alice"
  },
  {
    "id": 2,
    "name": "Bob"
  },
  {
    "id": 3,
    "name": "Charlie"
  }
]

and books.json:

[
  {
    "id": 101,
    "title": "RDF Fundamentals",
    "author_id": 1
  },
  {
    "id": 102,
    "title": "Knowledge Graphs Guide",
    "author_id": 2
  },
  {
    "id": 103,
    "title": "Semantic Web Handbook",
    "author_id": 1
  },
  {
    "id": 104,
    "title": "Data Mapping Patterns",
    "author_id": 3
  }
]

I get this error:

SLF4J(W): No SLF4J providers were found.\nSLF4J(W): Defaulting to no-operation (NOP) logger implementation\nSLF4J(W): See https://www.slf4j.org/codes.html#noProviders for further details.\norg.apache.jena.shacl.ValidationReport@c9413d8\njava.lang.RuntimeException: Mapping did not satisfy shapes.\n\tat burp.parse.Parse.parseMappingFile(Parse.java:44)\n\tat burp.Main.doMain(Main.java:53)\n\tat burp.Main.main(Main.java:42)\nMapping did not satisfy shapes.\n",
  "stack": "Error: Error while executing the rules.\n    at ChildProcess.<anonymous> (/home/administrator/rmlmapper-webapi-js/node_modules/@rmlio/rmlmapper-java-wrapper/lib/wrapper.js:210:23)\n    at ChildProcess.emit (node:events:519:28)\n    at maybeClose (node:internal/child_process:1101:16)\n    at ChildProcess._handle.onexit (node:internal/child_process:304:5)

The error disappears when add the following triple to the mapping: <#AuthorMapping> a rml:TriplesMap.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions