Hi Alan, On Fri, Apr 14, 2017 at 12:30 AM, Robson, Alan <alan.rob...@viasat.com> wrote: > > I’ve been having a couple of problems with LDP-NR, it may just be my > interpretation… >
Out LDP-NR support it's pretty basic, actually. Let's me reply inline to your questions. > 1) POSTing or PUTing a new item, say a text file, either results in > complaints about RDF formatting (if the content type is text/plain) or > creation of record with “.bin” appended to the name if I fake out the > content type (eg. set it to application/x-ftl which I just made up). This > means that the things I post get a new suffix. Can the suffix be controlled > somehow ? It would be nice to be able to upload something like aaa.docx and > for it to still be a word document when I retrieve it. Marmotta stores the > mime type in the container, so presumably it can manage mime types without > suffixes. Is there an alternative API to LDP that I should be using to > upload this content ? > There is a "conflict" with text/plain, because it's a acceptable mimetype for Turtle in the RDF world. So I remember we have to custom rules for avoiding that. But may be the source of your issue in the end. All the logic about extensions is based on Apache Tika, see: https://github.com/apache/marmotta/blob/develop/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/util/LdpUtils.java#L72 2) Marmotta seems not to be able to refer to its own LDP-NR resources > when posting JSON-LD. For example, if I host a context definition as LDP-NR > and then refer to that URL as the argument to @context in a json-ld post, > marmotta is not able to find the context definition and will not allow > JSON-LD referring to that context to be uploaded. However, if I just copy > the context definition to tomcat to be hosted as static content then it can > find it and marmotta will then accept the json-ld. Is there a way that I > can store a chunk of JSON in marmotta, through some web-api (ideally LDP) > such that it can be used as the @context for posting LDP-RSs in json-ld ? > No, Marmotta only allows to store RDF data. Which the slightly exception that represent LDP-NR in LDP. So the only idea that could work is trying to store the JSON as application/json; but probably will try to be parse as any JSON-based RDF serialization. Sorry. Cheers,