Skip to content
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

Add map() method to Triplestore #69

Merged
merged 2 commits into from
Jan 27, 2023
Merged

Add map() method to Triplestore #69

merged 2 commits into from
Jan 27, 2023

Conversation

jesper-friis
Copy link
Contributor

@jesper-friis jesper-friis commented Jan 25, 2023

This PR builds on top of PR #67

Add a map() method to triplestore that is equivalent to add_mapsTo(), except that it reverts the two first arguments and removes the third property_name argument.

The motivation for this method is that it has a more natural order of arguments.

The reason for the reverse argument order of add_mapsTo() was to make mappings from data models easier by allowing to provide the data model as one argument and the property name as another. However, with the use of namespaces, it turned out that it was as easy to refer to properties using their full IRI.

@jesper-friis jesper-friis marked this pull request as draft January 25, 2023 22:03
@jesper-friis jesper-friis marked this pull request as ready for review January 26, 2023 15:21
@codecov-commenter
Copy link

Codecov Report

Base: 67.07% // Head: 67.04% // Decreases project coverage by -0.04% ⚠️

Coverage data is based on head (985937e) compared to base (13c64ee).
Patch coverage: 50.00% of modified lines in pull request are covered.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #69      +/-   ##
==========================================
- Coverage   67.07%   67.04%   -0.04%     
==========================================
  Files          14       14              
  Lines        1063     1065       +2     
==========================================
+ Hits          713      714       +1     
- Misses        350      351       +1     
Impacted Files Coverage Δ
tripper/triplestore.py 78.05% <50.00%> (-0.21%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -495,6 +495,32 @@ def prefix_iri(self, iri: str, require_prefixed: bool = False):
raise NamespaceError(f"No prefix defined for IRI: {iri}")
return iri

def map(
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is there a method that just calls another method instead of just calling the other method directly?

@jesper-friis jesper-friis merged commit 7aa073c into main Jan 27, 2023
@jesper-friis jesper-friis deleted the map-method branch January 27, 2023 14: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.

3 participants