subjects method

Set<URIRef> subjects(
  1. URIRef pre,
  2. dynamic obj
)

Finds all subjects which have a certain predicate and object.

Implementation

Set<URIRef> subjects(URIRef pre, dynamic obj) {
  Set<URIRef> subs = {};
  for (Triple t in triples) {
    if (t.pre == pre && t.obj == obj) {
      subs.add(t.sub);
    }
  }
  return subs;
}