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

fix (RDF): composite key objects #4566

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
Draft

Conversation

svandenhoek
Copy link
Contributor

@svandenhoek svandenhoek commented Dec 16, 2024

What are the main changes you did

How to test

Known issues

Checklist

  • updated docs in case of new feature
  • added/updated tests
  • added/updated testplan to include a test for this fix, including ref to bug using # notation

Comment on lines +81 to +90
@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()));
}
Copy link
Contributor Author

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:

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:

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
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.

RDF API does not include composite references
2 participants