Metamodel

From RuleML Wiki
Jump to: navigation, search

--Athant 14:58, 6 July 2012 (UTC)

Overview: With the new @node and <meta> syntax, there is now an opportunity to use the RuleML namespace http://ruleml.org/spec (or something related, such as http://ruleml.org/vocab) as the identifier for an ontology of RuleML "types", whose "instances" are those things identified by the IRI that appears as the value of the @node attribute. Some requirements that need to be approved by the RuleML Steering Committee are:

  • the individuals of the metamodel are equivalence classes of RuleML representations. The equivalence relation that defines these classes needs to be specified precisely.
  • namespace and naming conventions (hash or slash) for metamodel concepts needs to be specified.
  • aggregative types need to be named and defined. For example, the range of <formula> might be named "Formula". However, the definition would need to be broader than logical formulas, so that extra-logical rules are included.
  • the normative status of the metamodel and its role in compliance of RuleML extensions should be determined.
  • A preliminary draft of an RDFS taxonomy has been published at http://ruleml.org/1.0/ruleml.rdfs . Should the formal model be published as RDFS (limited expressivity but immediately usable in OO jDREW) or in OWL (more expressivity) or both?


Some preliminary discussion is available (only) to RuleML Wiki users at Priv:FY2012-13WP0#RuleML_Formal_Metamodel_and_Ontology.

1 Background

2 Lessons Learned from Metamodel Development in LegalRuleML

  • An XSLT transformation can be written that can be applied to a (mostly) general striped xml instance, turning it into RDF/XML. However, there were a number of cases that had to be handled specially including:
    • key/keyref makes things complicated, but it has been resolved by reifying the resolved construct and relating it to a two member collection consisting of the explicit definition and the keyreffed definition.
    • attributes whose values are not IRIs have to be converted to child elements
    • a function is needed to map the XML instance namespaces into the appropriate metamodel namespace
    • the lower-case and upper-case naming convention followed by RuleML (and LegalRuleML) was exploited to distinguish between edge and Node elements. However <ruleml:slot> defies this classification - in some cases it would be desirable to translate a slot directly into a triple, in other cases the triple needs to be reified.
    • The RDF Collection (rdf:List) was used for the ordered sequences contained in e.g. Atom, Expr, Plex, And, Or (in contrast to rdf:Bag and rdf:Seq used in http://ruleml.org/inrdf.html). This was done because the collection may be closed if a little extra expressivity is allowed for the metamodel (e.g. OWL). On the downside, if the corresponding edges are labelled (i.e. with xml:id) then this representation is very verbose. However, it can be considerably compressed when labels are absent using the rdf:parseType of Collection (not implemented in the LegalRuleML XSLT for parsing to RDF).
    • Functionality axioms can be used to close the syntax in the case of children that are required to be present once (e.g. <ruleml:op>). Note that in the case of distributed syntax (key/keyref) the property can still be considered functional but unknown.
    • Interpreting absence of an optional child or attribute as cardinality zero may be appropriate in some cases, e.g. @closure, <degree>. Expressing this explicitly in RDF would require a pull-style template and OWL/RDF syntax. Alternately, the RDF graph may be treated with a closed-world assumption.
    • Elements with XML Literal content need to be identified.
    • xsi:type can be translated to rdf:datatype if the value is a simple xsd type, but this won't work with complex types.
    • xml:id on edge elements was interpreted as the label for the reified triple. A clear interpretation for xml:id on Node elements is not so straight-forward, so it was simply translated into a child element.

3 RDFS

The formal specification of the RuleML metamodel in RDFS is being developed on Github at https://github.com/RuleML/ruleml-metamodel .

Contributors are welcome to fork the repository and submit pull requests.

Please validate your changes against the schema http://www.w3.org/TR/2003/WD-rdf-syntax-grammar-20030123/rdfxml.rng, using for example http://Validator.nu or oXygen.