Package com.hp.hpl.jena.shared

Examples of com.hp.hpl.jena.shared.PrefixMapping


    // ---- prefixes

    @Test public void graphDSG_prefixes_1()
    {
        Graph g = makeNamedGraph(baseDSG, gn1) ;
        PrefixMapping pmap = g.getPrefixMapping() ;
        assertNotNull(pmap) ;
    }
View Full Code Here


    }
   
    @Test public void graphDSG_prefixes_2()
    {
        Graph g = makeNamedGraph(baseDSG, Quad.unionGraph) ;
        PrefixMapping pmap = g.getPrefixMapping() ;
        assertNotNull(pmap) ;
    }
View Full Code Here

    }
   
    @Test public void graphDSG_prefixes_3()
    {
        Graph g = makeDefaultGraph(baseDSG) ;
        PrefixMapping pmap = g.getPrefixMapping() ;
        assertNotNull(pmap) ;
    }
View Full Code Here

   
    @Test public void graphDSG_prefixes_4()
    {
        // All graphs exist.
        Graph g = makeNamedGraph(baseDSG, gnNotSuchGraph;
        PrefixMapping pmap = g.getPrefixMapping() ;
        assertNotNull(pmap) ;
    }
View Full Code Here

            return ;
        }
       
        if ( isPrefix )
        {
            PrefixMapping newMappings = BuilderPrefixMapping.build(item) ;
            prologue = prologue.sub(newMappings) ;
            // Remember first prefix mapping seen.
            if( topMap == null )
                topMap = newMappings ;
            return ;
View Full Code Here

    {
        try {
            if ( dataset != null )
            {
                // Load the models prefixes first
                PrefixMapping m = dataset.getDefaultModel() ;
                model.setNsPrefixes(m) ;
            }
            // Then add the queries (just the declared mappings)
            // so the query declarations override the data sources.
            model.setNsPrefixes(query.getPrefixMapping()) ;
View Full Code Here

    }

    @Test public void multiple1()
    {
        DatasetPrefixesTDB prefixes = DatasetPrefixesTDB.testing() ;
        PrefixMapping pmap1 = prefixes.getPrefixMapping() ;
        PrefixMapping pmap2 = prefixes.getPrefixMapping("http://graph/") ;
        pmap1.setNsPrefix("x", "http://foo/") ;
        assertNull(pmap2.getNsPrefixURI("x")) ;
        assertNotNull(pmap1.getNsPrefixURI("x")) ;
    }
View Full Code Here

    }
   
    @Test public void multiple2()
    {
        DatasetPrefixesTDB prefixes = DatasetPrefixesTDB.testing() ;
        PrefixMapping pmap1 = prefixes.getPrefixMapping("http://graph/") // Same
        PrefixMapping pmap2 = prefixes.getPrefixMapping("http://graph/") ;
        pmap1.setNsPrefix("x", "http://foo/") ;
        assertNotNull(pmap2.getNsPrefixURI("x")) ;
        assertNotNull(pmap1.getNsPrefixURI("x")) ;
    }
View Full Code Here

    {
        String dir = ConfigTest.getTestingDir() ;
        FileOps.clearDirectory(dir) ;
       
        DatasetPrefixesTDB prefixes = DatasetPrefixesTDB.create(new Location(dir), new DatasetControlMRSW()) ;
        PrefixMapping pmap1 = prefixes.getPrefixMapping() ;
       
        String x = pmap1.getNsPrefixURI("x") ;
        assertNull(x) ;
        prefixes.close();
    }
View Full Code Here

    {
        String dir = ConfigTest.getTestingDir() ;
        FileOps.clearDirectory(dir) ;
       
        DatasetPrefixesTDB prefixes = DatasetPrefixesTDB.create(new Location(dir), new DatasetControlMRSW()) ;
        PrefixMapping pmap1 = prefixes.getPrefixMapping() ;
       
        pmap1.setNsPrefix("x", "http://foo/") ;
        prefixes.close() ;
       
        prefixes = DatasetPrefixesTDB.create(new Location(dir), new DatasetControlMRSW()) ;
        assertEquals("http://foo/", pmap1.getNsPrefixURI("x")) ;
        prefixes.close();
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.shared.PrefixMapping

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.