Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.
Efimster edited this page Mar 24, 2014 · 1 revision

And expression is an alias of Match expression and can be used in different ways

  • with separated subject, predicate and object

And(string s, string p, dynamic o)

  • with shared subject of previous Match

And(string p, dynamic o)

query.Match("?x ns:price ?price").And(p:"dc:title", o:"?title")

And(dynamic o)

query.Match("?x ns:price ?price").And("dc:title ?title")
  • with shared subject and predicate of previous Match

And(dynamic o)

query.Match("?x ns:name Alice").And("Bob")
  • For static projection any triple part can be defined by lambda expression

And(Expression<Func<T, dynamic>> s, string p, dynamic o)
And(string s, Expression<Func<T, dynamic>> p, dynamic o)
And(string s, string p, Expression<Func<T, dynamic>> o)
And(Expression<Func<T, dynamic>> s, Expression<Func<T, dynamic>> p, dynamic o)
And(Expression<Func<T, dynamic>> s, string p, Expression<Func<T, dynamic>> o)
And(string s, Expression<Func<T, dynamic>> p, Expression<Func<T, dynamic>> o)
And(Expression<Func<T, dynamic>> s, Expression<Func<T, dynamic>> p, Expression<Func<T, dynamic>> o)
And(Expression<Func<T, dynamic>> p, dynamic o)
And(Expression<Func<T, dynamic>> p, Expression<Func<T, dynamic>> o)
And(source, string p, Expression<Func<T, dynamic>> o)

public class Person
{
     public string Name { get; set; }
     public string MBox { get; set; }
     public int Rating { get; set; }
}
var list = query.Match(s: "?x", p: "foaf:name", o: o => o.Name)
                .Optional(s: "?x", p: "foaf:mbox", o: o => o.MBox)
                    .And(p: "foaf:rating", o: o => o.Rating)
                .End()
                .Prefix("foaf:", "http://xmlns.com/foaf/0.1/")
                .AsEnumerable()
                .ToList();

Clone this wiki locally