use of org.vcell.sybil.rdf.nodestore.RDFValueSets in project vcell by virtualcell.
the class RDFEvaluator method getProperties.
public <T, T2> RDFObjectSets<T2> getProperties(T subject, RDFObjectPool<T> pool, URI property, RDFObjectPool<T2> pool2) {
RDFValueSets valueSets = getProperties(subject, pool, property);
Set<T2> objects = new HashSet<T2>();
Map<Resource, Set<Resource>> unsupported = new HashMap<Resource, Set<Resource>>();
for (Resource objectResource : valueSets.getResources()) {
Set<Resource> types = getProperties(objectResource, RDF.TYPE).getResources();
try {
T2 object2 = pool2.getOrCreateObject(objectResource, types);
objects.add(object2);
} catch (UnsupportedRDFTypeException e) {
unsupported.put(objectResource, types);
}
}
return new RDFObjectSets<T2>(valueSets, objects, unsupported);
}
use of org.vcell.sybil.rdf.nodestore.RDFValueSets in project vcell by virtualcell.
the class RDFEvaluator method getProperties.
public <T> RDFValueSets getProperties(T subject, RDFObjectPool<T> pool, URI property) {
Set<Value> objects = new HashSet<Value>();
Set<Resource> subjectResources = pool.getResources(subject);
for (Graph graph : graphs) {
for (Resource subjectResource : subjectResources) {
Iterator<Statement> stmtIter = graph.match(subjectResource, property, null);
while (stmtIter.hasNext()) {
objects.add(stmtIter.next().getObject());
}
}
}
return new RDFValueSets(objects);
}
Aggregations