當前位置: 首頁>>代碼示例>>Java>>正文


Java Lang.NQ屬性代碼示例

本文整理匯總了Java中org.apache.jena.riot.Lang.NQ屬性的典型用法代碼示例。如果您正苦於以下問題:Java Lang.NQ屬性的具體用法?Java Lang.NQ怎麽用?Java Lang.NQ使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.apache.jena.riot.Lang的用法示例。


在下文中一共展示了Lang.NQ屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: reinitialiseProcessors

@SuppressWarnings("unchecked")
private void reinitialiseProcessors(){
	if (!this.executor.isShutdown()){
		this.executor.shutdownNow();
	}
	
	Lang lang  = RDFLanguages.filenameToLang(datasetURI);
	
	if ((lang == Lang.NQ) || (lang == Lang.NQUADS)){
		this.iterator = new PipedRDFIterator<Quad>(rdfIterBufferSize, rdfIterFairBufferLock, rdfIterPollTimeout, rdfIterMaxPolls);
		this.rdfStream = new PipedQuadsStream((PipedRDFIterator<Quad>) iterator);
	} else {
		this.iterator = new PipedRDFIterator<Triple>(rdfIterBufferSize, rdfIterFairBufferLock, rdfIterPollTimeout, rdfIterMaxPolls);
		this.rdfStream = new PipedTriplesStream((PipedRDFIterator<Triple>) iterator);
	}
	
	
	this.isInitalised = true;
	
	this.executor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
	
	lstMetricConsumers = new ArrayList<MetricProcess>();
	for(String className : this.metricInstances.keySet()) {
		this.lstMetricConsumers.add(new MetricProcess(this.metricInstances.get(className)));
	}
}
 
開發者ID:EIS-Bonn,項目名稱:Luzzu,代碼行數:26,代碼來源:LargeStreamProcessor.java

示例2: setUpProcess

@SuppressWarnings("unchecked")
public void setUpProcess() {
		Lang lang  = RDFLanguages.filenameToLang(datasetURI);

		if ((lang == Lang.NQ) || (lang == Lang.NQUADS)){
			this.iterator = new PipedRDFIterator<Quad>(rdfIterBufferSize, rdfIterFairBufferLock, rdfIterPollTimeout, rdfIterMaxPolls);
			this.rdfStream = new PipedQuadsStream((PipedRDFIterator<Quad>) iterator);
		} else {
			this.iterator = new PipedRDFIterator<Triple>(rdfIterBufferSize, rdfIterFairBufferLock, rdfIterPollTimeout, rdfIterMaxPolls);
			this.rdfStream = new PipedTriplesStream((PipedRDFIterator<Triple>) iterator);
		}
		logger.debug("PipedRDFIterator initialized with: Buffer Size {}, Fair Lock {}, Poll Timeout {}, Max Polls {}", 
				rdfIterBufferSize, rdfIterFairBufferLock, rdfIterPollTimeout, rdfIterMaxPolls);
		
		this.isInitalised = true;
		
		try {
			this.loadMetrics();
		} catch (ExternalMetricLoaderException e) {
			logger.error(e.getLocalizedMessage());
		}
		
		this.executor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
}
 
開發者ID:EIS-Bonn,項目名稱:Luzzu,代碼行數:24,代碼來源:LargeStreamProcessor.java

示例3: setUpProcess

@SuppressWarnings("unchecked")
@Override
public void setUpProcess() {

	Lang lang  = RDFLanguages.filenameToLang(datasetURI);
	
	if ((lang == Lang.NQ) || (lang == Lang.NQUADS)){
		this.iterator = new PipedRDFIterator<Quad>(rdfIterBufferSize, rdfIterFairBufferLock, rdfIterPollTimeout, rdfIterMaxPolls);
		this.rdfStream = new PipedQuadsStream((PipedRDFIterator<Quad>) iterator);
	} else {
		this.iterator = new PipedRDFIterator<Triple>(rdfIterBufferSize, rdfIterFairBufferLock, rdfIterPollTimeout, rdfIterMaxPolls);
		this.rdfStream = new PipedTriplesStream((PipedRDFIterator<Triple>) iterator);
	}
	
	this.isInitalised = true;
	
	try {
		this.loadMetrics();
	} catch (ExternalMetricLoaderException e) {
		logger.error(e.getLocalizedMessage());
	}
	
	this.executor = Executors.newSingleThreadExecutor();
}
 
開發者ID:EIS-Bonn,項目名稱:Luzzu,代碼行數:24,代碼來源:GZNTMemoryProcessor.java

示例4: reinitialiseProcessors

