oeg-upm / yatter

Translate YARRRML into easy-to-read [R2]RML mappings

Home Page:https://doi.org/10.5281/zenodo.7024500

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does not support json as a source

jatoledo opened this issue · comments

Does not support JSON format as a source

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

mappings:
  person:
    sources:
      - ['data.json~jsonpath', '$.persons[*]']
    s: http://example.com/$(firstname)
    po:
      - [a, foaf:Person]
      - [ex:name, $(firstname)]

Output:

@prefix ex: <http://example.com/>.
@prefix rr: <http://www.w3.org/ns/r2rml#>.
@prefix rml: <http://semweb.mmlab.be/ns/rml#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.



@prefix ex: <http://example.com/>.
@prefix rr: <http://www.w3.org/ns/r2rml#>.
@prefix rml: <http://semweb.mmlab.be/ns/rml#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.


<#person_0> a rr:TriplesMap;

	rml:LogicalSource [
		a rml:logicalSource;
		rml:source "data.json";
		rml:referenceFormulation ql:JSONpath;
		rml:iterator"$.persons[*]";
	];
	rr:subjectMap [
		a rr:SubjectMap;
		rr:template "http://example.com/{firstname}";
	];
	rr:predicateObjectMap [
		rr:predicateMap [
			a rr:PredicateMap;
			rr:constant rdf:type;
		];
		rr:objectMap [
			a rr:ObjectMap;
			rr:constant foaf:Person;
		];
	];
	rr:predicateObjectMap [
		rr:predicateMap [
			a rr:PredicateMap;
			rr:constant ex:name;
		];
		rr:objectMap [
			a rr:ObjectMap;
			rml:reference "firstname";
		];
	].