ADO.NET Entity Provider or Custom Data Service Provider? RRS feed

  • Question

  • I'm working on a design for a system that will need to provide an entity layer on top of an RDF datasource.  The novel part about this problem is that the data does not follow a typical relational schema, instead is is ontology-based (RDF/OWL).

    It looks like there are two options for this layer.

    1. A Custom-built ADO.NET Entity Provider
    2. A Custom-built Data Service Provider

    The properties for the entities in this system will be quite dynamic.  As an example, a "Truck" entity might contain an "Engine" entity.  When you inspect the Engine entity on the Truck it might have additional properties that are not available when the engine is not contained by the Truck.  So in other words, the properties on the semantic entities could change depending on their context.  Does this rule out option #1?

    Wednesday, February 10, 2010 4:57 AM


  • Hi,

    If your entities are going to change dynamically then it rules out #1, since EF requires a static model.
    You could workaround that by adding properties which are not going to be used by all instances though, but that may not be appropriate for your scenario. The other approach might be that you use type inheritance, in which case all "Truck" entities have a reference to "Engine" entity which has all the common properties for all engines, and for example "Car" entity would also have a reference to the same "Engine". THen you could define "TruckEngine" entity which derives from "Engine" entity and adds the properties specific to engines in trucks. You model can then either specify that all Engines on a Truck are TruckEngines, or you could say that they may be normal Engines, but the particualr instances might be TruckEngines. All of this should work even with #1.
    #2 is more work, but it would allow you to be much more flexible and so on.

    Vitek Karas [MSFT]
    • Marked as answer by JayFunnell Thursday, April 1, 2010 6:44 PM
    Thursday, March 4, 2010 9:59 AM