Package com.hp.hpl.jena.assembler.assemblers

Examples of com.hp.hpl.jena.assembler.assemblers.ContentAssembler.open()


        {
        Assembler a = new ContentAssembler();
        Resource root = resourceInModel
            ( "c rdf:type ja:Content; c rdf:type ja:QuotedContent; c ja:quotedContent x"
            + "; c ja:quotedContent y; x P A; x Q B; y R C" );
        Content c = (Content) a.open( root );
        assertIsoModels( model( "x P A; x Q B; y R C" ), c.fill( model( "" ) ) );
        }
   
    public void testContentLoadsPrefixMappings()
        {
View Full Code Here


        Assembler a = new ContentAssembler();
        String content =
            "@prefix foo: <eh:/foo#>. <eh:/eggs> rdf:type rdf:Property."
            .replaceAll( " ", "\\\\s" );
        Resource root = resourceInModel( "x rdf:type ja:Content; x rdf:type ja:LiteralContent; x ja:literalContent '" + content + "'" );
        Content c = (Content) a.open( root );
        Model m = ModelFactory.createDefaultModel();
        c.fill( m );
        assertEquals( "eh:/foo#", m.getNsPrefixURI( "foo" ) );
        }
   
View Full Code Here

   
    protected void testStringContent( String expected, String n3 )
        {
        Assembler a = new ContentAssembler();
        Resource root = resourceInModel( "x rdf:type ja:Content; x rdf:type ja:LiteralContent; x ja:literalContent '" + n3.replaceAll( " ", "\\\\s" ) + "'" );
        Content c = (Content) a.open( root );
        Model m = ModelFactory.createDefaultModel();
        c.fill( m );
        assertIsoModels( model( expected ), m );
        }
   
View Full Code Here

                }
            };
        Assembler a = new ContentAssembler( fm );
        String source = Testing + "/schema.n3";
        Resource root = resourceInModel( "x rdf:type ja:Content; x rdf:type ja:ExternalContent; x ja:externalContent file:" + source );
        Content c = (Content) a.open( root );
        assertIsoModels( FileManager.get().loadModel( "file:" + source ), c.fill( model( "" ) ) );
        assertTrue( "the supplied file manager must have been used", used[0] );
        }
   
    public void testContentAssemblerUsesFileManagerProperty()
View Full Code Here

        Resource root = resourceInModel
            ( "x rdf:type ja:Content; x rdf:type ja:ExternalContent; x ja:externalContent <F>; x ja:fileManager F"
            .replaceAll( "<F>", fileName )
            );
        Assembler a = new ContentAssembler();       
        Content c = (Content) a.open( noa, root );
        assertTrue( fm.wasUsed() );
        assertIsoModels( expected, c.fill( model() ) );
        }   
   
    private final class FixedFileManager extends FileManager
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.