Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialization format http://www.w3.org/ns/formats/TriG not implemented! #225

Closed
alexander-mart opened this issue Nov 9, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@alexander-mart
Copy link

alexander-mart commented Nov 9, 2023

Error: Serialization format http://www.w3.org/ns/formats/TriG not implemented!

yarrrml-parser -i "./input.yarrrml.yaml" -o "./output.rml.ttl"
java -jar ./rmlmapper-6.2.2-r371-all.jar -m "./output.rml.ttl"

data.json:

{
 "characters": [
   {
     "id": "0",
     "firstname": "Ash",
     "lastname": "Ketchum",
     "hair": "black"
   },
   {
     "id": "1",
     "firstname": "Misty",
     "hair": "orange"
   }
 ]
}

input.yarrrml.yaml:

prefixes:
  ex: http://example.com/

targets:
  person-target:
    access: ./output.rdf.trig
    type: void
    serialization: trig

mappings:
  person:
    sources:
      - ['data.json~jsonpath', '$.characters[*]']
    s:
      - value: 'ex:$(firstname)'
        targets: person-target
    po:
      - [a, foaf:Person]
      - [ex:name, $(firstname)]
      - [ex:hair, ex:$(hair)]

output.rml.ttl:

@prefix rr: <http://www.w3.org/ns/r2rml#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix fnml: <http://semweb.mmlab.be/ns/fnml#>.
@prefix fno: <https://w3id.org/function/ontology#>.
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#>.
@prefix void: <http://rdfs.org/ns/void#>.
@prefix dc: <http://purl.org/dc/terms/>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix rml: <http://semweb.mmlab.be/ns/rml#>.
@prefix ql: <http://semweb.mmlab.be/ns/ql#>.
@prefix : <http://mapping.example.com/>.
@prefix ex: <http://example.com/>.
@prefix rmlt: <http://semweb.mmlab.be/ns/rml-target#>.
@prefix formats: <http://www.w3.org/ns/formats/>.

:rules_000 a void:Dataset.
:target_000 a rmlt:LogicalTarget;
    rdfs:label "person-target";
    rmlt:serialization formats:TriG;
    rmlt:target :void_000.
:void_000 a void:Dataset;
    void:dataDump <file://./output.rdf.trig>.
:rules_000 void:exampleResource :map_person_000.
:map_person_000 rml:logicalSource :source_000.
:source_000 a rml:LogicalSource;
    rml:source "data.json";
    rml:iterator "$.characters[*]";
    rml:referenceFormulation ql:JSONPath.
:map_person_000 a rr:TriplesMap;
    rdfs:label "person".
:s_000 a rr:SubjectMap.
:map_person_000 rr:subjectMap :s_000.
:s_000 rr:template "http://example.com/{firstname}";
    rml:logicalTarget :target_000.
:pom_000 a rr:PredicateObjectMap.
:map_person_000 rr:predicateObjectMap :pom_000.
:pm_000 a rr:PredicateMap.
:pom_000 rr:predicateMap :pm_000.
:pm_000 rr:constant rdf:type.
:pom_000 rr:objectMap :om_000.
:om_000 a rr:ObjectMap;
    rr:constant foaf:Person;
    rr:termType rr:IRI.
:pom_001 a rr:PredicateObjectMap.
:map_person_000 rr:predicateObjectMap :pom_001.
:pm_001 a rr:PredicateMap.
:pom_001 rr:predicateMap :pm_001.
:pm_001 rr:constant ex:name.
:pom_001 rr:objectMap :om_001.
:om_001 a rr:ObjectMap;
    rml:reference "firstname";
    rr:termType rr:Literal.
:pom_002 a rr:PredicateObjectMap.
:map_person_000 rr:predicateObjectMap :pom_002.
:pm_002 a rr:PredicateMap.
:pom_002 rr:predicateMap :pm_002.
:pm_002 rr:constant ex:hair.
:pom_002 rr:objectMap :om_002.
:om_002 a rr:ObjectMap;
    rr:template "http://example.com/{hair}";
    rr:termType rr:Literal.
@DylanVanAssche
Copy link
Contributor

TriG is not implemented yet for Logical Targets, could be a good feature :) If you want to dig into this yourself, feel free to make patches and send a pull request. Thanks!

@DylanVanAssche DylanVanAssche added the enhancement New feature or request label Mar 15, 2024
@DylanVanAssche
Copy link
Contributor

On the development branch, I added support for TriG in Logical Targets. Let me know if this works for you :)

Commit: fd59a3e1ae51a375f7734d7474d31c40367097d4

@DylanVanAssche DylanVanAssche added the next release The bug is fixed and the fix will be available in the next release. label Jun 7, 2024
@DylanVanAssche
Copy link
Contributor

Fixed in v7.1.0

@DylanVanAssche DylanVanAssche removed the next release The bug is fixed and the fix will be available in the next release. label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants