-
Notifications
You must be signed in to change notification settings - Fork 44
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
PROV-N deserialization? #122
Comments
Thanks, @MarcelPa. That'd be fab! I've been thinking about doing this, but haven't found the time for it. @TomasKulhanek recently wrote an ANTLR grammar for PROV-N, which I believe can be used to build a PROV-N parser. Are you interested in working on that? I'd be very happy to help with testing/integration when needed. |
Great, I would like to work on that then. The ANTLR grammar will surely be really helpful for that, thanks @trungdong (and @TomasKulhanek of course). |
Excellent! Thanks a lot, @MarcelPa. |
Quick question regarding testing: is there a pattern on how to create test files that can be found under tests/rdf for example? My approach would be to just copy the rdf documents and translate them into provn docs step by step. FYI: ANTLR works fine so far, I got rid of raising |
There is an extensive suite of round-trip conversion tests that you can use right away. See class RoundTripPROVNTests(RoundTripTestCase, AllTestsBase):
FORMAT = 'provn' BTW, could you develop from the |
Quite some time that I have pushed to my forked repo, therefore I am giving you an update via this issue: |
Thanks for the update, @MarcelPa. Unfortunately, I won't be of much help on ANTLR. The PROV-N specs does use grammar rules, which you might find useful. |
Hey, after quite a while I finally had some spare time to spend for this. I modified the grammar a little bit (basically just reordered some rules), now it seems to work properly :-) Literal(somevalue, datatype="xsd:float", langtag=someLangtag) or parsed native value, like float(somevalue) I think I used those a little bit inconsequently right now. I will need to refactor this one way or another ;-) |
Thank you for the update and the work, @MarcelPa!
BTW, a Python float value is mapped to |
I do: running
versus the testcase data:
The difference is noticable at So far, I did not notice any changes happening from float to double. |
@MarcelPa Just a quick question what the status of the PROV-N deserialiser is. It's been a good year, and it looked like things weren't far off. |
Oh my, I completely lost track of this issue, thanks for the reminder @pohutukawa ! I will rebase later today and give a status update; If I recall correctly, I was "stuck" editing the antlr prov-n grammar. Will keep you posted :-) |
I am back at finding out how antlr4 works (any help is appreciated!). For reasons I do not yet understand, langtags and some int_literals will fail to parse, which gives me 57 fails of 185 unit tests. Once I figure out how to fix that, PROV-N deserialization should near its completion. |
That looks promising! |
Hi @MarcelPa, Wondering if you've had any progress on this deserializer? I'm wanting to work some more with Prov-n but seem quite limited without the ability to store and extract from Prov-n strings. I'm taking a bit of a look at the code and the tools to see if I could help but it's a little bit beyond me at this stage |
I also found a mildly hacky way to convert in and out of Prov-n using the java ProvToolbox and provconvert, |
We've been trying to use @MarcelPa's feature branch that can parse PROV-N with decent results so far. Though, it's not based on the current 2.0 version, yet, so that's a bit of a pity. If the ANTLR3 grammar by Luc is more complete, would that be an option to move forward on? (Even though it may be more "sexy" to use a current ANTLR4 grammar.) After all, there is a I'm just searching for ways to not create any inconsistencies between individual approaches, for the case that the ANTLR4 grammar may differ from the ANTLR3 one ... |
Hello, I would like to know whether a PROV-N deserializer is somewhere on the implementation roadmap? If not, I would like to contribute that; in case it is of interest of course.
The text was updated successfully, but these errors were encountered: