Page MenuHomePhabricator

N3Quoter should generate correct escapes for ASCII control characters
Closed, ResolvedPublic

Description

N3Quoter::escapeLiteral currently generates C-style escape sequences for some control characters which are invalid according to the Turtle spec https://www.w3.org/TR/turtle/#turtle-literals. For instance, "x07" (bell) is escaped as '\a' (correct in C, but not in Turtle), instead of '\u0007'.

NOTE: https://www.w3.org/TeamSubmission/n3/#escaping says: Some escapes (\a, \b, \f, \v) should be avoided because the corresponding characters are not allowed in RDF. It's unclear if and how these characters should be represented at all.

Event Timeline

Pull request on Github: https://github.com/wikimedia/purtle/pull/5

Note that using this in Wikibase will need a minor release of the Purtle component.

Change 310918 had a related patch set uploaded (by Smalyshev):
Fix escaping \a and \v which should be numeric in n3/turtle

https://gerrit.wikimedia.org/r/310918

assigning to @Smalyshev, since he claimed the parent task

Change 310918 merged by jenkins-bot:
Fix escaping \a and \v which should be numeric in n3/turtle

https://gerrit.wikimedia.org/r/310918

Note: this still needs a release, so wikibase starts using the new version. We'll probably have to poke packagist to pick up the new tag.

I thought packagist auto-updates when you push new tag? May depend on settings though.

If the right github repo has the right web-hook set up, then it usually does. Unless it doesn't. But I don't think we have it set for the replicated repo.

@daniel I've made a tag, could you kick it on packagist to update? You seem to be have the rights there, I don't :)

@Smalyshev Done. Packagist now shows 1.0.4 as the current version. I have also added the wikimedia and mediawiki users as maintainers.

I can confirm that composer update pulls in purtle 1.0.4 now.

Should we have a test for this in Wikibase itself, so we can verify it works now? Or can we just close this ticket, since the updated component has been released?

I think this one is done, and we have purtle tests. The parent one we need to verify dump is OK, and then we can close it. Maybe add some tests to dump generator tests too just in case...