-
Notifications
You must be signed in to change notification settings - Fork 0
Working with ricordo rdfstore API
sarala edited this page Sep 12, 2012
·
2 revisions
-
Install Virtuoso RDF store from http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/.
-
Populate the RDF store. An example data set can be found at https://sites.google.com/site/ricordowp4/file-cabinet/sbmltordf
- resources folder consists of all curated BioModels in RDF
- rdfloader.sql supports setting up of Virtuoso to load multiple RDF files
- in order to get the API working with minimal changes, load rdfschema.rdf and sbmlrdfschema.rdf as ricordo-rule
- Update your pom file to use ricordo-rdfstore
<repository>
<id>ebi-repo</id>
<name>EBI Repository</name>
<url>http://www.ebi.ac.uk/~maven/m2repo/</url>
</repository>
<dependencies>
<dependency>
<groupId>uk.ac.ebi.ricordo</groupId>
<artifactId>rdfstore</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
- Assuming you are using spring, import ricordo-rdfstore-config.xml file
<import resource="classpath:ricordo-rdfstore-config.xml"/>
- Create a config.properties file and add the following. Change the values as needed. Default values are appropriate in many cases except rdf store end point configurations. Note: sparql query template files follow the sbmlrdfshema, if using a different data set, the query files need to be changed accordingly.
# rdf store end point
rdfstore.url=jdbc:virtuoso://localhost:1111
rdfstore.username=dba
rdfstore.password=dba
#Path to sparql query tempalates
sparql.resource=/
qualifier.file=/bioqualifiers.txt
qualifier.url=http://biomodels.net/biology-qualifiers/
- You are ready to explore the API
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import uk.ac.ebi.ricordo.rdfstore.service.RdfStoreService;
import uk.ac.ebi.ricordo.rdfstore.bean.ResourceList;
public class RDFStoreExample {
public static void main(String [] args){
ApplicationContext ctx = new ClassPathXmlApplicationContext("classpath:spring-config.xml");
RdfStoreService rdfStoreService = (RdfStoreService )ctx.getBean("rdfStoreServiceImpl");
ResourceList resourceList = new ResourceList();
rdfStoreService.search("","getResources",resourceList);
resourceList.getCount();
}
}