Package org.ontoware.rdf2go.model

Examples of org.ontoware.rdf2go.model.Model.open()


        this.dataset);

    if (jenaQuery.isConstructType()) {
      com.hp.hpl.jena.rdf.model.Model m = qexec.execConstruct();
      Model resultModel = new ModelImplJena(null, m, Reasoning.none);
      resultModel.open();
      return resultModel;
    } else {
      throw new RuntimeException(
          "Cannot handle this type of query! Please use CONSTRUCT.");
    }
View Full Code Here


        this.dataset);

    if (jenaQuery.isConstructType()) {
      com.hp.hpl.jena.rdf.model.Model m = qexec.execConstruct();
      Model resultModel = new ModelImplJena(null, m, Reasoning.none);
      resultModel.open();
      return resultModel;
    } else {
      throw new RuntimeException(
          "Cannot handle this type of query! Please use CONSTRUCT.");
    }
View Full Code Here

        this.dataset);

    if (jenaQuery.isDescribeType()) {
      com.hp.hpl.jena.rdf.model.Model m = qexec.execDescribe();
      Model resultModel = new ModelImplJena(null, m, Reasoning.none);
      resultModel.open();
      return resultModel;
    } else {
      throw new RuntimeException(
          "Cannot handle this type of query! Please use DESCRIBE.");
    }
View Full Code Here

public class TestSetup {
 
  @Test
  public void testSetup() {
    Model model = RDF2Go.getModelFactory().createModel();
    model.open();
    assertNotNull(model);
    assertTrue(model.isOpen());
    model.close();
  }
View Full Code Here

   * @throws IOException
   */
  public static Model loadFoaf(ModelFactory factory) throws IOException,
      ModelRuntimeException {
    Model result = factory.createModel();
    result.open();
    InputStream in = getFoafAsStream();
    try {
      result.readFrom(in);
    } finally {
      in.close();
View Full Code Here

   * @throws IOException
   */
  public static Model loadICAL(ModelFactory factory) throws IOException,
      ModelRuntimeException {
    Model result = factory.createModel();
    result.open();
    InputStream in = getICALAsStream();
    try {
      result.readFrom(in);
    } finally {
      in.close();
View Full Code Here

    searchAndReplace(model, this.searchURIPrefix, this.replaceURIPrefix);
  }
 
  public static void searchAndReplace(Model model, String searchURIPrefix, String replaceURIPrefix) {
    Model add = RDF2Go.getModelFactory().createModel();
    add.open();
   
    Model remove = RDF2Go.getModelFactory().createModel();
    remove.open();
   
    ClosableIterator<Statement> it = model.iterator();
View Full Code Here

  public static void searchAndReplace(Model model, String searchURIPrefix, String replaceURIPrefix) {
    Model add = RDF2Go.getModelFactory().createModel();
    add.open();
   
    Model remove = RDF2Go.getModelFactory().createModel();
    remove.open();
   
    ClosableIterator<Statement> it = model.iterator();
    while(it.hasNext()) {
      Statement stmt = it.next();
      Resource s = stmt.getSubject();
View Full Code Here

   * @param m the model to copy
   * @return a copy of the model in a memory model
   */
  public static Model copyModel(Model m) {
    Model res = RDF2Go.getModelFactory().createModel();
    res.open();
    res.addAll(m.iterator());
    return res;
  }
 
  /**
 
View Full Code Here

   * @param syntax the syntax to use
   * @return the model that was serialised.
   */
  public static Model stringToModel(String string, Syntax syntax) {
    Model m = RDF2Go.getModelFactory().createModel();
    m.open();
    StringReader s = new StringReader(string);
    try {
      m.readFrom(s, syntax);
      return m;
    } catch(Exception e) {
View Full Code Here

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.