Skip to content

Setting @context for JSON-LD parsing ? #4059

Answered by ate47
tfrancart asked this question in Q&A
Discussion options

You must be logged in to vote

It seems the library can't do that, the closest I was able to find is if the the "@context" URL is a fake one, but still an URL, you can use the JSONLDSettings.DOCUMENT_LOADER option to override the context download

I wrote this little example to read the original.json file and convert it into a ttl file.

original.json (the Wikipedia example)

{
  "@context": "http://bad.com/url",
  "@id": "https://me.example.com",
  "@type": "Person",
  "name": "John Smith",
  "homepage": "https://www.example.com/"
}

the removed context is

"@context": {
    "name": "http://xmlns.com/foaf/0.1/name",
    "homepage": {
        "@id": "http://xmlns.com/foaf/0.1/workplaceHomepage",
        "@type": "@id"
    }…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tfrancart
Comment options

Answer selected by tfrancart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants