W3C home > Mailing lists > Public > public-linked-json@w3.org > November 2013

Framing and @reverse

From: Anders Riutta <anders.riutta@gladstone.ucsf.edu>
Date: Wed, 20 Nov 2013 15:23:08 -0800 (PST)
To: public-linked-json@w3.org
Message-ID: <641529057.1253194.1384989788366.JavaMail.zimbra@gladstone.ucsf.edu>
Hello,

I am looking at using JSON-LD for a project I'm working on but am running into some difficulties. The data can be represented as a collection of directed acyclic graphs, and it needs to go through a topological sort. I'm trying to first transform the collection from the form "A-dependsOn-B, B-dependsOn-C" to the reverse, compacted form "C-hasDependencies-[A, B]" so I can use an algorithm like <https://github.com/davidstutz/d3-topological>. I think this transformation should be possible with JSON-LD, but I'm having difficulty making it happen. Here's a non-working code sample on the JSON-LD playground:

http://json-ld.org/playground/index.html?json-ld=%7B%22%40context%22%3A%7B%22dc%22%3A%22http%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%22%2C%22ex%22%3A%22http%3A%2F%2Fexample.org%2Fvocab%23%22%2C%22xsd%22%3A%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23%22%2C%22ex%3AdependsOn%22%3A%7B%22%40type%22%3A%22%40id%22%7D%2C%22ex%3AhasDependency%22%3A%7B%22%40reverse%22%3A%22ex%3AdependsOn%22%7D%7D%2C%22%40graph%22%3A%5B%7B%22%40id%22%3A%22http%3A%2F%2Fexample.org%2FwakeUp%22%2C%22%40type%22%3A%22ex%3AEvent%22%2C%22dc%3Atitle%22%3A%22Wake%20Up%22%7D%2C%7B%22%40id%22%3A%22http%3A%2F%2Fexample.org%2FmakeCoffee%22%2C%22%40type%22%3A%22ex%3AEvent%22%2C%22dc%3Atitle%22%3A%22Make%20Coffee%22%2C%22ex%3AdependsOn%22%3A%22http%3A%2F%2Fexample.org%2FwakeUp%22%7D%2C%7B%22%40id%22%3A%22http%3A%2F%2Fexample.org%2FmakeToast%22%2C%22%40type%22%3A%22ex%3AEvent%22%2C%22dc%3Atitle%22%3A%22Make%20Toast%22%2C%22ex%3AdependsOn%22%3A%22http%3A%2F%2Fexample.org%2FwakeUp%22%7D%2C%7B%22%40id%22%3A%22http%3A%2F%2Fexample.org%2FhaveBreakfast%22%2C%22%40type%22%3A%22ex%3AEvent%22%2C%22dc%3Atitle%22%3A%22Have%20Breakfast%22%2C%22ex%3AdependsOn%22%3A%5B%22http%3A%2F%2Fexample.org%2FmakeCoffee%22%2C%22http%3A%2F%2Fexample.org%2FmakeToast%22%5D%7D%5D%7D&frame=%7B%0A%20%20%22%40context%22%3A%20%7B%0A%20%20%20%20%22dc%22%3A%20%22http%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%22%2C%0A%20%20%20%20%22ex%22%3A%20%22http%3A%2F%2Fexample.org%2Fvocab%23%22%0A%20%20%7D%2C%0A%20%20%22%40type%22%3A%20%22ex%3AEvent%22%2C%0A%20%20%22ex%3AhasDependency%22%3A%20%7B%0A%20%20%20%20%22%40type%22%3A%20%22ex%3AEvent%22%0A%20%20%7D%0A%7D&context=%7B%0A%20%20%22%40context%22%3A%20%7B%0A%20%20%20%20%22dc%22%3A%20%22http%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%22%2C%0A%20%20%20%20%22ex%22%3A%20%22http%3A%2F%2Fexample.org%2Fvocab%23%22%2C%0A%20%20%20%20%22xsd%22%3A%20%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23%22%2C%0A%20%20%20%20%22ex%3Acontains%22%3A%20%7B%0A%20%20%20%20%20%20%22%40type%22%3A%20%22%40id%22%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D&startTab=tab-compacted

Thanks for any suggestions!
Anders
Received on Thursday, 21 November 2013 09:43:21 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:18:39 UTC