-
Notifications
You must be signed in to change notification settings - Fork 10
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
Conditional generation of triples #2
Comments
Hey Flavio,
I'm looking into it. |
In this particular case, we might wonder whether we could solve this on a different level of abstraction. After all, emptiness and whitespace trimming are common functions. |
@RubenVerborgh, that's why I said I'm looking into it (on RML model level) but the example given seems to me that was meant more on conditional statements rather than data cleansing. |
That's right. It could be useful to integrate it with some lib to evaluate expressions like Google Refine Expression Language (GREL) functions (https://github.com/OpenRefine/OpenRefine/wiki/GREL-Functions) or similar (jeval, etc). In my use case it's usefult to put conditions on subjects and predicate generations |
GREL is more on data cleansing though. GREL as well as Regular Expressions were considered when HTML2RDF mappings were performed. On the other side, rml:condition would/could cover cases that a condition (something like an if statement) needs to be fulfilled to do the mapping. We still need to see if that's necessary because we tried to keep as close as possible to the R2RML standard so far. |
That would be awesome for my uwe case, otherwise I have to implement it..
|
Actually what I was trying to implement as a a PoC was to use something like rr:guard or rr:expjeval with JEval on subjects and predicates to manage when to create them, that is what I need in my use case. Is it so uncommon to have such a requirement? |
I just pushed a merge request of a simple implementation for the management of production rules using JEval. This is just a PoC, I just wont to know if it could be ok or if you think it should be done in a different way. I cannot send you the test because it contains private data but we can keep in touch if you want so I can send it to you! |
The problem I see is that it is case-specific. From the RML model's perspective, this should be able to handle any possible post-processing. In your case it is JEval, I'm using regular expressions, eventually the post-processing will handle GREL. But, an RML processor might be implemented using Python or any other programming language where JEval is not available but still processing is required. At the moment, I hesitate to use by default something that's not compliant with a standard/specification/recommendation (as that's the way RML works so far - more details at rml.io), let alone if it's programming language specific. However, it should not be restrictive, so, for instance, if you or anyone else do want to use JEval or any other library, you should always be able to do so by adding it as a new processing performer in the same way that you add new type of input sources. |
Thanks for the reply. I agree that this functionality must be better formalized and standardized. |
Would you like to send me a private e-mail with more info about your use case? |
Sorry for the late reply..my private mail is [email protected] In my company (okkam.it) we would like to promote the use of RML but for At the moment we use a custom program but we'd really love to promote the Best,
|
Hi,
nice work! Do you think it could be possible to manage a condition for generation of triples?
For example, adding a rr:condition (expression) to a rr:subjectMap like:
<#DateTime>
rml:logicalSource [
rml:sourceName "example.xml";
rml:iterator "/notes/note";
rml:queryLanguage ql:XPath;
];
rr:subjectMap [
rr:template "http://www.example.com/DateTime/{@year}{@month}{@day}";
rr:class ex:DateTime;
rr:condition "{@month}.trim() != '' "
];
Thanks,
FP
The text was updated successfully, but these errors were encountered: