Merge pull request #2303 from OpenRefine/issue-2196-wikidata-tag

Apply tags directly through the Wikibase API, fixes #2196
This commit is contained in:
Antonin Delpeuch 2020-02-10 02:03:08 +00:00 committed by GitHub
commit b02830c879
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -158,15 +158,13 @@ public class PerformWikibaseEditsOperation extends EngineDependentOperation {
this._engine = engine;
this._schema = (WikibaseSchema) project.overlayModels.get("wikibaseSchema");
this._summary = summary;
// TODO this is one of the attributes that should be configured on a per-wiki basis
// TODO enable this tag once 3.3 final is released and create 3.4 tag without AbuseFilter
String tag = "openrefine";
Pattern pattern = Pattern.compile("^(\\d+\\.\\d+).*$");
Matcher matcher = pattern.matcher(RefineServlet.VERSION);
if (matcher.matches()) {
tag += "-"+matcher.group(1);
}
this._tags = Collections.emptyList(); // TODO Arrays.asList(tag);
this._tags = Arrays.asList(tag);
this._historyEntryID = HistoryEntry.allocateID();
}
@ -191,7 +189,7 @@ public class PerformWikibaseEditsOperation extends EngineDependentOperation {
// make sure they can be told apart.
String summaryWithoutCommas = _summary.replaceAll(", "," ").replaceAll(": ","։ ");
String summary = summaryWithoutCommas + String.format(" ([[:toollabs:editgroups/b/OR/%s|details]])",
(Long.toHexString(token).substring(0, 10)));
(Long.toHexString(token).substring(0, 11)));
// Evaluate the schema
List<ItemUpdate> itemDocuments = _schema.evaluate(_project, _engine);