Alx is a modular framework for developing applications. Rya has mechanisms to integrate directly into Alx to provide other modules access to queries.
Currently, the Alx Rya extension only allows interacting with an Accumulo store.
mvn:org.apache.rya/alx.rya/<version>/xml/features
)That's it. To make sure, run ls <alx.rya bundle id>
and make sure something like this pops up:
org.apache.rya.alx.rya (99) provides: ------------------------------ Bundle-SymbolicName = org.apache.rya.alx.rya Bundle-Version = 3.0.4.SNAPSHOT objectClass = org.osgi.service.cm.ManagedService service.id = 226 service.pid = org.apache.rya.alx ---- ...
The bundle registers a Sail Repository, so you can interact with it directly as in the other code examples. Here is a quick groovy example of the usage:
import org.springframework.osgi.extensions.annotation.*; import org.eclipse.rdf4j.repository.*; import org.eclipse.rdf4j.model.ValueFactory; import static org.apache.rya.api.RdfCloudTripleStoreConstants.*; class TstRepo { @ServiceReference public void setRepo(Repository repo) { println repo RepositoryConnection conn = repo.getConnection(); ValueFactory vf = VALUE_FACTORY; def statements = conn.getStatements(vf.createIRI("http://www.Department0.University0.edu"), null, null, true); while(statements.hasNext()) { System.out.println(statements.next()); } statements.close(); conn.close(); } }
The bundle also registers a RyaDAO, so you can interact with the RyaDAO interface directly