This is an archive of an inactive wiki and cannot be modified.

The XML syntax for all RIF dialects is a simple recursive serialization of the syntactic objects being interchanged. For instance, the serialization of a ruleset includes the serialization of each rule in the ruleset, and the serialization of each rule includes the serialization of each condition used in that rule.

Several issues have not yet been decided by the Working Group. These are not entirely orthogonal, but some attempt has been made to keep them as independent as possible.

1. Is the XML serialization a subset of RDF/XML?

This issue connects to many of the other issues here.

Reasons for using RDF/XML subset:

Reasons against:

1.1. Semantic Loop?

Question: There seems to be agreement that RDF graphs may be included in RIF by a normative embedding, ie. including a triple (s p o.) by it's translation to a RIF slot s[p->o]. Now, this slot again has a a RIF/RDF serialization (splitting off the RIF slot to a set of triples T), any of the triples in T again has an embedding in RIF. How do we resolve this semantic cycle?

Answer: The cycle here is the same cycle as occurs in prolog by the fact that clauses have the same syntax as terms. You can read a fact as a term, and assert it as part of another clause. You can read that clause as a term, and assert it as part of another clause, etc. But there is no actual problem here.

age(sam, 5).                     # simple fact 
claimed(fred, age(sam, 5))       # that fact turned into a term in another fact
claimed(jones, claimed(fred, age(sam, 5)))    # ... etc

This syntactic proposal does not define anything like 'claimed', it just aligns the rule syntax and the frame knowledge syntax, so that such things do not need to provide a mapping between the two.

1.2. Additional Issues/Requirements

In connection with the previous one, I would like to discuss in the group the followign requirements:

  1. RDF Ground facts preserved in RIF/RDF i.e.
     s p o. (in RDF/XML) =?=  s p o. (in RIF/RDF)
     
    Do we want RDF data to be preserved in its RIF reading? If not, ie. if we reify triples, shouldn't we rather reuse the existing reification vocabulary of RDF?
  2. It should be guaranteed that the RDF version of a ruleset (RDF-)merged with some RDF graph g should not possibly change the RIF-meaning of the single rules in r. ie, it should be allowed to merge rulesets, rulesets and data, but not data into rules by simply merging the representing RDF graphs.

Reason for facts being preserved:

Reason against facts being preserved:

Reason for single rules not changeable by RDF merge:

Reason against single rules not changeable by RDF merge:

The whole idea of RDF bases on the ease of merge of RDF Graphs, if we have a RIF/RDF version, we should follow this rationale as well.

2. If so: is the XML root element 'rdf:RDF'?

Moved to Arch/XML Syntax Issues/Root Element.

3. Does the XML instance document indicate where order is significant?

The parts of XML documents, being sequential data structures, are inherently ordered. In some cases the order of elements in the document is significant, while in others it is not. For example, the order of rules in a ruleset might have important semantic consequences in one dialect while the order might have no meaning in another. In BLD, the order of rules in a Ruleset, of conjuncts in an And (Horn premise), of disjuncts in an Or, and of slots in a Uniterm or Frame is not significant, as specified by the formal BLD semantics.

When the meaning has no significance, systems may store the data in more efficient unordered containers. The use of ordered versus unordered containers could also be used on the interchange format level to signal to programmers whether order is significant, which affects how they write related software. Alternatively, semantic attributes can be used to specify ordered versus unordered elements on the interchange format level (the default being unordered). On the implementation level, different optimized data structures can then be chosen according to the high level specification. The question here is whether the input processors can determine whether order is signficant just by examination of an input document, or if they need to refer to the specification of the relevant dialect first.

(This is part of "Do we allow parsing without schema knowledge?" in Arch/XML_Syntax_Issues_1)

Reasons for including order information:

Reasons against including order information:

With the right default, ordered="no", logics such as BLD can be easily represented in XML and can be conveniently modified to ordered dialects using an explicit ordered="yes" where required. For example, a BLD <Ruleset> is equivalent to <Ruleset ordered="no">. For a Prolog-like dialect <Ruleset ordered="yes"> can be used.

4. Are there local pointers in the XML serialization?

(This is a modified version of "IRIs vs Local Identifiers" in Arch/XML_Syntax_Issues_1, based on the idea that if we need identifier for parts of the syntax, local ones need to be allowed -- but we might not need them.)

Pointers are needed on some level if we want structure sharing or if the underlying instance data has loops. (Loops are avoided when developing a well-founded logic.)

In the RDF/XML example, these local pointers would be NodeIDs. In the general XML example, these local pointers would be id/idrefs.

Reasons for Local Pointers:

