Implement new version of FastRun#333
Open
LeMyst wants to merge 5 commits into
Open
Conversation
f385ea5 to
2d58257
Compare
572355a to
e4f3711
Compare
4 tasks
d9e6e67 to
aeca219
Compare
2f17582 to
63349a6
Compare
fa07a05 to
d91a485
Compare
3ae0a5a to
7c3671b
Compare
cf48aba to
3b00b3b
Compare
5816349 to
041153e
Compare
Features: - Restrict write_required() to the entity being edited: baseentity now passes entity_filter=self.id, so data existing on another entity no longer inhibits a required write - Support action_if_exists in write_required(); FORCE_APPEND always reports a write as required - Port the language data checking (labels, descriptions, aliases) from the old implementation: init_language_data(), get_language_data() and check_language_data(), backed by the shared base filter - Implement the case insensitive mode: string values are compared casefolded, the SPARQL data is keyed casefolded at load time - Add a clear() method and a module docstring Fixes: - write_required() crashed with an IndexError when no claim matched the property filter; it now reports a write as required - The deep comparison returned early on the first mismatching statement: an entity holding duplicate statements (one matching, one not) was wrongly reported as requiring a write. The comparison now looks for at least one entity holding a matching statement for every claim - A load restricted to a value or to qualifiers (cache disabled) was reused as a complete cache, poisoning later comparisons; partial loads are no longer marked as complete - _load_qualifiers()/_load_references() crashed when building datatypes: the full property URI was passed as prop_nr; it is now reduced to the bare property ID - _load_references() duplicated references spanning two result pages - A base filter mixing a valueless property and a property path crashed in the base filter string generation - Datatypes without from_sparql_value() support and unparseable values no longer crash the load; they are skipped with a warning and the statements are reported as requiring a write - Lazily loaded qualifiers, references and ranks are memoized per statement, honoring the cache flag Tests: rebuild test/test_wbi_fastrun.py on the offline MockWikibase infrastructure with a per-query-type SPARQL dispatcher (45 tests). Docs: rewrite the fast run README section around the actual API (base filter forms, write_required() options, language data checking, limitations) and remove the outdated WikidataIntegrator-era example. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The simple value of a quantity statement does not carry the unit: two amounts only differing by their unit were considered equal and a required write could be skipped. load_statements() now loads the unit from the value node (OPTIONAL, so only quantities bind it) and the normalized unit becomes part of the comparison key. The unit is normalized to the format of the JSON representation: the RDF export of any Wikibase instance represents a unitless quantity with the Wikidata Q199 entity, which maps back to '1', and the other units are reduced to their bare entity ID. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Guard the re.search() results before reading the match groups - Import ItemEntity instead of a string annotation Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.