Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save micheldumontier/cc4db9edf1e07c53485dcec2fa6999e5 to your computer and use it in GitHub Desktop.
Save micheldumontier/cc4db9edf1e07c53485dcec2fa6999e5 to your computer and use it in GitHub Desktop.
JSON-LD expansion of values into IRIs
{
"@context": {
"@vocab": "http://schema.org/",
"symbol": {
"@id": "http://schema.org/symbol",
"@type": "@id"
},
"pathway": {
"@id": "http://schema.org/regulates",
"@type": "@id"
},
"hgnc.symbol": {
"@id": "http://identifiers.org/hgnc.symbol/"
},
"kegg.pathway": {
"@id": "http://identifiers.org/kegg.pathway/"
}
},
"@id": "http://mygene.info/gene/1017",
"@type": "gene",
"symbol": "hgnc.symbol:CDK2",
"pathway": "kegg.pathway:K234234"
}
@micheldumontier
Copy link
Author

adding @base will enable expansion of non prefixed identifiers. however, there can only be one such @base value for the document

{
"@context": {
"@base": "http://identifiers.org/typeunknown/",
"@vocab": "http://schema.org/",
"symbol": {
"@id": "http://schema.org/symbol",
"@type": "@id"
},
"pathway": {
"@id": "http://schema.org/regulates",
"@type": "@id"
},
"hgnc.symbol": {
"@id": "http://identifiers.org/hgnc.symbol/"
},
"kegg.pathway": {
"@id": "http://identifiers.org/kegg.pathway/"
}
},

"@id": "http://mygene.info/gene/1017",
"@type": "gene",
"symbol": "hgnc.symbol:CDK2",
"pathway": ["kegg.pathway:K234234","K1111"]
}

<http://mygene.info/gene/1017> <http://schema.org/regulates> <http://identifiers.org/kegg.pathway/K234234> .
<http://mygene.info/gene/1017> <http://schema.org/regulates> <http://identifiers.org/typeunknown/K1111> . 
<http://mygene.info/gene/1017> <http://schema.org/symbol> <http://identifiers.org/hgnc.symbol/CDK2> .
<http://mygene.info/gene/1017> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/gene> .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment