-
Notifications
You must be signed in to change notification settings - Fork 157
Base URI per property [Duplicate] #428
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
Comments
this looks like a clear demonstration of a good argument for nesting contexts as such, rather than requiring that they always appear in-line. |
This would fall out of #426. It would look something like the following: {
"@context": {
"@base": "http://purl.uniprot.org/uniprot/",
"id": "@id",
"a": "@type",
"name": "http://purl.uniprot.org/core/name",
"taxon": "http://purl.uniprot.org/taxonomy/",
"organism": {
"@id": "http://purl.uniprot.org/core/organism",
"@content": {
"@context": {
"@base": "http://purl.uniprot.org/taxonomy/"
}
}
}
},
"id": "P12345",
"organism": {
"id": "9606",
"name": "Human"
}
} |
Yes, you can close it. There will be a marker to this issue, as this references #426. Once we achieve consensus on going forward with changes for 1.1, we can get spec text integrated into a draft; that should happen reasonably soon. |
@gkellogg @JervenBolleman is the json-ld example in this above comment is now supposed to work with 1.1 client (e.g. ruby one)? I tested it in my 1.1 playground, it does not seem able to pick up the |
No, we never proceeded on having term {
"@context": {
"@version": 1.1,
"@base": "http://purl.uniprot.org/uniprot/",
"id": "@id",
"a": "@type",
"name": "http://purl.uniprot.org/core/name",
"taxon": "http://purl.uniprot.org/taxonomy/",
"organism": {
"@id": "http://purl.uniprot.org/core/organism",
"@context": {
"@base": "http://purl.uniprot.org/taxonomy/"
}
}
},
"id": "P12345",
"organism": {
"id": "9606",
"name": "Human"
}
} It does not compact they way you expect (to be investigated), but it does expand using the embedded context. |
@gkellogg got it, "scoped context" should be the solution here. And looks like might be a bug in the ruby client for processing the scoped context. |
This is an usecase that comes from the UniProt RDF to JSON translation. The UniProt datamodel is big and uses a lot of properties, not only that they have large number of URI namespaces.
e.g. in this example
We would like to get rid of this prefixed taxon:9606 uri. i.e. in other words just show the 9606.
The main UniProt identifiers are dealt with by having set the base.
But for some specific properties I know that I will only have ids with a
certain prefix. This can't be specified in the context today.
e.g. I would like to have something like this.
That should translate to this
instead of this
There are ways to work around this with many inline contexts with their own base, but that is fragile (can have only one context per object so if we had two of this kind of predicates it would not work, in the UniProt case this does happen.)
The text was updated successfully, but these errors were encountered: