use of org.apache.jena.assembler.assemblers.PrefixMappingAssembler in project jena by apache.
the class TestPrefixMappingAssembler method testIncludesSingleMapping.
public void testIncludesSingleMapping() {
PrefixMapping wanted = PrefixMapping.Factory.create().setNsPrefix("pre", "some:prefix/");
Assembler a = new PrefixMappingAssembler();
Resource root = resourceInModel("root rdf:type ja:PrefixMapping; root ja:includes pm" + "; pm rdf:type ja:PrefixMapping; pm ja:prefix 'pre'; pm ja:namespace 'some:prefix/'");
PrefixMapping pm = (PrefixMapping) a.open(root);
assertSamePrefixMapping(wanted, pm);
}
use of org.apache.jena.assembler.assemblers.PrefixMappingAssembler in project jena by apache.
the class TestPrefixMappingAssembler method testConstructEmptyPrefixMapping.
public void testConstructEmptyPrefixMapping() {
Assembler a = new PrefixMappingAssembler();
Resource root = resourceInModel("pm rdf:type ja:PrefixMapping");
Object pm = a.open(root);
assertInstanceOf(PrefixMapping.class, pm);
}
use of org.apache.jena.assembler.assemblers.PrefixMappingAssembler in project jena by apache.
the class TestPrefixMappingAssembler method testIncludesMultipleMappings.
public void testIncludesMultipleMappings() {
PrefixMapping wanted = PrefixMapping.Factory.create().setNsPrefix("p1", "some:prefix/").setNsPrefix("p2", "other:prefix/").setNsPrefix("p3", "simple:prefix#");
Assembler a = new PrefixMappingAssembler();
Resource root = resourceInModel("root rdf:type ja:PrefixMapping" + "; root ja:includes pm1; pm1 rdf:type ja:PrefixMapping; pm1 ja:prefix 'p1'; pm1 ja:namespace 'some:prefix/'" + "; root ja:includes pm2; pm2 rdf:type ja:PrefixMapping; pm2 ja:prefix 'p2'; pm2 ja:namespace 'other:prefix/'" + "; root ja:prefix 'p3'; root ja:namespace 'simple:prefix#'");
PrefixMapping pm = (PrefixMapping) a.open(root);
assertSamePrefixMapping(wanted, pm);
}
use of org.apache.jena.assembler.assemblers.PrefixMappingAssembler in project jena by apache.
the class TestPrefixMappingAssembler method testSimplePrefixMapping.
public void testSimplePrefixMapping() {
PrefixMapping wanted = PrefixMapping.Factory.create().setNsPrefix("pre", "some:prefix/");
Assembler a = new PrefixMappingAssembler();
Resource root = resourceInModel("pm rdf:type ja:PrefixMapping; pm ja:prefix 'pre'; pm ja:namespace 'some:prefix/'");
PrefixMapping pm = (PrefixMapping) a.open(root);
assertSamePrefixMapping(wanted, pm);
}
Aggregations