Skip to content

Instantly share code, notes, and snippets.

@promontis
Created May 25, 2012 10:18
Show Gist options
  • Save promontis/2787147 to your computer and use it in GitHub Desktop.
Save promontis/2787147 to your computer and use it in GitHub Desktop.
return sparqlResultSet
.GroupBy(r => r.Value("Mid"))
.Select(r => new SchemaType
{
Mid = ((UriNode) r.Key).WithoutNamespace(),
Keys = r.Where(k => k.HasValue("Key")).Select(k => ((UriNode)k.Value("Key")).WithoutNamespace()).Distinct().ToList(),
Name = r.Where(k => k.HasValue("Name")).Select(n => ((LiteralNode)n.Value("Name")).Value).Distinct().SingleOrDefault(),
Type = r.Where(k => k.HasValue("Type")).Select(t => ((UriNode)t.Value("Type")).WithoutNamespace()).Distinct().SingleOrDefault()
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment