diff --git a/main/pom.xml b/main/pom.xml index c2705a24a..e3a730b35 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -19,7 +19,10 @@ 3333 /tmp/refine 2.0.7 - 3.15.0 + + 3.9.0 diff --git a/main/tests/server/src/com/google/refine/importers/RdfTripleImporterTests.java b/main/tests/server/src/com/google/refine/importers/RdfTripleImporterTests.java index 455dcc3ed..5e91decd5 100644 --- a/main/tests/server/src/com/google/refine/importers/RdfTripleImporterTests.java +++ b/main/tests/server/src/com/google/refine/importers/RdfTripleImporterTests.java @@ -286,7 +286,39 @@ public class RdfTripleImporterTests extends ImporterTest { Assert.assertEquals(project.rows.get(0).cells.get(2).value, "mailto:fred@example.com"); Assert.assertEquals(project.rows.get(0).cells.get(3).value, "http://meetings.example.com/cal#m1"); } - + + @Test + public void canParseTurtleBlankNode() throws UnsupportedEncodingException { + String sampleRdf = "@prefix ex: .\n" + + " ex:title \"Web Data\" ;\n" + + " ex:professor [ ex:fullName \"Alice Carol\" ;\n" + + " ex:homePage ] ."; + + InputStream input = new ByteArrayInputStream(sampleRdf.getBytes("UTF-8")); + + SUT = new RdfTripleImporter(RdfTripleImporter.Mode.TTL); + parseOneFile(SUT, input); + + String[] columns = {"subject", + "http://example.org/data#professor", + "http://example.org/data#title", + "http://example.org/data#homePage", + "http://example.org/data#fullName", + }; + + Assert.assertEquals(project.columnModel.columns.size(), columns.length); + for (int i = 0; i < columns.length; i++) { + Assert.assertEquals(project.columnModel.columns.get(i).getName(), columns[i]); + } + + Assert.assertEquals(project.rows.size(), 2); + Assert.assertEquals(project.rows.get(0).cells.size(), 3); + Assert.assertEquals(project.rows.get(1).cells.size(), 5); + Assert.assertEquals(project.rows.get(0).cells.get(0).value, "http://example.org/web-data"); + // Generated blank node ID is random, but should match + Assert.assertEquals(project.rows.get(0).cells.get(1).value, project.rows.get(1).cells.get(0).value); + } + @Test public void canParseJsonld() throws UnsupportedEncodingException { String sampleJsonld = "{\n "+