com.hp.hpl.jena.graph.Triple.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(139)

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

Triple.<init>介绍

暂无

代码示例

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

/** Get as a triple - useful because quads often come in blocks for the same graph */  
public Triple asTriple()
{ 
  return new Triple(subject, predicate, object) ;
}

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

@Override void addSuccessors( Node base, TransitiveGraphCache tgc, ArrayList<Triple> result )
  {
  for (Iterator<GraphNode> j = components.iterator(); j.hasNext(); ) 
    {
    result.add( new Triple(base, tgc.closedPredicate, j.next().rdfNode) );
    }
  }

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

/** Return as a triple when the path is a simple, 1-link, else return null */ 
public Triple asTriple()
{ 
  if ( triple != null )
    return triple ;
  
  if ( path instanceof P_Link )
    triple = new Triple(subject, ((P_Link)path).getNode(), object) ;
  return triple ;
}

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

public TriplePath(Node s, Path path, Node o)
{
  this.subject = s ;
  this.object = o ;
  if ( path instanceof P_Link )
  {
    this.predicate = ((P_Link)path).getNode() ;
    triple = new Triple(subject, this.predicate , o) ;
  } else
    this.predicate = null ;
  this.path = path ;
}

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

/** Return as a triple when the path is a simple, 1-link, else return null */ 
public Triple asTriple()
{ 
  if ( triple != null )
    return triple ;
  
  if ( path instanceof P_Link )
    triple = new Triple(subject, ((P_Link)path).getNode(), object) ;
  return triple ;
}

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

@Override
public void visit(P_Link pathNode)
{
  Op op = new OpTriple(new Triple(subject, pathNode.getNode(), object)) ;
  result = op  ;
}

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

@Override
public void add(Node g , Node s, Node p, Node o)
{
  if (  Quad.isDefaultGraph(g) )
    graph.add(new Triple(s, p, o)) ;
  else
    throw new UnsupportedOperationException("DatasetGraphOne.add/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-core

final public void Object(Node s, Node p) throws ParseException {
               Node o ;
 o = GraphNode();
 Triple t = new Triple(s,p,o) ;
 emitTriple(token.beginLine, token.beginColumn, t) ;
}

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

protected void insert(TripleCollector acc, Node s, Node p, Path path, Node o)
{
  if ( p == null )
    acc.addTriplePath(new TriplePath(s, path, o)) ;
  else
    acc.addTriple(new Triple(s, p, o)) ;
}

代码示例来源:origin: openimaj/openimaj

@Override
public Triple read(Kryo kryo, Input input, Class<Triple> type) {
  final Node s = (Node) kryo.readClassAndObject(input);
  final Node p = (Node) kryo.readClassAndObject(input);
  final Node o = (Node) kryo.readClassAndObject(input);
  return new Triple(s, p, o);
}

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

protected void insert(TripleCollectorMark acc, int index, Node s, Node p, Path path, Node o)
{
  if ( p == null )
    acc.addTriplePath(index, new TriplePath(s, path, o)) ;
  else
    acc.addTriple(index, new Triple(s, p, o)) ;
}

代码示例来源:origin: org.openimaj.storm/core-storm

@Override
public Triple read(Kryo kryo, Input input, Class<Triple> type) {
  final Node s = (Node) kryo.readClassAndObject(input);
  final Node p = (Node) kryo.readClassAndObject(input);
  final Node o = (Node) kryo.readClassAndObject(input);
  return new Triple(s, p, o);
}

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

/**
 * Return the final instantiated goal given the current binding state.
 */
public Triple getResult() {
  return new Triple(
        LPInterpreter.deref(argVars[0]),
        LPInterpreter.deref(argVars[1]), 
        LPInterpreter.derefPossFunctor(argVars[2]));
}

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

@Override public Triple next()
{ 
  Binding b = iter.nextBinding();
  Node S = b.get(varS) ;
  Node P = b.get(varP) ;
  Node O = b.get(varO) ;
  return new Triple(S,P,O) ;
}
@Override public void close() { iter.close() ; }

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

private static Triple _buildNode3(ItemList list)
{
  Node s = BuilderNode.buildNode(list.get(0)) ;
  Node p = BuilderNode.buildNode(list.get(1)) ;
  Node o = BuilderNode.buildNode(list.get(2)) ;
  return new Triple(s, p, o) ; 
}

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

private static void contains(TripleTable table, Node s, Node p, Node o)
{
  Iterator<Triple> iter = table.find(s, p, o) ;
  assertNotNull(iter) ;
  assertTrue(iter.hasNext()) ;
  assertEquals(new Triple(s, p, o), iter.next()) ;
  assertFalse(iter.hasNext()) ;
}

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

@Test public void add1()
{ 
  TripleTable table = createTripleTableMem() ;
  table.add(new Triple(n1,n2,n3)) ;
}

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

public void visit(OpPropFunc opPropFunc)
{
  Node s = processPropFuncArg(opPropFunc.getSubjectArgs()) ;
  Node o = processPropFuncArg(opPropFunc.getObjectArgs()) ;
  Triple t = new Triple(s, opPropFunc.getProperty(), o) ;
  currentGroup().addElement(process(t)) ;
}

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

@Override
public void visit(OpPropFunc opPropFunc)
{
  Node s = processPropFuncArg(opPropFunc.getSubjectArgs()) ;
  Node o = processPropFuncArg(opPropFunc.getObjectArgs()) ;
  Triple t = new Triple(s, opPropFunc.getProperty(), o) ;
  currentGroup().addElement(process(t)) ;
}

相关文章