Ejemplo n.º 1
0
        public override bool Execute()
        {
            if (string.IsNullOrWhiteSpace(OutputLocation) == false)
            {
                Log.LogMessage($"OutputLocation: {OutputLocation}");
            }
            Log.LogMessage($"Namespace: {Namespace}");
            Log.LogMessage($"OntologyFilePath: {OntologyFilePath}");
            bool result = true;

            try
            {
                CompilerResults compilerResults = ModelGenerator.CompileModelImplementationAssembly(OntologyFilePath, Namespace, OutputLocation, false);
                Log.LogMessage($"{Namespace} compiled with {compilerResults.Errors.Count} error(s)");
                foreach (CompilerError error in compilerResults.Errors)
                {
                    Log.LogError($"Error {error.ErrorNumber} ({error.Line},{error.Column}): {error.ErrorText}");
                }
                result = compilerResults.Errors.HasErrors == false;
            }
            catch (Exception e)
            {
                Log.LogError(e.Message);
                result = false;
            }
            return(result);
        }
Ejemplo n.º 2
0
        public void GenerateModelImplementationTest()
        {
            var result = ModelGenerator.CompileModelImplementationAssembly("Ontology.ttl", "Parliament.Model", System.IO.Path.GetTempPath());

            Assert.IsFalse(result.Errors.HasErrors);
        }
Ejemplo n.º 3
0
 public SerializationTest()
 {
     compilerResults = ModelGenerator.CompileModelImplementationAssembly("Ontology.ttl", "Parliament.Model", System.IO.Path.GetTempPath());
 }