com.hp.hpl.jena.rdf.model.Resource.isAnon()方法的使用及代码示例

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

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

Resource.isAnon介绍

暂无

代码示例

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

@Override
public boolean traverse(Resource r)
{
  return r.isAnon() ;
}

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

@Override
  public boolean accept(Resource r) {
    codeCoverage[4]++;
    if (r.isAnon())
      return false;
    Integer cnt = objectTable.get(r);
    if (cnt == null || cnt.intValue() <= 1)
      return false;
    return true;
  }
}, this.allInfiniteLeft());

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

/**
 * Local and/or anonymous resources.
 */
private boolean isGenuineAnon(Resource r) {
  if (!r.isAnon())
    return false;
  Integer v = objectTable.get(r);
  return v == null
      || ((!prettyWriter.sResourcePropertyElt) && v.intValue() <= 1 && (!haveReified
          .contains(r)));
}

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

/** Record a use of the given namespace in the count map */
private void countNamespace( Resource r, Map<String,Integer> nsCount ) {
  if (!r.isAnon()) {
    String ns = r.getNameSpace();
    // increment the count for this namespace
    Integer count = nsCount.containsKey( ns ) ? (Integer) nsCount.get( ns ) : new Integer( 0 );
    Integer count1 = new Integer( count.intValue() + 1 );
    nsCount.put( ns, count1 );
  }
}

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

private String getLocalName(Resource r) {
  if (r.isAnon()) {
    logger.error("Internal error - giving up - Unparser.getLocalName");
    throw new BrokenException("Internal error: getLocalName(bNode)");
  }
  String uri = r.getURI();
  int split = Util.splitNamespace(uri);
  return uri.substring(split);
}

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

private String getNameSpace(Resource r) {
  if (r.isAnon()) {
    logger.error("Internal error - Unparser.getNameSpace; giving up");
    throw new BrokenException("Internal error: getNameSpace(bNode)");
  }
  String uri = r.getURI();
  int split = Util.splitNamespace(uri);
  return uri.substring(0, split);
}

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

protected static void writeResource(Resource r, PrintWriter writer)
   {
  if (r.isAnon()) {
    writer.print(anonName(r.getId()));
  } else {
    writer.print("<");
    writeURIString(r.getURI(), writer);
    writer.print(">");
  }
}
static private boolean okURIChars[] = new boolean[128];

代码示例来源:origin: net.sourceforge.owlapi/pellet-pellint-ignazio1977

public void addAllStatementsWithExistingBNodesOnly(List<Statement> stmts) {
  for (Statement stmt : stmts) {
    Resource s = stmt.getSubject();
    if (s.isAnon() && !m_BNodes.contains(s)) continue;
    
    RDFNode o = stmt.getObject();
    if (o.isAnon() && !m_BNodes.contains(o)) continue;
    
    addStatement(stmt);
  }
}

代码示例来源:origin: epimorphics/elda

private List<Resource> findRoots() {
  List<Resource> roots = new ArrayList<Resource>();
  for (ResIterator i = model.listSubjects(); i.hasNext(); ) {
    Resource r = i.next();
    if (r.isAnon() && model.contains(null, null, r))
      continue;
    roots.add(r);
  }
  return roots;
}

代码示例来源:origin: com.github.ansell.pellet/pellet-pellint

public void addAllStatementsWithExistingBNodesOnly(List<Statement> stmts) {
  for (Statement stmt : stmts) {
    Resource s = stmt.getSubject();
    if (s.isAnon() && !m_BNodes.contains(s)) continue;
    
    RDFNode o = stmt.getObject();
    if (o.isAnon() && !m_BNodes.contains(o)) continue;
    
    addStatement(stmt);
  }
}

代码示例来源:origin: epimorphics/elda

private boolean inPlace( Trail t, Resource r ) {
  if (r.isAnon()) return false;
  if (t.hasSeen( r )) return true;
  if (r.listProperties().hasNext()) return false;
  return true;
}

代码示例来源:origin: com.marklogic/mlcp

private String resource(Resource rsrc) {
  if (rsrc.isAnon()) {
    return "http://marklogic.com/semantics/blank/" + Long.toHexString(
        fuse(scramble((long)rsrc.hashCode()),fuse(scramble(milliSecs),randomValue)));
  } else {
    return escapeXml(rsrc.toString());
  }
}

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

/**
   Answer a "nice" representation of <code>r</code>, suitable for appearance
   within an exception message.
*/
protected static String nice( Resource r )
  {
  String rString = r.asNode().toString( r.getModel() );
  return r.isAnon() ? rString + getLabels( r ) : rString; 
  }

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

protected void writeResourceReference( Resource r, PrintWriter writer )
   {
  if (r.isAnon()) {
    writer.print(rdfAt("nodeID") + "=" + attributeQuoted(anonId(r)));
  } else {
    writer.print(
      rdfAt("resource")
        + "="
        + substitutedAttribute(relativize(r.getURI())));
  }
}

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

protected void writeResourceId( Resource r, PrintWriter writer )
  {
  if (r.isAnon()) {
    writer.print(rdfAt("nodeID") + "=" + attributeQuoted(anonId(r)));
  } else {
    writer.print(
      rdfAt("about")
        + "="
        + substitutedAttribute(relativize(r.getURI())));
  }
}

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

private boolean wResourceAttr(Resource r) {
  if (r.isAnon())
    return false;
  print(" ");
  printRdfAt("resource");
  print("=");
  wURIreference(r);
  return true;
}

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

private static Resource otherModel(Resource r, Model model)
{
  if ( r.isURIResource() )
    return model.createResource(r.getURI()) ;
  if ( r.isAnon() )
    return model.createResource(r.getId()) ;
  // Literals do not need converting.
  return r ;
}

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

private static Resource otherModel(Resource r, Model model) {
    if (r.isURIResource())
      return model.createResource(r.getURI());
    if (r.isAnon())
      return model.createResource(r.getId());
    return r;
  }
}

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

private static Resource otherModel(Resource r, Model model)
{
  if ( r.isURIResource() )
    return model.createResource(r.getURI()) ;
  if ( r.isAnon() )
    return model.createResource(r.getId()) ;
  // Literals do not need converting.
  return r ;
}

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

private boolean wNodeIDAttr(Resource r) {
  if (!r.isAnon())
    return false;
  print(" ");
  printRdfAt("nodeID");
  print("=");
  print(q(prettyWriter.anonId(r)));
  return true;
}

相关文章