Search in sources :

Example 6 with AssemblerGroup

use of org.apache.jena.assembler.assemblers.AssemblerGroup in project jena by apache.

the class TestAssemblerGroup method testCopyPreservesMapping.

public void testCopyPreservesMapping() {
    AssemblerGroup initial = AssemblerGroup.create().implementWith(JA.InfModel, new InfModelAssembler());
    AssemblerGroup copy = initial.copy();
    assertSame(initial.assemblerFor(JA.InfModel), copy.assemblerFor(JA.InfModel));
}
Also used : ExpandingAssemblerGroup(org.apache.jena.assembler.assemblers.AssemblerGroup.ExpandingAssemblerGroup) AssemblerGroup(org.apache.jena.assembler.assemblers.AssemblerGroup) InfModelAssembler(org.apache.jena.assembler.assemblers.InfModelAssembler)

Example 7 with AssemblerGroup

use of org.apache.jena.assembler.assemblers.AssemblerGroup in project jena by apache.

the class TestAssemblerGroup method testEmptyAssemblerGroup.

public void testEmptyAssemblerGroup() {
    AssemblerGroup a = AssemblerGroup.create();
    assertInstanceOf(AssemblerGroup.class, a);
    assertEquals(null, a.assemblerFor(resource("ja:Anything")));
    checkFailsType(a, "rdf:Resource");
}
Also used : ExpandingAssemblerGroup(org.apache.jena.assembler.assemblers.AssemblerGroup.ExpandingAssemblerGroup) AssemblerGroup(org.apache.jena.assembler.assemblers.AssemblerGroup)

Example 8 with AssemblerGroup

use of org.apache.jena.assembler.assemblers.AssemblerGroup in project jena by apache.

the class TestAssemblerGroup method testBuiltinGroup.

public void testBuiltinGroup() {
    AssemblerGroup g = Assembler.general;
    assertInstanceOf(Model.class, g.open(resourceInModel("x rdf:type ja:DefaultModel")));
    assertInstanceOf(InfModel.class, g.open(resourceInModel("x rdf:type ja:InfModel")));
    assertMemoryModel(g.open(resourceInModel("x rdf:type ja:MemoryModel")));
}
Also used : ExpandingAssemblerGroup(org.apache.jena.assembler.assemblers.AssemblerGroup.ExpandingAssemblerGroup) AssemblerGroup(org.apache.jena.assembler.assemblers.AssemblerGroup)

Example 9 with AssemblerGroup

use of org.apache.jena.assembler.assemblers.AssemblerGroup in project jena by apache.

the class TestAssemblerGroup method testMultipleAssemblerGroup.

public void testMultipleAssemblerGroup() {
    AssemblerGroup a = AssemblerGroup.create();
    assertSame(a, a.implementWith(JA.InfModel, Assembler.infModel));
    assertSame(a, a.implementWith(JA.MemoryModel, Assembler.memoryModel));
    assertInstanceOf(InfModel.class, a.openModel(resourceInModel("x rdf:type ja:InfModel")));
    assertFalse(a.openModel(resourceInModel("y rdf:type ja:MemoryModel")) instanceof InfModel);
    checkFailsType(a, "js:DefaultModel");
}
Also used : ExpandingAssemblerGroup(org.apache.jena.assembler.assemblers.AssemblerGroup.ExpandingAssemblerGroup) AssemblerGroup(org.apache.jena.assembler.assemblers.AssemblerGroup) InfModel(org.apache.jena.rdf.model.InfModel)

Aggregations

AssemblerGroup (org.apache.jena.assembler.assemblers.AssemblerGroup)9 ExpandingAssemblerGroup (org.apache.jena.assembler.assemblers.AssemblerGroup.ExpandingAssemblerGroup)9 Resource (org.apache.jena.rdf.model.Resource)4 InfModelAssembler (org.apache.jena.assembler.assemblers.InfModelAssembler)2 InfModel (org.apache.jena.rdf.model.InfModel)2 Assembler (org.apache.jena.assembler.Assembler)1 Mode (org.apache.jena.assembler.Mode)1 AssemblerBase (org.apache.jena.assembler.assemblers.AssemblerBase)1 Model (org.apache.jena.rdf.model.Model)1