Package com.google.gwt.ricordo.server

Source Code of com.google.gwt.ricordo.server.RDFHandlerTest

package com.google.gwt.ricordo.server;

import junit.framework.TestCase;

import com.hp.hpl.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ResultSet;

public class RDFHandlerTest extends TestCase{
 
  private RDFHandler rdfHandler;
 
  protected void setUp() {
    rdfHandler = new RDFHandler();
  }
 
  public void testGetModelQuery(){
    ResultSet results = rdfHandler.getModelQuery("urn:miriam:obo.fma:FMA%3A9557");
   
    while (results.hasNext()) {
        
      QuerySolution solution = results.next();
      String modelName = "";
      int frequency = 0;

      if (solution.getResource("?m") != null) {
        modelName = solution.getResource("?m").getURI();
      }

      if (solution.getLiteral("?callret-1") != null) {
        frequency = solution.getLiteral("?callret-1").getInt();
      }
     
      System.out.println(modelName + " - " + frequency);
    }
  }

}
TOP

Related Classes of com.google.gwt.ricordo.server.RDFHandlerTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.