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


Java RepositoryConnection.export方法代码示例

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


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

示例1: testTicket583

import org.openrdf.repository.RepositoryConnection; //导入方法依赖的package包/类
@Test
public void testTicket583() throws Exception {
	RepositoryConnection rc = engine.getRawConnection();
	rc.add( TICKETBASE, null, RDFFormat.TURTLE );
	engine.setBuilders( UriBuilder.getBuilder( "http://example.org/ex1" ),
			UriBuilder.getBuilder( "http://foo.bar/model#" ) );

	EngineLoader el = new EngineLoader();
	el.loadToEngine( Arrays.asList( TICKET583 ), engine, false, null );
	el.release();

	if ( log.isTraceEnabled() ) {
		File tmpdir = FileUtils.getTempDirectory();
		try ( Writer w = new BufferedWriter( new FileWriter( new File( tmpdir,
				"ticket583.nt" ) ) ) ) {
			rc.export( new NTriplesWriter( w ) );
		}
	}

	compareData( rc, getExpectedGraph( TICKET583_EXP ),
			UriBuilder.getBuilder( "http://example.org/ex1" ),
			UriBuilder.getBuilder( "http://foo.bar/model#" ) );
}
 
开发者ID:Ostrich-Emulators,项目名称:semtool,代码行数:24,代码来源:EngineLoaderTest.java

示例2: dumpRDF

import org.openrdf.repository.RepositoryConnection; //导入方法依赖的package包/类
/**
 * dump RDF graph
 * 
 * @param out
 *            output stream for the serialization
 * @param outform
 *            the RDF serialization format for the dump
 * @return
 */
public void dumpRDF(OutputStream out, RDFFormat outform) {
	try {
		RepositoryConnection con = therepository.getConnection();
		try {
			RDFWriter w = Rio.createWriter(outform, out);
			con.export(w, new Resource[0]);
		} finally {
			con.close();
		}
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:dvcama,项目名称:resource-to-sparqlresult,代码行数:23,代码来源:SimpleGraph.java

示例3: merge

import org.openrdf.repository.RepositoryConnection; //导入方法依赖的package包/类
/**
 * Copies all the data from the "from" repository to the "to" repository
 *
 * @param from the source of statements
 * @param to the destination of the statements
 * @param doData copy the data
 * @param doInsights copy the insights
 *
 * @throws RepositoryException
 */
public synchronized void merge( final IEngine from, final IEngine to,
		boolean doData, boolean doInsights ) throws RepositoryException {
	// this is a little complicated because we don't have a handle to either
	// repositoryconnection. 

	if ( doData ) {
		ModificationExecutor fromcopier = new ModificationExecutorAdapter() {

			@Override
			public void exec( final RepositoryConnection fromconn ) throws RepositoryException {

				final ModificationExecutor tocopier = new ModificationExecutorAdapter() {

					@Override
					public void exec( RepositoryConnection toconn ) throws RepositoryException {
						try {
							final RepositoryCopier copier = new RepositoryCopier( toconn );
							fromconn.export( copier );
						}
						catch ( RDFHandlerException e ) {
							log.error( e );
						}
					}
				};

				to.execute( tocopier );
			}

		};

		from.execute( fromcopier );
	}

	if ( doInsights ) {
		insightqueue.put( to,
				new InsightsImportConfig( from.getInsightManager(), false ) );
		notify();
	}
}
 
开发者ID:Ostrich-Emulators,项目名称:semtool,代码行数:50,代码来源:EngineUtil.java


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