Search in sources :

Example 1 with EntityIndexOptimizer

use of org.apache.rya.indexing.entity.EntityIndexOptimizer in project incubator-rya by apache.

the class MongoEntityIndex2IT method beforeClass.

@Before
public void beforeClass() throws Exception {
    optimizer = new EntityIndexOptimizer();
    optimizer.setConf(conf);
    final TypeStorage typeStorage = optimizer.getTypeStorage();
    typeStorage.create(PERSON_TYPE);
    final Entity entity = Entity.builder().setSubject(new RyaURI("urn:SSN:111-11-1111")).setExplicitType(RYA_PERSON_TYPE).setProperty(RYA_PERSON_TYPE, new Property(new RyaURI("urn:age"), new RyaType("25"))).setProperty(RYA_PERSON_TYPE, new Property(new RyaURI("urn:eye"), new RyaType("blue"))).setProperty(RYA_PERSON_TYPE, new Property(new RyaURI("urn:name"), new RyaType("bob"))).build();
    entityStorage = optimizer.getEntityStorage();
    entityStorage.create(entity);
}
Also used : TypeStorage(org.apache.rya.indexing.entity.storage.TypeStorage) Entity(org.apache.rya.indexing.entity.model.Entity) RyaURI(org.apache.rya.api.domain.RyaURI) EntityIndexOptimizer(org.apache.rya.indexing.entity.EntityIndexOptimizer) RyaType(org.apache.rya.api.domain.RyaType) Property(org.apache.rya.indexing.entity.model.Property) Before(org.junit.Before)

Aggregations

RyaType (org.apache.rya.api.domain.RyaType)1 RyaURI (org.apache.rya.api.domain.RyaURI)1 EntityIndexOptimizer (org.apache.rya.indexing.entity.EntityIndexOptimizer)1 Entity (org.apache.rya.indexing.entity.model.Entity)1 Property (org.apache.rya.indexing.entity.model.Property)1 TypeStorage (org.apache.rya.indexing.entity.storage.TypeStorage)1 Before (org.junit.Before)1