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

Examples of com.hp.hpl.jena.assembler.assemblers.ContentAssembler


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


        assertIsoModels( model( "x P A; x Q B" ), c.fill( model( "" ) ) );
        }
   
    public void testMultipleContentQuotation()
        {
        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( "" ) ) );
        }
View Full Code Here

        assertIsoModels( model( "x P A; x Q B; y R C" ), c.fill( model( "" ) ) );
        }
   
    public void testContentLoadsPrefixMappings()
        {
        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

        assertEquals( "eh:/foo#", m.getNsPrefixURI( "foo" ) );
        }
   
    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

        -- ContentAssembler FileManager tests ----------------------------------
    */
   
    public void testContentAssemblerHasNoDefaultFileManager()
        {
        assertNull( "by default, ContentAssemblers have no FileManager", new ContentAssembler().getFileManager() );
        }   
View Full Code Here

        }   
   
    public void testContentAssemblerHasSuppliedFileManager()
        {
        FileManager fm = new FileManager();
        assertSame( fm, new ContentAssembler( fm ).getFileManager() );
        }
View Full Code Here

                {
                used[0] = true;
                return FileManager.get().loadModel( filenameOrURI );
                }
            };
        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] );
        }
View Full Code Here

        NamedObjectAssembler noa = new NamedObjectAssembler( resource( "F" ), fm );
        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() ) );
        }   
View Full Code Here

   
    public void testContent()
        {
        Resource root = resourceInModel( "x rdf:type ja:DefaultModel; x ja:initialContent c; c ja:quotedContent A; A P B" );
//        root.getModel().write( System.err, "N3"  );
        Model m = (Model) new FakeModelAssembler().open( new ContentAssembler(), root, Mode.ANY );
        assertIsoModels( modelWithStatements( "A P B" ), m );
        }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.assembler.assemblers.ContentAssembler

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.