本文整理汇总了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);
}
示例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);
}
}
示例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");
}
示例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));
}
}
示例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);
}
}