Package com.hp.jena.rules.ast

Examples of com.hp.jena.rules.ast.EntityName


public class TestParsingEntityName
    {
    @Test public void ensureCanParseEmptyEntityName() throws ParseException
        {
        EntityName e = parserOn( "" ).entityName();
        assertEquals( null, e.getIRI() );
        assertEquals( labels( "" ), e.getLabels() );
        }
View Full Code Here


        assertEquals( labels( "" ), e.getLabels() );
        }

    @Test public void ensureCanParseIRIEntityName() throws ParseException
        {
        EntityName e = parserOn( "my:name" ).entityName();
        assertEquals( "my:name", e.getIRI() );
        assertEquals( labels( "" ), e.getLabels() );
        }
View Full Code Here

        assertEquals( labels( "" ), e.getLabels() );
        }

    @Test public void ensureCanParseLabelEntityName() throws ParseException
        {
        EntityName e = parserOn( "'hello'" ).entityName();
        assertEquals( null, e.getIRI() );
        assertEquals( labels( "hello" ), e.getLabels() );
        }
View Full Code Here

        assertEquals( labels( "hello" ), e.getLabels() );
        }

    @Test public void ensureCanParseLabelWithLanguageEntityName() throws ParseException
        {
        EntityName e = parserOn( "'chat'@fr" ).entityName();
        assertEquals( null, e.getIRI() );
        assertEquals( labels( "chat@fr"), e.getLabels() );
        }
View Full Code Here

        assertEquals( labels( "chat@fr"), e.getLabels() );
        }

    @Test public void ensureCanParseIRIAndLabelEntityName() throws ParseException
        {
        EntityName e = parserOn( "my:thing 'which-is-mine'" ).entityName();
        assertEquals( "my:thing", e.getIRI() );
        assertEquals( labels( "which-is-mine" ), e.getLabels() );
        }
View Full Code Here

        assertEquals( labels( "which-is-mine" ), e.getLabels() );
        }

    @Test public void ensureCanParseManyLabelsEntityName() throws ParseException
        {
        EntityName e = parserOn( "'hello', 'world', 'again'@en" ).entityName();
        assertEquals( null, e.getIRI() );
        assertEquals( labels( "hello world again@en" ), e.getLabels() );
        }
View Full Code Here

        }

    private void testGeneratesConclusionTriples
        ( String conclusions, String boundVar, String boundValue, String expected )
        {
        EntityName name = new EntityName( "anon", new ArrayList<StringInLanguage>() );
        Node X = node( boundVar ), Y = node( boundValue );
        ConsumeToSet<Triple> t = new ConsumeToSet<Triple>();
        Conclude x = new Conclude( null, name, tripleTerms( conclusions ), t );
        x.consume( binding( X, Y ) );
        assertEquals( GraphCreateUtils.tripleSet( expected ), new HashSet<Triple>( t.elements() ) );
View Full Code Here

TOP

Related Classes of com.hp.jena.rules.ast.EntityName

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.