-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RUBY: Merge pull request #10 from rioug/fix-product-types-parsing
Improve SKOS Concept parsing to allow use of intermediate SKOS Concept.
- Loading branch information
Showing
10 changed files
with
297 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
src/org/datafoodconsortium/connector/codegen/ruby/classifier.mtl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
[comment encoding = UTF-8 /] | ||
[module classifier('http://www.eclipse.org/uml2/5.0.0/UML')] | ||
|
||
[import org::datafoodconsortium::connector::codegen::queries /] | ||
[import org::datafoodconsortium::connector::codegen::ruby::common /] | ||
|
||
[template public generateImports(classifier: Classifier)] | ||
[for (ei: ElementImport | classifier.elementImport->sortedBy(i: ElementImport | i.importedElement.name)) separator('\n')][if (ei.importedElement.oclIsTypeOf(Class))][generateImport(ei)/][/if][/for] | ||
[if (classifier.oclIsTypeOf(Class))]require "virtual_assembly/semantizer"[/if] | ||
[if (classifier.isSKOSConceptClass())]require 'datafoodconsortium/connector/skos_helper'[/if] | ||
[/template] | ||
|
||
[template public generateImport(ei: ElementImport)]require "datafoodconsortium/connector/[generateFileName(ei.importedElement.name) /]"[/template] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...dconsortium/connector/codegen/ruby/static/lib/datafoodconsortium/connector/skos_helper.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
module DataFoodConsortium::Connector::SKOSHelper | ||
def addAttribute(name, value) | ||
self.instance_variable_set("@#{name}", value) | ||
self.define_singleton_method(name) do | ||
instance_variable_get("@#{name}") | ||
end | ||
end | ||
|
||
def hasAttribute(name) | ||
self.methods.include?(:"#{name}") | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.