RMLio / yarrrml-parser

A YARRRML parser library and CLI in Javascript
MIT License
41 stars 17 forks source link

Expressing nested features #113

Closed ritamargherita closed 3 years ago

ritamargherita commented 3 years ago

Issue type: :question: Question

Is it possible to create a nested structure with YARRRML? For example, from this xml example:

<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
            xmlns:dc="http://purl.org/dc/elements/1.1/"
            xmlns:ex="http://example.org/stuff/1.0/">
  <rdf:Description rdf:about="http://www.w3.org/TR/rdf-syntax-grammar"
             dc:title="RDF1.1 XML Syntax">
    <ex:editor>
      <rdf:Description ex:fullName="Dave Beckett">
        <ex:homePage rdf:resource="http://purl.org/net/dajobe/" />
      </rdf:Description>
    </ex:editor>
  </rdf:Description>
</rdf:RDF>

Can I create an RDF structure that would look like this? And if yes, how?

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix ex: <http://example.org/stuff/1.0/> .

<http://www.w3.org/TR/rdf-syntax-grammar>
  dc:title "RDF/XML Syntax Specification (Revised)" ;
  ex:editor [
    ex:fullname "Dave Beckett";
    ex:homePage <http://purl.org/net/dajobe/>
  ] .
bjdmeest commented 3 years ago

I'm afraid that this is an open challenge in RML: https://github.com/kg-construct/mapping-challenges/tree/main/challenges/multivalue-references . Right now in the community group we are discussing these open challenges, but no specific solution is available yet

I assume this example is merely an example: here you don't need YARRRML/RML, since the data is already in RDF/XML? I could just transform your example to the requested output e.g. using https://www.easyrdf.org/converter :)

ritamargherita commented 3 years ago

Hi Ben, Yes that was just an example. Thanks for replying, and I will try to keen an eye in the community group about future updates.