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


Java Lang.NQUADS屬性代碼示例

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


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

示例1: nextStreamingKeyValue

public boolean nextStreamingKeyValue() throws IOException, InterruptedException {
    if(rdfIter == null) return false;
    if (!rdfIter.hasNext() && collectionHash.size() == 0) {
        if(compressed) {
            hasNext = false;
            return false;
        } else {
            if (iterator!=null && iterator.hasNext()) {
                close();
                initStream(iterator.next());
            } else {
                hasNext = false;
                return false;
            }
        }
    }

    if (lang == Lang.NQUADS || lang == Lang.TRIG) {
        return nextStramingQuadKeyValue();
    } else {
        return nextStreamingTripleKeyValue();
    }
}
 
開發者ID:marklogic,項目名稱:marklogic-contentpump,代碼行數:23,代碼來源:RDFReader.java

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: nextInMemoryKeyValue

public boolean nextInMemoryKeyValue() throws IOException, InterruptedException {
    if (lang == Lang.NQUADS || lang == Lang.TRIG) {
        return nextInMemoryQuadKeyValue();
    } else {
        return nextInMemoryTripleKeyValue();
    }
}
 
開發者ID:marklogic,項目名稱:marklogic-contentpump,代碼行數:7,代碼來源:RDFReader.java

示例9: getLanguage

protected Lang getLanguage(String href) {
    String language = getOption(_language, (String) null);

    if (language == null && href != null) {
        String ext = null;
        if (href.contains(".")) {
            int pos = href.lastIndexOf(".");
            ext = href.substring(pos);
        }

        if (ext == null) {
            // nevermind
        } else if (".rdf".equals(ext)) {
            language = "rdf/xml";
        } else if (".ttl".equals(ext)) {
            language = "turtle";
        } else if (".json".equals(ext)) {
            language = "rdf/json";
        } else if (".n3".equals(ext)) {
            language = "n3";
        } else if (".nt".equals(ext)) {
            language = "ntriples";
        } else if (".nq".equals(ext)) {
            language = "nquads";
        } else if (".trig".equals(ext)) {
            language = "trig";
        }
    }

    Lang lang = null;
    if ("rdf/xml".equals(language)) {
        lang = Lang.RDFXML;
    } else if ("turtle".equals(language)) {
        lang = Lang.TURTLE;
    } else if ("rdf/json".equals(language)) {
        lang = Lang.RDFJSON;
    } else if ("n3".equals(language)) {
        lang = Lang.N3;
    } else if ("ntriples".equals(language)) {
        lang = Lang.NTRIPLES;
    } else if ("nquads".equals(language)) {
        lang = Lang.NQUADS;
    } else if ("trig".equals(language)) {
        lang = Lang.TRIG;
    }

    if (lang == null) {
        throw new XProcException("Could not deduce language for RDFLoad data: " + language);
    }

    return lang;
}
 
開發者ID:ndw,項目名稱:xmlcalabash1-rdf,代碼行數:52,代碼來源:RDFStep.java

示例10: 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.NQUADS屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。