Re: Mapping between a generic Web API and an LDP Server

Hi Miguel, welcome to the list! Great to have you here

On 2015-01-27 18:10, Miguel wrote:
> Hi everybody,
> this is the first post I write on this list so I will introduce myself
> first...
>
> I am Miguel Ceriani, a PhD candidate in computer science at Sapienza,
> University of Rome.
> I am working on a platform to define linked data applications using a
> dataflow language based on SPARQL.
> I am new to the Hydra spec and I am still sudying it.

That beside the topic, but I'm curious about the SPARQL-based language.

>
> I have a problem that is not striclty in the scope of Hydra, but it
> seems to me quite related.
> I hope that I am not completely out of topic.
>
> Let's say I want to build a server that have to comply with a given Web
> API, that uses JSON, and I want to implement it backed on an LDP server.
> I can define a suitable Linked Data model and then map it from/to JSON
> with a JSON-LD profile.
> Then I have to map  somehow the operations supported by the Web API with
> operations on LDP (assuming that the operations offered by the Web API
> are simple enough to be mapped directly to LDP operations).

I don't exactly understand the work flow. Could you please give some 
example?

>
> The question is: is there a standard way to do this second mapping?
> I can do it ad-hoc in different server-side languages, but ideally I
> would use some RDF vocabulary, like Hydra.
> As a fact Hydra seems very close to what I need, because it maps Web API
> operations to their Linked Data meaning.
> The main difference is that I would like to use this mapping to DEFINE
> the behaviour of a Web API, while (if I understood its purpose
> correctly) Hydra is used to DOCUMENT (to the client) the behaviour of a
> Web API.

Hm, Hydra is used to describe a Web API using RDF terms, yes. So what do 
you mean by define? Like define so that it can be later implemented?

>
> In general, it seems to me that such mapping could be useful to
> integrate existing Web APIs with linked data workflows.
>
> What do you think about it?

This should be possible with relative ease. Of course a kind of proxy or 
adapter would be necessary depending on your setup. Essentially if I 
understand correctly such use case is the main selling point of JSON-LD. 
First step would be to enhance each existing JSON response with 
@context, @type and @id. Assuming a good REST design, building the Hydra 
ApiDocumentation would then be accomplished as if the API was Linked 
from the beginning. And of course incoming payloads must be converted to 
JSON-LD if necessary and normalized by using the right @context.

Is that roughly what you have in mind?

>
> Thanks,
> Miguel
>
>

Received on Tuesday, 27 January 2015 21:08:57 UTC