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

Framing to an id map (@container: @id) fails #172

Closed
rybesh opened this issue Jun 1, 2021 · 1 comment · Fixed by #173
Closed

Framing to an id map (@container: @id) fails #172

rybesh opened this issue Jun 1, 2021 · 1 comment · Fixed by #173
Labels
bug Something isn't working
Milestone

Comments

@rybesh
Copy link

rybesh commented Jun 1, 2021

Describe the bug

A valid JSON-LD frame with an id map ("@container": "@id") fails with an error.

To Reproduce

The relevant test data and frame can be found on the JSON-LD playground.

The flattened JSON-LD graph and frame are loaded and processed using the following code:

    private static boolean frame(Path datasetPath, Path framePath) {
        try (BufferedReader datasetReader = Files.newBufferedReader(datasetPath);
                BufferedReader frameReader = Files.newBufferedReader(framePath)) {

            Document jsonld = JsonDocument.of(datasetReader);
            Document jsonldFrame = JsonDocument.of(frameReader);
            JsonObject results = JsonLd.frame(jsonld, jsonldFrame).get();

            Pretty.createWriter(System.out).writeObject(results);

            return true;

        } catch (IOException | JsonLdError e) {
            return err("Failed to frame dataset using %s: %s", framePath, e);
        }

Expected behavior

The reference JSON-LD processor at the Playground produces the expected output, but the code above (using the latest snapshot of titanium-json-ld) throws the following error: An @id entry was encountered whose value was not a string [code=INVALID_KEYWORD_ID_VALUE]

Additional context

This seems to be a separate issue from #171 since I get this error even when I load the flattened JSON-LD graph directly.

@filip26 filip26 added the bug Something isn't working label Jun 1, 2021
filip26 added a commit that referenced this issue Jun 2, 2021
@filip26 filip26 linked a pull request Jun 2, 2021 that will close this issue
filip26 added a commit that referenced this issue Jun 2, 2021
@rybesh
Copy link
Author

rybesh commented Jun 2, 2021

Thank you! Working perfectly for me now.

@filip26 filip26 added this to the 1.1.0 milestone Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants