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


Java LDFTConfigConstants类代码示例

本文整理汇总了Java中cz.cuni.mff.odcleanstore.fusiontool.config.LDFTConfigConstants的典型用法代码示例。如果您正苦于以下问题:Java LDFTConfigConstants类的具体用法?Java LDFTConfigConstants怎么用?Java LDFTConfigConstants使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


LDFTConfigConstants类属于cz.cuni.mff.odcleanstore.fusiontool.config包,在下文中一共展示了LDFTConfigConstants类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadFromConnection

import cz.cuni.mff.odcleanstore.fusiontool.config.LDFTConfigConstants; //导入依赖的package包/类
private long loadFromConnection(UriMappingIterableImpl uriMapping, RepositoryConnection connection)
        throws QueryEvaluationException, RepositoryException, MalformedQueryException {

    long loadedCount = 0;
    for (IRI link : sameAsLinkTypes) {
        String query = String.format("CONSTRUCT {?s <%1$s> ?o} WHERE {?s <%1$s> ?o}", link.stringValue());
        GraphQueryResult sameAsTriples = connection.prepareGraphQuery(QueryLanguage.SPARQL, query).evaluate();
        while (sameAsTriples.hasNext()) {
            uriMapping.addLink(sameAsTriples.next());
            loadedCount++;
            if (loadedCount % LDFTConfigConstants.LOG_LOOP_SIZE == 0) {
                LOG.info("... loaded {} sameAs links", loadedCount);
            }
        }
    }
    return loadedCount;
}
 
开发者ID:UnifiedViews,项目名称:Plugins,代码行数:18,代码来源:DataUnitSameAsLinkLoader.java

示例2: iteratesOverStatementsWhenParsingValidFile

import cz.cuni.mff.odcleanstore.fusiontool.config.LDFTConfigConstants; //导入依赖的package包/类
@Test
public void iteratesOverStatementsWhenParsingValidFile() throws Exception {
    // Arrange
    ArrayList<Statement> statements = new ArrayList<Statement>();
    statements.add(createHttpStatement("s1", "p1", "o1", "g1"));
    statements.add(createHttpStatement("s2", "p1", "o1", "g2"));
    statements.add(createHttpStatement("s3", "p1", "o3", "g1"));

    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    Rio.write(statements, outputStream, RDFFormat.NQUADS);
    outputStream.close();

    // Act
    Reader inputReader = new InputStreamReader(new ByteArrayInputStream(outputStream.toByteArray()));
    NQuadsParserIterator parserIterator = new NQuadsParserIterator(inputReader, LDFTConfigConstants.DEFAULT_FILE_PARSER_CONFIG);
    ArrayList<Statement> result = new ArrayList<Statement>();
    while (parserIterator.hasNext()) {
        result.add(parserIterator.next());
    }

    // Assert
    assertThat(result.size(), equalTo(statements.size()));
    for (int i = 0; i < result.size(); i++) {
        assertThat(result.get(i), contextAwareStatementIsEqual(statements.get(i)));
    }
}
 
开发者ID:mifeet,项目名称:LD-FusionTool,代码行数:27,代码来源:NQuadsParserIteratorTest.java

示例3: throwsExceptionOnSyntacticError

import cz.cuni.mff.odcleanstore.fusiontool.config.LDFTConfigConstants; //导入依赖的package包/类
@Test(expected = Exception.class)
public void throwsExceptionOnSyntacticError() throws Exception {
    // Arrange
    ArrayList<Statement> statements = new ArrayList<Statement>();
    statements.add(createHttpStatement("s1", "p1", "o1", "g1"));

    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    Rio.write(statements, outputStream, RDFFormat.NQUADS);
    outputStream.write(";".getBytes());
    outputStream.close();

    // Act
    Reader inputReader = new InputStreamReader(new ByteArrayInputStream(outputStream.toByteArray()));
    NQuadsParserIterator parserIterator = new NQuadsParserIterator(inputReader, LDFTConfigConstants.DEFAULT_FILE_PARSER_CONFIG);
    while (parserIterator.hasNext()) {
        parserIterator.next();
    }
}
 
开发者ID:mifeet,项目名称:LD-FusionTool,代码行数:19,代码来源:NQuadsParserIteratorTest.java

示例4: loadFromConnection

import cz.cuni.mff.odcleanstore.fusiontool.config.LDFTConfigConstants; //导入依赖的package包/类
private long loadFromConnection(UriMappingIterableImpl uriMapping, RepositoryConnection connection)
        throws QueryEvaluationException, RepositoryException, MalformedQueryException {

    long loadedCount = 0;
    for (URI link : sameAsLinkTypes) {
        String query = String.format("CONSTRUCT {?s <%1$s> ?o} WHERE {?s <%1$s> ?o}", link.stringValue());
        GraphQueryResult sameAsTriples = connection.prepareGraphQuery(QueryLanguage.SPARQL, query).evaluate();
        while (sameAsTriples.hasNext()) {
            uriMapping.addLink(sameAsTriples.next());
            loadedCount++;
            if (loadedCount % LDFTConfigConstants.LOG_LOOP_SIZE == 0) {
                LOG.info("... loaded {} sameAs links", loadedCount);
            }
        }
    }
    return loadedCount;
}
 
