Skip to content

Implement new version of FastRun#333

Open
LeMyst wants to merge 5 commits into
masterfrom
new-fastrun
Open

Implement new version of FastRun#333
LeMyst wants to merge 5 commits into
masterfrom
new-fastrun

Conversation

@LeMyst

@LeMyst LeMyst commented May 12, 2022

Copy link
Copy Markdown
Owner

No description provided.

@LeMyst LeMyst force-pushed the new-fastrun branch 2 times, most recently from f385ea5 to 2d58257 Compare May 13, 2022 17:49
@LeMyst LeMyst force-pushed the new-fastrun branch 6 times, most recently from 572355a to e4f3711 Compare May 28, 2022 13:10
@LeMyst LeMyst linked an issue May 28, 2022 that may be closed by this pull request
4 tasks
@LeMyst LeMyst force-pushed the new-fastrun branch 3 times, most recently from d9e6e67 to aeca219 Compare May 30, 2022 20:57
@LeMyst LeMyst added this to the v0.12 milestone Jul 2, 2022
@LeMyst LeMyst modified the milestones: v0.12, v0.13 Jul 3, 2022
@LeMyst LeMyst changed the base branch from rewrite-wbi to master July 14, 2022 17:43
@LeMyst LeMyst force-pushed the new-fastrun branch 6 times, most recently from 2f17582 to 63349a6 Compare May 8, 2023 10:39
@LeMyst LeMyst force-pushed the new-fastrun branch 3 times, most recently from fa07a05 to d91a485 Compare January 2, 2024 21:46
@LeMyst LeMyst force-pushed the new-fastrun branch 2 times, most recently from 3ae0a5a to 7c3671b Compare January 8, 2024 11:45
@LeMyst LeMyst force-pushed the new-fastrun branch 2 times, most recently from cf48aba to 3b00b3b Compare December 19, 2024 11:03
@LeMyst LeMyst force-pushed the new-fastrun branch 2 times, most recently from 5816349 to 041153e Compare December 26, 2024 20:59
LeMyst and others added 4 commits July 7, 2026 17:28
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>
@LeMyst LeMyst marked this pull request as ready for review July 8, 2026 19:55
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

Successfully merging this pull request may close these issues.

Improve fastrun query

1 participant