Skip to content

Instantly share code, notes, and snippets.

<Property Name="Runtime" Type="Decimal" Nullable="true">
<ValueAnnotation Term="Sparql.Uri" String="http://dbpedia.org/property/runtime"/>
</Property>
<NavigationProperty Name="Director" Relationship="DBPedia.Film_Director" FromRole="Film" ToRole ="Director">
<ValueAnnotation Term="Sparql.Property" String="http://dbpedia.org/ontology/director"/>
</NavigationProperty>
<EntityType Name="Film">
<Key>
<PropertyRef Name="Id"/>
</Key>
<Property Name="Id" Type="Edm.String" Nullable="false">
<ValueAnnotation Term="Sparql.IdentifierPrefix"
String="http://dbpedia.org/resource/"/>
</Property>
</EntityType>
<?xml version="1.0" encoding="utf-8" ?>
<edmx:Edmx xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx" Version="3.0">
<edmx:DataServices xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" m:DataServiceVersion="2.0">
<Schema xmlns="http://schemas.microsoft.com/ado/2009/11/edm" Namespace="DBPedia">
<Using Namespace="ODataSparqlLib.Annotations" Alias="Sparql"/>
<EntityType Name="Film">
<Key>
<PropertyRef Name="Id"/>
</Key>
<Property Name="Id" Type="Edm.String" Nullable="false">
@gra-moore
gra-moore / GEDCOMImporterTest.cs
Created July 30, 2012 07:35
GEDCOM Importer Test
[TestMethod]
public void TestImporter()
{
var storeId = Guid.NewGuid().ToString();
GedcomImporter.Import(DataFolder + "simple.ged", "type=embedded;storesdirectory=c:\\brightstar;storename=" + storeId);
var ctx = new GedComContext("type=embedded;storesdirectory=c:\\brightstar;storename=" + storeId);
Assert.AreEqual(3, ctx.Individuals.Count());
Assert.AreEqual(1, ctx.Families.Count());
@gra-moore
gra-moore / GEDCOMImporter.cs
Created July 30, 2012 07:32
GEDCOM Importer from XML to BrightstarDB Model
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
namespace BrightstarDB.Gedcom
{
public class GedcomImporter
{
@gra-moore
gra-moore / GEDCOMInterfaces.cs
Created July 30, 2012 07:27
GEDCOM Interface definition
namespace BrightstarDB.Gedcom
{
[Entity]
public interface IFamily
{
IMarriageEvent MarriageEvent { get; set; }
IIndividual Husband { get; set; }
IIndividual Wife { get; set; }
ICollection<IIndividual> Children { get; set; }
}
@gra-moore
gra-moore / Simple.ged
Created July 30, 2012 07:04
Simple GEDCOM File
0 HEAD
1 CHAR ASCII
1 SOUR ID_OF_CREATING_FILE
1 GEDC
2 VERS 5.5
2 FORM Lineage-Linked
1 SUBM @SUBMITTER@
0 @SUBMITTER@ SUBM
1 NAME /Submitter/
1 ADDR Submitters address
@gra-moore
gra-moore / DynamicSystem.cs
Created July 19, 2012 08:30
DynamicSystem Implementation
public class DynamicObjectSystem : IDynamicObjectSystem
{
private readonly string _connectionString;
private readonly string _storeId;
private readonly DynamicStore _dynamicStore;
public const string UriPrefix = "http://www.brightstardb.com/dynamic/system/";
public DynamicObjectSystem(string connectionString, string storeId)
{
_connectionString = connectionString;
@gra-moore
gra-moore / IDynamicSystem.cs
Created July 19, 2012 08:18
dynamic system interface
interface IDynamicObjectSystem
{
/// <summary>
/// Returns an enumeration of all the 'types' defined in the dynamic system.
/// </summary>
IEnumerable<dynamic> Types { get; }
/// <summary>
/// Either creates a new dynamic object to represent the specified type or updates the instanceProperties
/// property of the existing type.