@SuppressWarnings("unchecked")
private void reinitialiseProcessors(){
	if (!this.executor.isShutdown()){
		this.executor.shutdownNow();
	}
	
	Lang lang  = RDFLanguages.filenameToLang(datasetURI);
	
	if ((lang == Lang.NQ) || (lang == Lang.NQUADS)){
		this.iterator = new PipedRDFIterator<Quad>(rdfIterBufferSize, rdfIterFairBufferLock, rdfIterPollTimeout, rdfIterMaxPolls);
		this.rdfStream = new PipedQuadsStream((PipedRDFIterator<Quad>) iterator);
	} else {
		this.iterator = new PipedRDFIterator<Triple>(rdfIterBufferSize, rdfIterFairBufferLock, rdfIterPollTimeout, rdfIterMaxPolls);
		this.rdfStream = new PipedTriplesStream((PipedRDFIterator<Triple>) iterator);
	}
	
	this.isInitalised = true;
	
	this.executor = Executors.newSingleThreadExecutor();
	
	lstMetricConsumers = new ArrayList<MetricProcess>();
	for(String className : this.metricInstances.keySet()) {
		this.lstMetricConsumers.add(new MetricProcess(this.metricInstances.get(className)));
	}
}
 
開發者ID:EIS-Bonn,項目名稱:Luzzu,代碼行數:25,代碼來源:StreamProcessor.java

示例5: setUpProcess

@SuppressWarnings("unchecked")
public void setUpProcess() {
		Lang lang  = RDFLanguages.filenameToLang(datasetURI);

		if ((lang == Lang.NQ) || (lang == Lang.NQUADS)){
			this.iterator = new PipedRDFIterator<Quad>(rdfIterBufferSize, rdfIterFairBufferLock, rdfIterPollTimeout, rdfIterMaxPolls);
			this.rdfStream = new PipedQuadsStream((PipedRDFIterator<Quad>) iterator);
		} else {
			this.iterator = new PipedRDFIterator<Triple>(rdfIterBufferSize, rdfIterFairBufferLock, rdfIterPollTimeout, rdfIterMaxPolls);
			this.rdfStream = new PipedTriplesStream((PipedRDFIterator<Triple>) iterator);
		}
		logger.debug("PipedRDFIterator initialized with: Buffer Size {}, Fair Lock {}, Poll Timeout {}, Max Polls {}", 
				rdfIterBufferSize, rdfIterFairBufferLock, rdfIterPollTimeout, rdfIterMaxPolls);
		
		this.isInitalised = true;
		
		try {
			this.loadMetrics();
		} catch (ExternalMetricLoaderException e) {
			logger.error(e.getLocalizedMessage());
		}
		
		this.executor = Executors.newSingleThreadExecutor();
}
 
開發者ID:EIS-Bonn,項目名稱:Luzzu,代碼行數:24,代碼來源:StreamProcessor.java

示例6: setUpProcess

public void setUpProcess() {
		Lang lang  = RDFLanguages.filenameToLang(datasetURI);

		if ((lang == Lang.NQ) || (lang == Lang.NQUADS)){
		} else {
		}
		
		this.isInitalised = true;
		
//		try {
//			this.loadMetrics();
//		} catch (ExternalMetricLoaderException e) {
//			logger.error(e.getLocalizedMessage());
//		}
		
		this.executor = Executors.newSingleThreadExecutor();
	}
 
開發者ID:EIS-Bonn,項目名稱:Luzzu,代碼行數:17,代碼來源:SparkStreamProcessor.java

示例7: load

@Override
public void load(
		final SolrQueryRequest request, 
		final SolrQueryResponse response,
		final ContentStream stream, 
		final UpdateRequestProcessor processor) throws Exception {
	
	// Default ContentStream implementation starts reading the stream and
	// if it starts with '<' then it assumes a content type of "application/xml", 
	// if it starts with '{' then it assumes a content type of "application/json" 			
	// This behaviour is wrong is SolRDF and maybe we need a custom ContentStream here
	// At the moment this is just a workaround:
	final String contentType = stream.getContentType() != null 
			&& !"application/xml".equals(stream.getContentType())
			&& !"application/json".equals(stream.getContentType()) 
				? stream.getContentType() 
				: request.getParams().get(UpdateParams.ASSUME_CONTENT_TYPE);
	
	log.debug(MessageCatalog._00094_BULK_LOADER_CT, contentType);			
				
	final Lang lang = RDFLanguages.contentTypeToLang(contentType);
	if (lang == null) {
		final String message = MessageFactory.createMessage(MessageCatalog._00095_INVALID_CT, contentType);
		log.error(message);							
		throw new SolrException(ErrorCode.BAD_REQUEST, message);
	}
	
	final ContentStreamLoader delegate = 
			(lang == Lang.NQ || lang == Lang.NQUADS || lang == Lang.TRIG)
				? quadsLoader
				: triplesLoader;
	
	log.debug(MessageCatalog._00096_SELECTED_BULK_LOADER, contentType, delegate);
	
	delegate.load(
			request, 
			response, 
			new ContentStream() {	
				@Override
				public InputStream getStream() throws IOException {
					return stream.getStream();
				}
				
				@Override
				public String getSourceInfo() {
					return stream.getSourceInfo();
				}
				
				@Override
				public Long getSize() {
					return stream.getSize();
				}
				
				@Override
				public Reader getReader() throws IOException {
					return stream.getReader();
				}
				
				@Override
				public String getName() {
					return stream.getName();
				}
				
				@Override
				public String getContentType() {
					return contentType;
				}
			}, 
		processor);
}
 
開發者ID:spaziocodice,項目名稱:SolRDF,代碼行數:70,代碼來源:RdfBulkUpdateRequestHandler.java


注:本文中的org.apache.jena.riot.Lang.NQ屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。