Use modern N-Quads content type Signed-off-by: Peter Ansell <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/any23/repo Commit: http://git-wip-us.apache.org/repos/asf/any23/commit/8ccf456c Tree: http://git-wip-us.apache.org/repos/asf/any23/tree/8ccf456c Diff: http://git-wip-us.apache.org/repos/asf/any23/diff/8ccf456c Branch: refs/heads/master Commit: 8ccf456c371f0ab396f5b6e17b8bb1609d4363bd Parents: cbd3802 Author: Peter Ansell <[email protected]> Authored: Tue Jan 10 10:44:59 2017 +1100 Committer: Peter Ansell <[email protected]> Committed: Tue Jan 10 10:44:59 2017 +1100 ---------------------------------------------------------------------- .../org/apache/any23/extractor/rdf/NQuadsExtractorFactory.java | 2 ++ service/src/test/java/org/apache/any23/servlet/ServletTest.java | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/any23/blob/8ccf456c/core/src/main/java/org/apache/any23/extractor/rdf/NQuadsExtractorFactory.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/any23/extractor/rdf/NQuadsExtractorFactory.java b/core/src/main/java/org/apache/any23/extractor/rdf/NQuadsExtractorFactory.java index 4a6c6ab..36b985b 100644 --- a/core/src/main/java/org/apache/any23/extractor/rdf/NQuadsExtractorFactory.java +++ b/core/src/main/java/org/apache/any23/extractor/rdf/NQuadsExtractorFactory.java @@ -23,6 +23,7 @@ import org.apache.any23.extractor.ExtractorDescription; import org.apache.any23.extractor.ExtractorFactory; import org.apache.any23.extractor.SimpleExtractorFactory; import org.apache.any23.rdf.Prefixes; +import org.eclipse.rdf4j.rio.RDFFormat; /** * @author Peter Ansell [email protected] @@ -42,6 +43,7 @@ public class NQuadsExtractorFactory extends SimpleExtractorFactory<NQuadsExtract NQuadsExtractorFactory.NAME, NQuadsExtractorFactory.PREFIXES, Arrays.asList( + RDFFormat.NQUADS.getDefaultMIMEType(), "text/x-nquads;q=0.1", "text/rdf+nq;q=0.1", "text/nq;q=0.1", http://git-wip-us.apache.org/repos/asf/any23/blob/8ccf456c/service/src/test/java/org/apache/any23/servlet/ServletTest.java ---------------------------------------------------------------------- diff --git a/service/src/test/java/org/apache/any23/servlet/ServletTest.java b/service/src/test/java/org/apache/any23/servlet/ServletTest.java index 81a1d10..da220b5 100644 --- a/service/src/test/java/org/apache/any23/servlet/ServletTest.java +++ b/service/src/test/java/org/apache/any23/servlet/ServletTest.java @@ -396,7 +396,7 @@ public class ServletTest { @Test public void testJSONResponseFormat() throws Exception { String body = "<http://sub/1> <http://pred/1> \"123\"^^<http://datatype> <http://graph/1>."; - HttpTester response = doPostRequest("/json", body, "text/x-nquads"); + HttpTester response = doPostRequest("/json", body, "application/n-quads"); Assert.assertEquals(200, response.getStatus()); final String EXPECTED_JSON = "[" + @@ -411,7 +411,7 @@ public class ServletTest { @Test public void testTriXResponseFormat() throws Exception { String body = "<http://sub/1> <http://pred/1> \"123\"^^<http://datatype> <http://graph/1>."; - HttpTester response = doPostRequest("/trix", body, "text/x-nquads"); + HttpTester response = doPostRequest("/trix", body, "application/n-quads"); Assert.assertEquals(200, response.getStatus()); final String content = response.getContent(); assertContainsTag("graph" , false, 1, content);
