Tabnine Logo
Models.isomorphic
Code IndexAdd Tabnine to your IDE (free)

How to use
isomorphic
method
in
org.openrdf.model.util.Models

Best Java code snippets using org.openrdf.model.util.Models.isomorphic (Showing top 12 results out of 315)

origin: org.openrdf.sesame/sesame-model

@Override
public boolean equals(Object o) {
  if (this == o) {
    return true;
  }
  if (o instanceof Model) {
    Model model = (Model)o;
    return Models.isomorphic(this, model);
  }
  return false;
}
origin: org.openrdf.sesame/sesame-model

/**
 * Compares two RDF models, defined by two statement collections, and returns
 * <tt>true</tt> if they are equal. Models are equal if they contain the same
 * set of statements. Blank node IDs are not relevant for model equality,
 * they are mapped from one model to the other by using the attached
 * properties.
 * 
 * @deprecated since 2.8.0. Use {@link Models#isomorphic(Iterable, Iterable)}
 *             instead.
 */
@Deprecated
public static boolean equals(Iterable<? extends Statement> model1, Iterable<? extends Statement> model2) {
  return isomorphic(model1, model2);
}
origin: org.openrdf.sesame/sesame-rio-testsuite

private void assertModel(Model expectedModel) {
  if(logger.isTraceEnabled()) {
    logger.trace("Expected: {}", expectedModel);
    logger.trace("Actual: {}", testStatements);
  }
  assertTrue("Did not find expected statements", Models.isomorphic(expectedModel, testStatements));
}
origin: org.openrdf.sesame/sesame-sparql-testsuite

private void compareGraphs(Iterable<? extends Statement> actual, Iterable<? extends Statement> expected)
  throws Exception
{
  if (!Models.isomorphic(expected, actual)) {
    StringBuilder message = new StringBuilder(128);
    message.append("\n============ ");
    message.append(getName());
    message.append(" =======================\n");
    message.append("Expected result: \n");
    for (Statement st : expected) {
      message.append(st.toString());
      message.append("\n");
    }
    message.append("=============");
    StringUtil.appendN('=', getName().length(), message);
    message.append("========================\n");
    message.append("Actual result: \n");
    for (Statement st : actual) {
      message.append(st.toString());
      message.append("\n");
    }
    message.append("=============");
    StringUtil.appendN('=', getName().length(), message);
    message.append("========================\n");
    logger.error(message.toString());
    fail(message.toString());
  }
}
origin: org.openrdf.sesame/sesame-query

/**
 * Compares two graph query results and returns {@code true} if they are
 * equal. Two graph query results are considered equal if they are isomorphic
 * graphs. Note that the method consumes both query results fully.
 * 
 * @param result1
 *        the first query result to compare
 * @param result2
 *        the second query result to compare.
 * @return {@code true} iff the supplied graph query results are isomorphic
 *         graphs, {@code false} otherwise.
 * @throws QueryEvaluationException
 * @see {@link Models#isomorphic(Iterable, Iterable)}
 */
public static boolean equals(GraphQueryResult result1, GraphQueryResult result2)
  throws QueryEvaluationException
{
  Set<? extends Statement> graph1 = Iterations.asSet(result1);
  Set<? extends Statement> graph2 = Iterations.asSet(result2);
  return Models.isomorphic(graph1, graph2);
}
origin: org.openrdf.sesame/sesame-model-testsuite

private void testFilesEqual(String file1, String file2)
  throws Exception
{
  Set<Statement> model1 = loadModel(file1);
  Set<Statement> model2 = loadModel(file2);
  // long startTime = System.currentTimeMillis();
  boolean modelsEqual = Models.isomorphic(model1, model2);
  // long endTime = System.currentTimeMillis();
  // System.out.println("Model equality checked in " + (endTime - startTime)
  // + "ms (" + file1 + ", " + file2
  // + ")");
  assertTrue(modelsEqual);
}
origin: org.openrdf.sesame/sesame-sparql-testsuite

protected final void compareGraphs(Set<Statement> queryResult, Set<Statement> expectedResult)
  throws Exception
  if (!Models.isomorphic(expectedResult, queryResult)) {
origin: org.openrdf.sesame/sesame-rio-testsuite

if (!Models.isomorphic(inputCollection, outputCollection)) {
  System.err.println("===models not equal===");
origin: org.openrdf.sesame/sesame-rio-testsuite

if (!Models.isomorphic(inputCollection, outputCollection)) {
  System.err.println("===models not equal===");
  System.err.println("Expected: " + outputCollection);
origin: org.openrdf.sesame/sesame-rio-testsuite

if (!Models.isomorphic(inputCollection, outputCollection)) {
  System.err.println("===models not equal===");
  System.err.println("Expected: " + outputCollection);
origin: org.openrdf.sesame/sesame-rio-testsuite

if (!Models.isomorphic(inputCollection, outputCollection)) {
  StringBuilder sb = new StringBuilder(1024);
  sb.append("models not equal\n");
origin: org.openrdf.sesame/sesame-serql-testsuite

if (!Models.isomorphic(actualStatements, expectedStatements)) {
org.openrdf.model.utilModelsisomorphic

Javadoc

Compares two RDF models, and returns true 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.

Popular methods of Models

  • objectLiteral
    Retrieves an object Literal value from the statements in the given model. If more than one possible
  • objectIRI
    Retrieves an object IRI value from the statements in the given model. If more than one possible IRI
  • objectResource
    Retrieves an object Resource value from the statements in the given model. If more than one possible
  • isSubset
    Compares two RDF models, and returns true if the first model is a subset of the second model, using
  • findMatchingStatements
  • isSubsetInternal
  • matchModels
  • object
    Retrieves an object Value from the statements in the given model. If more than one possible object v
  • predicate
    Retrieves a predicate from the statements in the given model. If more than one possible predicate va
  • statementsMatch
  • subject
    Retrieves a subject Resource from the statements in the given model. If more than one possible resou
  • subjectBNode
    Retrieves a subject BNode from the statements in the given model. If more than one possible blank no
  • subject,
  • subjectBNode,
  • subjectIRI,
  • toSet

Popular in Java

  • Reactive rest calls using spring rest template
  • getResourceAsStream (ClassLoader)
  • getExternalFilesDir (Context)
  • requestLocationUpdates (LocationManager)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now