Search in sources :

Example 1 with PrefixMappingAssembler

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);
}
Also used : PrefixMapping(org.apache.jena.shared.PrefixMapping) PrefixMappingAssembler(org.apache.jena.assembler.assemblers.PrefixMappingAssembler) Resource(org.apache.jena.rdf.model.Resource) PrefixMappingAssembler(org.apache.jena.assembler.assemblers.PrefixMappingAssembler)

Example 2 with PrefixMappingAssembler

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);
}
Also used : PrefixMappingAssembler(org.apache.jena.assembler.assemblers.PrefixMappingAssembler) Resource(org.apache.jena.rdf.model.Resource) PrefixMappingAssembler(org.apache.jena.assembler.assemblers.PrefixMappingAssembler)

Example 3 with PrefixMappingAssembler

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);
}
Also used : PrefixMapping(org.apache.jena.shared.PrefixMapping) PrefixMappingAssembler(org.apache.jena.assembler.assemblers.PrefixMappingAssembler) Resource(org.apache.jena.rdf.model.Resource) PrefixMappingAssembler(org.apache.jena.assembler.assemblers.PrefixMappingAssembler)

Example 4 with PrefixMappingAssembler

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);
}
Also used : PrefixMapping(org.apache.jena.shared.PrefixMapping) PrefixMappingAssembler(org.apache.jena.assembler.assemblers.PrefixMappingAssembler) Resource(org.apache.jena.rdf.model.Resource) PrefixMappingAssembler(org.apache.jena.assembler.assemblers.PrefixMappingAssembler)

Aggregations

PrefixMappingAssembler (org.apache.jena.assembler.assemblers.PrefixMappingAssembler)4 Resource (org.apache.jena.rdf.model.Resource)4 PrefixMapping (org.apache.jena.shared.PrefixMapping)3