handling text/plain as LDP-NS (just asking rio about the mimetype parseability as rdf is not a valid solution, since it expects n-triples)
Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/71ccaf6c Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/71ccaf6c Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/71ccaf6c Branch: refs/heads/develop Commit: 71ccaf6cb65aec019fa5e77572b771b839484a73 Parents: 5d7f00d Author: Sergio Fernández <[email protected]> Authored: Mon Jun 30 17:13:45 2014 +0200 Committer: Sergio Fernández <[email protected]> Committed: Mon Jun 30 17:13:45 2014 +0200 ---------------------------------------------------------------------- .../apache/marmotta/platform/ldp/services/LdpServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/marmotta/blob/71ccaf6c/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/services/LdpServiceImpl.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/services/LdpServiceImpl.java b/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/services/LdpServiceImpl.java index 96b68de..d39749b 100644 --- a/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/services/LdpServiceImpl.java +++ b/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/services/LdpServiceImpl.java @@ -287,7 +287,9 @@ public class LdpServiceImpl implements LdpService { connection.add(resource, DCTERMS.modified, now, ldpContext); // Add the bodyContent - final RDFFormat rdfFormat = Rio.getParserFormatForMIMEType(type); + // TODO: find a better way to ingest n-triples (text/plain) while still supporting regular text files + final RDFFormat rdfFormat = ("text/plain".equals(type) ? null : Rio.getParserFormatForMIMEType(type)); + System.out.println(rdfFormat); if (rdfFormat == null) { log.debug("POST creates new LDP-NR, because no suitable RDF parser found for type {}", type); final Literal format = valueFactory.createLiteral(type);
