Package com.ontology2.haruhi

Examples of com.ontology2.haruhi.TestApplicationConfigurationLoader


    }

    @Test
    public void rewriteThis() throws IOException, InterruptedException {
        RecyclingIterable<TaggedTextItem> inputz=new RecyclingIterable<>(TaggedTextItem.class,
            new TaggedTextItem("<http://dbpedia.org/resources/Usagi_Tsukino>\t<http://www.w3.org/2002/07/owl#sameAs>\t<http://dbpedia.org/resources/Sailor_Moon>\t.",1),
            new TaggedTextItem("<http://dbpedia.org/resources/Usagi_Tsukino>\t<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>\t<http://example.com/type/Superhero>\t.",16)
        );

        reducer.reduce(
                new TaggedTextItem("<http://dbpedia.org/resources/Usagi_Tsukino>",1),
                inputz,
                context
        );

        verify(context).write(
View Full Code Here


    }

    @Test
    public void dontRewriteThat() throws IOException,InterruptedException {
        RecyclingIterable<TaggedTextItem> inputz=new RecyclingIterable<>(TaggedTextItem.class,
                new TaggedTextItem("<http://dbpedia.org/resources/Usagi_Tsukino>\t<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>\t<http://example.com/type/Superhero>\t.",16)
        );

        reducer.reduce(
                new TaggedTextItem("<http://dbpedia.org/resources/Usagi_Tsukino>",1),
                inputz,
                context
        );

        verifyNoMoreInteractions(context);
View Full Code Here

    }

    @Test
    public void rewriteThis() throws IOException, InterruptedException {
        RecyclingIterable<TaggedTextItem> inputz=new RecyclingIterable<>(TaggedTextItem.class,
                new TaggedTextItem("<http://dbpedia.org/resources/Usagi_Tsukino>\t<http://www.w3.org/2002/07/owl#sameAs>\t<http://dbpedia.org/resources/Sailor_Moon>\t.",1),
                new TaggedTextItem("<http://dbpedia.org/resources/Sailor_Mars>\t<http://example.org/friend>\t<http://dbpedia.org/resources/Usagi_Tsukino>\t.",16)
        );

        reducer.reduce(
                new TaggedTextItem("<http://dbpedia.org/resources/Usagi_Tsukino>",1),
                inputz,
                context
        );

        verify(context).write(
View Full Code Here

    }

    @Test
    public void dontRewriteThat() throws IOException, InterruptedException {
        RecyclingIterable<TaggedTextItem> inputz=new RecyclingIterable<>(TaggedTextItem.class,
                new TaggedTextItem("<http://dbpedia.org/resources/Sailor_Mars>\t<http://example.org/friend>\t<http://dbpedia.org/resources/Usagi_Tsukino>\t.",16)
        );

        reducer.reduce(
                new TaggedTextItem("<http://dbpedia.org/resources/Usagi_Tsukino>",1),
                inputz,
                context
        );

        verifyNoMoreInteractions(context);
View Full Code Here

import com.ontology2.bakemono.primitiveTriples.PrimitiveTriple;

public class TestBeans {
    @Test
    public void linkTriplesAreAcceptedAsSuchByFunction() {
        PrimitiveTriple pt=new PrimitiveTriple(
                "<http://example.com/A>",
                "<http://example.com/B>",
                "<http://example.com/C>"
                );
       
View Full Code Here

        assertTrue(Beans.isLinkRelationship().apply(pt));
    }
   
    @Test
    public void nonLinkTriplesTriplesAreNotAcceptedAsSuchByFunction() {
        PrimitiveTriple pt=new PrimitiveTriple(
                "<http://example.com/A>",
                "<http://example.com/B>",
                "55"
                );
       
View Full Code Here

    final static String L1="88712";
    final static String L2="\"all is well that ends well\"";
    @Test
    public void parsesALinkTriple() {
        String in=X+"       "+Y+"\t"+Z+".";
        PrimitiveTriple out=codec.decode(in);
        assertEquals(X,out.getSubject());
        assertEquals(Y,out.getPredicate());
        assertEquals(Z,out.getObject());
    }
View Full Code Here

    }
   
    @Test
    public void parsesASingleSpaceTriple() {
        String in=X+" "+Y+" "+Z+" .";
        PrimitiveTriple out=codec.decode(in);
        assertEquals(X,out.getSubject());
        assertEquals(Y,out.getPredicate());
        assertEquals(Z,out.getObject());
    }
View Full Code Here

    }
   
    @Test
    public void parsesATabbyTriple() {
        String in=X+"\t"+Y+"\t "+Z+"\t.";
        PrimitiveTriple out=codec.decode(in);
        assertEquals(X,out.getSubject());
        assertEquals(Y,out.getPredicate());
        assertEquals(Z,out.getObject());
    }
View Full Code Here

    }

    @Test
    public void parsesALiteralTriple() {
        String in=X+"\t"+Y+"\t "+L1+"\t.";
        PrimitiveTriple out=codec.decode(in);
        assertEquals(X,out.getSubject());
        assertEquals(Y,out.getPredicate());
        assertEquals(L1,out.getObject());
    }
View Full Code Here

TOP

Related Classes of com.ontology2.haruhi.TestApplicationConfigurationLoader

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.