开发者ID:mifeet,项目名称:FusionTool-DPU,代码行数:18,代码来源:DataUnitSameAsLinkLoader.java

示例5: AllTriplesRepositoryLoader

import cz.cuni.mff.odcleanstore.fusiontool.config.LDFTConfigConstants; //导入依赖的package包/类
/**
 * Creates a new instance.
 * @param dataSource an initialized data source
 */
public AllTriplesRepositoryLoader(DataSource dataSource) {
    super(dataSource);
    this.dataSource = dataSource;
    OutputParamReader paramReader = new OutputParamReader(dataSource);
    this.defaultContext = computeDefaultContext(paramReader);
    this.maxSparqlResultsSize = paramReader.getIntValue(
            ConfigParameters.DATA_SOURCE_SPARQL_RESULT_MAX_ROWS,
            LDFTConfigConstants.DEFAULT_SPARQL_RESULT_MAX_ROWS);
}
 
开发者ID:mifeet,项目名称:LD-FusionTool,代码行数:14,代码来源:AllTriplesRepositoryLoader.java

示例6: handleStatement

import cz.cuni.mff.odcleanstore.fusiontool.config.LDFTConfigConstants; //导入依赖的package包/类
@Override
public void handleStatement(Statement statement) throws RDFHandlerException {
    Statement mappedStatement = fillDefaultContext(statement);
    rdfHandler.handleStatement(mappedStatement);

    statementCounter++;
    if (statementCounter % LDFTConfigConstants.LOG_LOOP_SIZE == 0) {
        LOG.debug("... written {} quads to temporary location", statementCounter);
    }
}
 
开发者ID:mifeet,项目名称:LD-FusionTool,代码行数:11,代码来源:ExternalSortingInputLoaderPreprocessor.java

示例7: handleStatement

import cz.cuni.mff.odcleanstore.fusiontool.config.LDFTConfigConstants; //导入依赖的package包/类
@Override
public void handleStatement(Statement statement) throws RDFHandlerException {
    // Ignore sameAs links between everything but URI resources; see owl:sameAs syntax
    // at http://www.w3.org/TR/2004/REC-owl-semantics-20040210/syntax.html
    if (sameAsLinkTypes.contains(statement.getPredicate())
            && statement.getObject() instanceof URI
            && statement.getSubject() instanceof URI) {
        uriMapping.addLink(statement.getSubject().stringValue(), statement.getObject().stringValue());
        loadedCount++;

        if (loadedCount % LDFTConfigConstants.LOG_LOOP_SIZE == 0) {
            LOG.info("... loaded {} sameAs links from {}", loadedCount, paramReader.getLabel());
        }
    }
}
 
开发者ID:mifeet,项目名称:LD-FusionTool,代码行数:16,代码来源:SameAsLinkFileLoader.java

示例8: iteratesOverStatementsWhenCommentIsInTheMiddle

import cz.cuni.mff.odcleanstore.fusiontool.config.LDFTConfigConstants; //导入依赖的package包/类
@Test
public void iteratesOverStatementsWhenCommentIsInTheMiddle() throws Exception {
    // Arrange
    Statement statement1 = createHttpStatement("s1", "p1", "o1", "g1");
    Statement statement2 = createHttpStatement("s2", "p1", "o1", "g2");
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    RDFWriter writer = Rio.createWriter(RDFFormat.NQUADS, outputStream);
    writer.startRDF();
    writer.handleStatement(statement1);
    writer.handleComment("comment");
    writer.handleStatement(statement2);
    writer.endRDF();
    outputStream.close();

    // Act
    Reader inputReader = new InputStreamReader(new ByteArrayInputStream(outputStream.toByteArray()));
    NQuadsParserIterator parserIterator = new NQuadsParserIterator(inputReader, LDFTConfigConstants.DEFAULT_FILE_PARSER_CONFIG);
    ArrayList<Statement> result = new ArrayList<Statement>();
    while (parserIterator.hasNext()) {
        result.add(parserIterator.next());
    }

    // Assert
    assertThat(result.size(), equalTo(2));
    assertThat(result.get(0), contextAwareStatementIsEqual(statement1));
    assertThat(result.get(1), contextAwareStatementIsEqual(statement2));
}
 
开发者ID:mifeet,项目名称:LD-FusionTool,代码行数:28,代码来源:NQuadsParserIteratorTest.java

示例9: closesInputStreamWhenClosed

import cz.cuni.mff.odcleanstore.fusiontool.config.LDFTConfigConstants; //导入依赖的package包/类
@Test
public void closesInputStreamWhenClosed() throws Exception {
    // Arrange
    Reader inputReader = mock(Reader.class);

    // Act
    NQuadsParserIterator parserIterator = new NQuadsParserIterator(inputReader, LDFTConfigConstants.DEFAULT_FILE_PARSER_CONFIG);
    parserIterator.close();

    // Assert
    verify(inputReader).close();
}
 
开发者ID:mifeet,项目名称:LD-FusionTool,代码行数:13,代码来源:NQuadsParserIteratorTest.java


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