Package com.google.refine.importers

Examples of com.google.refine.importers.RdfTripleImporter


    @Override
    @BeforeMethod
    public void setUp(){
        super.setUp();
        SUT = new RdfTripleImporter();
        JSONUtilities.safePut(options, "base-url", "http://rdf.freebase.com");
    }
View Full Code Here


    @Test
    public void canParseTripleWithValue() throws UnsupportedEncodingException {
        String sampleRdf = "<http://rdf.freebase.com/ns/en.bob_dylan> <http://rdf.freebase.com/ns/common.topic.alias> \"Robert Zimmerman\"@en.";
        InputStream input = new ByteArrayInputStream(sampleRdf.getBytes("UTF-8"));
       
        SUT = new RdfTripleImporter(RdfTripleImporter.Mode.NT);
        parseOneFile(SUT, input);

        Assert.assertEquals(project.columnModel.columns.size(), 2);
        Assert.assertEquals(project.columnModel.columns.get(0).getName(), "subject");
        Assert.assertEquals(project.columnModel.columns.get(1).getName(), "http://rdf.freebase.com/ns/common.topic.alias");
View Full Code Here

                + "    <dc:title xml:lang=\"en\">The Tree</dc:title>\n"
                + "  </rdf:Description>\n"
                + "</rdf:RDF>\n";

        InputStream input = new ByteArrayInputStream(sampleRdf.getBytes("UTF-8"));
        SUT = new RdfTripleImporter(RdfTripleImporter.Mode.RDFXML);
        parseOneFile(SUT, input);

        Assert.assertEquals(project.columnModel.columns.size(), 3);
        Assert.assertEquals(project.columnModel.columns.get(0).getName(), "subject");
        Assert.assertEquals(project.columnModel.columns.get(1).getName(), "http://purl.org/dc/elements/1.1/title");
View Full Code Here

TOP

Related Classes of com.google.refine.importers.RdfTripleImporter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.