com.hp.hpl.jena.graph.Graph.isIsomorphicWith()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(160)

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

Graph.isIsomorphicWith介绍

[英]Compare this graph with another using the method described in http://www.w3.org/TR/rdf-concepts#section-Graph-syntax
[中]使用http://www.w3.org/TR/rdf-concepts#section-Graph-syntax中描述的方法将此图与另一个图进行比较

代码示例

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-core

/**
 * Answer true if the given enhanced graph contains the same nodes and 
 * edges as this graph.  The default implementation delegates this to the
 * underlying graph objects.
 * 
 * @param eg A graph to test
 * @return True if eg is a graph with the same structure as this.
 */
final public boolean isIsomorphicWith(EnhGraph eg){
  return graph.isIsomorphicWith(eg.graph);
}

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

@Override
public boolean isIsomorphicWith(Graph g)
{
  return graph.isIsomorphicWith(g) ;
}

代码示例来源:origin: org.appdapter/org.appdapter.lib.remote

@Override public boolean isIsomorphicWith(Graph arg0) {
  return g.isIsomorphicWith(arg0);
}

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-core

@Override
public boolean isIsomorphicWith( Graph g )
{ return base.isIsomorphicWith( g ); }

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-core

/**
Answer whether or not these two graphs are isomorphic, taking the
hidden (reification) statements into account.
  */
 @Override
 public boolean isIsomorphicWith( Model m )
 {
   Graph L = this.getGraph();  
   Graph R = m.getGraph();
   return L.isIsomorphicWith( R );
 }

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

/**
 * Return true if the datasets are isomorphic - same names for graphs, graphs isomorphic. 
 */
public static boolean isomorphic(DatasetGraph dataset1, DatasetGraph dataset2)
{
  long x1 = dataset1.size() ;
  long x2 = dataset2.size() ;
  if ( x1 >=0 && x1 != x2 )
    return false ;
  
  boolean b = dataset1.getDefaultGraph().isIsomorphicWith(dataset2.getDefaultGraph()) ;
  if ( ! b )
    return b ;
  
  for ( Iterator<Node> iter1 = dataset1.listGraphNodes() ; iter1.hasNext() ; )
  {
    Node gn = iter1.next() ;
    Graph g1 = dataset1.getGraph(gn) ;
    Graph g2 = dataset2.getGraph(gn) ;
    if ( g2 == null )
      return false ;
    if ( ! g1.isIsomorphicWith(g2) )
      return false ;
  }
  
  return true ;
}

代码示例来源:origin: com.hp.hpl.jena/arq

/**
 * Return true if the datasets are isomorphic - same names for graphs, graphs isomorphic. 
 */
public static boolean isomorphic(DatasetGraph dataset1, DatasetGraph dataset2)
{
  long x1 = dataset1.size() ;
  long x2 = dataset2.size() ;
  if ( x1 >=0 && x1 != x2 )
    return false ;
  
  boolean b = dataset1.getDefaultGraph().isIsomorphicWith(dataset2.getDefaultGraph()) ;
  if ( ! b )
    return b ;
  
  for ( Iterator<Node> iter1 = dataset1.listGraphNodes() ; iter1.hasNext() ; )
  {
    Node gn = iter1.next() ;
    Graph g1 = dataset1.getGraph(gn) ;
    Graph g2 = dataset2.getGraph(gn) ;
    if ( g2 == null )
      return false ;
    if ( ! g1.isIsomorphicWith(g2) )
      return false ;
  }
  
  return true ;
}

相关文章