Search in sources :

Example 1 with EntityDefinition

use of org.apache.jena.query.text.EntityDefinition in project jena by apache.

the class TestEntityMapAssembler method EntityHasMapEntries.

@Test
public void EntityHasMapEntries() {
    EntityDefinitionAssembler entDefAssem = new EntityDefinitionAssembler();
    EntityDefinition entityDef = entDefAssem.open(null, spec1, null);
    assertEquals(SPEC1_PREDICATE.asNode(), getOne(entityDef, SPEC1_DEFAULT_FIELD));
}
Also used : EntityDefinition(org.apache.jena.query.text.EntityDefinition) Test(org.junit.Test)

Example 2 with EntityDefinition

use of org.apache.jena.query.text.EntityDefinition in project jena by apache.

the class TestEntityMapAssembler method EntityHasMapEntryWithLowerCaseKeywordAnalyzer.

@Test
public void EntityHasMapEntryWithLowerCaseKeywordAnalyzer() {
    EntityDefinitionAssembler entDefAssem = new EntityDefinitionAssembler();
    EntityDefinition entityDef = entDefAssem.open(Assembler.general, spec6, null);
    assertEquals(LowerCaseKeywordAnalyzer.class, entityDef.getAnalyzer(SPEC1_DEFAULT_FIELD).getClass());
}
Also used : EntityDefinition(org.apache.jena.query.text.EntityDefinition) Test(org.junit.Test)

Example 3 with EntityDefinition

use of org.apache.jena.query.text.EntityDefinition in project jena by apache.

the class TestEntityMapAssembler method EntityHasMultipleMapEntries.

@Test
public void EntityHasMultipleMapEntries() {
    EntityDefinitionAssembler entDefAssem = new EntityDefinitionAssembler();
    EntityDefinition entityDef = entDefAssem.open(null, spec2, null);
    assertEquals(SPEC2_PREDICATE1.asNode(), getOne(entityDef, SPEC2_DEFAULT_FIELD));
    assertEquals(SPEC2_PREDICATE2.asNode(), getOne(entityDef, SPEC2_FIELD2));
}
Also used : EntityDefinition(org.apache.jena.query.text.EntityDefinition) Test(org.junit.Test)

Example 4 with EntityDefinition

use of org.apache.jena.query.text.EntityDefinition in project jena by apache.

the class TestEntityMapAssembler method EntityHasMapEntryWithKeywordAnalyzer.

@Test
public void EntityHasMapEntryWithKeywordAnalyzer() {
    EntityDefinitionAssembler entDefAssem = new EntityDefinitionAssembler();
    EntityDefinition entityDef = entDefAssem.open(Assembler.general, spec5, null);
    assertEquals(KeywordAnalyzer.class, entityDef.getAnalyzer(SPEC1_DEFAULT_FIELD).getClass());
}
Also used : EntityDefinition(org.apache.jena.query.text.EntityDefinition) Test(org.junit.Test)

Example 5 with EntityDefinition

use of org.apache.jena.query.text.EntityDefinition in project jena by apache.

the class TestEntityMapAssembler method EntityHasMapEntryWithConfigurableAnalyzer.

@Test
public void EntityHasMapEntryWithConfigurableAnalyzer() {
    EntityDefinitionAssembler entDefAssem = new EntityDefinitionAssembler();
    EntityDefinition entityDef = entDefAssem.open(Assembler.general, spec7, null);
    assertEquals(ConfigurableAnalyzer.class, entityDef.getAnalyzer(SPEC1_DEFAULT_FIELD).getClass());
}
Also used : EntityDefinition(org.apache.jena.query.text.EntityDefinition) Test(org.junit.Test)

Aggregations

EntityDefinition (org.apache.jena.query.text.EntityDefinition)13 Test (org.junit.Test)9 TextIndexConfig (org.apache.jena.query.text.TextIndexConfig)3 HashMap (java.util.HashMap)2 TextIndexException (org.apache.jena.query.text.TextIndexException)2 Node (org.apache.jena.graph.Node)1 Resource (org.apache.jena.rdf.model.Resource)1 Analyzer (org.apache.lucene.analysis.Analyzer)1 Directory (org.apache.lucene.store.Directory)1 RAMDirectory (org.apache.lucene.store.RAMDirectory)1