Skip to content
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

formula_aware requirement in notation3 parser too stringent for turtle? #214

Closed
maparent opened this issue May 20, 2012 · 2 comments
Closed

Comments

@maparent
Copy link
Contributor

Good day.

I am trying to get some turtle data into a sparql endpoint, and if I understand well the parser to use for turtle is the notation3 parser. (Using tip of rdflib and rdflib-sparqlstore)

I stumbled on the fact that the sparql endpoint is not formula_aware. I am still trying to understand the exact requirements of formula-awareness of a store, but it makes sense to me that my sparql endpoint could not be formula-aware. (I am also working on sparql endpoints which are not context-aware, which is another headache.) Now, the n3 parser asserts formula-awareness, which makes sense for n3 but not for turtle. (Again, even context-awareness should not be necessary!)

Am I missing something obvious (you should use another parser...) or is this a real issue?
Do you agree that this requirement should be relaxed?

I have a patch ready, which simply disables the assertion at line 2357 and delays the check implicit at line 897 by replacing the newFormula call by a direct Formula constructor; this leaves the newFormula call at 1373 that will check formula_awareness for full n3.

Aside: at line 895, we have a newFormula call with an argument, which should just fail; it is probably never called?

Now, this simple-minded hack is certainly not the best approach; maybe we want a proper turtle parser, and a N3 parser that subclasses it. Maybe we want to build the turtle parser independently (maybe on the ntriples parser?). I am more than willing to do the work, but I'd like some guidance on which approach would be favored by maintainers.

Best,
Marc-Antoine Parent

@gromgull
Copy link
Member

You are spot on - the requirement is too stringent.

if possible we should subclass the parser and only relax the checks in the subclass. Writing a new turtle parser from scratch is probably more hassle than it's worth.

@maparent
Copy link
Contributor Author

Ah?
Is it not easier to have the relaxed checks in the superclass? Though I agree that cutting the class in two will not be easy.
Anyway, if I took a stab at it, could you review?
Marc-Antoine

Le 2012-05-24 à 12:56, Gunnar Aastrand Grimnes a écrit :

You are spot on - the requirement is too stringent.

if possible we should subclass the parser and only relax the checks in the subclass. Writing a new turtle parser from scratch is probably more hassle than it's worth.


Reply to this email directly or view it on GitHub:
#214 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants