Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Query projection

Efimster edited this page Apr 2, 2014 · 4 revisions

Query projection can be dynamic or static (typed). Dynamic projection is used by default.

Sample of static (typed) projection:

  public class Book
  {
    public string Title { get; set; }
    public decimal Price { get; set; }
  }
  DynamicSPARQL dyno = DynamicSPARQL.CreateDyno(QueringFunc);
  Book book = dyno.Select<Book>(
		prefixes: new[] { 
			SPARQL.Prefix("dc", "http://purl.org/dc/elements/1.1/"),
			SPARQL.Prefix("ns", "http://example.org/ns#"),
		},
		projection: "?title ?price",//could be omitted
		where: SPARQL.Group(
			SPARQL.Triple("?x ns:price ?price"),
			SPARQL.Triple("?x dc:title ?title")
		),
		orderBy: "desc(?price)"
	)
	.First();

Clone this wiki locally