Skip to content

feature!: knowledge graph flexibility #2030

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ahgraber
Copy link
Contributor

@ahgraber ahgraber commented May 7, 2025

The current implementations of the synthesizers (in particular, MultiHopAbstractQuerySynthesizer and MultiHopSpecificQuerySynthesizer) have hard-coded values for the node- and relationship- properties/types they look for when generating scenarios and samples. This works when using the default knowledge graph transforms, but may cause unexpected behavior (or force users to use the expected hardcoded values when they do not actually correspond to the reality of property lineage) when using customized the knowledge graph transformations.

This PR allows flexibility in defining the node-property, relationship-property, and relationship-type expected by the *QuerySynthesizers, while retaining the current behavior as default

The bulk of this PR is nonbreaking, but there may be a breaking typo fix in the SingleHopSpecificQuerySynthesizer default name.

  • feat: allow user-defined node- and relationship- properties in MultiHopAbstractQuerySynthesizer
    • Users should be able to set the relationship property to use for identifying clusters and the node property used for identifying abstract concepts.
    • This will not change default behavior, but allows users to override.
  • feat: allow user-defined node- and relationship- properties in MultiHopSpecificQuerySynthesizer
    • Users should be able to set the relationship type to use for identifying clusters and the relationship property used for identifying overlapping concepts within the triple.
    • This will not change default behavior, but allows users to override.
  • fix!: typo in SingleHopSpecificQuerySynthesizer name (single_hop_specifc_query_synthesizer -> single_hop_specific_query_synthesizer)
  • docs: minor docstring updates to SingleHopSpecificQuerySynthesizer

alex-graber-pmi and others added 4 commits May 7, 2025 16:11
…opAbstractQuerySynthesizer

- Users should be able to set the relationship property to use for identifying clusters and the node property used for identifying abstract concepts.
- This will not change default behavior, but allows users to override.
…opSpecificQuerySynthesizer

- Users should be able to set the relationship type to use for identifying clusters and the relationship property used for identifying overlapping concepts within the triple.
- This will not change default behavior, but allows users to override.
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label May 7, 2025
@ahgraber
Copy link
Contributor Author

ahgraber commented May 8, 2025

Failing unit tests seem to be triggered by the typo correction; lmk if changes are needed or if I should revert it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants