本文整理汇总了C#中DocProject类的典型用法代码示例。如果您正苦于以下问题:C# DocProject类的具体用法?C# DocProject怎么用?C# DocProject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DocProject类属于命名空间,在下文中一共展示了DocProject类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GenerateCode
/// <summary>
/// Generates folder of definitions
/// </summary>
/// <param name="path"></param>
public static void GenerateCode(DocProject project, string path)
{
foreach (DocSection docSection in project.Sections)
{
foreach (DocSchema docSchema in docSection.Schemas)
{
foreach (DocType docType in docSchema.Types)
{
using (FormatJAV format = new FormatJAV(path + @"\" + docSchema.Name + @"\" + docType.Name + ".java"))
{
format.Instance = project;
format.Definition = docType;
format.Save();
}
}
foreach (DocEntity docType in docSchema.Entities)
{
using (FormatJAV format = new FormatJAV(path + @"\" + docSchema.Name + @"\" + docType.Name + ".java"))
{
format.Instance = project;
format.Definition = docType;
format.Save();
}
}
}
}
}
开发者ID:pipauwel,项目名称:IfcDoc,代码行数:32,代码来源:FormatJAV.cs
示例2: FormSelectSchema
public FormSelectSchema(DocProject project) : this()
{
this.m_project = project;
foreach (DocSection docSection in project.Sections)
{
if (docSection.Schemas.Count > 0)
{
TreeNode tnSection = new TreeNode();
tnSection.Tag = docSection;
tnSection.Text = docSection.Name;
tnSection.ImageIndex = 1;
this.treeView.Nodes.Add(tnSection);
foreach (DocSchema docSchema in docSection.Schemas)
{
TreeNode tnSchema = new TreeNode();
tnSchema.Tag = docSchema;
tnSchema.Text = docSchema.Name;
tnSchema.ImageIndex = 0;
tnSection.Nodes.Add(tnSchema);
}
tnSection.Expand();
}
}
}
开发者ID:corneliuspreidel,项目名称:IfcDoc,代码行数:27,代码来源:FormSelectSchema.cs
示例3: FormSelectPropertyEnum
public FormSelectPropertyEnum(DocProject project, DocPropertyEnumeration selection)
: this()
{
this.m_project = project;
SortedList<string, DocPropertyEnumeration> list = new SortedList<string, DocPropertyEnumeration>();
foreach(DocSection section in project.Sections)
{
foreach(DocSchema schema in section.Schemas)
{
foreach(DocPropertyEnumeration enumeration in schema.PropertyEnums)
{
list.Add(enumeration.Name, enumeration);
}
}
}
foreach (string s in list.Keys)
{
DocPropertyEnumeration enumeration = list[s];
ListViewItem lvi = new ListViewItem();
lvi.Tag = enumeration;
lvi.Text = enumeration.Name;
lvi.ImageIndex = 0;
this.listView.Items.Add(lvi);
if (selection == enumeration)
{
lvi.Selected = true;
}
}
}
开发者ID:BuildingSMART,项目名称:IfcDoc,代码行数:32,代码来源:FormSelectPropertyEnum.cs
示例4: FormatZIP
/// <summary>
///
/// </summary>
/// <param name="stream">Stream for the zip file.</param>
/// <param name="project">Project.</param>
/// <param name="included">Map of included definitions</param>
/// <param name="type">Optional type of data to export, or null for all; DocPropertySet, DocQuantitySet are valid</param>
public FormatZIP(Stream stream, DocProject project, Dictionary<DocObject, bool> included, Type type)
{
this.m_stream = stream;
this.m_project = project;
this.m_included = included;
this.m_type = type;
}
开发者ID:pipauwel,项目名称:IfcDoc,代码行数:14,代码来源:FormatZIP.cs
示例5: FormSelectAttribute
public FormSelectAttribute(DocEntity entity, DocProject project, string selection, bool freeform)
: this()
{
this.textBoxAttributeName.Enabled = freeform;
this.textBoxAttributeName.Text = selection;
this.LoadEntity(entity, project, selection);
}
开发者ID:corneliuspreidel,项目名称:IfcDoc,代码行数:8,代码来源:FormSelectAttribute.cs
示例6: FormReference
public FormReference(DocProject docProject, DocDefinition docBase, Dictionary<string, DocObject> map, string value)
: this()
{
this.m_project = docProject;
this.m_base = docBase;
this.m_map = map;
// parse value
CvtValuePath valuepath = CvtValuePath.Parse(value, map);
LoadValuePath(valuepath);
}
开发者ID:pipauwel,项目名称:IfcDoc,代码行数:11,代码来源:FormReference.cs
示例7: FormatData
public string FormatData(DocProject docProject, DocPublication docPublication, DocExchangeDefinition docExchange, Dictionary<string, DocObject> map, Dictionary<long, SEntity> instances, SEntity root, bool markup)
{
this.m_stream = new System.IO.MemoryStream();
this.Instance = root;
this.Markup = markup;
this.Save();
this.m_stream.Position = 0;
StreamReader reader = new StreamReader(this.m_stream);
string content = reader.ReadToEnd();
return content;
}
开发者ID:BuildingSMART,项目名称:IfcDoc,代码行数:12,代码来源:FormatSML.cs
示例8: TopicMiddleware
public TopicMiddleware(Func<IDictionary<string, object>, Task> inner, DocProject project, IHtmlGenerator generator, DocSettings settings)
{
_inner = inner;
_project = project;
_generator = generator;
_settings = settings;
var stream = Assembly.GetExecutingAssembly()
.GetManifestResourceStream(typeof(TopicMiddleware), "WebsocketsRefresh.txt");
_webSocketScript = stream.ReadAllText();
_topicJS = Assembly.GetExecutingAssembly().GetManifestResourceStream(typeof(Program),"topics.js").ReadAllText();
}
开发者ID:jamesmanning,项目名称:Storyteller,代码行数:13,代码来源:TopicMiddleware.cs
示例9: TopicMiddleware
public TopicMiddleware(DocProject project, IHtmlGenerator generator, DocSettings settings)
{
_project = project;
_generator = generator;
_settings = settings;
var topicAssembly = typeof(TopicMiddleware).GetAssembly();
var stream = topicAssembly.GetManifestResourceStream("dotnet-stdocs.Runner.WebsocketsRefresh.txt");
_webSocketScript = stream.ReadAllText();
_topicJS = topicAssembly.GetManifestResourceStream("dotnet-stdocs.topics.js").ReadAllText();
}
开发者ID:storyteller,项目名称:Storyteller,代码行数:13,代码来源:TopicMiddleware.cs
示例10: FormRule
public FormRule(DocModelRule rule, DocProject project, DocTemplateDefinition template)
: this()
{
this.m_rule = rule;
this.m_project = project;
this.m_template = template;
this.Text = this.m_rule.Name;
this.textBoxIdentifier.Text = this.m_rule.Identification;
this.textBoxIdentifier.Enabled = !String.IsNullOrEmpty(this.m_rule.Identification);
if (String.IsNullOrEmpty(this.m_rule.Identification))
{
this.comboBoxUsage.SelectedIndex = 0;
}
else if (this.m_rule.Description != null && this.m_rule.Description.Equals("*"))
{
// convention indicating filter
this.comboBoxUsage.SelectedIndex = 1;
}
else
{
// indicates parameter constraint
this.comboBoxUsage.SelectedIndex = 2;
}
if (this.m_rule.CardinalityMin == 0 && this.m_rule.CardinalityMax == 0)
{
this.comboBoxCardinality.SelectedIndex = 0;
}
else if (this.m_rule.CardinalityMin == -1 && this.m_rule.CardinalityMax == -1)
{
this.comboBoxCardinality.SelectedIndex = 1;
}
else if (this.m_rule.CardinalityMin == 0 && this.m_rule.CardinalityMax == 1)
{
this.comboBoxCardinality.SelectedIndex = 2;
}
else if (this.m_rule.CardinalityMin == 1 && this.m_rule.CardinalityMax == 1)
{
this.comboBoxCardinality.SelectedIndex = 3;
}
else if (this.m_rule.CardinalityMin == 1 && this.m_rule.CardinalityMax == -1)
{
this.comboBoxCardinality.SelectedIndex = 4;
}
this.UpdateBehavior();
}
开发者ID:BuildingSMART,项目名称:IfcDoc,代码行数:48,代码来源:FormRule.cs
示例11: LoadEntity
private void LoadEntity(DocEntity entity, DocProject project, string selection)
{
if (entity == null)
return;
// recurse to base
if (entity.BaseDefinition != null)
{
DocEntity docBase = project.GetDefinition(entity.BaseDefinition) as DocEntity;
LoadEntity(docBase, project, selection);
}
// load attributes
foreach (DocAttribute docAttr in entity.Attributes)
{
// if attribute is derived, dont add, but remove existing
if (!String.IsNullOrEmpty(docAttr.Derived))
{
foreach (ListViewItem lvi in this.listView.Items)
{
if (lvi.Text.Equals(docAttr.Name))
{
lvi.Remove();
break;
}
}
}
else
{
ListViewItem lvi = new ListViewItem();
lvi.Tag = docAttr;
lvi.Text = docAttr.Name;
lvi.SubItems.Add(docAttr.DefinedType); // INVERSE / SET / LIST / OPTIONAL...
this.listView.Items.Add(lvi);
if(selection != null && lvi.Text.Equals(selection))
{
lvi.Selected = true;
}
}
}
}
开发者ID:corneliuspreidel,项目名称:IfcDoc,代码行数:42,代码来源:FormSelectAttribute.cs
示例12: FormSelectView
/// <summary>
///
/// </summary>
/// <param name="project">The project.</param>
public FormSelectView(DocProject project, string description)
: this()
{
this.m_project = project;
if (description != null)
{
this.labelDescription.Text = description;
}
foreach (DocModelView docView in this.m_project.ModelViews)
{
ListViewItem lvi = new ListViewItem();
lvi.Tag = docView;
lvi.Text = docView.Name;
lvi.ImageIndex = 0;
lvi.SubItems.Add(docView.Version);
this.listView.Items.Add(lvi);
}
}
开发者ID:corneliuspreidel,项目名称:IfcDoc,代码行数:24,代码来源:FormSelectView.cs
示例13: FormValidate
public FormValidate(DocProject project, DocModelView docView, DocExchangeDefinition docExchange) : this()
{
this.textBoxPath.Text = Properties.Settings.Default.ValidateFile;
this.checkBoxReport.Checked = Properties.Settings.Default.ValidateReport;
foreach (DocModelView docEachView in project.ModelViews)
{
this.comboBoxView.Items.Add(docEachView);
}
if (docView == null && project.ModelViews.Count > 0)
{
docView = project.ModelViews[0];
}
this.comboBoxView.SelectedItem = docView;
if (docExchange == null && docView != null && docView.Exchanges.Count > 0)
{
docExchange = docView.Exchanges[0];
}
this.comboBoxExchange.SelectedItem = docExchange;
}
开发者ID:corneliuspreidel,项目名称:IfcDoc,代码行数:22,代码来源:FormValidate.cs
示例14: FormSelectPropertyEnum
public FormSelectPropertyEnum(DocProject project, DocPropertyEnumeration selection) : this()
{
this.m_project = project;
foreach(DocSection section in project.Sections)
{
foreach(DocSchema schema in section.Schemas)
{
foreach(DocPropertyEnumeration enumeration in schema.PropertyEnums)
{
ListViewItem lvi = new ListViewItem();
lvi.Tag = enumeration;
lvi.Text = enumeration.Name;
this.listView.Items.Add(lvi);
if (selection == enumeration)
{
lvi.Selected = true;
}
}
}
}
}
开发者ID:corneliuspreidel,项目名称:IfcDoc,代码行数:23,代码来源:FormSelectPropertyEnum.cs
示例15: GenerateTemplateImage
private static string GenerateTemplateImage(DocTemplateDefinition docTemplate, Dictionary<string, DocObject> mapEntity, DocProject project, string path)
{
int cx = 0;
int cy = 0;
System.Drawing.Image image = IfcDoc.Format.PNG.FormatPNG.CreateTemplateDiagram(docTemplate, mapEntity, new Dictionary<System.Drawing.Rectangle, DocModelRule>(), project, null);
if (image != null)
{
using (image)
{
cx = image.Width;
cy = image.Height;
string filepath = path + "\\" + docTemplate.Name.ToLower().Replace(' ', '-') + ".png";
image.Save(filepath, System.Drawing.Imaging.ImageFormat.Png);
cx = cx / 2;
cy = cy / 2;
}
}
return "<br/><img src=\"" + docTemplate.Name.ToLower().Replace(' ', '-') + ".png\" width=\"" + cx + "\" height=\"" + cy + "\"/>";
}
开发者ID:corneliuspreidel,项目名称:IfcDoc,代码行数:23,代码来源:NBIMS.cs
示例16: FormSelectTemplate
/// <summary>
///
/// </summary>
/// <param name="selection">Selected template.</param>
/// <param name="project">Projet containing templates.</param>
/// <param name="entity">The entity for which templates are filtered.</param>
public FormSelectTemplate(DocTemplateDefinition selection, DocProject project, DocEntity entity)
: this()
{
this.m_selection = selection;
this.m_project = project;
this.m_entity = entity;
// build map
this.m_map = new Dictionary<string, DocObject>();
foreach (DocSection docSection in this.m_project.Sections)
{
foreach (DocSchema docSchema in docSection.Schemas)
{
foreach (DocEntity docEntity in docSchema.Entities)
{
if(!this.m_map.ContainsKey(docEntity.Name))
{
m_map.Add(docEntity.Name, docEntity);
}
}
foreach (DocType docType in docSchema.Types)
{
try
{
m_map.Add(docType.Name, docType);
}
catch
{
}
}
}
}
LoadTemplates(project.Templates);
}
开发者ID:corneliuspreidel,项目名称:IfcDoc,代码行数:43,代码来源:FormSelectTemplate.cs
示例17: Compiler
public Compiler(DocProject project, DocModelView[] views, DocExchangeDefinition exchange)
{
this.m_project = project;
this.m_views = views;
this.m_exchange = exchange;
this.m_assembly = AppDomain.CurrentDomain.DefineDynamicAssembly(new AssemblyName("IFC4"), AssemblyBuilderAccess.RunAndSave);
this.m_module = this.m_assembly.DefineDynamicModule("IFC4.dll", "IFC4.dll");
this.m_definitions = new Dictionary<string, DocObject>();
this.m_types = new Dictionary<string, Type>();
this.m_fields = new Dictionary<Type, Dictionary<string, FieldInfo>>();
this.m_templates = new Dictionary<DocTemplateDefinition, MethodInfo>();
this.m_namespaces = new Dictionary<string, string>();
Dictionary<DocObject, bool> included = null;
if (this.m_views != null)
{
included = new Dictionary<DocObject, bool>();
foreach (DocModelView docView in this.m_views)
{
this.m_project.RegisterObjectsInScope(docView, included);
}
}
foreach (DocSection docSection in project.Sections)
{
foreach (DocSchema docSchema in docSection.Schemas)
{
foreach (DocEntity docEntity in docSchema.Entities)
{
if (included == null || included.ContainsKey(docEntity))
{
if (!this.m_definitions.ContainsKey(docEntity.Name))
{
this.m_definitions.Add(docEntity.Name, docEntity);
this.m_namespaces.Add(docEntity.Name, docSchema.Name);
}
}
}
foreach (DocType docType in docSchema.Types)
{
if (included == null || included.ContainsKey(docType))
{
if (!this.m_definitions.ContainsKey(docType.Name))
{
this.m_definitions.Add(docType.Name, docType);
this.m_namespaces.Add(docType.Name, docSchema.Name);
}
}
}
}
}
// first register types and fields
foreach (string key in this.m_definitions.Keys)
{
RegisterType(key);
}
// now register template functions (may depend on fields existing)
// find associated ConceptRoot for model view, define validation function
if (this.m_views != null)
{
foreach (DocModelView view in this.m_views)
{
string viewname = view.Code;
foreach (DocConceptRoot root in view.ConceptRoots)
{
Type tOpen= null;
if (this.m_types.TryGetValue(root.ApplicableEntity.Name, out tOpen) && tOpen is TypeBuilder)
{
TypeBuilder tb = (TypeBuilder)tOpen;
foreach (DocTemplateUsage concept in root.Concepts)
{
CompileConcept(concept, view, tb);
}
}
}
}
}
// seal types once all are built
List<TypeBuilder> listBase = new List<TypeBuilder>();
foreach (string key in this.m_definitions.Keys)
{
Type tOpen = this.m_types[key];
while (tOpen is TypeBuilder)
{
listBase.Add((TypeBuilder)tOpen);
tOpen = tOpen.BaseType;
}
// seal in base class order
for (int i = listBase.Count - 1; i >= 0; i--)
{
//.........这里部分代码省略.........
开发者ID:corneliuspreidel,项目名称:IfcDoc,代码行数:101,代码来源:Compiler.cs
示例18: WriteConceptTemplates
private static void WriteConceptTemplates(DocProject project, FormatHTM format, bool descriptions, bool all, string path, Dictionary<string, DocObject> mapEntity, Dictionary<DocObject, bool> included)
{
foreach (DocTemplateDefinition docTemplate in project.Templates)
{
if (all || included.ContainsKey(docTemplate))
{
int count = 1;
if (docTemplate.Templates != null)
{
foreach (DocTemplateDefinition doc2 in docTemplate.Templates)
{
if (all || included.ContainsKey(doc2))
{
count++;
if (doc2.Templates != null)
{
foreach (DocTemplateDefinition doc3 in doc2.Templates)
{
if (all || included.ContainsKey(doc3))
{
count++;
}
}
}
}
}
}
string img = "";
if (docTemplate.Rules != null && docTemplate.Rules.Count > 0)
{
img = GenerateTemplateImage(docTemplate, mapEntity, project, path);
//img = "<br/><img src=\"" + docTemplate.Name.ToLower().Replace(' ', '-') + ".png\" width=\"" + cx + "\" height=\"" + cy + "\"/>";
}
format.WriteLine("<tr><td rowspan=\"" + count + "\">" + docTemplate.Name + "</td><td></td><td></td>");
if (descriptions)
{
format.Write("<td>" + docTemplate.Documentation + img + "</td>");
}
format.WriteLine("</tr>");
if (docTemplate.Templates != null)
{
foreach (DocTemplateDefinition doc2 in docTemplate.Templates)
{
if (all || included.ContainsKey(doc2))
{
int count2 = 1;
if (doc2.Templates != null)
{
foreach (DocTemplateDefinition doc3 in doc2.Templates)
{
if (all || included.ContainsKey(doc3))
{
count2++;
}
}
}
img = "";
if (doc2.Rules != null && doc2.Rules.Count > 0)
{
img = GenerateTemplateImage(doc2, mapEntity, project, path);
//img = "<br/><img src=\"" + doc2.Name.ToLower().Replace(' ', '-') + ".png\"/>";
}
format.WriteLine("<tr><td rowspan=\"" + count2 + "\">" + doc2.Name + "</td><td></td>");
if (descriptions)
{
format.WriteLine("<td>" + doc2.Documentation + img + "</td>");
}
format.Write("</tr>");
if (doc2.Templates != null)
{
foreach (DocTemplateDefinition doc3 in doc2.Templates)
{
if (all || included.ContainsKey(doc3))
{
img = "";
if (doc3.Rules != null && doc3.Rules.Count > 0)
{
img = GenerateTemplateImage(doc3, mapEntity, project, path);
//img = "<br/><img src=\"" + doc3.Name.ToLower().Replace(' ', '-') + ".png\"/>";
}
format.WriteLine("<tr><td>" + doc3.Name + "</td>");
if (descriptions)
{
format.WriteLine("<td>" + doc3.Documentation + img + "</td>");
}
format.WriteLine("</tr>");
}
}
}
}
}
}
//.........这里部分代码省略.........
开发者ID:pipauwel,项目名称:IfcDoc,代码行数:101,代码来源:NBIMS.cs
示例19: Export
public static void Export(DocProject project, DocModelView docView, string path, Dictionary<string, DocObject> mapEntity, Dictionary<string, string> mapSchema)
{
Dictionary<DocObject, bool> included = docView.Filter(project);
const string HEADERCELL = "<th style=\"-webkit-transform:rotate(90deg); writing-mode:tb-rl; -moz-transform:rotate(90deg); -o-transform: rotate(90deg); white-space:nowrap; display:blocking; ms-filter: \"progid:DXImageTransform.Microsoft.BasicImage(rotation=0.083)\"; >";
// get list of entities in order
List<DocEntity> sortEntity = project.GetEntityList();
// build list of templates in use (to preserve sort order)
Dictionary<DocTemplateDefinition, List<DocConceptRoot>> mapTemplates = new Dictionary<DocTemplateDefinition, List<DocConceptRoot>>();
// double-loop not optimal, but lists aren't that large
foreach (DocEntity docSortEnt in sortEntity)
{
foreach (DocConceptRoot docRoot in docView.ConceptRoots)
{
if (docRoot.ApplicableEntity == docSortEnt)
{
foreach (DocTemplateUsage docConcept in docRoot.Concepts)
{
if (!mapTemplates.ContainsKey(docConcept.Definition))
{
mapTemplates.Add(docConcept.Definition, new List<DocConceptRoot>());
}
mapTemplates[docConcept.Definition].Add(docRoot);
}
}
}
}
// build list of concept roots sorted by entity order
List<DocConceptRoot> sortConceptRoot = new List<DocConceptRoot>();
foreach (DocEntity docSortEntity in sortEntity)
{
foreach (DocConceptRoot docRoot in docView.ConceptRoots)
{
if (docRoot.ApplicableEntity == docSortEntity)
{
sortConceptRoot.Add(docRoot);
break;
}
}
}
using (FormatEXP formatEXP = new FormatEXP(path + @"\" + docView.Code + ".exp"))
{
formatEXP.Instance = project;
formatEXP.ModelViews = new DocModelView[] { docView };
formatEXP.Save();
}
using (FormatXSD formatXSD = new FormatXSD(path + @"\" + docView.Code + ".xsd"))
{
formatXSD.Instance = project;
formatXSD.ModelViews = new DocModelView[] { docView };
formatXSD.Save();
}
using (FormatSPF format = new FormatSPF(path + @"\" + docView.Code + ".ifc", Schema.IFC.SchemaIfc.Types, new Dictionary<long, SEntity>()))
{
format.InitHeaders(docView.Code, "IFC4");
Schema.IFC.IfcProject ifcProject = new IfcDoc.Schema.IFC.IfcProject();
Program.ExportIfc(ifcProject, project, included);
format.Save();
}
using (FormatXML format = new FormatXML(path + @"\" + docView.Code + ".mvdxml", typeof(mvdXML), mvdXML.DefaultNamespace))
{
mvdXML mvd = new mvdXML();
Program.ExportMvd(mvd, project, included);
format.Instance = mvd;
format.Save();
}
using (FormatHTM format = new FormatHTM(path + @"\" + docView.Code + ".htm", mapEntity, new Dictionary<string, string>(), included))
{
format.WriteHeader(docView.Name, 0, null);
// 1 Scope
// 1.1 Business Case Description
// 1.2 Participants and Stakeholders
// 2 Normative References
// 3 Terms and definitions
// 4 Symbols and abbreviated terms
// 5 Business processes
// 5.1 Process models provided
// 5.2 Representative process models
// 5.3 Process models formatting
format.WriteLine("<h1>6 Exchange requirements</h1>");
format.WriteLine("<h2>6.1 Exchange requirements legibility</h2>");
format.WriteLine("<h3>6.1.1 Exchange requirements list</h3>");
format.WriteLine("<p>Each exchange is listed by name as follows.</p>");
Dictionary<string, string> mapExchangeClass = new Dictionary<string, string>();
format.WriteLine("<ul>");
//.........这里部分代码省略.........
开发者ID:pipauwel,项目名称:IfcDoc,代码行数:101,代码来源:NBIMS.cs
示例20: FormatDefinitions
public string FormatDefinitions(DocProject docProject, Dictionary<string, DocObject> map, Dictionary<DocObject, bool> included)
{
// clear containers
listPropertiesOutput.Clear();
addedIndividuals.Clear();
attribInverses.Clear();
subTypesOfEntity.Clear();
StringBuilder sb = new StringBuilder();
string ifcversion = "IFC4";
// TO DO: customize the IFC version. In case of XSD, the piece of information (the full URL) is read from the .ifcdoc file
//string ifcns = "http://www.buildingsmart-tech.org/ifcOWL/" + ifcversion;
string ifcns = "http://ifcowl.openbimstandards.org/" + ifcversion;
// namespace definitions
sb.AppendLine("@prefix : <" + ifcns + "#> .");
sb.AppendLine("@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .");
sb.AppendLine("@prefix dce: <http://purl.org/dc/elements/1.1/> .");
sb.AppendLine("@prefix owl: <http://www.w3.org/2002/07/owl#> .");
sb.AppendLine("@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .");
sb.AppendLine("@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .");
sb.AppendLine("@prefix vann: <http://purl.org/vocab/vann/> .");
sb.AppendLine("@prefix list: <https://w3id.org/list#> .");
sb.AppendLine("@prefix expr: <https://w3id.org/express#> .");
sb.AppendLine("@prefix ifc: <" + ifcns + "#> .");
sb.AppendLine("@prefix cc: <http://creativecommons.org/ns#> .");
sb.AppendLine("");
// ontology definition
sb.AppendLine("<" + ifcns + ">");
sb.AppendLine("\ta owl:Ontology ;");
sb.AppendLine("\trdfs:comment \"Ontology automatically generated from the EXPRESS schema using the IfcDoc functions developed by Pieter Pauwels ([email protected]) and Walter Terkaj ([email protected]) \" ;");
sb.AppendLine("\tcc:license <http://creativecommons.org/licenses/by/3.0/> ;");
sb.AppendLine("\tdce:contributor \"Jakob Beetz ([email protected])\" , \"Maria Poveda Villalon ([email protected])\" ;"); // \"Aleksandra Sojic ([email protected])\" ,
sb.AppendLine("\tdce:creator \"Pieter Pauwels ([email protected])\" , \"Walter Terkaj ([email protected])\" ;");
sb.AppendLine("\tdce:date \"2015/10/02\" ;");
sb.AppendLine("\tdce:description \"OWL ontology for the IFC conceptual data schema and exchange file format for Building Information Model (BIM) data\" ;");
sb.AppendLine("\tdce:identifier \"" + ifcversion + "\" ;");
sb.AppendLine("\tdce:language \"en\" ;");
sb.AppendLine("\tdce:title \"" + ifcversion + "\" ;");
sb.AppendLine("\tvann:preferredNamespacePrefix \"ifc\" ;");
sb.AppendLine("\tvann:preferredNamespaceUri \"" + ifcns + "\" ;");
sb.AppendLine("\towl:imports <https://w3id.org/express> .");
sb.AppendLine();
// check which Inverse Attributes must be discarded because of conflicts
// get subtypes of an entity
foreach (DocSection docSection in docProject.Sections)
{
foreach (DocSchema docSchema in docSection.Schemas)
{
foreach (DocEntity docEntity in docSchema.Entities)
{
// get supertype/subtype
if (docEntity.BaseDefinition != null)
{
if (!subTypesOfEntity.ContainsKey(docEntity.BaseDefinition))
subTypesOfEntity.Add(docEntity.BaseDefinition, new HashSet<string>());
subTypesOfEntity[docEntity.BaseDefinition].Add(docEntity.Name);
}
// check attributes
foreach (DocAttribute docAttr in docEntity.Attributes)
{
if (docAttr.Inverse != null)
{
var key = new Tuple<string, string>(docAttr.Inverse, docAttr.DefinedType);
if (!attribInverses.ContainsKey(key))
attribInverses.Add(key, 1);
else
attribInverses[key] += 1;
}
}
}
}
}
// generate definitions
foreach (DocSection docSection in docProject.Sections)
{
foreach (DocSchema docSchema in docSection.Schemas)
{
foreach (DocType docType in docSchema.Types)
{
bool use = false;
included.TryGetValue(docType, out use);
if (use)
{
if (docType is DocDefined)
{
DocDefined docDefined =
|
请发表评论