Triply-Dev / YASGUI.YASQE-deprecated

Deprecated, see https://github.com/TriplyDB/Yasgui for the Yasgui monorepo
MIT License
73 stars 36 forks source link

Check for apostrophe instead of prime #89

Closed kinow closed 7 years ago

kinow commented 7 years ago

Hi,

Working on the following issue in Apache Jena: https://issues.apache.org/jira/browse/JENA-1072

For a bit of context, the following query:

ASK {
<http://en.wikipedia.org/wiki/Good_Love_(Meli'sa_Morgan_album)> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Document> .
}

Is marked as invalid, as in the following screen shot.

screenshot_2016-10-09_20-50-46

I believe the cause for this issue is that the regular expression in used in YASQE is using a prime (single quote) instead of an apostrophe, as in https://www.w3.org/TR/sparql11-query/#rIRIREF

i.e., while the SPARQL 1.1 specification has iriref as '<' ([^<>"{}|^`]-[#x00-#x20])* '>', YASQE is converting that into the following regex '<[^<>\"\'|{}^\x00-\x20]*>'.

This pull request addresses just the prime vs. apostrophe, and seems to fix the issue in the editor with the same query. However, I think there may be other differences in the regex and the spec value.

screenshot_2016-10-09_22-02-00

It was super easy to check out and play with YASQE in development mode, thanks for such a super library and for making it easier for other developers to play with it :-)

Thanks Bruno

LaurensRietveld commented 7 years ago

that's a pretty complete PR, thanks! Merged, and published as new version (2.11.3)

kinow commented 7 years ago

Thanks @LaurensRietveld! Confirmed that with the new version the issue is fixed in Jena.

LaurensRietveld commented 7 years ago

@kinow It turns out that a bug (https://github.com/OpenTriply/YASGUI/issues/84, infinite loop crashing your browser) was introduced in 2.11.0. The latest version (2.11.4) contains the fix (#90). Considering you just updated Jena with a 2.11.x version, it's probably best if you upgrade to the latest version

kinow commented 7 years ago

Thank you very very much for letting me know about the bug @LaurensRietveld

Will bump up Jena to 2.11.4 this weekend.