Casting literals as IRIs

Hi,

I found that some services return JSON-LD, in which IRIs are serialized as
literals. For example, consider the following example:

{
  "@id": "http://mynarz.net/#jindrich",
  "http://xmlns.com/foaf/0.1/knows": [
     "http://ruben.verborgh.org/#me",
     "http://richard.cyganiak.de/foaf.rdf#cygri"
  ]
}

The objects of foaf:knows are serialized as literals, even though they are
IRIs.

Now, if I want to recover the objects of foaf:knows as IRIs, the following
context is of no use:

{
  "@context": {
    "foaf": "http://xmlns.com/foaf/0.1/",
    "foaf:knows": {"@type": "@id"}
  }
}

The definition of foaf:knows in this way doesn't match the input JSON-LD,
which ends up compacted as:

{
  "@context": {
    "foaf": "http://xmlns.com/foaf/0.1/",
    "foaf:knows": {
      "@type": "@id"
    }
  },
  "@id": "http://mynarz.net/#jindrich",
  "http://xmlns.com/foaf/0.1/knows": [
    "http://ruben.verborgh.org/#me",
    "http://richard.cyganiak.de/foaf.rdf#cygri"
  ]
}

I.e. not even the foaf namespace prefix is used. JSON-LD Framing gives the
same result.

Is it possible to use a JSON-LD context or frame to *coerce* literal
objects to IRIs?

Best,

Jindřich

-- 
Jindřich Mynarz
http://mynarz.net/#jindrich

Received on Thursday, 17 December 2015 10:04:52 UTC