use of org.apache.jena.shared.PrefixMapping in project jena by apache.
the class OpPrefixesUsed method used.
public static PrefixMapping used(Op op, PrefixMapping pmap) {
PrefixMapping pmap2 = new PrefixMappingImpl();
PrefixFinder finder = new PrefixFinder(pmap2, pmap.getNsPrefixMap());
OpWalker.walk(op, finder);
return pmap2;
}
use of org.apache.jena.shared.PrefixMapping in project jena by apache.
the class BuilderPrefixMapping method build.
public static PrefixMapping build(Item elt) {
PrefixMapping pmap = new PrefixMappingImpl();
build(pmap, elt);
return pmap;
}
use of org.apache.jena.shared.PrefixMapping in project jena by apache.
the class AbstractTestPrefixMappingView method prefix3.
@Test
public void prefix3() {
String uri = "http://example/";
PrefixMapping pmap = create();
pmap.setNsPrefix("ex", uri);
// Create a second view onto the same storage.
PrefixMapping pmap2 = view();
String x = pmap2.getNsPrefixURI("ex");
assertNotNull(x);
assertEquals(uri, x);
}
use of org.apache.jena.shared.PrefixMapping in project jena by apache.
the class AbstractTestPrefixMappingView method prefix5.
@Test
public void prefix5() {
String uri = "http://example/";
PrefixMapping pmap = create();
pmap.setNsPrefix("ex", uri);
assertEquals(uri + "foo", pmap.expandPrefix("ex:foo"));
}
use of org.apache.jena.shared.PrefixMapping in project jena by apache.
the class AbstractTestPrefixMappingView 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"));
}
Aggregations