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

Accessing expansionMap when there are no unmapped properties #398

Open
gjj opened this issue May 26, 2020 · 2 comments
Open

Accessing expansionMap when there are no unmapped properties #398

gjj opened this issue May 26, 2020 · 2 comments

Comments

@gjj
Copy link

gjj commented May 26, 2020

Hello! I wanted to check if it's possible to access info in the expansionMap in compact when there are no unmapped properties?

To provide some context: I'm currently working on a W3C Verifiable Credentials-related project and in one of our validations, we had to check for every value in type as shown below, whether it can be mapped to any of the @contexts.

{
    "@context": [
        "https://www.w3.org/2018/credentials/v1",
        "https://link.to/our/DrivingLicenceCredentialContext.jsonld"
    ],
    "type": ["VerifiableCredential", "DrivingLicenceCredential"],
    ...
    // Removed for brevity
}

The catch here is that we found out that expansionMap only shows up when there are unmapped properties, but not values. For example, only in the case below then we can access expansionMap assuming that someRandomProperty cannot be mapped to any of the @contexts.

{
    "@context": [
        "https://www.w3.org/2018/credentials/v1",
        "https://link.to/our/DrivingLicenceCredentialContext.jsonld"
    ],
    "type": ["VerifiableCredential", "DrivingLicenceCredential"],
    "someRandomProperty": "not found in any of the contexts above"
    ...
    // Removed for brevity
}

So... is there an alternative way for us to access activeCtx.mappings that's found in info in this case?

@dlongley
Copy link
Member

So, currently, the answer is no. But this is an interesting feature request as this issue has come to bite multiple people in the VC community. We may want the unmapped API to get triggered when a base URI is not set and an undefined base-relative value is found (and perhaps we should also add a flag to forcibly call the API even if a base URI is set in this case).

This should be looked into when implementing a fix for #199.

PRs welcome. @davidlehn - do you know of any workarounds for this at the moment?

@gjj
Copy link
Author

gjj commented May 26, 2020

@dlongley thank you for the clarifications!

Linking this to w3c/vc-test-suite#96 and w3c/vc-test-suite#97, in case anyone else who implements it this way also encounter the same issue.

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

No branches or pull requests

2 participants