zazuko / xrm

A friendly language for mappings to RDF
MIT License
1 stars 0 forks source link

xpath support #16

Open mchlrch opened 5 years ago

mchlrch commented 5 years ago

Goal: A standalone CLI tool that reads out XML paths, generates the appropriate EMF object model for a LogicalSource and then serializes into DSL text.

xrm-cli -extract-sources -xml foobar.xml > foobar-sources.xrm

mchlrch commented 4 years ago

Here's one approach for implementing this functionality:

  1. Inspect XML to get inventory of paths, include the path inventory in XmlLogicalSource (build AST and serialize DSL file). I haven't done much with XPath so far, so I don't know, if the paths will be Sprachzonen/Sprachzone[attribute::Sprache='DE']/Synonym[attribute::Nr='1']/Definition[./Typ='ab']/Text or only Sprachzonen/Sprachzone/Synonym/Definition/Text

  2. Implement proposal provider for Referenceable.value. Create proposals based on the path inventory.

  3. Add validation rule that checks Referenceable.value to be valid XPath

mchlrch commented 4 years ago
  1. Implement proposal provider for Referenceable.value. Create proposals based on the path inventory.

It makes sense to first play with the proposal provider and check if that approach is workable, before implementing the other parts