Beispiel #1
0
 /// <summary>
 /// Selects all Triples which meet the criteria of an ISelector from all the Query Triples
 /// </summary>
 /// <param name="selector">A Selector on Triples</param>
 /// <returns></returns>
 public IEnumerable <Triple> GetTriples(ISelector <Triple> selector)
 {
     return(from g in this._graphs
            from t in g.Triples
            where selector.Accepts(t)
            select t);
 }
Beispiel #2
0
 /// <summary>
 /// Selects all Nodes that meet the criteria of a given ISelector from all the Query Triples
 /// </summary>
 /// <param name="selector">A Selector on Nodes</param>
 /// <returns></returns>
 public IEnumerable <INode> GetNodes(ISelector <INode> selector)
 {
     return(from g in this._graphs
            from n in g.Nodes
            where selector.Accepts(n)
            select n);
 }
Beispiel #3
0
 /// <summary>
 /// Selects all Triples where the Subject meets the criteria of an ISelector from all Graphs in the Triple Store
 /// </summary>
 /// <param name="selector">A Selector on Nodes</param>
 /// <returns></returns>
 public IEnumerable <Triple> GetTriplesWithSubject(ISelector <INode> selector)
 {
     return(from g in this._graphs
            from t in g.Triples
            where selector.Accepts(t.Subject)
            select t);
 }
Beispiel #4
0
        public override bool TriplesExist(ISelector <Triple> selector)
        {
            IEnumerable <Triple> ts = from t in this._triples
                                      where selector.Accepts(t)
                                      select t;

            return(ts.Any());
        }
Beispiel #5
0
        public override IEnumerable <INode> GetNodes(ISelector <INode> selector)
        {
            IEnumerable <INode> ns = from n in this._nodes
                                     where selector.Accepts(n)
                                     select n;

            return(ns);
        }
Beispiel #6
0
        public override IEnumerable <Triple> GetTriplesWithObject(ISelector <INode> selector)
        {
            IEnumerable <Triple> ts = from t in this._triples
                                      where selector.Accepts(t.Object)
                                      select t;

            return(ts);
        }
Beispiel #7
0
        /// <summary>
        /// Internal Helper method for applying a Selector to a subset of the Triples in the Triple Store
        /// </summary>
        /// <param name="triples">Subset of Triples</param>
        /// <param name="selector">Selector Class to perform the Selection</param>
        /// <returns></returns>
        private IEnumerable <Triple> GetTriples(IEnumerable <Triple> triples, ISelector <Triple> selector)
        {
            IEnumerable <Triple> ts = from t in triples
                                      where selector.Accepts(t)
                                      select t;

            return(ts);
        }
Beispiel #8
0
        /// <summary>
        /// Selects all Triples where the Subject meets the criteria of an ISelector from a Subset of Graphs in the Triple Store
        /// </summary>
        /// <param name="graphUris">List of the Graph URIs of Graphs you want to select over</param>
        /// <param name="selector">A Selector on Nodes</param>
        /// <returns></returns>
        public IEnumerable <Triple> GetTriplesWithSubject(List <Uri> graphUris, ISelector <INode> selector)
        {
            IEnumerable <Triple> ts = from g in this._graphs
                                      where graphUris.Contains(g.BaseUri)
                                      from t in g.Triples
                                      where selector.Accepts(t.Subject)
                                      select t;

            return(ts);
        }
Beispiel #9
0
        /// <summary>
        /// Selects all Nodes that meet the criteria of a given ISelector from a Subset of Graphs in the Triple Store
        /// </summary>
        /// <param name="selector">A Selector on Nodes</param>
        /// <param name="graphUris">List of the Graph URIs of Graphs you want to select over</param>
        /// <returns></returns>
        public IEnumerable <INode> GetNodes(List <Uri> graphUris, ISelector <INode> selector)
        {
            IEnumerable <INode> ns = from g in this._graphs
                                     where graphUris.Contains(g.BaseUri)
                                     from n in g.Nodes
                                     where selector.Accepts(n)
                                     select n;

            return(ns);
        }
Beispiel #10
0
 /// <summary>
 /// Selects all Nodes that meet the criteria of a given ISelector from all the Query Triples
 /// </summary>
 /// <param name="selector">A Selector on Nodes</param>
 /// <returns></returns>
 public IEnumerable<INode> GetNodes(ISelector<INode> selector)
 {
     return (from g in this._graphs
             from n in g.Nodes
             where selector.Accepts(n)
             select n);           
 }
