/// <summary> /// Gets all the Triples with a specific Subject and Predicate /// </summary> /// <param name="subj">Subject</param> /// <param name="pred">Predicate</param> /// <returns></returns> public override IEnumerable <Triple> WithSubjectPredicate(INode subj, INode pred) { if (this._source is SelectableSource) { EnumerationSink sink = new EnumerationSink(this._mapping); Statement stmt = new Statement(SemWebConverter.ToSemWebEntity(subj, this._mapping), SemWebConverter.ToSemWebEntity(pred, this._mapping), null); ((SelectableSource)this._source).Select(stmt, sink); return(sink); } else { return(base.WithSubjectPredicate(subj, pred)); } }
/// <summary> /// Gets all the Triples with a specific Object /// </summary> /// <param name="obj">Object</param> /// <returns></returns> public override IEnumerable <Triple> WithObject(INode obj) { if (this._source is SelectableSource) { EnumerationSink sink = new EnumerationSink(this._mapping); Statement stmt = new Statement(null, null, SemWebConverter.ToSemWeb(obj, this._mapping)); ((SelectableSource)this._source).Select(stmt, sink); return(sink); } else { return(base.WithObject(obj)); } }