Skip to content

Feat property specific label maps#6

Open
rmfranken wants to merge 3 commits into
developfrom
feat-property-specific-label-maps
Open

Feat property specific label maps#6
rmfranken wants to merge 3 commits into
developfrom
feat-property-specific-label-maps

Conversation

@rmfranken
Copy link
Copy Markdown
Member

@rmfranken rmfranken commented Sep 25, 2025

Proposed Changes

label map is now predicate specific - meaning you can't match "Python" the snake for ex:programmingLanguage.

Types of Changes

What types of changes does your contribution introduce? Put an x in the boxes
that apply

  • A bug fix (non-breaking change which fixes an issue). Use MR tag
    bugfix.
  • A new feature (non-breaking change which adds functionality). Use MR
    tag feature.
  • A breaking change (fix or feature that would cause existing
    functionality to not work as expected). Use MR tag feature.
  • A non-productive update (documentation, tooling, etc. if none of the
    other choices apply). Use MR tag chore.

Checklist

Put an x in the boxes that apply. You can also fill these out after creating
the PR. If you're unsure about any of them, don't hesitate to ask. We're here to
help! This is simply a reminder of what we are going to look for before merging
your code.

Further Comments

@rmfranken rmfranken requested a review from caviri September 25, 2025 15:01
@rmfranken
Copy link
Copy Markdown
Member Author

@caviri feel free to put the clanker on this - but I couldn't find the option in my "Reviewers" tab.

@rmfranken rmfranken changed the base branch from main to develop September 29, 2025 07:27
@caviri caviri requested a review from Copilot October 8, 2025 11:14
@caviri
Copy link
Copy Markdown
Member

caviri commented Oct 8, 2025

@rmfranken done, I didn't received the notification. Sorry.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements predicate-specific label maps to prevent mismatches like matching "Python" the snake for a programming language predicate. The key change is transitioning from a single global label map to predicate-specific label maps based on SHACL PropertyShape constraints.

Key changes:

  • Refactored label map structure from flat dictionary to predicate-specific nested dictionaries
  • Updated RDFTransformer to use the new predicate-specific approach
  • Removed global ambiguity handling in favor of immediate failure on predicate-level duplicates

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/strings2things/app/core/ontology_manager.py Replaced global label map building with SHACL-based predicate-specific label maps
src/strings2things/app/core/rdf_transformer.py Updated to use predicate-specific label maps for matching
src/strings2things/app/config.py Removed FAIL_ON_AMBIGUOUS_LABELS setting
src/strings2things/app/api/endpoints.py Updated method call to get predicate-specific label map
tests/test_rdf_transformer.py Refactored tests to use new predicate-specific structure
tests/test_ambigous.py Updated ambiguity tests for new predicate-specific validation
tests/conftest.py Added new test fixtures supporting the updated architecture

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/strings2things/app/core/ontology_manager.py
Comment thread src/strings2things/app/core/rdf_transformer.py Outdated
@rmfranken
Copy link
Copy Markdown
Member Author

@caviri ready for human review !

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.

3 participants