-
Notifications
You must be signed in to change notification settings - Fork 17
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
fix (RDF): composite key objects #4566
base: master
Are you sure you want to change the base?
Conversation
@Test | ||
void testEncodedValues() { | ||
assertAll( | ||
() -> assertEquals("a=1", new PrimaryKey(Map.of("a", "1")).getEncodedValue()), | ||
() -> assertEquals("a=1&b=2", new PrimaryKey(Map.of("a", "1", "b", "2")).getEncodedValue()), | ||
() -> | ||
assertEquals( | ||
"a=1&b=2&c=3", | ||
new PrimaryKey(Map.of("a", "1", "b", "2", "c", "3")).getEncodedValue())); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BrendaHijmans Added this check for making sure a composite key with more than 2 keys works correctly. This class is used to generate the full reference IRI here:
molgenis-emx2/backend/molgenis-emx2-rdf/src/main/java/org/molgenis/emx2/rdf/ColumnTypeRdfMapper.java
Lines 234 to 235 in 9764054
PrimaryKey key = new PrimaryKey(item); | |
values.add(Values.iri(ns, rootTableName + "?" + key.getEncodedValue())); |
The code before this that ends up creating the input for PrimaryKey
does not care about the number of composite keys, so if other tests with 2 primary keys work, it should work with more as well:
molgenis-emx2/backend/molgenis-emx2-rdf/src/main/java/org/molgenis/emx2/rdf/ColumnTypeRdfMapper.java
Line 217 in 9764054
for (final Reference reference : column.getReferences()) { |
You can mark this as solved if you feel this answers your concern adequately. Otherwise, let me know.
Conflicts: backend/molgenis-emx2-rdf/src/test/java/org/molgenis/emx2/rdf/ColumnTypeRdfMapperTest.java
What are the main changes you did
How to test
Known issues
Column.getReferences()
when dealing with composite REFBACK #4564Checklist