Open bblfish opened 2 years ago
Hmmm, for some reason grel:toDate doesn't work. However, we have another function that should do smth similar, however it doesn't seem to handle the X
pattern too well, the RML below seems to work at my end:
@base <http://example.org/> . ## see issue https://github.com/RMLio/rmlmapper-java/issues/178
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix rml: <http://semweb.mmlab.be/ns/rml#> .
@prefix rr: <http://www.w3.org/ns/r2rml#> .
@prefix sosa: <http://www.w3.org/ns/sosa/> .
@prefix fnml: <http://semweb.mmlab.be/ns/fnml#> .
@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
@prefix fno: <https://w3id.org/function/ontology#> .
@prefix idlab-fn: <http://example.com/idlab/function/> .
<#allDataMap> rr:predicateObjectMap [
rr:predicate sosa:resultTime ;
rr:objectMap [
rr:datatype xsd:dateTimeStamp;
fnml:functionValue [
rr:predicateObjectMap [
rr:predicate fno:executes ;
rr:objectMap [ rr:constant idlab-fn:normalizeDateTime ]
];
rr:predicateObjectMap [
rr:predicate idlab-fn:strDate;
rr:objectMap [ rml:reference "timestamp"]
];
rr:predicateObjectMap [
rr:predicate idlab-fn:pattern;
rr:objectMap [ rr:constant "yyyy-MM-dd HH:mm:ss'+00:00'"];
];
];
];
] .
Thanks for the help.
I saw test cases using idlab-fn
, but as the ontology is on the domain example.com I was not sure if that should be used. Perhaps it would be worth publishing those ontologies with descriptions of how they work at a place you own?
The idlab-fn
are functions used for internal purposes and research projects, they are not standardized in any case and may change at any time, that's why they are not published.
@bjdmeest fn:normalizeDate
does not work either:
ERROR be.ugent.knows.idlabFunctions.IDLabFunctions - Text '2016-07' could not be parsed: Unable to obtain LocalDate from TemporalAccessor: {MonthOfYear=7, Year=2016},ISO of type java.time.format.Parsed; format pattern: "yyyy-MM", input: "2016-07", language: "en"
I have the following csv data where the second column is close to an
xsd:dateTimeStamp
format.To map the second column I have written the following mapping rule
Given the other turtle files, which I will append to this report I get the following output. It seems to be able to find the right function and the apply the right methods, but it does not seem to understand how to map a Date object to return an xsd:dateTimeStamp (or any other value) and so the result is empty.
This seems somewhat similar to issue https://github.com/RMLio/rmlmapper-java/issues/142
all data and code: example.tar.gz