-
Notifications
You must be signed in to change notification settings - Fork 20
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
RML Mapper for array of array in json #42
Comments
Using the JSONPath below gives me access to the values of the
|
Thank you! But I don't understand which iterator I should assign that path. |
Unfortunately it doesn't work.. |
Hi Chiara,
Whats actual output?, the problem is only with *value* or also with others
like *fm.*
1) I don´t know if you can say this
rr:subjectMap [
rr:template "http://ifo.com/{grpid}";
rr:class fo:Measure;
rml:iterator "$.measures";
];
I have seen the iterator only in the* rml:logicalSource* part.
2) I don't know why you use @ at the path
rr:predicateObjectMap [
rr:predicate fo:hasNumericalValue;
rr:objectMap [
rml:reference "*@.value*";
rr:datatype xsd:float;
];
];
Try without @.value, only use value since
<#MeasureHeartRate> rml:logicalSource [
rml:iterator "$.body.measuregrps[*].measures[*]"
]
Will set the dir to the measures and then you can acces value without
problems.
Try this command $.body.measuregrps[*].measures[*].value on
http://jsonpath.com/ with your json and make some tests.
Best,
2018-06-14 8:34 GMT-05:00 chiarisilver <[email protected]>:
… Unfortunately it doesn't work..
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#42 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AT0gtXYP6FzsnEFbfghJ03DFNY0x_5MWks5t8mZ0gaJpZM4Un7FY>
.
--
------------------------------
Cristian Andres Narvaez Alarcon
Estudiante de Maestría en Ingeniería de Sistemas y Computación
Universidad Nacional de Colombia
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I'm trying to map this json file to RDF, but I probably can not iterate correctly to get the values of "value", which are inside the measures array.
Json:
{ "status": 0, "body": { "updatetime": 1528904042, "timezone": "Europe\/Rome", "measuregrps": [{ "grpid": 1154218424, "attrib": 2, "date": 1528902698, "category": 1, "brand": 1, "modified": 1528902700, "deviceid": null, "measures": [{ "value": 7000, "type": 11, "unit": -2, "algo": 0, "fw": 0, "fm": 131 }] }, { "grpid": 1154218987, "attrib": 2, "date": 1528902745, "category": 1, "brand": 1, "modified": 1528902747, "deviceid": null, "measures": [{ "value": 7200, "type": 11, "unit": -2, "algo": 0, "fw": 0, "fm": 131 }] } ] } }
RML:
`@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 fo: http://purl.org/ifo/#.
MAPPING
<#RestingHeartRate>
rml:logicalSource [
rml:source "provaJson.json";
rml:referenceFormulation ql:JSONPath;
rml:iterator "$.body.measuregrps";
];
rr:subjectMap [
rr:template "http://ifo.com/{grpid}";
rr:class fo:HeartRate;
];
rr:predicateObjectMap [
rr:predicate fo:hasTemporalRelationshipToPhysicalActivity;
rr:objectMap [
rr:constant fo:AtRest;
];
];
rr:predicateObjectMap [
rr:predicate fo:hasMeasure;
rr:objectMap [
rr:parentTriplesMap <#MeasureHeartRate>;
];
].
<#MeasureHeartRate>
rml:logicalSource [
rml:source "provaJson.json";
rml:referenceFormulation ql:JSONPath;
rml:iterator "$.body.measuregrps";
];
rr:subjectMap [
rr:template "http://ifo.com/{grpid}";
rr:class fo:Measure;
rml:iterator "$.body.measuregrps";
];
rr:predicateObjectMap [
rr:predicate fo:hasNumericalValue;
rr:objectMap [
rml:reference "@.measures.value";
rr:datatype xsd:float;
];
];
rr:predicateObjectMap [
rr:predicate fo:hasDescriptiveStatistic;
rr:objectMap [
rr:constant fo:average;
];
];
rr:predicateObjectMap [
rr:predicate fo:hasUnit;
rr:objectMap [
rr:constant fo:bpm;
];
].
`
Thanks,
Chiara
The text was updated successfully, but these errors were encountered: