solutions for semantic web (OWL ontologies, SPARQL, reasoning) and model driven development (metamodel, model design, model transformation, code generation)

OWL Annotations for textual Ecore Metamodels

| Tuesday, August 17, 2010
Using the TwoUse Toolkit, it is possible to easily annotate text-based Ecore metamodels by (Ecore-based) textual annotations. The editor provides syntax highlighting for annotations which are based on OWL 2 Web Ontology Language in Manchester Syntax. The Ecore metamodels together with its annotations are transformed by the OWLizer into a pure OWL 2 Ontology (representing the input for reasoning tools). Figure 1 gives a screenshot of the editor which is implemented as an Eclipse plugin based on EMF Text.




In general we have extended a metamodeling language (Ecore) by constructs provided by OWL. Thus we have a much more expressiveness language to develop Ecore-based metamodels which continuously can be used in the MDD process (e.g. to define the abstract syntax of a modeling language or for code generation) and in addition are "ready" for ontology technologies.

The extended grammar for Ecore metamodels and the extended annotations is given in the following:
EPackage =
{EAnnotation} "package" name
[EDataType]
["\"" name "\""] "{" {EClass} {EPackage} "}" ;

EClass =
["abstract"] ("interface" | "class")
["" EClass {"," EClass} ">"] name
["\"" name "\""]
["extends" EClass {"," EClass}]
{classAnnotation} "{" {EClass | EOperation} "}";

EParameter =
{EAnnotation}
{("ordered" | "unique")} EClass name
["(" integer ".." integer ")"] ;

EReference =
{ ("containment" | "derived" | "transient" | "volatile" | "unique" |
"ordered" | "unsettable" | "changeable" | "resolveProxies") }
{frontReferenceAnnotation}
"reference" (EClass | EGenericType) name
["=" "\"" name "\""]
["(" integer ".." integer ")"]
["opposite" EReference] {endReferenceAnnotation} ";" ;

EOperation =
{EAnnotation}
{("ordered" | "unique")} "operation" ("void" | EClass)
["(" integer ".." integer ")"]
["" ETypeParameter {"," ETypeParameter} ">"] name "(" [EParameter {"," EParameter}] ")"
["throws" EClass {"," EClass}] ";" ;

EEnumLiteral = {EAnnotation} EDataType ":" name "=" "\"" EEnumLiteral "\"" ";" ;
EAnnotation = "[" {
"eAnnotations" ":" EAnnotation |
"source" ":" "\"" name "\"" |
"details" ":" "\"" name "\"" "=" "\"" name "\"" |
"contents" ":" EObject |
"references" ":" EReference |
"eModelElement" ":" EObject } "]";
EObject = "EObject";
EDataType = {EAnnotation} ["serializable"] "datatype" name "\"" name "\"";
ETypeParameter = {EAnnotation} name ;
EGenericType =
"typed" ["" (ETypeParameter | "?" "extends" EGenericType | "?" "super" EGenericType) ">"]
EClass ["" (EGenericType | "?" ) {"," (EGenericType | "?")} ">"] ;



frontReferenceAnnotation = "(" (
"functional" |
"inversefunctional" |
"symmetric" |
"asymmetric" |
"reflexive" |
"irreflexive" |
"transitive"
) ")";

endReferenceAnnotation = "(" (
"equivalentTo" OPE |
"subPropertyOf" OPE |
"domain" CE |
"range" CE |
"disjointWith" OPE |
"inverseOf" name |
"subPropertyChain" OPE "o" OPE {"o" OPE}
) ")";

classAnnotation = "(" (
("equivalentTo" | "disjointWith") CE {CE} |
"subClassOf" CE |
"disjointUnionOf" CE CE {CE}
) ")";

CE = "(" (
["not"] name |
"not" CE |
CE "and" CE { "and" CE } |
CE "or" CE {"or" CE} |
OPE ("some" | "only") CE |
OPE "Self" |
OPE ("min" | "max" | "exactly") "cardinality" nonnegativeinteger CE
) ")" ;

OPE = name | "(" "inverse" name ")" ;

digit = "0"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9";
nonnulldigit = "1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9";
integer = ["-"] nonnulldigit {digit} | "0";
nonnegativeinteger = "0" | nonnulldigit {digit};
name = ( letter | "_" ) { letter | digit | "_" } ;
letter = "a".."z" | "A".."Z" ;

0 comments:

Post a Comment