本文整理匯總了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();
}
}
示例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)));
}
}
示例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());
}
示例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();
}
示例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)));
}
}
示例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();
}
示例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();
}
示例8: nextInMemoryKeyValue
public boolean nextInMemoryKeyValue() throws IOException, InterruptedException {
if (lang == Lang.NQUADS || lang == Lang.TRIG) {
return nextInMemoryQuadKeyValue();
} else {
return nextInMemoryTripleKeyValue();
}
}
示例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;
}
示例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);
}