Reasons against:

5. If so, is structure sharing allowed, mandated, or forbidden?

Structure sharing occurs when some part of the syntax tree occurs multiple times and instead of repeating the serialization at each occurrance, a back-pointer is serialized instead.

Reasons to mandate structure sharing:

Reasons to forbid it:

Reasons to have it optional:

6. What XML serialization for variables?

Does a variable look the same where it's declared as where it's used? When/if variables are typed (sorted), will the type be repeated at each use? Will a pointer be used?

Since the multisorted logic was abandoned, in BLD a variable cannot be constrained to only have (long) integer values. However, if this was re-introduced in analgoy to similarly constrained constants, it would be declared thus:

<Exists>
   <declare>
      <Var type="xsd:long">x</Var>
   <declare>
   <formula>
      ...
   </formula>
</Exists>

But imagine declaring a variable that is constrained to only have integer values as follows:

<Exists>
   <declare>
      <Var id="var_x">
         <name>x</name>
         <type>http://www.w3.org/2001/XMLSchema#int</type>
      </Var>
   <declare>
   <formula>
      ...
   </formula>
</Exists>

Now we have three options on using it:

6.1. Use Variable Name to Use Variable

<Uniterm>
   ...
   <VarReference>
      <name>x</name>
   </VarReference>
   ...
</Uniterm>

Note that we probably want to call it a "VarReference" instead of a "Var" because its syntax is different.

Actually, "Var" should be used since there is no syntactic distinction between bound and free variables in a pure logic such as BLD:

<Uniterm>
   ...
   <Var>x</Var>
   ...
</Uniterm>

Reasons For (Use Variable Name to Use Variable):

6.2. Repeat Variable Structure to Use Variable

<Uniterm>
   ...
      <Var>
         <name>x</name>
         <type>http://www.w3.org/2001/XMLSchema#int</type>
      </Var>
   ...
</Uniterm>

Actually,

<Uniterm>
   ...
      <Var type="xsd:long">x</Var>
   ...
</Uniterm>

Reasons For (Repeat Variable Structure to Use Variable):

Reasons against:

6.3. Use Variable ID for Reference

Suppose we add an ID to the declaration:

<Exists>
   <declare>
      <Var id="var_x">  <!-- Note the "id" attribute here -->
         <name>x</name>
         <type>http://www.w3.org/2001/XMLSchema#int</type>
      </Var>
   <declare>
   <formula>
      ...
   </formula>
</Exists>

Actually,

<Exists>
   <declare>
      <Var id="var_x" type="xsd:long">x</Var> <!-- Note the "id" attribute here -->
   <declare>
   <formula>
      ...
   </formula>
</Exists>

Then we can use it by just making a reference:

<Uniterm>
   ...
      <Var id="var_x" />
   ...
</Uniterm>

and the input processor (without knowing anything about the dialect or variables or anything) will produce (via structure sharing) an internal data structure like in option 2.

Reasons For (Use Variable ID for Reference):

Reasons Against (Use Variable ID for Reference):

7. What XML serialization for local named constants?

Example from BLD0921, with both book and LeRif made local:

<Uniterm>
  <op><Const type="rif:local">book</Const></op>
  <arg><Var>Author</Var></arg>
  <arg><Const type="rif:local">LeRif</Const></arg>
</Uniterm>

(fully striped, where names become content between element tags)

8. What XML serialization for global (IRI) named constants?

Example from BLD0921, with both book and LeRif made global:

<Uniterm>
  <op><Const type="rif:iri">http://example.com/products#book</Const></op>
  <arg><Var>Author</Var></arg>
  arg><Const type="rif:iri">http://example.com/books#LeRif</Const></arg>
</Uniterm>

Example from eg7b:

     <Uniterm>
       ...
       <op>
         <GlobalConstant>
           <name>http://example.com/app#r</name>
         </GlobalConstant>
       </op>
     </Uniterm>

9. What XML serialization of literal data values?

Example from BLD0921:

   <arg><Const type="xsd:long">49</Const></arg>

(fully striped)

Example from eg7b:

   <Literal_int><intValue>1</intValue></Literal_int>

10. Are builtins distinguished in the syntax from logical functions and predicates?

Assumption so far has been: no (except in their IRI path names).

11. If so: What syntax is used?

Example from BLD0921:

<Uniterm>
  <op><Const type="rif:iri">http://www.w3.org/2007/rif/builtin/greaterThan</Const></op>
  <arg><Var>diffdate</Var></arg>
  <arg><Const type="xsd:long">10</Const></arg>
</Uniterm>

(fully striped, where names become content between element tags)