Beispiel #11
0
        /// <summary>
        /// Selects all Triples where the Subject meets the criteria of an ISelector from a Subset of Graphs in the Triple Store
        /// </summary>
        /// <param name="graphUris">List of the Graph URIs of Graphs you want to select over</param>
        /// <param name="selector">A Selector on Nodes</param>
        /// <returns></returns>
        public IEnumerable<Triple> GetTriplesWithSubject(List<Uri> graphUris, ISelector<INode> selector)
        {
            IEnumerable<Triple> ts = from g in this._graphs
                                     where graphUris.Contains(g.BaseUri)
                                     from t in g.Triples
                                     where selector.Accepts(t.Subject)
                                     select t;

            return ts;
        }
Beispiel #12
0
        /// <summary>
        /// Selects all Nodes that meet the criteria of a given ISelector from a Subset of Graphs in the Triple Store
        /// </summary>
        /// <param name="selector">A Selector on Nodes</param>
        /// <param name="graphUris">List of the Graph URIs of Graphs you want to select over</param>
        /// <returns></returns>
        public IEnumerable<INode> GetNodes(List<Uri> graphUris, ISelector<INode> selector)
        {
            IEnumerable<INode> ns = from g in this._graphs
                                    where graphUris.Contains(g.BaseUri)
                                    from n in g.Nodes
                                    where selector.Accepts(n)
                                    select n;

            return ns;
        }
Beispiel #13
0
 /// <summary>
 /// Selects all Triples where the Subject meets the criteria of an ISelector from all Graphs in the Triple Store
 /// </summary>
 /// <param name="selector">A Selector on Nodes</param>
 /// <returns></returns>
 public IEnumerable<Triple> GetTriplesWithSubject(ISelector<INode> selector)
 {
     return (from g in this._graphs
             from t in g.Triples
             where selector.Accepts(t.Subject)
             select t);
 }
Beispiel #14
0
 /// <summary>
 /// Selects all Triples which meet the criteria of an ISelector from all the Query Triples
 /// </summary>
 /// <param name="selector">A Selector on Triples</param>
 /// <returns></returns>
 public IEnumerable<Triple> GetTriples(ISelector<Triple> selector)
 {
     return (from g in this._graphs
             from t in g.Triples
             where selector.Accepts(t)
             select t);
 }
Beispiel #15
0
        /// <summary>
        /// Internal Helper method for applying a Selector to a subset of the Triples in the Triple Store
        /// </summary>
        /// <param name="triples">Subset of Triples</param>
        /// <param name="selector">Selector Class to perform the Selection</param>
        /// <returns></returns>
        private IEnumerable<Triple> GetTriples(IEnumerable<Triple> triples, ISelector<Triple> selector)
        {
            IEnumerable<Triple> ts = from t in triples
                                     where selector.Accepts(t)
                                     select t;

            return ts;
        }
Beispiel #16
0
        /// <summary>
        /// Gets all the Nodes according to some arbitrary criteria as embodied in a Selector
        /// </summary>
        /// <param name="selector">Selector class which performs the Selection</param>
        /// <returns>Zero/More Nodes</returns>
        public override IEnumerable<INode> GetNodes(ISelector<INode> selector)
        {
            IEnumerable<INode> ns = from n in this._nodes
                                    where selector.Accepts(n)
                                    select n;

            return ns;
        }
Beispiel #17
0
        /// <summary>
        /// Gets all the Triples with an Object matching some arbitrary criteria as embodied in a Selector
        /// </summary>
        /// <param name="selector">Selector class which performs the Selection</param>
        /// <returns>Zero/More Triples</returns>
        public override IEnumerable<Triple> GetTriplesWithObject(ISelector<INode> selector)
        {
            IEnumerable<Triple> ts = from t in this._triples
                                     where selector.Accepts(t.Object)
                                     select t;

            return ts;
        }
Beispiel #18
0
 /// <summary>
 /// Checks whether any Triples Exist which match a given Selector
 /// </summary>
 /// <param name="selector">Selector Class which performs the Selection</param>
 /// <returns></returns>
 public override bool TriplesExist(ISelector<Triple> selector)
 {
     IEnumerable<Triple> ts = from t in this._triples
                              where selector.Accepts(t)
                              select t;
     return ts.Any();
 }