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 profile negotiation for EMM dump data. #1539

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

jannistsiroyannis
Copy link
Contributor

@jannistsiroyannis jannistsiroyannis commented Dec 13, 2024

This adds profile negotiation for EMM, the same way it exists for normal record GETs in libris (using &profile=..profile url..).

Copy link
Contributor

@olovy olovy left a comment

Choose a reason for hiding this comment

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

See other comment.
Other than that, LGTM!

Maybe reuse the profileDoc instead of loading it for each document?

We possibly want to use the types of the selected profile in the update stream.
Instead of the KBV types. But we can deal with that separately.

@@ -357,15 +359,29 @@ private static void writeJsonLdLine(Object object, OutputStream os) throws IOExc
os.write("\n".getBytes(StandardCharsets.UTF_8));
}

private static Object wrapDoc(Document doc, Document contextDoc) {
private static Object formatDoc(Document doc, Document contextDoc, Whelk whelk, TargetVocabMapper targetVocabMapper, String profile) {
var context = new ArrayList<>();
context.add(null);
context.add(contextDoc.getRecordIdentifiers().getFirst());
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe that when a profile is selected we should point to that context here.
Same with the first document of the dump. It should be the profile context instead of the system context.

See e.g. @context
https://libris-qa.kb.se/fxql7jqr38b1dkf/data.jsonld?profile=https%3A%2F%2Fid.kb.se%2Fsys%2Fcontext%2Ftarget%2Fsdo-w3c&embellished=false

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.

2 participants