Re: JSON-LD: Skipping keys, but parsing their contents

Hi Markus,

On 15/12/13 12:16, Markus Lanthaler wrote:
> Could you explain what triples you would like to get out of this

<http://id.example.com/happy> a skos:Concept ;
  skos:prefLabel "happy" ;
  skos:narrower <http://id.example.com/ecstatic> .

> The link relation types (i.e., the predicates) would be lost because
> they are outside your link objects.

Yep.

> The other trick you need to use is to map "_links" to a blank node
> and set its container to @index so that doesn't get ignored. The
> triples containing blank nodes as predicate are discarded (unless you
> set a special flag) by default when converting to RDF. Your document
> would then look as follows:
>
> […]

That's a clever hack, but means that when it comes to HAL's "_embedded",
properties of the linked resource won't make it in. (I should probably
have mentioned that part at the beginning).

> Is assume this is what you wanted to achieve, right? It would be
> much simple though to just ignore the _links property altogether and
> duplicate the links directly in the object itself:

I hadn't considered that level of duplication, but yes, that'd work.

Given the triviality of turning a HAL document into a JSON-LD document,
I reckon the best way forward would be to use HAL as the primary
representation and convert to JSON-LD as required. Doing so should just
mean moving the contents of _links and _embedded up a level, adding a
@context, and maybe flattening some other grouping keys.

>> Is there an answer?
>
> I hope I gave you two above :-)

Yep; thank you for the insight!

Best regards,

Alex

-- 
Alexander Dutton
Linked Open Data Architect, Office of the CIO; data.ox.ac.uk, OxPoints
IT Services, University of Oxford

Received on Monday, 16 December 2013 09:15:39 UTC