use of org.apache.jena.assembler.Assembler in project jena by apache.
the class TestTextIndexLuceneAssembler method testMemDirectory.
@Test
public void testMemDirectory() {
TextIndexLuceneAssembler assembler = new TextIndexLuceneAssembler();
Resource root = SIMPLE_INDEX_SPEC_MEM_DIR;
Assembler a = Assembler.general;
// the open method is not supposed to throw exceptions when the directory is
// a iri resource
TextIndexLucene index = (TextIndexLucene) assembler.open(a, root, /*mode*/
null);
try {
assertTrue(index.getDirectory() instanceof ByteBuffersDirectory);
} finally {
index.close();
}
}
use of org.apache.jena.assembler.Assembler in project jena by apache.
the class TestTextIndexLuceneAssembler method testLiteralDirectory.
@Test
public void testLiteralDirectory() {
TextIndexLuceneAssembler assembler = new TextIndexLuceneAssembler();
Resource root = SIMPLE_INDEX_SPEC_LITERAL_DIR;
Assembler a = Assembler.general;
// the open method is not supposed to throw exceptions when the directory is
// a literal
TextIndexLucene index = (TextIndexLucene) assembler.open(a, root, /*mode*/
null);
try {
assertNotNull(index);
} finally {
index.close();
}
}
use of org.apache.jena.assembler.Assembler in project jena by apache.
the class TestTextIndexLuceneAssembler method testResourceDirectory.
@Test
public void testResourceDirectory() {
TextIndexLuceneAssembler assembler = new TextIndexLuceneAssembler();
Resource root = SIMPLE_INDEX_SPEC2;
Assembler a = Assembler.general;
// the open method is not supposed to throw exceptions when the directory is
// a resource
TextIndexLucene index = (TextIndexLucene) assembler.open(a, root, /*mode*/
null);
try {
assertFalse(index.getDirectory() instanceof ByteBuffersDirectory);
assertNotNull(index.getQueryAnalyzer());
} finally {
index.close();
}
}
use of org.apache.jena.assembler.Assembler in project jena by apache.
the class VocabRDFS method init.
public static synchronized void init() {
if (initialized)
return;
initialized = true;
AssemblerUtils.registerDataset(tDatasetRDFS, new DatasetRDFSAssembler());
Assembler a = new GraphRDFSAssembler();
AssemblerUtils.registerModel(tGraphRDFS, a);
AssemblerUtils.registerModel(tModelRDFS, a);
}
use of org.apache.jena.assembler.Assembler in project jena by apache.
the class TestModelAssembler method testGetsPrefixMappings.
public void testGetsPrefixMappings() {
Assembler a = new FakeModelAssembler();
PrefixMapping wanted = PrefixMapping.Factory.create().setNsPrefix("my", "urn:secret:42/").setNsPrefix("your", "urn:public:17#");
Resource root = resourceInModel("x rdf:type ja:DefaultModel; x ja:prefixMapping p1; x ja:prefixMapping p2" + "; p1 rdf:type ja:PrefixMapping; p1 ja:prefix 'my'; p1 ja:namespace 'urn:secret:42/'" + "; p2 rdf:type ja:PrefixMapping; p2 ja:prefix 'your'; p2 ja:namespace 'urn:public:17#'");
Model m = (Model) a.open(Assembler.prefixMapping, root);
assertSamePrefixMapping(wanted, m);
}
Aggregations