Re: Casting literals as IRIs

Sorry for prematurely sending the former mail. Thinking about what I 
wanted to say, my intended response isn't that relevant to this thread. 
As I am already writing this, I will just mention it anyway.

I just recently stumbled over the ability to define both @type and 
@container in the context, e.g.

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

Actually, this doesn't make a big difference in this case. It would make 
sense, though, if you had some foaf:knows triples with only one object 
and also wanted these to be delivered as an array for the sake of 
homogeneity...

All the best
Adrian


Am 18.12.2015 um 09:13 schrieb Adrian Pohl:
> Hello Jindřich,
>
> with this context:
>
> Am 17.12.2015 um 23:53 schrieb Markus Lanthaler:
>> Hi Jindřich,
>>
>>
>> On Thursday, December 17, 2015 11:04 AM, Jindřich Mynarz wrote:
>>> 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"}
>>>    }
>>> }
>>
>> What about this context:
>>
>>    "@context": {
>>      "http://xmlns.com/foaf/0.1/knows": { "@type": "@id" }
>>    }
>>
>> Result: http://tinyurl.com/hadcx4d
>>
>>
>> HTH,
>> Markus
>>
>>
>> --
>> Markus Lanthaler
>> @markuslanthaler
>>
>>
>

Received on Friday, 18 December 2015 08:24:31 UTC