<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.ormfoundation.org/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ActiveFacts</title><link>http://www.ormfoundation.org/forums/82.aspx</link><description>This forum is for discussing the ActiveFacts tool and the CQL language being developed by Clifford Heath.</description><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 20917.1142)</generator><item><title>Diagram metamodel added to ActiveFacts metamodel</title><link>http://www.ormfoundation.org/forums/thread/2146.aspx</link><pubDate>Thu, 20 May 2010 05:03:46 GMT</pubDate><guid isPermaLink="false">9d039735-a311-4a8d-9c49-a0bb2572af9e:2146</guid><dc:creator>Clifford Heath</dc:creator><slash:comments>0</slash:comments><comments>http://www.ormfoundation.org/forums/thread/2146.aspx</comments><wfw:commentRss>http://www.ormfoundation.org/forums/commentrss.aspx?SectionID=82&amp;PostID=2146</wfw:commentRss><description>&lt;p&gt;Folk,&lt;/p&gt;&lt;p&gt;Thanks to NORMA, I present a metamodel for ORM2 diagrams as an extension of the ActiveFacts metamodel. This diagram is also available in the Files section under &amp;quot;Open Source Models&amp;quot;.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Note some items relevant to this model being used with AdtiveFacts, rather than ORM2 in general:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Where NORMA uses the word &amp;quot;model&amp;quot; or &amp;quot;schema&amp;quot;, ActiveFacts uses &amp;quot;Vocabulary&amp;quot;.&lt;/li&gt;&lt;li&gt;This metamodel has been added to the &amp;quot;next&amp;quot; or upcomingversion of the metamodel, where object type is called ObjectType, not the current version, where they&amp;#39;re called &amp;quot;Concept&amp;quot;.&lt;/li&gt;&lt;li&gt;The constraint shape subtypes that are shown are shown because their position is relative to something they&amp;#39;re attached to, not to the diagram origin.&lt;/li&gt;&lt;li&gt;The closest thing that ActiveFacts has to a Model Note is its Context Notes, hence the naming mismatch.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br /&gt;The CQL text for this model fragment follows: &lt;br /&gt;&lt;/p&gt;&lt;p&gt;DisplayRoleNamesSetting is written as String restricted to {&amp;#39;false&amp;#39;, &amp;#39;true&amp;#39;};&lt;br /&gt;RotationSetting is written as String restricted to {&amp;#39;left&amp;#39;, &amp;#39;right&amp;#39;};&lt;br /&gt;X is written as Integer(32);&lt;br /&gt;Y is written as Integer(32);&lt;br /&gt;Position is identified by X and Y where&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Position is at one X,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Position is at one Y;&lt;br /&gt;&lt;br /&gt;Diagram is identified by Vocabulary and Name where&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Diagram is for one Vocabulary,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Vocabulary contains Diagram,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Diagram is called one Name,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name is of Diagram;&lt;br /&gt;&lt;br /&gt;Shape is identified by Diagram and Position where&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Shape is in one Diagram,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Diagram includes Shape,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Shape is at at most one Position;&lt;br /&gt;Shape is expanded;&lt;br /&gt;&lt;br /&gt;ConstraintShape is a kind of Shape;&lt;br /&gt;ConstraintShape is for one Constraint;&lt;br /&gt;&lt;br /&gt;FactTypeShape is a kind of Shape;&lt;br /&gt;FactTypeShape has at most one DisplayRoleNamesSetting;&lt;br /&gt;FactTypeShape is for one FactType,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FactType has FactTypeShape;&lt;br /&gt;FactTypeShape has at most one RotationSetting;&lt;br /&gt;&lt;br /&gt;FrequencyConstraintShape is a kind of ConstraintShape;&lt;br /&gt;&lt;br /&gt;ModelNoteShape is a kind of Shape;&lt;br /&gt;ModelNoteShape is for one ContextNote;&lt;br /&gt;&lt;br /&gt;ObjectTypeShape is a kind of Shape;&lt;br /&gt;ObjectTypeShape is for one ObjectType,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ObjectType has ObjectTypeShape;&lt;br /&gt;ObjectTypeShape has expanded reference mode;&lt;br /&gt;&lt;br /&gt;ObjectifiedFactTypeNameShape is a kind of Shape identified by FactTypeShape where&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ObjectifiedFactTypeNameShape is for one FactTypeShape,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FactTypeShape has at most one ObjectifiedFactTypeNameShape;&lt;br /&gt;&lt;br /&gt;ReadingShape is a kind of Shape identified by FactTypeShape where&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FactTypeShape has at most one ReadingShape,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ReadingShape is for one FactTypeShape;&lt;br /&gt;ReadingShape is for one Reading,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Reading has ReadingShape;&lt;br /&gt;&lt;br /&gt;RingConstraintShape is a kind of ConstraintShape;&lt;br /&gt;RingConstraintShape is attached to one FactType;&lt;br /&gt;&lt;br /&gt;RoleDisplay is where&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FactTypeShape displays Role in Ordinal position;&lt;br /&gt;RoleDisplay has FrequencyConstraintShape,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FrequencyConstraintShape is for one RoleDisplay;&lt;br /&gt;&lt;br /&gt;RoleNameShape is a kind of Shape;&lt;br /&gt;RoleNameShape is for one Role;&lt;br /&gt;&lt;br /&gt;ValueConstraintShape is a kind of ConstraintShape;&lt;br /&gt;RoleDisplay has at most one ValueConstraintShape,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ValueConstraintShape is for at most one RoleDisplay;&lt;br /&gt;ValueConstraintShape is for at most one ObjectTypeShape,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ObjectTypeShape has ValueConstraintShape;&lt;br /&gt;&lt;br /&gt;ValueType has at most one ValueConstraint,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ValueConstraint constrains ValueType;&lt;br /&gt;either ValueConstraintShape is for ObjectTypeShape or ValueConstraintShape is for RoleDisplay but not both;&lt;br /&gt;each combination FactTypeShape, Ordinal occurs at most one time in&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FactTypeShape displays Role in Ordinal position;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>ActiveFacts and CQL</title><link>http://www.ormfoundation.org/forums/thread/2143.aspx</link><pubDate>Thu, 20 May 2010 03:57:00 GMT</pubDate><guid isPermaLink="false">9d039735-a311-4a8d-9c49-a0bb2572af9e:2143</guid><dc:creator>Clifford Heath</dc:creator><slash:comments>0</slash:comments><comments>http://www.ormfoundation.org/forums/thread/2143.aspx</comments><wfw:commentRss>http://www.ormfoundation.org/forums/commentrss.aspx?SectionID=82&amp;PostID=2143</wfw:commentRss><description>&lt;p&gt;ActiveFacts is a free open-source project of &lt;a href="http://dataconstellation.com" target="_blank" title="Data Constellation"&gt;Data Constellation&lt;/a&gt; which implements the Constellation Query Language (CQL) and the Constellation API. The Constellation Query Language was presented at the ORM Workshop 2009 in Portugal, and a version of that presentation is available in a screencast you can &lt;a href="http://dataconstellation.com/ActiveFacts/CQLIntroduction.html" target="_blank" title="CQL Screencast and introduction"&gt;download here&lt;/a&gt; (links at top right). You can also install and use ActiveFacts freely on your own computer, even for commercial purposes, with no strings attached and &lt;a href="http://github.com/cjheath/activefacts/blob/master/LICENSE" target="_blank" title="ActiveFacts License"&gt;no viral licensing&lt;/a&gt;.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The Constellation Query Language (CQL) is a plain-text restricted natural language which provides full-featured ORM2 capabilities without needing to use diagrams. As such, it is especially suitable for use in collaborating over models with people who do not have, would not use, or are not trained to understand an ORM2 diagramming tool such as NORMA. It&amp;#39;s also useful when combined with differential revision management tools, and only requires plain-text tools such as text editors and email programs. CQL extends the ORM2 metamodel a little, and will be further extended to provide full query language capabilities surpassing SQL&amp;#39;s select. CQL is also under development in French and Spanish, and other languages will become available over time - it&amp;#39;s intended that the same model and database may be presented and queries in multiple languages. &lt;/p&gt;&lt;p&gt;ActiveFacts (written in the Ruby scripting language) centres around the ActiveFacts generator, which uses the ActiveFacts metamodel. The generator:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;can &lt;b&gt;read&lt;/b&gt; models created in either NORMA or directly in CQL (more input formats will be available over time, or you can write your own)&lt;/li&gt;&lt;li&gt;can &lt;b&gt;transform&lt;/b&gt; models into object-oriented or 5NF relational form&lt;/li&gt;&lt;li&gt;can &lt;b&gt;generate&lt;/b&gt; (using a modular extensible generator architecture):&lt;/li&gt;&lt;ul&gt;&lt;li&gt;CQL (if your NORMA models have adequate readings, they convert easily)&lt;/li&gt;&lt;li&gt;Ruby code for the Constellation API&lt;/li&gt;&lt;li&gt;SQL for several dialects&lt;/li&gt;&lt;li&gt;fact-oriented, object-oriented or relational code or documentation using generators you can easily write for yourself.&lt;/li&gt;&lt;li&gt;other generators may be available for purchase or on commission
&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;The Constellation API is Ruby code which supports the output of the Ruby code generator. The generated code allows representation and manipulation of any collection of facts from your model. Although it&amp;#39;s implemented in an object-oriented language, the API is fact-oriented. As such, there are no &lt;b&gt;new&lt;/b&gt; and &lt;b&gt;delete&lt;/b&gt; operations, instead you must (within a constellation of facts) &lt;b&gt;assert&lt;/b&gt; and &lt;b&gt;retract&lt;/b&gt; instances of facts. It is not possible to create duplicate instances within a constellation - a duplicate assert will just return the previous instance. All object instances are fully cross-referenced, such that every role played by each object is a method available on that object. For example, if you have a Person instance, you can say &lt;i&gt;person.birth_date.all_directorship_as_appointment_date&lt;/i&gt; to get every company director who was appointed on the day this person was born. This is a radically new style of programming - it&amp;#39;s true &lt;b&gt;fact-oriented programming&lt;/b&gt;. Constellations in the API can not yet be retrieved from and saved to the relational storage for the same model, but this is work in progress which solves for the first time the notorious problem known as the &lt;a href="http://blogs.tedneward.com/2006/06/26/The+Vietnam+Of+Computer+Science.aspx" target="_blank" title="The Vietnam of Computer Science"&gt;Vietnam of Computer Science&lt;/a&gt;.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;ActiveFacts contains (to my knowledge) the &lt;a href="http://dataconstellation.com/ActiveFacts/examples/" title="ActiveFacts example models" target="_blank"&gt;only published ORM2 metamodel&lt;/a&gt; which has actually been proven by being used to generate ORM2 tools. The metamodel differs from and extends somewhat the accepted ORM2 structures. In particular, it:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;includes a dimensional model for value types, supporting arbitrary conversion between compatible values in different units (including ephemeral conversions such as between currencies)&lt;/li&gt;&lt;li&gt;models uniqueness, mandatory and frequency constraints as one constraint type called presence constraints, which allows easier constraint type migration&lt;/li&gt;&lt;li&gt;supports deontic constraints by reference to the enforcement action that must be taken when the constraint is found to have been invalidated&lt;/li&gt;&lt;li&gt;supports Business Context Notes to record the reasons why a particular entity type or constraint was created, and also to record the date and participants in agreeding to those reasons.&lt;/li&gt;&lt;/ul&gt;The ActiveFacts metamodel is maintained in CQL and NORMA, and is used with the generator to produce the code that supports all the ActiveFacts tools, including the CQL compiler. Being bootstrapped in this way makes it very easy to evolve the tools, and shows that the metamodel is actually sufficient and correct for converting between fact-oriented languages. Amidst all the noise and delay involved in our attempts to create a common agreed metamodel, it silently delivers. It also amply demonstrates the power of using fact-oriented modeling in the automatic generation of framework code to support real systems.&lt;br /&gt;&lt;br /&gt;ActiveFacts is also being used as the basis for some enterprise-level and graphical tools for collaborative modelling, but these are not open source. Contact &lt;a href="mailto:cjh@dataconstellation.com?subject=Data%20Constellation%20Enterprise%20Tools" title="Send email to Data Constellation"&gt;Data Constellation&lt;/a&gt; for more details.&lt;br /&gt;</description></item></channel></rss>