@@ -549,3 +549,222 @@ to a RDF dump with N-Triples as serialization format:
549
549
< ; http://example.org/3> ; < ; http://xmlns.com/foaf/0.1/age> ; "36" .
550
550
< ; http://example.org/4> ; < ; http://xmlns.com/foaf/0.1/age> ; "37" .
551
551
</pre >
552
+
553
+ ### Datatype Map {#datatype-map}
554
+
555
+ All triples with a datatype are exported to the specified targets
556
+ in the Datatype Map [[ RML]] .
557
+
558
+ The following examples export all triples with a datatype xsd: integer
559
+ to a RDF dump with N-Triples as serialization format:
560
+
561
+ <pre class =" ex-input " >
562
+ [
563
+ {
564
+ "id": 0,
565
+ "name": "Monica Geller",
566
+ "age": 33
567
+ },
568
+ {
569
+ "id": 1,
570
+ "name": "Rachel Green",
571
+ "age": 34
572
+ },
573
+ {
574
+ "id": 2,
575
+ "name": "Joey Tribbiani",
576
+ "age": 35
577
+ },
578
+ {
579
+ "id": 3,
580
+ "name": "Chandler Bing",
581
+ "age": 36
582
+ },
583
+ {
584
+ "id": 4,
585
+ "name": "Ross Geller",
586
+ "age": 37
587
+ }
588
+ ]
589
+ </pre >
590
+
591
+ <pre class =" ex-access " >
592
+ < ; #DCATSourceAccess> ; a rml:Source, dcat:Distribution;
593
+ dcat:downloadURL "https://rml.io/specs/rml-target/Friends.json";
594
+ .
595
+ </pre >
596
+
597
+ <pre class =" ex-mapping " >
598
+ < ; #TriplesMap> ; a rml:TriplesMap;
599
+ rml:logicalSource [ a rml:LogicalSource;
600
+ rml:source < ; #DCATSourceAccess> ; ;
601
+ rml:referenceFormulation rml:JSONPath;
602
+ rml:iterator "$.[*]";
603
+ ];
604
+ rml:subjectMap [ a rml:SubjectMap;
605
+ rml:template "http://example.org/{id}";
606
+ ];
607
+ rml:predicateObjectMap [ a rml:PredicateObjectMap;
608
+ rml:predicateMap [ a rml:PredicateMap;
609
+ rml:constant foaf:name;
610
+ ];
611
+ rml:objectMap [ a rml:ObjectMap;
612
+ rml:reference "$.name";
613
+ rml:languageMap [
614
+ rml:constant "en";
615
+ ];
616
+ ];
617
+ ];
618
+ rml:predicateObjectMap [ a rml:PredicateObjectMap;
619
+ rml:predicateMap [ a rml:PredicateMap;
620
+ rml:constant foaf:age;
621
+ ];
622
+ rml:objectMap [ a rml:ObjectMap;
623
+ rml:reference "$.age";
624
+ rml:datatypeMap [ a rml:DatatypeMap;
625
+ rml:constant xsd:integer;
626
+ rml:logicalTarget < ; #TargetDump1> ; ;
627
+ ]
628
+ ];
629
+ ];
630
+ .
631
+ </pre >
632
+
633
+ <pre class =" ex-target " >
634
+ < ; #TargetDump1> ; a rml:LogicalTarget;
635
+ rml:target < ; #VoIDDump1> ; ;
636
+ rml:serialization formats:N-Triples;
637
+ .
638
+ </pre >
639
+
640
+ <pre class =" ex-access " >
641
+ < ; #VoIDDump1> ; a rml:Target, void:Dataset ;
642
+ void:dataDump < ; file:///data/dump1.nt> ; ;
643
+ .
644
+ </pre >
645
+
646
+ <pre class =" ex-output " >
647
+ # file:///data/dump1.nt
648
+ < ; http://example.org/0> ; < ; http://xmlns.com/foaf/0.1/age> ; "33"^^xsd:integer .
649
+ < ; http://example.org/1> ; < ; http://xmlns.com/foaf/0.1/age> ; "34"^^xsd:integer .
650
+ < ; http://example.org/2> ; < ; http://xmlns.com/foaf/0.1/age> ; "35"^^xsd:integer .
651
+ < ; http://example.org/3> ; < ; http://xmlns.com/foaf/0.1/age> ; "36"^^xsd:integer .
652
+ < ; http://example.org/4> ; < ; http://xmlns.com/foaf/0.1/age> ; "37"^^xsd:integer .
653
+
654
+ # default target of the processor
655
+ < ; http://example.org/0> ; < ; http://xmlns.com/foaf/0.1/name> ; "Monica Geller"@en .
656
+ < ; http://example.org/1> ; < ; http://xmlns.com/foaf/0.1/name> ; "Rachel Green"@en .
657
+ < ; http://example.org/2> ; < ; http://xmlns.com/foaf/0.1/name> ; "Joey Tribbiani"@en .
658
+ < ; http://example.org/3> ; < ; http://xmlns.com/foaf/0.1/name> ; "Chandler Bing"@en .
659
+ < ; http://example.org/4> ; < ; http://xmlns.com/foaf/0.1/name> ; "Ross Geller"@en .
660
+ </pre >
661
+
662
+ ### Function Map {#function-map}
663
+
664
+ <pre class =" ex-input " >
665
+ [
666
+ {
667
+ "id": 0,
668
+ "name": "Monica Geller",
669
+ "age": 33
670
+ },
671
+ {
672
+ "id": 1,
673
+ "name": "Rachel Green",
674
+ "age": 34
675
+ },
676
+ {
677
+ "id": 2,
678
+ "name": "Joey Tribbiani",
679
+ "age": 35
680
+ },
681
+ {
682
+ "id": 3,
683
+ "name": "Chandler Bing",
684
+ "age": 36
685
+ },
686
+ {
687
+ "id": 4,
688
+ "name": "Ross Geller",
689
+ "age": 37
690
+ }
691
+ ]
692
+ </pre >
693
+
694
+ <pre class =" ex-access " >
695
+ < ; #DCATSourceAccess> ; a rml:Source, dcat:Distribution;
696
+ dcat:downloadURL "https://rml.io/specs/rml-target/Friends.json";
697
+ .
698
+ </pre >
699
+
700
+ <pre class =" ex-mapping " >
701
+ < ; #TriplesMap> ; a rml:TriplesMap;
702
+ rml:logicalSource [ a rml:LogicalSource;
703
+ rml:source < ; #DCATSourceAccess> ; ;
704
+ rml:referenceFormulation rml:JSONPath;
705
+ rml:iterator "$.[*]";
706
+ ];
707
+ rml:subjectMap [ a rml:SubjectMap;
708
+ rml:template "http://example.org/{id}";
709
+ ];
710
+ rml:predicateObjectMap [ a rml:PredicateObjectMap;
711
+ rml:predicateMap [ a rml:PredicateMap;
712
+ rml:constant foaf:name;
713
+ ];
714
+ rml:objectMap [ a rml:ObjectMap;
715
+ rml:functionExecution <#Execution>;
716
+ rml:return grel:stringOut;
717
+ ];
718
+ ];
719
+ rml:predicateObjectMap [ a rml:PredicateObjectMap;
720
+ rml:predicateMap [ a rml:PredicateMap;
721
+ rml:constant foaf:age;
722
+ ];
723
+ rml:objectMap [ a rml:ObjectMap;
724
+ rml:reference "$.age";
725
+ ];
726
+ ];
727
+ .
728
+
729
+ <#Execution> a rml:FunctionExecution;
730
+ rml:logicalTarget < ; #TargetDump1> ; ;
731
+ rml:function grel:toUppercase;
732
+ rml:input [ a rml:Input;
733
+ rml:parameter grel:valueParam;
734
+ rml:inputValueMap [
735
+ rml:reference "$.name"
736
+ ]
737
+ ]
738
+ .
739
+
740
+ </pre >
741
+
742
+ <pre class =" ex-target " >
743
+ < ; #TargetDump1> ; a rml:LogicalTarget;
744
+ rml:target < ; #VoIDDump1> ; ;
745
+ rml:serialization formats:N-Quads;
746
+ .
747
+ </pre >
748
+
749
+ <pre class =" ex-access " >
750
+ < ; #VoIDDump1> ; a rml:Target, void:Dataset ;
751
+ void:dataDump < ; file:///data/dump1.nq.gz> ; ;
752
+ rml:compression rml:gzip;
753
+ .
754
+ </pre >
755
+
756
+ <pre class =" ex-output " >
757
+ # dump1.nq.gz
758
+ < ; http://example.org/0> ; < ; http://xmlns.com/foaf/0.1/name> ; "MONICA GELLER" .
759
+ < ; http://example.org/1> ; < ; http://xmlns.com/foaf/0.1/name> ; "RACHEL GREEN" .
760
+ < ; http://example.org/2> ; < ; http://xmlns.com/foaf/0.1/name> ; "JOEY TRIBBIANI" .
761
+ < ; http://example.org/3> ; < ; http://xmlns.com/foaf/0.1/name> ; "CHANDLER BING" .
762
+ < ; http://example.org/4> ; < ; http://xmlns.com/foaf/0.1/name> ; "ROSS GELLER" .
763
+
764
+ # default target of the processor
765
+ < ; http://example.org/0> ; < ; http://xmlns.com/foaf/0.1/age> ; "33" .
766
+ < ; http://example.org/1> ; < ; http://xmlns.com/foaf/0.1/age> ; "34" .
767
+ < ; http://example.org/2> ; < ; http://xmlns.com/foaf/0.1/age> ; "35" .
768
+ < ; http://example.org/3> ; < ; http://xmlns.com/foaf/0.1/age> ; "36" .
769
+ < ; http://example.org/4> ; < ; http://xmlns.com/foaf/0.1/age> ; "37" .
770
+ </pre >
0 commit comments