Package de.fuberlin.wiwiss.d2rq

Source Code of de.fuberlin.wiwiss.d2rq.JenaAPITest

package de.fuberlin.wiwiss.d2rq;

import com.hp.hpl.jena.util.FileManager;

import de.fuberlin.wiwiss.d2rq.jena.GraphD2RQ;
import de.fuberlin.wiwiss.d2rq.jena.ModelD2RQ;

import junit.framework.TestCase;

public class JenaAPITest extends TestCase {

  public void testCopyPrefixesFromMapModelToD2RQModel() {
    ModelD2RQ m = new ModelD2RQ(D2RQTestSuite.DIRECTORY_URL + "prefixes.ttl");
    assertEquals("http://example.org/", m.getNsPrefixURI("ex"));
  }
 
  public void testCopyPrefixesFromMapModelToD2RQGraph() {
    GraphD2RQ g = new ModelD2RQ(
        FileManager.get().loadModel(D2RQTestSuite.DIRECTORY_URL + "prefixes.ttl"), null).getGraph();
    assertEquals("http://example.org/", g.getPrefixMapping().getNsPrefixURI("ex"));
  }
 
  public void testDontCopyD2RQPrefixFromMapModel() {
    ModelD2RQ m = new ModelD2RQ(D2RQTestSuite.DIRECTORY_URL + "prefixes.ttl");
    assertNull(m.getNsPrefixURI("d2rq"));
  }
}
TOP

Related Classes of de.fuberlin.wiwiss.d2rq.JenaAPITest

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.