Search in sources :

Example 86 with PrefixMapping

use of org.apache.jena.shared.PrefixMapping in project jena by apache.

the class AbstractTestGraphOverDataset method graphDSG_prefixes_4.

@Test
public void graphDSG_prefixes_4() {
    // All graphs exist.
    Graph g = makeNamedGraph(baseDSG, gnNotSuchGraph);
    PrefixMapping pmap = g.getPrefixMapping();
    assertNotNull(pmap);
}
Also used : PrefixMapping(org.apache.jena.shared.PrefixMapping) DatasetGraph(org.apache.jena.sparql.core.DatasetGraph) Graph(org.apache.jena.graph.Graph) Test(org.junit.Test) BaseTest(org.apache.jena.atlas.junit.BaseTest)

Example 87 with PrefixMapping

use of org.apache.jena.shared.PrefixMapping in project jena by apache.

the class AbstractTestPrefixMapping2 method prefix2.

@Test
public void prefix2() {
    PrefixMapping pmap = create();
    pmap.setNsPrefix("ex", "http://example/");
    assertNotNull(pmap.getNsPrefixURI("ex"));
}
Also used : PrefixMapping(org.apache.jena.shared.PrefixMapping) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Example 88 with PrefixMapping

use of org.apache.jena.shared.PrefixMapping in project jena by apache.

the class AbstractTestPrefixMapping2 method prefix7.

@Test
public void prefix7() {
    String uri1 = "http://example/";
    String uri2 = "http://example/ns#";
    PrefixMapping pmap = create();
    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) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Example 89 with PrefixMapping

use of org.apache.jena.shared.PrefixMapping in project jena by apache.

the class AbstractTestPrefixMapping2 method prefix6.

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

Example 90 with PrefixMapping

use of org.apache.jena.shared.PrefixMapping in project jena by apache.

the class AbstractTestPrefixMapping2 method prefix4.

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

Aggregations

PrefixMapping (org.apache.jena.shared.PrefixMapping)149 Test (org.junit.Test)47 PrefixMappingImpl (org.apache.jena.shared.impl.PrefixMappingImpl)29 Graph (org.apache.jena.graph.Graph)22 BaseTest (org.apache.jena.atlas.junit.BaseTest)11 Triple (org.apache.jena.graph.Triple)9 Resource (org.apache.jena.rdf.model.Resource)9 Path (org.apache.jena.sparql.path.Path)8 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 ArrayList (java.util.ArrayList)5 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 URI (java.net.URI)4 HashMap (java.util.HashMap)4 WhereValidator (org.apache.jena.arq.querybuilder.WhereValidator)4