You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@marmotta.apache.org by nikhil trivedi <nt...@artic.edu> on 2016/09/06 21:21:50 UTC

Structure of LDPath returned data

Hey all,

I'm running some tests querying a Marmotta server to transform a resource
into JSON, and I have a question about the structure of the data as it's
returned from Marmotta. When posting a program[1] to a vanilla Marmotta
install (version 3.3.0), all the data fields are returned as arrays that
specify the data type as well as the value itself:

"created":
  [
    {
      "type":"literal",
      "value":"Tue Aug 02 19:30:25 CDT 2016"
    }
  ]

In the case of multi-valued fields, I get several instances of this
structure:

"type":
  [
    {
      "type":"literal",
      "value":"http://www.w3.org/ns/ldp#Container"
    },
    {
      "type":"literal",
      "value":"http://www.w3.org/ns/ldp#RDFSource"
    },
    {
      "type":"literal",
      "value":"http://fedora.info/definitions/v4/repository#Resource"
    },
  ]

We would like to receive the data in a much simpler format, ideally just
"field":"value". How do I customize how Marmotta structures its returned
data?

Thanks!
nikhil


[1] https://github.com/fcrepo4-exts/fcrepo-camel-toolbox/blob/master/fcrepo-
ldpath/src/main/resources/default.ldpath


-- 




......... ........ ....... ...... ..... .... ... .. . .  .   .    .
. Nikhil Trivedi
. Senior Systems Analyst
. Art Institute of Chicago
. http://www.artic.edu/
.
. P . 312.629.6541
.

Re: Structure of LDPath returned data

Posted by Sergio Fernández <wi...@apache.org>.
Hi,

On Tue, Sep 6, 2016 at 11:21 PM, nikhil trivedi <nt...@artic.edu> wrote:
>
> We would like to receive the data in a much simpler format, ideally just
> "field":"value". How do I customize how Marmotta structures its returned
> data?
>

No sorry, currently the JSON response can't be customized.

If you really need it maybe it could be implemented by sendind a JOLT
template (http://bazaarvoice.github.io/jolt/) in addition to the LDPath
program.

A PR with such feature would be more than welcomed ;-)

Cheers,

-- 
Sergio Fernández
Partner Technology Manager
Redlink GmbH
m: +43 6602747925
e: sergio.fernandez@redlink.co
w: http://redlink.co