Ecore Model Reflection in RDF

585 views

Published on

Persist Ecore models to RDF, or use Active Objects and Reflection to hold active object state in RDF. These slides were presented as a lightning talk at Code Generation 2013 <http: />.

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
585
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Resources have (absolute) URIs or may be anonymous.Literals (represented by rectangles) may be untyped, use XSD datatypes, or may use custom datatypes (e.g. for enumerated types).
  • Resource-Orientationrecasts the code-centric notion of object-orientation to an inter-linked network of web-resources.It is an architectural style for developing software in the form of resources with RESTful interfaces.
  • In genmodel, set Root Extends Class, and FeatureDelegation to ‘Reflective’.
  • SPARQL,pronounced &quot;sparkle&quot;, is a recursive acronym for SPARQL Protocol and RDF Query Language.The result is returned programmatically as a relation, or as JSON via the web.
  • @stevebattlestevebattle.meblog.stevebattle.me
  • Ecore Model Reflection in RDF

    1. 1. Model Reflection in RDF Steve Battle @stevebattle
    2. 2. Introduction • Based at the Bristol and Bath Science Park. • Aerospace and Advanced Manufacturing. • Model Driven Architecture and Development. Successes : • DSL based service configuration • Model Driven Architecture Evaluation • Model Driven 3D Printing • Linked Data and Ontology
    3. 3. Purchase-Order MetaModel Sharing of models between applications is hard: • Code dependency. • Wrong level of modularization for Services. • Alternative Views.
    4. 4. Resource Description RDF : Resource Description Framework <www.w3.org/RDF> • URIs name resources • Share data not objects • Self-describing (schema-less)
    5. 5. Resource vs. Object Orientation public interface PurchaseOrder extends EObject { String getShipTo(); void setShipTo(String value); String getBillTo(); void setBillTo(String value); EList<Item> getItems(); } External view • Model reflection in RDF • Shared ontology in OWL • Loose coupling • Resource Orientation Internal view • System model • Code Generation • Object Orientation Model Driven • Ecore Meta-Model • Architecture Evaluation
    6. 6. Persistence and Reflection • Ecore Persistence framework – ResourceSet supplies the base URI e.g. http://example.com/po.rdf – RDF Resource defines a hash URI e.g. http://example.com/po.rdf#/0 http://example.com/po.rdf#/0/@items.0 – Benefit : Exchange objects by URI reference • Active Objects and Reflection – RDF EStore holds active object state in RDF model – Generated classes use reflective methods eGet(),eSet(), … – Generated implementations extend custom EStoreEObjectImpl – Benefit : Lazy object construction resolves URIs on demand
    7. 7. SPARQL Query • Query across models (aspect orientation?) • Expose models as linked-data PREFIX po: <http://example.com/#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT * WHERE { ?po a po:PurchaseOrder ; po:PurchaseOrder_billTo ?bill ; po:PurchaseOrder_items [ rdfs:member ?item ] . ?item a po:Item ; po:Item_quantity ?qty ; po:Item_price ?price . OPTIONAL { ?item po:Item_productName ?product } }
    8. 8. Summary • Comments, ideas, applications? steve.battle@sysemia.co.uk Bristol & Bath Science Park, Dirac Crescent, Emerson's Green, Bristol.

    ×