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

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

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

Graph.delete介绍

[英]Delete the triple t (if possible) from the set belonging to this graph
[中]从属于此图的集合中删除三重t(如果可能)

代码示例

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

public boolean handledRemove(Triple triple)
{
  graph.delete(triple) ;
  return true ;
}

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

@Override
public void delete(Triple t) throws DeleteDeniedException
{
  graph.delete(t) ;
}

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

/**
 * <p>
 * Delete the given triple from the union model; the actual component model to
 * be updated will be the designated (or default) {@linkplain #getBaseGraph updateable} graph.
 * </p>
 *
 * @param t A triple to from the union graph
 * @exception JenaException if the union does not contain any sub-graphs yet
 */
@Override  public void performDelete( Triple t ) {
  getRequiredBaseGraph().delete( t );
}

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

/**
  Add a triple to the difference: add it to the left operand, and remove it from the 
  right operand.
*/
@Override public void performAdd( Triple t )
  {
  L.add( t );
  R.delete( t );
  }

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

@Override
public void delete(Quad quad)
{
  if (  isDefaultGraph(quad) )
    graph.delete(quad.asTriple()) ;
  else
    throw new UnsupportedOperationException("DatasetGraphOne.delete/named graph") ;
}

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

@Override
public void delete(Node g , Node s, Node p, Node o)
{
  if (  Quad.isDefaultGraph(g) )
    graph.delete(new Triple(s, p, o)) ;
  else
    throw new UnsupportedOperationException("DatasetGraphOne.delete/named graph") ;
}

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

@Override
public void delete(Quad quad)
{
  if (  isDefaultGraph(quad) )
    graph.delete(quad.asTriple()) ;
  else
    throw new UnsupportedOperationException("DatasetGraphOne.delete/named graph") ;
}

代码示例来源:origin: org.apache.clerezza/rdf.jena.storage

public boolean performRemove(Triple triple) {
  if (!contains(triple)) {
    return false;
  }
  jenaGraph.delete(tria2JenaUtil.convertTriple(triple));
  return true;
}

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

@Override
public void delete(Triple t)
{
  base.delete(t) ;
  getEventManager().notifyDeleteTriple(this, t) ;
}

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

/**
 * Remove the triple, ie, remove it from the adds, add it to the removals.
 */
@Override
public void performDelete(Triple t)
{
  L.delete(t) ;
  if (base.contains(t)) 
    R.add(t) ;
}

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

/** 
 * Removes the triple t (if possible) from the set belonging to this graph. 
 */   
@Override
public synchronized void performDelete(Triple t) {
  version++;
  engine.checkSafeToUpdate();
  fdata.getGraph().delete(t);
  this.setPreparedState(false);
}

代码示例来源:origin: Quetzal-RDF/quetzal

public void delete(Quad quad)
 {
 if (quad.getGraph().getURI().equalsIgnoreCase(Constants.DEFAULT_GRAPH_MONIKER))
   {
   defaultModel.getGraph().delete(quad.asTriple());
   }
 getGraph(quad.getGraph()).delete(quad.asTriple());
 }

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

@Override
public void delete(Quad quad)
{
  Graph g = fetchGraph(quad.getGraph()) ;
  g.delete(quad.asTriple()) ;
}

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

/** 
 * Removes the triple t (if possible) from the set belonging to this graph.
 */   
@Override
public synchronized void performDelete(Triple t) {
  fdata.getGraph().delete(t);
  if (this.isPrepared()) {
    transitiveEngine.delete(t);
  }
}
/**

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

@Override
public Model remove( Resource s, Property p, RDFNode o ) {
  graph.delete( Triple.create( s.asNode(), p.asNode(), o.asNode() ) );
  return this;
}

代码示例来源:origin: org.semweb4j/rdf2go.impl.jena

@Override
public void removeStatement(org.ontoware.rdf2go.model.node.Resource subject, URI predicate,
    org.ontoware.rdf2go.model.node.Node object) throws ModelRuntimeException {
  assertModel();
  
  log.debug("removing a statement (" + subject + "," + predicate + "," + object + ")");
  this.modificationCount++;
  this.jenaModel.getGraph().delete(
      new Triple(
      
      TypeConversion.toJenaNode(subject, this.jenaModel), TypeConversion.toJenaNode(
          predicate, this.jenaModel), TypeConversion.toJenaNode(object,
          this.jenaModel)));
}

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

public static void removeAll(Graph g, Node s, Node p, Node o) {
  ExtendedIterator<Triple> it = g.find(s, p, o);
  try {
    while (it.hasNext()) {
      Triple t = it.next();
      g.delete(t);
      it.remove();
    }
  } finally {
    it.close();
  }
}

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

public void remove(Node node, Triple triple)
{
  if ( node == null )
    node = Node.ANY ;
  
  //QueryIterator qIter = nodesReifTriple(node, triple) ;
  Set<Triple> triples = new HashSet<Triple>();
  triplesToZap(triples, node, rdfType, statement) ;
  triplesToZap(triples, node, subject, triple.getSubject()) ;
  triplesToZap(triples, node, predicate, triple.getPredicate()) ;
  triplesToZap(triples, node, object, triple.getObject()) ;
  for ( Triple t : triples )
    graph.delete(t) ;
}

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

public void clearGraph()
{ 
  if ( graph != null )
  {
    Iterator<Triple> iter = Iter.convert(graph.find(Node.ANY, Node.ANY, Node.ANY)) ;
    List<Triple> triples = Iter.toList(iter) ;
    
    for ( Triple t : triples )
      graph.delete(t) ;
  }
}

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

@Test(expected=ConcurrentModificationException.class)
public void mrswGraph3()
{
  Model m = create().getDefaultModel() ;
  Resource r = m.createResource("x") ;
  ExtendedIterator<Statement> iter1 = m.listStatements(r, null, (RDFNode)null) ;
  assertNotNull(iter1.next()) ;
  
  Triple t = SSE.parseTriple("(<y> <p> 99)") ;
  m.getGraph().delete(t) ;
  
  // Bad
  iter1.hasNext();
}

相关文章