Search in sources :

Example 1 with PrefixMappingSDB

use of org.apache.jena.sdb.graph.PrefixMappingSDB in project jena by apache.

the class TestPrefixMappingSDB method prefix4.

@Test
public void prefix4() {
    String uri = "http://example/";
    PrefixMapping pmap = new PrefixMappingSDB(defaultPrefixURI, sdb);
    pmap.setNsPrefix("ex", uri);
    assertEquals("ex", pmap.getNsURIPrefix("http://example/"));
}
Also used : PrefixMapping(org.apache.jena.shared.PrefixMapping) PrefixMappingSDB(org.apache.jena.sdb.graph.PrefixMappingSDB) Test(org.junit.Test)

Example 2 with PrefixMappingSDB

use of org.apache.jena.sdb.graph.PrefixMappingSDB in project jena by apache.

the class TestPrefixMappingSDB method prefix3.

@Test
public void prefix3() {
    String uri = "http://example/";
    PrefixMapping pmap = new PrefixMappingSDB(defaultPrefixURI, sdb);
    pmap.setNsPrefix("ex", uri);
    PrefixMapping pmap2 = new PrefixMappingSDB(defaultPrefixURI, sdb);
    String x = pmap2.getNsPrefixURI("ex");
    assertNotNull(x);
    assertEquals(uri, x);
}
Also used : PrefixMapping(org.apache.jena.shared.PrefixMapping) PrefixMappingSDB(org.apache.jena.sdb.graph.PrefixMappingSDB) Test(org.junit.Test)

Example 3 with PrefixMappingSDB

use of org.apache.jena.sdb.graph.PrefixMappingSDB in project jena by apache.

the class TestPrefixMappingSDB method prefix6.

@Test
public void prefix6() {
    String uri = "http://example/";
    PrefixMapping pmap = new PrefixMappingSDB(defaultPrefixURI, sdb);
    pmap.setNsPrefix("ex", uri);
    assertEquals("ex:foo", pmap.qnameFor("http://example/foo"));
}
Also used : PrefixMapping(org.apache.jena.shared.PrefixMapping) PrefixMappingSDB(org.apache.jena.sdb.graph.PrefixMappingSDB) Test(org.junit.Test)

Example 4 with PrefixMappingSDB

use of org.apache.jena.sdb.graph.PrefixMappingSDB in project jena by apache.

the class TestPrefixMappingSDB method prefix2.

@Test
public void prefix2() {
    PrefixMapping pmap = new PrefixMappingSDB(defaultPrefixURI, sdb);
    pmap.setNsPrefix("ex", "http://example/");
    assertNotNull(pmap.getNsPrefixURI("ex"));
}
Also used : PrefixMapping(org.apache.jena.shared.PrefixMapping) PrefixMappingSDB(org.apache.jena.sdb.graph.PrefixMappingSDB) Test(org.junit.Test)

Example 5 with PrefixMappingSDB

use of org.apache.jena.sdb.graph.PrefixMappingSDB in project jena by apache.

the class TestPrefixMappingSDB method prefix7.

@Test
public void prefix7() {
    String uri1 = "http://example/";
    String uri2 = "http://example/ns#";
    PrefixMapping pmap = new PrefixMappingSDB(defaultPrefixURI, sdb);
    pmap.setNsPrefix("ex1", uri1);
    pmap.setNsPrefix("ex2", uri2);
    assertEquals("ex2:foo", pmap.qnameFor("http://example/ns#foo"));
}
Also used : PrefixMapping(org.apache.jena.shared.PrefixMapping) PrefixMappingSDB(org.apache.jena.sdb.graph.PrefixMappingSDB) Test(org.junit.Test)

Aggregations

PrefixMappingSDB (org.apache.jena.sdb.graph.PrefixMappingSDB)6 PrefixMapping (org.apache.jena.shared.PrefixMapping)6 Test (org.junit.Test)6