本文整理匯總了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)));
}
}
示例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());
}
示例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();
}
示例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)));
}
}
示例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();
}
示例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();
}
示例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);
}