本文整理了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
暂无
代码示例来源: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;
}
内容来源于网络,如有侵权,请联系作者删除!