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

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

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

ResIterator.toSet介绍

暂无

代码示例

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

/**
  Answer a Set of the objects in the full expansion of the assembler
  specification <code>model</code> which have rdf:type <code>type</code>,
  which <i>must</i> be a subtype of <code>ja:Object</code>.
*/
public static Set<Resource> findAssemblerRoots( Model model, Resource type )
  { return fullModel( model ).listResourcesWithProperty( RDF.type, type ).toSet(); }

代码示例来源:origin: net.sf.taverna.t2.activities/sadi-activity

public void setContents(String contentsAsString) {
  if (contentsAsString.startsWith("<rdf:RDF")) {
    Model model = ModelFactory.createDefaultModel();
    model.read(new StringReader(contentsAsString), null);
    Set<Resource> subjects = model.listSubjects().toSet();
    Set<RDFNode> objects = model.listObjects().toSet();
    subjects.removeAll(objects);
    node = subjects.iterator().next();
  } else {
    node = RdfUtils.createTypedLiteral(contentsAsString);
  }
}

代码示例来源:origin: net.sf.taverna.t2.activities/sadi-activity

public static RDFNode convert(InputStream stream) {
  Model model = ModelFactory.createDefaultModel().read(stream, null);
  Set<Resource> subjects = model.listSubjects().toSet();
  Set<RDFNode> objects = model.listObjects().toSet();
  subjects.removeAll(objects);
  return subjects.iterator().next();
}

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

public Set<Resource> runLicenceQuery(String licenceQuery) {
  Source dataSource = spec.getAPISpec().getDataSource();
  final Set<Resource> licences = new HashSet<Resource>();
  if (licenceQuery != null) {
    Model cons = dataSource.executeConstruct(QueryFactory.create(licenceQuery));
    licences.addAll(cons.listSubjects().toSet());
  }
  return licences;
}

代码示例来源:origin: org.eagle-i/eagle-i-datatools-catalyst

private List<EIInstance> create(final Model model) {
  if ( model == null ) {
    return Collections.emptyList();
  }
  final List<EIInstance> instances = new ArrayList<EIInstance>();
  final Set<Resource> subjects = model.listSubjects().toSet();
  // create an EIInstance per subject
  for (final Resource r : subjects) {
    final Model subModel = model.query( new SimpleSelector( r, null, (RDFNode)null ) );
    final EIInstance ei = jenaIntanceFactory.create( EIURI.create( r.getURI() ), subModel );
    if ( ei != null && !EIInstance.NULL_INSTANCE.equals( ei ) ) {
      instances.add( ei );
    }
  }
  return instances;
}

相关文章