Closed vimaldarjiv26 closed 5 years ago
How does your mapping file look like? And what error does the mapper return?
@andimou, in the example below, why 4 blank nodes generated instead of 2?
Input
{
"results": [
{
"record_id": "ec5ca92d-865a-431f-9984",
"demographics": { "gender":"male", "age":18 }
},
{
"record_id": "0a79ecf0-83d8-4148-9054",
"demographics": { "gender":"female", "age":19 }
}
]
}
Mappings
@prefix rr: <http://www.w3.org/ns/r2rml#>.
@prefix rml: <http://semweb.mmlab.be/ns/rml#>.
@prefix ql: <http://semweb.mmlab.be/ns/ql#>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix exo: <http://example.org/ontology/>.
@prefix exr: <http://example.org/resource/>.
<#RecordMapping>
rml:logicalSource [
rml:source "/home/kralin/Desktop/results.json";
rml:referenceFormulation ql:JSONPath;
rml:iterator "$.results.[*]"
];
rr:subjectMap [ rr:termType rr:BlankNode ];
rr:predicateObjectMap [
rr:predicate exo:has_age;
rr:objectMap [
rml:reference "demographics.age" ;
rr:datatype xsd:integer
]
].
<#ResultsMapping>
rml:logicalSource [
rml:source "/home/kralin/Desktop/results.json";
rml:referenceFormulation ql:JSONPath;
rml:iterator "$"
];
rr:subjectMap [ rr:constant "http://example.org/resource/results" ];
rr:predicateObjectMap [
rr:predicate exo:has_record;
rr:objectMap [
rr:parentTriplesMap <#RecordMapping>
]
].
Output
exr:results exo:has_record _:NasCMHQ4qO , _:6zFBpcR1el .
_:59SyVseNjX exo:has_age 18 .
_:mEdfZ9cRrU exo:has_age 19 .
_:NasCMHQ4qO exo:has_age 18 .
_:6zFBpcR1el exo:has_age 19 .
While testing with RML mapper I have added rr:BlankNode in RML mapping file but RML mapper doesn't allow me.