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

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

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

Resource.asResource介绍

暂无

代码示例

代码示例来源:origin: AskNowQA/AutoSPARQL

static Set<Resource> subjects(Model model,Property p, RDFNode r)
{
  Set<Resource> subjects = new HashSet<>();
  ResIterator it = model.listSubjectsWithProperty(p, r);
  while(it.hasNext()) subjects.add(it.next().asResource());
  it.close();
  return subjects;
}

代码示例来源:origin: culturecommunication/ginco

while (iter.hasNext()) {
  Statement s = iter.next();
  skosRessources.add(s.getSubject().asResource());

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

/**
  Answer this view after modifying it to contain all the property
  chains defined by <code>spec</code>.
*/
public View addViewFromRDFList(Resource spec, ShortnameService sns) {
  cannotUpdateALL();
  if (spec.canAs(RDFList.class)) {
    List<ViewProperty> properties = new ArrayList<>();
    Iterator<RDFNode> list = spec.as(RDFList.class).iterator();
    while(list.hasNext()) {
      properties.add(new ViewProperty.Base(list.next().as(Property.class)));
    }
    chains.add( new PropertyChain( properties ) );
  } else {
    String uri = spec.asResource().getURI();
    Property prop = ResourceFactory.createProperty(uri);
    ViewProperty vp = new ViewProperty.Base(prop);
    chains.add(new PropertyChain(vp));
  }
  if (chains.size() > 0) type = Type.T_CHAINS;
  return this;
}

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

model.createTypedLiteral(from, NodeFactory.getType(from)));
blank.addProperty(Constants.DEFACTO_TO, model.createTypedLiteral(to, NodeFactory.getType(to)));
blank.addProperty(model.createProperty(blankProperty), objectRes.asResource());
   model.createLiteral(entry.getValue(), entry.getKey()));
subjectRes.addProperty(model.createProperty(subjectProperty), blank.asResource());

代码示例来源:origin: culturecommunication/ginco

/**
 * Gets the thesaurus resource from the model, returning the first one only
 * 
 * @param model
 * @return
 */
private Resource getSKOSThesaurus(Model model) {
  SimpleSelector schemeSelector = new SimpleSelector(null, null,
      (RDFNode) null) {
    public boolean selects(Statement s) {
      if (s.getObject().isResource()) {
        return s.getObject().asResource()
            .equals(SKOS.CONCEPTSCHEME);
      } else {
        return false;
      }
    }
  };
  StmtIterator iter = model.listStatements(schemeSelector);
  Resource thesaurusSKOS = null;
  if (iter.hasNext()) {
    Statement s = iter.next();
    thesaurusSKOS = s.getSubject().asResource();
  }
  return thesaurusSKOS;
}

代码示例来源:origin: culturecommunication/ginco

Statement orgStms = iter.next();
Resource organizationRes = orgStms.getSubject()
    .asResource();
Statement foafName = organizationRes.getProperty(FOAF.name);
Statement foafHomepage = organizationRes

相关文章