Przeglądaj źródła

updated template

rakshit 2 lat temu
rodzic
commit
c032677d67

+ 89 - 9
be.uantwerpen.msdl.vafl.docgen/src/be/uantwerpen/msdl/vafl/docgen/main/generate.mtl

@@ -29,13 +29,96 @@
 The vocabulary bundle is composed of the following sub-vocabulary bundles:
 
 [for (anExtension: VocabularyBundleExtension | topBundle.ownedImports->filter(oml::VocabularyBundleExtension))]
-[let aVocabularyBundle : VocabularyBundle = getAllVocabularyBundles(topBundle)->select(p|p.namespace.matches(anExtension.namespace))->asOrderedSet()->first()]
-\section{[aVocabularyBundle.ownedAnnotations->select(p|p.property.name.toString().matches('title'))->first()/] [if (aVocabularyBundle.ownedAnnotations->exists(p|p.property.name.toString().matches('deprecated')))](DEPRECATED)[/if]}
-\label{sec:[aVocabularyBundle.ownedAnnotations->select(p|p.property.name.toString().matches('label'))->first()/]}
+[let aVocabularyBundle : VocabularyBundle = getAllVocabularyBundles(topBundle)->select(p|p.namespace.matches(anExtension.namespace))->any(true)]
+\section{[annotationValue(getTitleAnnotation(aVocabularyBundle))/][isDeprecated(aVocabularyBundle)/]}
+\label{sec:[annotationValue(getLabelAnnotation(aVocabularyBundle))/]}
 
 [generateBoxAnnotations(aVocabularyBundle)/]
 
 The vocabulary bundle is composed of the following vocabularies:
+
+[for (anInclusion: VocabularyBundleInclusion | aVocabularyBundle.ownedImports->filter(oml::VocabularyBundleInclusion))]
+[let aVocabulary : Vocabulary = getAllVocabularies(topBundle)->select(p|p.namespace.matches(anInclusion.namespace))->any(true)]
+\subsection{[annotationValue(getTitleAnnotation(aVocabulary))/][isDeprecated(aVocabulary)/]}
+\label{subsec:[annotationValue(getLabelAnnotation(aVocabulary))/]}
+
+[generateBoxAnnotations(aVocabulary)/]
+
+[for(aDocument: Annotation | getDefinedByAnnotations(aVocabulary))]
+	\textbf{DEFINED IN}: \url{https://doi.org/[annotationValue(aDocument)/]}\\
+[/for]
+
+[for(aDocument: Annotation | getSeeAlsoAnnotations(aVocabulary))]
+	\textbf{REFERENCE}: \url{https://doi.org/[annotationValue(aDocument)/]}\\
+[/for]
+
+The vocabulary is composed of the following entities:
+
+[comment Vocabulary Entities/]
+
+[for (anEntity : Entity | aVocabulary.ownedStatements->filter(oml::Entity))]
+
+\subsubsection{[anEntity.name.toString()/][if (anEntity.ownedAnnotations->exists(p|p.property.name.toString().matches('deprecated')))](DEPRECATED)[/if]}
+\label{subsubsec:[anEntity.ownedAnnotations->select(p|p.property.name.toString().matches('label'))->first()/]}
+
+[if (anEntity.ownedAnnotations->exists(p|p.property.name.toString().matches('aka')))]
+	Also known as: [for (aName : Annotation | anEntity.ownedAnnotations->select(p|p.property.name.toString().matches('aka'))) separator(', ')][aName.toString()/][/for]\\ 
+[/if]
+
+[if (anEntity.ownedAnnotations->exists(p|p.property.name.toString().matches('description')))]
+	[anEntity.ownedAnnotations->select(p|p.property.name.toString().matches('description'))->first().toString()/]
+[else]
+	\todo{add @dc:^description annotation to type!}
+[/if]\\
+
+[if (anEntity.ownedAnnotations->exists(p|p.property.name.toString().matches('definition')))]
+	[anEntity.ownedAnnotations->select(p|p.property.name.toString().matches('definition'))->first().toString()/]
+[else]
+	\todo{add @resource:definition annotation to type!}
+[/if]\\
+
+[if (anEntity.ownedSpecializations->notEmpty())]
+	\textbf{Subclass of:}
+	\begin{list}
+[for (aSuperEntity : SpecializationAxiom | anEntity.ownedSpecializations)]
+	\item [aSuperEntity.specializedTerm.name/] (see section \ref{[aSuperEntity.specializedTerm.ownedAnnotations->select(p|p.property.name.toString().matches('label'))->first().toString()/]})
+[/for]
+	\end{list}
+[/if]
+
+[if (anEntity.eClass() = oml::RelationEntity)]
+[let aRelationEntity : RelationEntity = anEntity]
+	\textbf{Source}: [aRelationEntity.source.name.toString()/] (see section \ref{[aRelationEntity.source.ownedAnnotations->select(p|p.property.name.toString().matches('label'))->first().toString()/]})//
+	\textbf{Target}: [aRelationEntity.target.name.toString()/] (see section \ref{[aRelationEntity.target.ownedAnnotations->select(p|p.property.name.toString().matches('label'))->first().toString()/]})//
+	\textbf{Forward}: [aRelationEntity.forwardRelation.name.toString()/]//
+	\textbf{Reverse}: [aRelationEntity.reverseRelation.name.toString()/]//
+[if (aRelationEntity.asymmetric)]
+	This relation is \textbf{Asymmetric}//
+[/if]
+[if (aRelationEntity.functional)]
+	This relation is \textbf{Functional}//
+[/if]
+[if (aRelationEntity.irreflexive)]
+	This relation is \textbf{Irreflexive}//
+[/if]
+[if (aRelationEntity.reflexive)]
+	This relation is \textbf{Reflexive}//
+[/if]
+[if (aRelationEntity.symmetric)]
+	This relation is \textbf{Symmetric}//
+[/if]
+[if (aRelationEntity.transitive)]
+	This relation is \textbf{Transitive}//
+[/if]
+[/let]
+[/if]
+
+[for(aComment: Annotation | self.ownedAnnotations->select(p|p.property.name.toString().matches('comment')))]
+	\textbf{COMMENT}: [aComment.toString()/]\\
+[/for]
+[/for]
+[/let]
+[/for]
 [/let]
 [/for]
 
@@ -48,12 +131,9 @@ The vocabulary bundle is composed of the following vocabularies:
 NAMESPACE: [aBox.namespace.toString()/]\\
 
 [if (self.ownedAnnotations->exists(p|p.property.name.toString().matches('description')))]
-[annotationValue(getDescriptionAnnotation(aBox))/]
-[else]
-\todo{add @dc:^description annotation to vocabulary!}
-[/if]
+[annotationValue(getDescriptionAnnotation(aBox))/][else]
+\todo{add @dc:^description annotation to vocabulary!}[/if]
 
 [for(aComment: Annotation | getCommentAnnotations(aBox))]
-\textbf{COMMENT}: [aComment.toString()/]\\
-[/for]
+\textbf{COMMENT}: [aComment.toString()/]\\[/for]
 [/template]