org.apache.jena.graph.Triple.getPredicate()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(115)

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

Triple.getPredicate介绍

暂无

代码示例

代码示例来源:origin: apache/tinkerpop

static GraphTraversal<?, ?> transform(final Triple triple) {
  final GraphTraversal<Vertex, ?> matchTraversal = __.as(triple.getSubject().getName());
  
  final Node predicate = triple.getPredicate();
  final String uri = predicate.getURI();
  final String uriValue = Prefixes.getURIValue(uri);
  final String prefix = Prefixes.getPrefix(uri);
  switch (prefix) {
    case "edge":
      return matchTraversal.out(uriValue).as(triple.getObject().getName());
    case "property":
      return matchProperty(matchTraversal, uriValue, PropertyType.PROPERTY, triple.getObject());
    case "value":
      return matchProperty(matchTraversal, uriValue, PropertyType.VALUE, triple.getObject());
    default:
      throw new IllegalStateException(String.format("Unexpected predicate: %s", predicate));
  }
}

代码示例来源:origin: apache/jena

@Override
  protected Node[] createNodes(Triple tuple) {
    return new Node[] { tuple.getSubject(), tuple.getPredicate(), tuple.getObject() };
  }
}

代码示例来源:origin: apache/jena

private static Node[] row(Triple triple)
{
  Node[] nodes = new Node[3] ;
  nodes[0] = triple.getSubject() ;
  nodes[1] = triple.getPredicate() ;
  nodes[2] = triple.getObject() ;
  return nodes ;
}

代码示例来源:origin: apache/jena

public PatternTriple(Triple triple)
{
  this(triple.getSubject(),
     triple.getPredicate(),
     triple.getObject()) ;
}

代码示例来源:origin: apache/jena

/*package*/ static boolean matches(Triple t, Node s, Node p, Node o) {
  if ( s != null && ! Objects.equals(s, t.getSubject()) )
    return false ;
  if ( p != null && ! Objects.equals(p, t.getPredicate()) )
    return false ;
  if ( o != null && ! Objects.equals(o, t.getObject()) )
    return false ;
  return true ;
}

代码示例来源:origin: apache/jena

@Override
public void triple(Triple triple)
{
  Node s = triple.getSubject() ;
  Node p = triple.getPredicate() ;
  Node o = triple.getObject() ;
  process(Quad.tripleInQuad,s,p,o);
}

代码示例来源:origin: apache/jena

/**
 * Return true if the triple is already in either the graph or the stack.
 * I.e. it has already been deduced.
 */
@Override
public boolean contains(Triple t) {
  // Can't use stackCache.contains because that does not do semantic equality
  return contains(t.getSubject(), t.getPredicate(), t.getObject());
}

代码示例来源:origin: apache/jena

@Override public void triple(Triple triple) 
{
  dsg.add(Quad.defaultGraphNodeGenerated, triple.getSubject(), triple.getPredicate(), triple.getObject()) ;
  //throw new IllegalStateException("Triple passed to dataset parsing") ;
}

代码示例来源:origin: apache/jena

/** Add a quad (as graph node and triple) - return true if it was added, false if it already existed */
public boolean add(Node gn, Triple triple ) 
{ 
  return add(gn, triple.getSubject(), triple.getPredicate(), triple.getObject()) ;
}

代码示例来源:origin: apache/jena

@Override
public void triple(Triple triple) {
  Node s = triple.getSubject() ;
  Node p = triple.getPredicate() ;
  Node o = triple.getObject() ;
  process(Quad.tripleInQuad, s, p, o) ;
}

代码示例来源:origin: apache/jena

/**
 * @see org.apache.jena.reasoner.rulesys.RuleContext#contains(org.apache.jena.graph.Triple)
 */
@Override
public boolean contains(Triple t) {
  return contains(t.getSubject(), t.getPredicate(), t.getObject());
}

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

/**
 * @see org.apache.jena.reasoner.rulesys.RuleContext#contains(org.apache.jena.graph.Triple)
 */
@Override
public boolean contains(Triple t) {
  return contains(t.getSubject(), t.getPredicate(), t.getObject());
}

代码示例来源:origin: apache/jena

@Override
public void triple(Triple triple) {
  triplesLoader.load(triple.getSubject(), triple.getPredicate(), triple.getObject());
  countTriples++;
}

代码示例来源:origin: apache/jena

/** Delete a triple  - return true if it was deleted, false if it didn't exist */
public boolean delete( Triple triple ) 
{ 
  return delete(triple.getSubject(), triple.getPredicate(), triple.getObject()) ;
}

代码示例来源:origin: apache/jena

private static List<Tuple<Node>> tuplesTriples(Iterator<Triple> iter) {
  List<Tuple<Node>> tuples = new ArrayList<>() ;
  for ( ; iter.hasNext() ; ) {
    Triple t = iter.next() ;
    Tuple<Node> tuple = tuple(t.getSubject(), t.getPredicate(), t.getObject()) ;
    tuples.add(tuple) ;
  }
  return tuples ;
}

代码示例来源:origin: apache/jena

/** Delete a quad (as graph node and triple) - return true if it was deleted, false if it didn't exist */
public boolean delete( Node gn, Triple triple ) 
{ 
  return delete(gn, triple.getSubject(), triple.getPredicate(), triple.getObject()) ;
}

代码示例来源:origin: apache/jena

@Override
protected Node[] getNodes(TripleWritable tuple) {
  Triple t = tuple.get();
  return new Node[] { t.getSubject(), t.getPredicate(), t.getObject() };
}

代码示例来源:origin: apache/jena

/**
 * Add a quad (as graph node and triple) - return true if it was added,
 * false if it already existed
 */
public void add(Node gn, Triple triple) {
  add(gn, triple.getSubject(), triple.getPredicate(), triple.getObject()) ;
}

代码示例来源:origin: apache/jena

/**
 * Delete a quad (as graph node and triple) - return true if it was deleted,
 * false if it didn't exist
 */
public void delete(Node gn, Triple triple) {
  delete(gn, triple.getSubject(), triple.getPredicate(), triple.getObject()) ;
}

代码示例来源:origin: apache/jena

/**
 * Return true if the triple is already in either the graph or the stack.
 * I.e. it has already been deduced.
 */
@Override
public boolean contains(Triple t) {
  // Can't use stackCache.contains because that does not do semantic equality
  return contains(t.getSubject(), t.getPredicate(), t.getObject());
}

相关文章