Codota Logo
Graph
Code IndexAdd Codota to your IDE (free)

How to use
Graph
in
com.hp.hpl.jena.graph

Best Java code snippets using com.hp.hpl.jena.graph.Graph (Showing top 20 results out of 315)

  • Common ways to obtain Graph
private void myMethod () {
Graph g =
  • Codota IconModel model;model.getGraph()
  • Codota IconFactory.createGraphMem()
  • Codota IconDatasetGraph datasetGraph;datasetGraph.getDefaultGraph()
  • Smart code suggestions by Codota
}
origin: com.hp.hpl.jena/arq

  public void send(Triple triple)
  {
    graph.add(triple) ;
  }
}
origin: org.fcrepo/fcrepo-kernel

/**
 * This method will return null until the source iterator is exhausted.
 *
 * @return The elements that turned out not to be common to the two inputs.
 */
public Iterator<Triple> notCommon() {
  return source.hasNext() ? null : notCommon.find(ANY, ANY, ANY);
}
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

/**
  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: org.apache.clerezza.ext/org.apache.jena.jena-arq

private void clearGraph(Graph graph) {
  if ( !graph.isEmpty() )
    graph.clear() ;
}
origin: com.hp.hpl.jena/tdb

static private void addAll(Graph srcGraph, Graph dstGraph)
{
  Iterator<Triple> triples = srcGraph.find(Node.ANY, Node.ANY, Node.ANY) ;
  for ( Triple t : Iter.iter(triples) )
    dstGraph.add(t) ;
}
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: openimaj/openimaj

@Override
public void write(Kryo kryo, Output output, Graph object) {
  output.writeInt(object.size());
  final Iterator<Triple> it = object.find(null, null, null);
  while (it.hasNext()) {
    final Triple next = it.next();
    kryo.writeClassAndObject(output, next);
  }
}
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 int size()
{
  return graph.size() ;
}
origin: com.hp.hpl.jena/arq

  public static boolean isContainer(Graph graph, Node container, Node containerType)
  {
//        if ( container.isLiteral() )
//            return false ;
    
    if ( containerType == null )
      return  isContainer(graph, container, BAG) ||
          isContainer(graph, container, ALT) ||
          isContainer(graph, container, SEQ) ;
    
    return graph.contains(container, RDFtype, containerType) ; 
  }
   
origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

@Override
public PrefixMapping getPrefixMapping()
{
  return graph.getPrefixMapping() ;
}
origin: org.apache.clerezza.ext/org.apache.jena.jena-core

@Override
public void close()
  {
  L.close();
  R.close();
  this.closed = true;
  }
  
origin: com.hp.hpl.jena/tdb

@Test public void load_dataset_01()
{
  DatasetGraphTDB dsg = TDBFactory.createDatasetGraph() ;
  TDBLoader.load(dsg, DIR+"data-1.nq", false) ;
  assertTrue(dsg.getDefaultGraph().isEmpty()) ;
  assertEquals(1, dsg.getGraph(g).size()) ;
}
origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

@Override
public boolean isEmpty()
{
  return graph.isEmpty() ;
}
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: org.openimaj.storm/core-storm

@Override
public void write(Kryo kryo, Output output, Graph object) {
  output.writeInt(object.size());
  final Iterator<Triple> it = object.find(null, null, null);
  while (it.hasNext()) {
    final Triple next = it.next();
    kryo.writeClassAndObject(output, next);
  }
}
origin: org.apache.clerezza.ext/org.apache.jena.jena-core

/**
  To remove a triple, remove it from <i>both</i> operands.
*/
@Override public void performDelete( Triple t )
  {
  L.delete( t );
  R.delete( t );
  }
origin: com.hp.hpl.jena/arq

ReorderStatsHandler(Graph graph, GraphStatisticsHandler stats)
{
  this.stats = stats ;
  N = graph.size() ;
  // Note: when these are too badly wrong, the app can supply a statistics file. 
  TERM_S = 10 ;       // Wild guess: "An average subject has 10 properties".
  TERM_P = N/10 ;     // Wild guess: "An average vocabulary has 10 properties"
  TERM_O = 20 ;       // Wild guess: "An average object is in 20 triples".
  TERM_TYPE = N/10 ;  // Wild guess: "An average class has 1/10 of the resources."
}
 
origin: org.apache.clerezza.ext/org.apache.jena.jena-core

  @Override
  public boolean doCheck( Node n, EnhGraph g ) {
    return g.asGraph().contains( n, RDF.type.asNode(), OWL.Ontology.asNode() );
  }
}
com.hp.hpl.jena.graphGraph

Javadoc

The interface to be satisfied by implementations maintaining collections of RDF triples. The core interface is small (add, delete, find, contains) and is augmented by additional classes to handle more complicated matters such as reification, query handling, bulk update, event management, and transaction handling.

For add(Triple) see GraphAdd.

Most used methods

  • add
    Add the triple t (if possible) to the set belonging to this graph
  • find
    Returns an iterator over all the Triples that match the triple pattern.
  • delete
    Delete the triple t (if possible) from the set belonging to this graph
  • size
    For a concrete graph this returns the number of triples in the graph. For graphs which might infer a
  • contains
    Answer true iff the graph contains a triple that t matches; t may be fluid.
  • close
    Free all resources, any further use of this Graph is an error.
  • getPrefixMapping
    returns this Graph's prefix mapping. Each call on a given Graph gets the same PrefixMapping object,
  • isEmpty
    Answer true iff this graph is empty. "Empty" means "has as few triples as it can manage", because an
  • getBulkUpdateHandler
    returns this Graph's bulk-update handler
  • getEventManager
    Answer this Graph's event manager.
  • getStatisticsHandler
    Answer this Graph's statistics handler, or null if there isn't one. Every call to this method on a p
  • isIsomorphicWith
    Compare this graph with another using the method described in http://www.w3.org/TR/rdf-concepts#sec
  • getStatisticsHandler,
  • isIsomorphicWith,
  • dependsOn,
  • getCapabilities,
  • getTransactionHandler,
  • isClosed,
  • remove,
  • clear,
  • getReifier,
  • queryHandler

Popular in Java

  • Making http requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • getSharedPreferences (Context)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Dictionary (java.util)
    The Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to valu
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • JFrame (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now