Search in sources :

Example 1 with YardBackend

use of org.apache.stanbol.entityhub.ldpath.backend.YardBackend in project stanbol by apache.

the class LDPathTestBase method setup.

@BeforeClass
public static void setup() throws Exception {
    // get the working directory
    // use property substitution to test this feature!
    String prefix = System.getProperty("basedir") == null ? "." : "${basedir}";
    String solrServerDir = prefix + TEST_INDEX_REL_PATH;
    log.info("Test Solr Server Directory: {}", solrServerDir);
    System.setProperty(ManagedSolrServer.MANAGED_SOLR_DIR_PROPERTY, solrServerDir);
    SolrYardConfig config = new SolrYardConfig(TEST_YARD_ID, TEST_SOLR_CORE_NAME);
    config.setAllowInitialisation(false);
    // the dbpedia default data
    config.setIndexConfigurationName(TEST_SOLR_CORE_CONFIGURATION);
    // init from datafile provider
    config.setAllowInitialisation(true);
    config.setName("DBpedia.org default data");
    config.setDescription("Data used for the LDPath setup");
    // create the Yard used for the tests
    IndexReference solrIndexRef = IndexReference.parse(config.getSolrServerLocation());
    SolrServer server = StandaloneEmbeddedSolrServerProvider.getInstance().getSolrServer(solrIndexRef, config.getIndexConfigurationName());
    Assert.assertNotNull("Unable to initialise SolrServer for testing", server);
    yard = new SolrYard(server, config, null);
    backend = new YardBackend(yard);
}
Also used : YardBackend(org.apache.stanbol.entityhub.ldpath.backend.YardBackend) IndexReference(org.apache.stanbol.commons.solr.IndexReference) ManagedSolrServer(org.apache.stanbol.commons.solr.managed.ManagedSolrServer) SolrServer(org.apache.solr.client.solrj.SolrServer) SolrYard(org.apache.stanbol.entityhub.yard.solr.impl.SolrYard) SolrYardConfig(org.apache.stanbol.entityhub.yard.solr.impl.SolrYardConfig) BeforeClass(org.junit.BeforeClass)

Example 2 with YardBackend

use of org.apache.stanbol.entityhub.ldpath.backend.YardBackend in project stanbol by apache.

the class LdpathPostProcessor method initialise.

@Override
public void initialise() {
    // override the ldpath instance used for the initialisation with
    // the one using the IndexingDestination
    // this is OK, because parsing ldpath programs anyway does only need
    // the "value factory" role of the RDFBackend and does not actually
    // access any data.
    Yard yard = indexingConfig.getIndexingDestination().getYard();
    YardBackend backend = new YardBackend(yard);
    this.ldPath = new EntityhubLDPath(backend, yard.getValueFactory());
}
Also used : YardBackend(org.apache.stanbol.entityhub.ldpath.backend.YardBackend) Yard(org.apache.stanbol.entityhub.servicesapi.yard.Yard) EntityhubLDPath(org.apache.stanbol.entityhub.ldpath.EntityhubLDPath)

Aggregations

YardBackend (org.apache.stanbol.entityhub.ldpath.backend.YardBackend)2 SolrServer (org.apache.solr.client.solrj.SolrServer)1 IndexReference (org.apache.stanbol.commons.solr.IndexReference)1 ManagedSolrServer (org.apache.stanbol.commons.solr.managed.ManagedSolrServer)1 EntityhubLDPath (org.apache.stanbol.entityhub.ldpath.EntityhubLDPath)1 Yard (org.apache.stanbol.entityhub.servicesapi.yard.Yard)1 SolrYard (org.apache.stanbol.entityhub.yard.solr.impl.SolrYard)1 SolrYardConfig (org.apache.stanbol.entityhub.yard.solr.impl.SolrYardConfig)1 BeforeClass (org.junit.BeforeClass)1