use of org.apache.jena.shared.PrefixMapping in project jena by apache.
the class AbstractTestPrefixMapping method testExpandPrefix.
public void testExpandPrefix() {
PrefixMapping ns = getMapping();
ns.setNsPrefix("crisp", crispURI);
ns.setNsPrefix("rope", ropeURI);
/* */
for (String aDontChange : dontChange) {
assertEquals("should be unchanged", aDontChange, ns.expandPrefix(aDontChange));
}
/* */
for (String[] expansion : expansions) {
assertEquals("should expand correctly", expansion[1], ns.expandPrefix(expansion[0]));
}
}
use of org.apache.jena.shared.PrefixMapping in project jena by apache.
the class AbstractTestPrefixMapping method testSameURIKeepsDefault.
/**
Test that adding a new prefix mapping for U does not throw away a default
mapping for U.
*/
public void testSameURIKeepsDefault() {
PrefixMapping A = getMapping();
A.setNsPrefix("", crispURI);
A.setNsPrefix("crisp", crispURI);
assertEquals(crispURI, A.getNsPrefixURI(""));
}
use of org.apache.jena.shared.PrefixMapping in project jena by apache.
the class FusekiLib method addDataInto.
// Do the addition directly on the dataset
public static void addDataInto(Graph data, DatasetGraph dsg, Node graphName) {
// Prefixes?
if (graphName == null)
graphName = Quad.defaultGraphNodeGenerated;
Iterator<Triple> iter = data.find(Node.ANY, Node.ANY, Node.ANY);
for (; iter.hasNext(); ) {
Triple t = iter.next();
dsg.add(graphName, t.getSubject(), t.getPredicate(), t.getObject());
}
PrefixMapping pmapSrc = data.getPrefixMapping();
PrefixMapping pmapDest = dsg.getDefaultGraph().getPrefixMapping();
pmapDest.setNsPrefixes(pmapSrc);
}
use of org.apache.jena.shared.PrefixMapping in project jena by apache.
the class AbstractTestGraphOverDataset method graphDSG_prefixes_3.
@Test
public void graphDSG_prefixes_3() {
Graph g = makeDefaultGraph(baseDSG);
PrefixMapping pmap = g.getPrefixMapping();
assertNotNull(pmap);
}
use of org.apache.jena.shared.PrefixMapping in project jena by apache.
the class AbstractTestGraphOverDataset method graphDSG_prefixes_2.
@Test
public void graphDSG_prefixes_2() {
Graph g = makeNamedGraph(baseDSG, Quad.unionGraph);
PrefixMapping pmap = g.getPrefixMapping();
assertNotNull(pmap);
}
Aggregations