org.eclipse.rdf4j.model.util.Models.toModel()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中org.eclipse.rdf4j.model.util.Models.toModel()方法的一些代码示例,展示了Models.toModel()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Models.toModel()方法的具体详情如下:
包路径:org.eclipse.rdf4j.model.util.Models
类名称:Models
方法名:toModel

Models.toModel介绍

暂无

代码示例

代码示例来源:origin: eclipse/rdf4j

/**
 * Compares two RDF models, and returns <tt>true</tt> if the first model is a subset of the second model,
 * using graph isomorphism to map statements between models.
 */
public static boolean isSubset(Iterable<? extends Statement> model1, Iterable<? extends Statement> model2)
{
  // Filter duplicates
  Model set1 = toModel(model1);
  Model set2 = toModel(model2);
  return isSubset(set1, set2);
}

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client

/**
 * Compares two RDF models, and returns <tt>true</tt> if the first model is a subset of the second model,
 * using graph isomorphism to map statements between models.
 */
public static boolean isSubset(Iterable<? extends Statement> model1, Iterable<? extends Statement> model2)
{
  // Filter duplicates
  Model set1 = toModel(model1);
  Model set2 = toModel(model2);
  return isSubset(set1, set2);
}

代码示例来源:origin: eclipse/rdf4j

/**
 * Compares two RDF models, and returns <tt>true</tt> if the first model is a subset of the second model,
 * using graph isomorphism to map statements between models.
 */
public static boolean isSubset(Set<? extends Statement> model1, Set<? extends Statement> model2) {
  // Compare the number of statements in both sets
  if (model1.size() > model2.size()) {
    return false;
  }
  return isSubsetInternal(toModel(model1), toModel(model2));
}

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client

/**
 * Compares two RDF models, and returns <tt>true</tt> if the first model is a subset of the second model,
 * using graph isomorphism to map statements between models.
 */
public static boolean isSubset(Set<? extends Statement> model1, Set<? extends Statement> model2) {
  // Compare the number of statements in both sets
  if (model1.size() > model2.size()) {
    return false;
  }
  return isSubsetInternal(toModel(model1), toModel(model2));
}

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client

/**
 * Compares two RDF models, and returns <tt>true</tt> if they consist of isomorphic graphs and the
 * isomorphic graph identifiers map 1:1 to each other. RDF graphs are isomorphic graphs if statements from
 * one graphs can be mapped 1:1 on to statements in the other graphs. In this mapping, blank nodes are not
 * considered mapped when having an identical internal id, but are mapped from one graph to the other by
 * looking at the statements in which the blank nodes occur.
 * A Model can consist of more than one graph (denoted by context identifiers). Two models are considered
 * isomorphic if for each of the graphs in one model, an isomorphic graph exists in the other model, and
 * the context identifiers of these graphs are either identical or (in the case of blank nodes) map 1:1 on
 * each other.
 *
 * @see <a href="http://www.w3.org/TR/rdf11-concepts/#graph-isomorphism">RDF Concepts &amp; Abstract
 * Syntax, section 3.6 (Graph Comparison)</a>
 */
public static boolean isomorphic(Iterable<? extends Statement> model1,
    Iterable<? extends Statement> model2)
{
  Model set1 = toModel(model1);
  Model set2 = toModel(model2);
  // Compare the number of statements in both sets
  if (set1.size() != set2.size()) {
    return false;
  }
  return isSubsetInternal(set1, set2);
}

代码示例来源:origin: eclipse/rdf4j

/**
 * Compares two RDF models, and returns <tt>true</tt> if they consist of isomorphic graphs and the
 * isomorphic graph identifiers map 1:1 to each other. RDF graphs are isomorphic graphs if statements from
 * one graphs can be mapped 1:1 on to statements in the other graphs. In this mapping, blank nodes are not
 * considered mapped when having an identical internal id, but are mapped from one graph to the other by
 * looking at the statements in which the blank nodes occur.
 * A Model can consist of more than one graph (denoted by context identifiers). Two models are considered
 * isomorphic if for each of the graphs in one model, an isomorphic graph exists in the other model, and
 * the context identifiers of these graphs are either identical or (in the case of blank nodes) map 1:1 on
 * each other.
 *
 * @see <a href="http://www.w3.org/TR/rdf11-concepts/#graph-isomorphism">RDF Concepts &amp; Abstract
 * Syntax, section 3.6 (Graph Comparison)</a>
 */
public static boolean isomorphic(Iterable<? extends Statement> model1,
    Iterable<? extends Statement> model2)
{
  Model set1 = toModel(model1);
  Model set2 = toModel(model2);
  // Compare the number of statements in both sets
  if (set1.size() != set2.size()) {
    return false;
  }
  return isSubsetInternal(set1, set2);
}

相关文章