|
4 | 4 | import static org.junit.Assert.assertFalse; |
5 | 5 | import static org.junit.Assert.assertNotNull; |
6 | 6 |
|
7 | | -import java.io.BufferedReader; |
8 | | -import java.io.IOException; |
9 | | -import java.io.InputStreamReader; |
10 | 7 | import java.net.URL; |
11 | | -import java.nio.charset.StandardCharsets; |
12 | | -import java.util.List; |
13 | | -import java.util.stream.Collectors; |
14 | 8 |
|
15 | | -import org.junit.Ignore; |
16 | 9 | import org.junit.Test; |
17 | 10 |
|
18 | 11 | import com.github.jsonldjava.utils.JsonUtils; |
19 | | -import com.github.jsonldjava.utils.TestUtils; |
20 | 12 |
|
21 | | -public class ToRDFTest { |
| 13 | +public class ArrayContextToRDFTest { |
22 | 14 | @Test |
23 | 15 | public void toRdfWithNamespace() throws Exception { |
24 | 16 |
|
@@ -52,34 +44,4 @@ public RemoteDocument loadDocument(String url) throws JsonLdError { |
52 | 44 |
|
53 | 45 | } |
54 | 46 |
|
55 | | - @Test |
56 | | - // See https://github.com/jsonld-java/jsonld-java/issues/232 |
57 | | - public void toRdfWithHttpBaseIri() throws IOException, JsonLdError { |
58 | | - testToRdf("/custom/toRdf-0001-in.jsonld", "/custom/toRdf-0001-out.nq", "http://example.org/"); |
59 | | - } |
60 | | - |
61 | | - @Test |
62 | | - // See https://github.com/jsonld-java/jsonld-java/issues/232 |
63 | | - public void toRdfWithHierarchicalBaseIri() throws IOException, JsonLdError { |
64 | | - testToRdf("/custom/toRdf-0001-in.jsonld", "/custom/toRdf-0002-out.nq", "tag:/example/"); |
65 | | - } |
66 | | - |
67 | | - @Test |
68 | | - @Ignore |
69 | | - // See https://github.com/jsonld-java/jsonld-java/issues/232#issuecomment-493454096 |
70 | | - public void toRdfWithOpaqueBaseIri() throws IOException, JsonLdError { |
71 | | - testToRdf("/custom/toRdf-0001-in.jsonld", "/custom/toRdf-0003-out.nq", "tag:example/"); |
72 | | - } |
73 | | - |
74 | | - private void testToRdf(String inFile, String outFile, String baseIri) throws IOException { |
75 | | - final Object input = JsonUtils |
76 | | - .fromInputStream(getClass().getResourceAsStream(inFile)); |
77 | | - List<String> resultLines = new BufferedReader(new InputStreamReader( |
78 | | - getClass().getResourceAsStream(outFile), StandardCharsets.UTF_8)).lines() |
79 | | - .collect(Collectors.toList()); |
80 | | - JsonLdOptions options = new JsonLdOptions(baseIri); |
81 | | - options.format = JsonLdConsts.APPLICATION_NQUADS; |
82 | | - Object result = JsonLdProcessor.toRDF(input, options); |
83 | | - assertEquals(TestUtils.join(resultLines, "\n").trim(), ((String) result).trim()); |
84 | | - } |
85 | 47 | } |
0 commit comments