当前位置: 首页>>代码示例>>Java>>正文


Java Repository.getValueFactory方法代码示例

本文整理汇总了Java中org.eclipse.rdf4j.repository.Repository.getValueFactory方法的典型用法代码示例。如果您正苦于以下问题:Java Repository.getValueFactory方法的具体用法?Java Repository.getValueFactory怎么用?Java Repository.getValueFactory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.rdf4j.repository.Repository的用法示例。


在下文中一共展示了Repository.getValueFactory方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setUp

import org.eclipse.rdf4j.repository.Repository; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
    this.connector = repositoryProvider.createConnector(false);
    final Repository repository = connector.unwrap(Repository.class);
    this.axiomLoader = new AxiomLoader(connector, repository.getValueFactory(), "en");
    this.generatedData = Generator.initTestData(repository);
    this.vf = connector.unwrap(Repository.class).getValueFactory();
}
 
开发者ID:kbss-cvut,项目名称:jopa,代码行数:9,代码来源:AxiomLoaderTest.java

示例2: AbstractRepositoryGraphLike

import org.eclipse.rdf4j.repository.Repository; //导入方法依赖的package包/类
AbstractRepositoryGraphLike(final Repository repository, final UUID salt, final boolean handleInitAndShutdown,
        final boolean includeInferred) {
    this.repository = repository;
    this.salt = salt;
    this.includeInferred = includeInferred;
    this.handleInitAndShutdown = handleInitAndShutdown;
    if (handleInitAndShutdown && !repository.isInitialized()) {
        repository.initialize();
    }
    rdf4jTermFactory = new RDF4J(repository.getValueFactory(), salt);
}
 
开发者ID:apache,项目名称:commons-rdf,代码行数:12,代码来源:AbstractRepositoryGraphLike.java

示例3: init

import org.eclipse.rdf4j.repository.Repository; //导入方法依赖的package包/类
private void init(Repository repository) {
	this.repository = repository;
	this.valueFactory = repository.getValueFactory();
}
 
开发者ID:semweb4j,项目名称:semweb4j,代码行数:5,代码来源:RepositoryModelSet.java

示例4: testDirectRepositoryAccess

import org.eclipse.rdf4j.repository.Repository; //导入方法依赖的package包/类
@Test
public void testDirectRepositoryAccess() throws Exception {
	Model model = getModelFactory().createModel();
	model.open();

	// fetch the Repository, a Connection and a ValueFactory
	Repository repository = (Repository) model
			.getUnderlyingModelImplementation();
	RepositoryConnection connection = repository.getConnection();
	ValueFactory factory = repository.getValueFactory();

	// add a statement
	model.addStatement(subject, predicate, object);

	// convert the statement parts to RDF4J data types
	Resource targetSubject = ConversionUtil.toRDF4J(subject, factory);
	IRI targetPredicate = ConversionUtil.toRDF4J(predicate, factory);
	Value targetObject = ConversionUtil.toRDF4J(object, factory);
	IRI context = RepositoryModel.DEFAULT_RDF4J_CONTEXT;

	// make sure this statement is contained in this model
	assertTrue(connection.hasStatement(targetSubject, targetPredicate,
			targetObject, false, context));

	// make sure this statement can also be found through the Model API
	ClosableIterator<? extends Statement> sit = model.findStatements(
			subject, predicate, object);
	assertNotNull(sit);
	assertTrue(sit.hasNext());

	Statement s2 = sit.next();
	URI s2s = (URI) s2.getSubject();
	URI s2p = s2.getPredicate();
	URI s2o = (URI) s2.getObject();

	assertEquals(subject, s2s);
	assertEquals(predicate, s2p);
	assertEquals(object, s2o);

	// make sure that this statement is only returned once
	assertFalse(sit.hasNext());

	// clean-up
	sit.close();
	connection.close();
	model.close();
}
 
开发者ID:semweb4j,项目名称:semweb4j,代码行数:48,代码来源:RepositoryModelTest.java


注:本文中的org.eclipse.rdf4j.repository.Repository.getValueFactory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。