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


Java ResolvedStatement.getSourceGraphNames方法代码示例

本文整理汇总了Java中cz.cuni.mff.odcleanstore.conflictresolution.ResolvedStatement.getSourceGraphNames方法的典型用法代码示例。如果您正苦于以下问题:Java ResolvedStatement.getSourceGraphNames方法的具体用法?Java ResolvedStatement.getSourceGraphNames怎么用?Java ResolvedStatement.getSourceGraphNames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cz.cuni.mff.odcleanstore.conflictresolution.ResolvedStatement的用法示例。


在下文中一共展示了ResolvedStatement.getSourceGraphNames方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: matches

import cz.cuni.mff.odcleanstore.conflictresolution.ResolvedStatement; //导入方法依赖的package包/类
@Override
public boolean matches(Object actualValue) {
    if (actualValue == null) {
        return expectedSources == null;
    } else if (!(actualValue instanceof ResolvedStatement)) {
        return false;
    }

    ResolvedStatement actualResolvedStatement = (ResolvedStatement) actualValue;
    Collection<Resource> actualSources = actualResolvedStatement.getSourceGraphNames();
    HashSet<Resource> actualSourcesSet = new HashSet<>(actualSources);
    if (actualSources.size() != actualSourcesSet.size()) {
        return false; // sources are not unique
    }
    return actualSourcesSet.equals(expectedSources);
}
 
开发者ID:mifeet,项目名称:LD-FusionTool,代码行数:17,代码来源:ResolvedStatementMatchesSources.java

示例2: write

import cz.cuni.mff.odcleanstore.conflictresolution.ResolvedStatement; //导入方法依赖的package包/类
@Override
public void write(ResolvedStatement resolvedStatement) throws IOException {
    try {
        IRI statementContext = dataUnit.addNewDataGraph(dataGraphSymbolicName + DATA_GRAPH_NAME_INFIX + Long.toString(counter.incrementAndGet()));
        connection.add(resolvedStatement.getStatement(), statementContext);
        connection.add(statementContext, ODCS.QUALITY, valueFactory.createLiteral(resolvedStatement.getQuality()), metadataContext);
        for (Resource sourceGraph : resolvedStatement.getSourceGraphNames()) {
            connection.add(statementContext, ODCS.SOURCE_GRAPH, sourceGraph, metadataContext);
        }
    } catch (DataUnitException | RepositoryException e) {
        throw new IOException("Error writing to data unit", e);
    }
}
 
开发者ID:UnifiedViews,项目名称:Plugins,代码行数:14,代码来源:DataUnitRDFWriterWithMetadata.java

示例3: write

import cz.cuni.mff.odcleanstore.conflictresolution.ResolvedStatement; //导入方法依赖的package包/类
@Override
public void write(ResolvedStatement resolvedStatement) throws IOException {
    writeOpeningTr(writer, ++this.statementCounter);
    writer.write("<td>");
    writeNode(writer, resolvedStatement.getStatement().getSubject());
    writer.write("</td><td>");
    writeNode(writer, resolvedStatement.getStatement().getPredicate());
    writer.write("</td><td>");
    writeNode(writer, resolvedStatement.getStatement().getObject());
    writer.write("</td><td style=\"background-color:");
    double quality = resolvedStatement.getQuality();
    if (quality < MID_QUALITY) {
        writer.write("rgba(255,0,0," + (1 - quality / MID_QUALITY) + ")");
    } else {
        writer.write("rgba(0,255,0," + ((quality - MID_QUALITY) / (MAX_QUALITY - MID_QUALITY)) + ")");
    }
    writer.write(";\">");
    writer.write(String.format(Locale.ROOT, "%.5f", quality));
    writer.write("</td><td>");
    boolean first = true;
    for (Resource sourceURI : resolvedStatement.getSourceGraphNames()) {
        if (!first) {
            writer.write(", ");
        }
        first = false;
        writeAbsoluteLink(writer,  sourceURI.stringValue(), getPrefixedURI(sourceURI.stringValue()));
    }
    writer.write("</td></tr>\n");
}
 
开发者ID:mifeet,项目名称:LD-FusionTool,代码行数:30,代码来源:CloseableHtmlWriter.java

示例4: write

import cz.cuni.mff.odcleanstore.conflictresolution.ResolvedStatement; //导入方法依赖的package包/类
@Override
public void write(ResolvedStatement resolvedStatement) throws IOException {
    if (dataContext == null) {
        write(resolvedStatement.getStatement());
        if (metadataContext != null) {
            write(VALUE_FACTORY.createStatement(
                    resolvedStatement.getStatement().getContext(),
                    ODCS.QUALITY,
                    VALUE_FACTORY.createLiteral(resolvedStatement.getQuality()),
                    metadataContext));
            for (Resource sourceNamedGraph : resolvedStatement.getSourceGraphNames()) {
                write(VALUE_FACTORY.createStatement(
                        resolvedStatement.getStatement().getContext(),
                        ODCS.SOURCE_GRAPH,
                        sourceNamedGraph,
                        metadataContext));
            }
        }
    } else {
        Statement statement = resolvedStatement.getStatement();
        write(VALUE_FACTORY.createStatement(
                statement.getSubject(),
                statement.getPredicate(),
                statement.getObject(),
                dataContext));
    }
}
 
开发者ID:mifeet,项目名称:LD-FusionTool,代码行数:28,代码来源:SesameCloseableRDFWriterQuad.java

示例5: write

import cz.cuni.mff.odcleanstore.conflictresolution.ResolvedStatement; //导入方法依赖的package包/类
@Override
public void write(ResolvedStatement resolvedStatement) throws IOException {
    try {
        URI statementContext = dataUnit.addNewDataGraph(dataGraphSymbolicName + DATA_GRAPH_NAME_INFIX + Long.toString(counter.incrementAndGet()));
        connection.add(resolvedStatement.getStatement(), statementContext);
        connection.add(statementContext, ODCS.QUALITY, valueFactory.createLiteral(resolvedStatement.getQuality()), metadataContext);
        for (Resource sourceGraph : resolvedStatement.getSourceGraphNames()) {
            connection.add(statementContext, ODCS.SOURCE_GRAPH, sourceGraph, metadataContext);
        }
    } catch (DataUnitException | RepositoryException e) {
        throw new IOException("Error writing to data unit", e);
    }
}
 
开发者ID:mifeet,项目名称:FusionTool-DPU,代码行数:14,代码来源:DataUnitRDFWriterWithMetadata.java


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