Search in sources :

Example 1 with PrefixMapping

use of org.apache.jena.shared.PrefixMapping 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 PrefixMapping

use of org.apache.jena.shared.PrefixMapping 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 PrefixMapping

use of org.apache.jena.shared.PrefixMapping 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 PrefixMapping

use of org.apache.jena.shared.PrefixMapping 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 PrefixMapping

use of org.apache.jena.shared.PrefixMapping 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

PrefixMapping (org.apache.jena.shared.PrefixMapping)154 Test (org.junit.Test)47 PrefixMappingImpl (org.apache.jena.shared.impl.PrefixMappingImpl)34 Graph (org.apache.jena.graph.Graph)22 Path (org.apache.jena.sparql.path.Path)12 BaseTest (org.apache.jena.atlas.junit.BaseTest)11 Triple (org.apache.jena.graph.Triple)9 Resource (org.apache.jena.rdf.model.Resource)9 ConfigTest (org.apache.jena.tdb.ConfigTest)8 DatasetPrefixesTDB (org.apache.jena.tdb.store.DatasetPrefixesTDB)8 ContractTest (org.xenei.junit.contract.ContractTest)8 DatasetGraph (org.apache.jena.sparql.core.DatasetGraph)7 Node (org.apache.jena.graph.Node)5 Query (org.apache.jena.query.Query)5 Model (org.apache.jena.rdf.model.Model)5 PrefixMappingSDB (org.apache.jena.sdb.graph.PrefixMappingSDB)5 ArrayList (java.util.ArrayList)4 HashMap (java.util.HashMap)4 WhereValidator (org.apache.jena.arq.querybuilder.WhereValidator)4 Dataset (org.apache.jena.query.Dataset)4