org.apache.jena.rdf.model.Model.isClosed()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(99)

本文整理了Java中org.apache.jena.rdf.model.Model.isClosed()方法的一些代码示例,展示了Model.isClosed()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Model.isClosed()方法的具体详情如下:
包路径:org.apache.jena.rdf.model.Model
类名称:Model
方法名:isClosed

Model.isClosed介绍

[英]Answer true iff .close() has been called on this Model.
[中]回答正确。已在此模型上调用close()。

代码示例

代码示例来源:origin: vivo-project/Vitro

@Override
public boolean isClosed() {
  return inner.isClosed();
}

代码示例来源:origin: apache/jena

@Override
public boolean isClosed() {
  return holder.getBaseItem().isClosed();
}

代码示例来源:origin: apache/jena

public void testIsClosedDelegatedToGraph()
{
  Assert.assertFalse(model.isClosed());
  model.close();
  Assert.assertTrue(model.isClosed());
}

代码示例来源:origin: org.apache.jena/jena-core

public void testIsClosedDelegatedToGraph()
{
  Assert.assertFalse(model.isClosed());
  model.close();
  Assert.assertTrue(model.isClosed());
}

代码示例来源:origin: org.apache.jena/jena-core

@SuppressWarnings("unchecked")
@Override
final public void cleanUp() {
  for (Model m : modelList) {
    if (!m.isClosed()) {
      m.close();
    }
    afterClose((T) m);
  }
  modelList.clear();
}

代码示例来源:origin: apache/jena

@SuppressWarnings("unchecked")
@Override
final public void cleanUp() {
  for (Model m : modelList) {
    if (!m.isClosed()) {
      m.close();
    }
    afterClose((T) m);
  }
  modelList.clear();
}

代码示例来源:origin: apache/jena

/**
 * <p>
 * Answer the cached model corresponding to the given document, if known.
 * </p>
 *
 * @param uri The ontology document to lookup
 * @return The model for the document, or null if the model is not known.
 * @see #getOntology
 */
public Model getModel( String uri ) {
  Model m = getFileManager().getFromCache( uri );
  // if a previously cached model has been closed, we ignore it
  if (m != null && m.isClosed()) {
    getFileManager().removeCacheModel( uri );
    m = null;
  }
  return m;
}

代码示例来源:origin: org.apache.jena/jena-core

/**
 * <p>
 * Answer the cached model corresponding to the given document, if known.
 * </p>
 *
 * @param uri The ontology document to lookup
 * @return The model for the document, or null if the model is not known.
 * @see #getOntology
 */
public Model getModel( String uri ) {
  Model m = getFileManager().getFromCache( uri );
  // if a previously cached model has been closed, we ignore it
  if (m != null && m.isClosed()) {
    getFileManager().removeCacheModel( uri );
    m = null;
  }
  return m;
}

代码示例来源:origin: apache/jena

public void testIsClosedDelegatedToGraph()
  {
  Model m = getModel();
  assertFalse( m.isClosed() );
  m.close();
  assertTrue( m.isClosed() );
  }

代码示例来源:origin: org.apache.jena/jena-core

public void testIsClosedDelegatedToGraph()
  {
  Model m = getModel();
  assertFalse( m.isClosed() );
  m.close();
  assertTrue( m.isClosed() );
  }

代码示例来源:origin: apache/jena

/**
 * @param spec
 * @param importURI
 * @return Model
 */
private Model fetchLoadedImportModel( OntModelSpec spec, String importURI ) {
  // workaround - default model maker can apparently create models that are closed
  // TODO: this really suggests a bug in ModelMaker, kers to investigate
  ModelMaker maker = spec.getImportModelMaker();
  if (maker.hasModel( importURI )) {
    Model m = maker.getModel( importURI );
    if (!m.isClosed()) {
      return m;
    }
    else {
      // we don't want to hang on to closed models
      maker.removeModel( importURI );
    }
  }
  // otherwise, we use the model maker to get the model anew
  Model m = spec.getImportModelGetter()
        .getModel( importURI, new ModelReader() {
                    @Override
                    public Model readModel( Model toRead, String URL ) {
                      read( toRead, URL, true );
                      return toRead;
                    }
                   } );
  return m;
}

代码示例来源:origin: org.apache.jena/jena-core

/**
 * @param spec
 * @param importURI
 * @return Model
 */
private Model fetchLoadedImportModel( OntModelSpec spec, String importURI ) {
  // workaround - default model maker can apparently create models that are closed
  // TODO: this really suggests a bug in ModelMaker, kers to investigate
  ModelMaker maker = spec.getImportModelMaker();
  if (maker.hasModel( importURI )) {
    Model m = maker.getModel( importURI );
    if (!m.isClosed()) {
      return m;
    }
    else {
      // we don't want to hang on to closed models
      maker.removeModel( importURI );
    }
  }
  // otherwise, we use the model maker to get the model anew
  Model m = spec.getImportModelGetter()
        .getModel( importURI, new ModelReader() {
                    @Override
                    public Model readModel( Model toRead, String URL ) {
                      read( toRead, URL, true );
                      return toRead;
                    }
                   } );
  return m;
}

代码示例来源:origin: Galigator/openllet

@Test
public void closeMultiple()
{
  // ticket #487
  final Model baseModel = ModelFactory.createDefaultModel();
  final OntModel model = ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC, baseModel);
  ((PelletInfGraph) model.getGraph()).close(false);
  assertTrue(model.isClosed());
  assertFalse(baseModel.isClosed());
  ((PelletInfGraph) model.getGraph()).close(false);
  assertTrue(model.isClosed());
  assertFalse(baseModel.isClosed());
}

代码示例来源:origin: Galigator/openllet

@Test
public void closeModel()
{
  // ticket #487
  final Model baseModel = ModelFactory.createDefaultModel();
  final OntModel model = ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC, baseModel);
  model.close();
  assertTrue(model.isClosed());
  assertTrue(baseModel.isClosed());
}

代码示例来源:origin: Galigator/openllet

@Test
public void closeRecursive()
{
  // ticket #487
  final Model baseModel = ModelFactory.createDefaultModel();
  final OntModel model = ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC, baseModel);
  ((PelletInfGraph) model.getGraph()).close(true);
  assertTrue(model.isClosed());
  assertTrue(baseModel.isClosed());
}

代码示例来源:origin: Galigator/openllet

@Test
public void closeNonRecursive()
{
  // ticket #487
  final Model baseModel = ModelFactory.createDefaultModel();
  final OntModel model = ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC, baseModel);
  ((PelletInfGraph) model.getGraph()).close(false);
  assertTrue(model.isClosed());
  assertFalse(baseModel.isClosed());
}

相关文章

Model类方法