Search in sources :

Example 6 with PropertyDescriptor

use of nl.knaw.huygens.timbuctoo.search.description.PropertyDescriptor in project timbuctoo by HuygensING.

the class PropertyDescriptorFactoryTest method getLocalWithPrefixAndPostfixReturnsLocalPropertyDescriptor.

@Test
public void getLocalWithPrefixAndPostfixReturnsLocalPropertyDescriptor() {
    PropertyParser parser = mock(PropertyParser.class);
    PropertyDescriptor descriptor = instance.getLocal("propertyName", parser, "prefix", "postfix");
    assertThat(descriptor, is(instanceOf(LocalPropertyDescriptor.class)));
}
Also used : PropertyDescriptor(nl.knaw.huygens.timbuctoo.search.description.PropertyDescriptor) PropertyParser(nl.knaw.huygens.timbuctoo.search.description.PropertyParser) Test(org.junit.Test)

Example 7 with PropertyDescriptor

use of nl.knaw.huygens.timbuctoo.search.description.PropertyDescriptor in project timbuctoo by HuygensING.

the class PropertyDescriptorFactoryTest method getDerivedWithSeparatorReturnsADerivedPropertyDescriptor.

@Test
public void getDerivedWithSeparatorReturnsADerivedPropertyDescriptor() {
    PropertyParser parser = mock(PropertyParser.class);
    PropertyDescriptor descriptor = instance.getDerivedWithSeparator("relationName", "propertyName", parser, "accepted", "--");
    assertThat(descriptor, is(instanceOf(RelatedPropertyDescriptor.class)));
}
Also used : PropertyDescriptor(nl.knaw.huygens.timbuctoo.search.description.PropertyDescriptor) PropertyParser(nl.knaw.huygens.timbuctoo.search.description.PropertyParser) Test(org.junit.Test)

Example 8 with PropertyDescriptor

use of nl.knaw.huygens.timbuctoo.search.description.PropertyDescriptor in project timbuctoo by HuygensING.

the class PropertyDescriptorFactoryTest method getAppenderReturnsAnAppenderPropertyDescriptor.

@Test
public void getAppenderReturnsAnAppenderPropertyDescriptor() {
    PropertyDescriptor descriptor = instance.getAppender(mock(PropertyDescriptor.class), mock(PropertyDescriptor.class), " ");
    assertThat(descriptor, is(instanceOf(AppenderPropertyDescriptor.class)));
}
Also used : PropertyDescriptor(nl.knaw.huygens.timbuctoo.search.description.PropertyDescriptor) Test(org.junit.Test)

Example 9 with PropertyDescriptor

use of nl.knaw.huygens.timbuctoo.search.description.PropertyDescriptor in project timbuctoo by HuygensING.

the class WwDocumentAuthorDescriptor method createAuthorDescriptor.

private PropertyDescriptor createAuthorDescriptor() {
    PropertyDescriptor authorNameDescriptor = propertyDescriptorFactory.getDerivedWithSeparator("isCreatedBy", "wwperson_names", propertyParserFactory.getParser(PersonNames.class), "wwrelation_accepted", "; ");
    PropertyDescriptor authorTempNameDescriptor = propertyDescriptorFactory.getDerivedWithSeparator("isCreatedBy", "wwperson_tempName", propertyParserFactory.getParser(String.class), "wwrelation_accepted", "; ");
    return propertyDescriptorFactory.getComposite(authorNameDescriptor, authorTempNameDescriptor);
}
Also used : PersonNames(nl.knaw.huygens.timbuctoo.model.PersonNames) PropertyDescriptor(nl.knaw.huygens.timbuctoo.search.description.PropertyDescriptor)

Example 10 with PropertyDescriptor

use of nl.knaw.huygens.timbuctoo.search.description.PropertyDescriptor in project timbuctoo by HuygensING.

the class WwDocumentDisplayNameDescriptor method createDisplayNameDescriptor.

private PropertyDescriptor createDisplayNameDescriptor() {
    PropertyDescriptor titleDescriptor = propertyDescriptorFactory.getLocal("wwdocument_title", String.class);
    PropertyDescriptor dateDescriptor = propertyDescriptorFactory.getLocal("wwdocument_date", Datable.class, "(", ")");
    PropertyDescriptor documentDescriptor = propertyDescriptorFactory.getAppender(titleDescriptor, dateDescriptor, " ");
    return propertyDescriptorFactory.getAppender(new WwDocumentAuthorDescriptor(), documentDescriptor, " - ");
}
Also used : PropertyDescriptor(nl.knaw.huygens.timbuctoo.search.description.PropertyDescriptor)

Aggregations

PropertyDescriptor (nl.knaw.huygens.timbuctoo.search.description.PropertyDescriptor)15 Test (org.junit.Test)11 Vertex (org.apache.tinkerpop.gremlin.structure.Vertex)7 PropertyParser (nl.knaw.huygens.timbuctoo.search.description.PropertyParser)3 PersonNames (nl.knaw.huygens.timbuctoo.model.PersonNames)1 ElementValidationResult (nl.knaw.huygens.timbuctoo.server.healthchecks.ElementValidationResult)1 Transaction (org.apache.tinkerpop.gremlin.structure.Transaction)1 Node (org.neo4j.graphdb.Node)1 IndexManager (org.neo4j.graphdb.index.IndexManager)1