W3C


RIF Basic Logic Dialect

W3C Editor's Draft 18 May17 July 2008

This version:
http://www.w3.org/2005/rules/wg/draft/ED-rif-bld-20080518/http://www.w3.org/2005/rules/wg/draft/ED-rif-bld-20080717/
Latest editor's draft:
http://www.w3.org/2005/rules/wg/draft/rif-bld/
Previous version:
http://www.w3.org/TR/2008/WD-rif-bld-20080415/http://www.w3.org/2005/rules/wg/draft/ED-rif-bld-20080707/ (color-coded diff)
Editors:
Harold Boley, National Research CouncilCouncil, Canada
Michael Kifer, State University of New York at Stony BrookBrook, USA


Abstract

This document, developed by the Rule Interchange Format (RIF) Working Group, specifies athe Basic Logic Dialect, RIF-BLD, a format that allows logic rules to be exchanged between rule-basedrule systems. A separate document RIF Data Types and Built-Ins describes data typesThe RIF-BLD presentation syntax and built-in functionssemantics are specified both directly and predicates.as specializations of the RIF Framework for Logic-based Dialects. The XML serialization syntax of RIF-BLD, obtained via a mapping from the presentation syntax, is specified using XML Schema.

Status of this Document

May Be Superseded

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.

This document is being published as one of a set of 56 documents:

  1. RIF Use Cases and Requirements
  2. RIF Basic Logic Dialect (this document)
  3. RIF Framework for Logic Dialects
  4. RIF RDF and OWL Compatibility
  5. RIF Data Types and Built-InsProduction Rule Dialect
  6. RIF Use CasesDatatypes and RequirementsBuilt-Ins 1.0

Please Comment By 2008-05-252008-07-21

The Rule Interchange Format (RIF) Working Group seeks public feedback on these Working Drafts. Please send your comments to public-rif-comments@w3.org (public archive). If possible, please offer specific changes to the text that would address your concern. You may also wish to check the Wiki Version of this document for internal-review comments and changes being drafted which may address your concerns.

No Endorsement

Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

Patents

This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.


Contents

1 Overview

This documentspecification develops RIF-BLD (the Basic Logic Dialect of the Rule Interchange Format). From a theoretical perspective, RIF-BLD corresponds to the language of definite Horn rules (see Horn Logic )with equality and witha standard first-order semantics.semantics [CL73]. Syntactically, RIF-BLD has a number of extensions to support features such as objects and frames as in F-logic [KLW95], internationalized resource identifiers (or IRIs, defined by [RFC-3987]) as identifiers for concepts, and XML Schema data types.datatypes [XML-SCHEMA2]. In addition, the documentRIF RDF and OWL Compatibility [RIF-RDF+OWL] defines the syntax and semantics of integrated RIF-BLD/RDF and RIF-BLD/OWL languages. These features make RIF-BLD a Web-aware language. However, it should be kept in mind that RIF is designed to enable interoperability among rule languages in general, and its uses are not limited to the Web.

RIF-BLD is defined in two different ways -- both normative:

  • As a direct specification, independently of the RIF Framework for Logic Dialects [RIF-FLD], for the benefit of those who desire a direct path to RIF-BLD, e.g., as prospective implementers, and are not interested in extensibility issues. This version of the RIF-BLD specification is given first.
  • As a specialization of the RIF Framework for Logic-based Dialects (RIF-FLD) ,[RIF-FLD], which is part of the RIF extensibility framework. Building on RIF-FLD, this version of the RIF-BLD specification is verycomparatively short and is presented at the end of this document,in Section RIF-BLD as a Specialization of the RIF Framework . Itat the end of this document. This is intended for the reader who is already familiar with RIF-FLD and, therefore,and does not need to go through the much longer direct specification of RIF-BLD. This version of the specificationsection is also useful for dialect designers, as it is a concrete example of how a non-trivial RIF dialect can be derived from the RIF framework for logic dialects.

Independently of the RIF framework for logic dialects, for the benefit of those who desire a quicker path to RIF-BLD, e.g. as prospective implementers, and are not interested in the extensibility issues. This version of the RIF-BLD specification is given first. Logic-based RIF dialects that extend RIF-BLD in accordance withLogic-based RIF dialects that specialize or extend RIF-BLD in accordance with the RIF Framework for Logic Dialects [RIF-FLD] will be specifieddeveloped in other documentsspecifications by thisthe RIF working group.

Editor's Note: This documentTo give a preview, here is the latest draft of thea simple complete RIF-BLD specification.example deriving a number of extensions is plannedternary relation from its inverse.

Example 1 (An introductory RIF-BLD example).

A rule can be written in English to support importderive buy relationships (rather than store any of RIF documents,them) from sell relationships (e.g., stored as facts, as exemplified by the notion of RIF compliance, andsecond line):

A few others. Tool supportbuyer buys an item from a seller if the seller sells the item to the buyer.
John sells LeRif to Mary.

The fact Mary buys LeRif from John can be logically derived by a modus ponens argument. Assuming Web IRIs for the predicates buy and sell, as well as for the individuals John, Mary, and LeRif, the above English text can be represented in RIF-BLD Presentation Syntax as follows.

Document(
  Prefix(cpt http://example.com/concepts#)
  Prefix(ppl http://example.com/people#)
  Prefix(bks http://example.com/books#)

  Group
  (
    Forall ?Buyer ?Item ?Seller (
        cpt:buy(?Buyer ?Item ?Seller) :- cpt:sell(?Seller ?Item ?Buyer)
    )
 
    cpt:sell(ppl:John bks:LeRif ppl:Mary)
  )
)

For the interchange of such rule (and fact) documents, an equivalent RIF-BLD XML Syntax is given in this specification. To formalize their meaning, a RIF-BLD Semantics is forthcoming.specified.

2 Direct Specification of RIF-BLD Presentation Syntax

This normative section specifies the syntax of RIF-BLD directly, without relying on [RIF-FLD .]. We define both athe presentation syntax (below) and an XML syntax.syntax in Section XML Serialization Syntax for RIF-BLD. The presentation syntax is normative, but not intended to be a concrete syntax for RIF-BLD. It is defined in mathematical English and is meant to be used in the definitions and examples. This syntax deliberately leaves out details such as the delimiters of the various syntactic components, escape symbols, parenthesizing, precedence of operators, and the like. Since RIF is an interchange format, it uses XML as its concrete syntax. Editor's Note: A future versionsyntax and RIF-BLD conformance is described in terms of this document might introduce syntactic shortcutssemantics-preserving transformations.

Note to simplify writingthe examplesreader: this section depends on Section Constants, Symbol Spaces, and test cases.Datatypes of [RIF-DTB].


2.1 Alphabet of RIF-BLD

Definition (Alphabet). The alphabet of the presentation language of RIF-BLD consists of

  • a countably infinite set of constant symbols Const
  • a countably infinite set of variable symbols Var (disjoint from Const)
  • a countably infinite set of argument names, ArgNames (disjoint from Const and Var)
  • connective symbols And, Or, and :-
  • quantifiers Exists and Forall
  • the symbols =, #, ##, ->, andExternal, Import, Prefix, and Base
  • the symbols Document , Group ,and ImportGroup
  • the auxiliary symbols, such assymbols "(", ")", "[", "]", "<", ">", and "^^"

The set of connective symbols, quantifiers, =, etc., is disjoint from Const and Var. The argument names in ArgNames are written as unicode strings that must not start with a question mark, "?". Variables are written as Unicode strings preceded with the symbol "?".

Constants are written as "literal"^^symspace, where literal is a sequence of Unicode characters and symspace is an identifier for a symbol space. Symbol spaces are defined in Section Constants and Symbol Spaces of the RIF-FLD document . Editor's Note: The definition of symbol spaces will eventually be also given in the document Data Types and Builtins , so the above reference will be to that document instead of RIF-FLD.[RIF-DTB].

The symbols =, #, and ## are used in formulas that define equality, class membership, and subclass relationships. The symbol -> is used in terms that have named arguments and in frame formulas. The symbol External indicates that an atomic formula or a function term is defined externally (e.g., a builtin).built-in) and the symbols Prefix and Base are used in abridged representations of IRIs.

The symbol Document is used to definespecify RIF-BLD documents, Import is an import directive, and the symbol Group is used to organize RIF-BLD formulas into collections optionally annotated with metadata.collections.   ☐

The language of RIF-BLD is the set of formulas constructed using the above alphabet according to the rules given below.


2.2 Terms

RIF-BLD defines several kinds of terms: constants and variables, positional terms, terms with named arguments, plus equality, membership, subclass, frame, and external terms. The word "term" will be used to refer to any of these constructs.

To simplify the language in the next definition, we will use the following terminology:

  • Internal base term: A simple, positional, or named-argument term.
  • ExternalBase term: An externalinternal base term of the formor External(t), where t is an internal base term. Internal term : Everything but an external term (i.e., internal base, equality, membership, subclass, and frame terms). Base term : An internala positional or external basea named-argument term.

Definition (Term).

  1. Constants and variables. If tConst or tVar then t is a simple term.
  2. Positional terms. If tConst and t1, ..., tn are base terms then t(t1 ... tn) is a positional term.
  3. Terms with named arguments. A term with named arguments is of the form t(s1->v1 ... sn->vn), where tConst and v1, ..., vn are base terms and s1, ..., sn are pairwise distinct symbols from the set ArgNames.

    The constant t here represents a predicate or a function; s1, ..., sn represent argument names; and v1, ..., vn represent argument values. The argument names, s1, ..., sn, are required to be pairwise distinct. Terms with named arguments are like positional terms except that the arguments are named and their order is immaterial. Note that a term of the form f() is both positional and with named arguments.

  4. Equality terms. t = s is an equality term, if t and s are base terms then t = s is an equality term .terms.
  5. Class membership terms (or just membership terms). t#s is a membership term if t and s are base terms.
  6. Subclass terms. t##s is a subclass term if t and s are base terms.
  7. Frame terms. t[p1->v1 ... pn->vn] is a frame term (or simply a frame) if t, p1, ..., pn, v1, ..., vn, n ≥ 0, are base terms.

    Membership, subclass, and frame terms are used to describe objects and class hierarchies.

  8. Externally defined terms. If t is an internal non-variablea positional, named-argument, or a frame term then External(t) is an externally defined term.
  9. Such terms are used for representing builtinbuilt-in functions and predicates as well as "procedurally attached" terms or predicates, which might exist in various rule-based systems, but are not specified by RIF.

      ☐ 2.3 Well-formedness ofNote that frame terms are allowed to be externally defined. Therefore, externally defined objects can be accessed using the setmore natural frame-based interface. For instance, External("http://example.com/acme"^^rif:iri["http://example.com/mycompany/president"^^rif:iri(?Year) -> ?Pres]) could be an interface provided to access an externally defined method "http://example.com/mycompany/president"^^rif:iri of all symbols, Const ,an external object "http://example.com/acme"^^rif:iri.   ☐

Observe that the argument names of frame terms, p1, ..., pn, are base terms and, as a special case, can be variables. In contrast, terms with named arguments individuals.can use only the symbols infrom ArgNames to represent their argument names. They cannot be constants from Const that belongor variables from Var. (The reason for this restriction has to do with the supported RIF data types are individuals. Each predicate and function symbol has precisely one arity . For positional symbols, an aritycomplexity of unification, which is a non-negative integer that tells how many arguments the symbol can take. For symbols that takeused by several inference mechanisms of first-order logic.)

2.3 Formulas

Any term (positional or with named arguments, an arityarguments) of the form p(...), where p is a set {s 1 ... s k }predicate symbol, is also an atomic formula. Equality, membership, subclass, and frame terms are also atomic formulas. An externally defined term of argument names ( s i ArgNames )the form External(φ), where φ is an atomic formula, is also an atomic formula, called an externally defined atomic formula.

Note that simple terms (constants and variables) are allowed for that symbol.not formulas.

More general formulas are constructed out of the arityatomic formulas with the help of logical connectives.

Definition (Formula). A symbol (or whether itformula is a predicate, a function, or an individual)statement that has one of the following forms:

  • Atomic: If φ is not specified in RIF-BLD explicitly. Instead,an atomic formula then it is inferred as follows. Each constant symbol, p , inalso a RIF-BLDformula.
  • Condition formula (or: A set of formulas) may occur in at most one context: An individual. This means that pcondition formula is either an atomic formula or a term by itself, which appears inside some other term (positional, with named arguments, in a frame, etc.). A function symbol of a particular arity. This meansformula that p occurs in a term thas one of the form p(...) and t itself occurs inside some other term. A predicate symbol of a particular arity. This meansfollowing forms:
    • Conjunction: If φ1, ..., φn, n 0, are condition formulas then so is And(φ1 ... φn), called a conjunctive formula. As a special case, And() is allowed and is treated as a tautology, i.e., a formula that p occurs inis always true.
    • Disjunction: If φ1, ..., φn, n 0, are condition formulas then so is Or(φ1 ... φn), called a term t of the form p(...)disjunctive formula. As a special case, Or() is permitted and t does not occuris treated as a contradiction, i.e., a formula that is always false.
    • Existentials: If φ is a condition formula and ?V1, ..., ?Vn are variables then Exists ?V1 ... ?Vn(φ) is an existential formula.

Condition formulas are intended to be used inside some other term.the aritypremises of rules. Next we define the symbolnotion of RIF-BLD rules, sets of rules, and its typeRIF documents.

  • Rule implication: φ :- ψ is determined by its context. Ifa symbol from Const occurs in more than one context informula, called rule implication, if:
    • φ is an atomic formula or a setconjunction of atomic formulas,
    • the setψ is not well-formed in RIF-BLD. Fora termcondition formula, and
    • none of the form External(t) to be well-formed, t must be an instance of an external schema , i.e., a schema of an externally specified term, as definedatomic formulas in Section Schemas forφ is an externally defined Terms of RIF-FLD. Also, ifterm (i.e., a term of the form External(p(...)) occurs as an atomic formula then p is considered a predicate symbol. Editor's Note:External(...)).
  • Universal rule: If φ is a well-formed termrule implication and ?V1, ..., ?Vn are variables then Forall ?V1 ... ?Vn(φ) is onea formula, called a universal rule. It is required that occursall the free variables in φ occur among variables ?V1 ... ?Vn in the quantification part. A well-formed setvariable ?v is free in φ if it does not occur in a subformula of fomulas. 2.4 Formulas Any term (positional or with named arguments)φ of the form p(...)Q ?v (ψ), where pQ is a predicate symbol, isquantifier (Forall or Exists). Universal rules will also an atomic formulabe referred to as RIF-BLD rules.
  • Equality, membership, subclass, and frame terms are also atomic formulas. A statement of the form External(φ) , whereUniversal fact: If φ is an atomic formula,formula then Forall ?V1 ... ?Vn(φ) is also an atomica formula, called an externally defined atomic formula. Simple terms (constants and variables) are not formulas. Not all atomic formulas are well-formed.a well-formed atomic formula is an atomic formulauniversal fact, provided that is also a well-formed term (see Section Well-formedness of Terms ). More general formulas are constructed out ofall the atomic formulas withfree variables in φ occur among the help of logical connectives. Definition (Well-formed formula) . A well-formed formula is a statement that has one of the following forms: Atomic : If φ is a well-formed atomic formula then it is also a well-formed formula. Conjunctionvariables ?V1 ... ?Vn.

    Universal facts are often considered to be rules without premises (or having true as their premises).

  • Group: If φ1, ..., φn , n 0 ,are well-formedRIF-BLD rules, universal facts, variable-free rule implications, variable-free atomic formulas, or group formulas then so is And(φGroup(φ1 ... φn) , called a conjunctive formula. As a special case, And()is allowed and is treated as a tautology, i.e.,a group formula.

    Group formulas are used to represent sets of rules and facts. Note that is always true. Disjunction : If φ 1 , ...,some of the φ n , n 0 , are well-formedi's can be group formulas then so is Or(φthemselves, which means that groups can be nested.

  • Document: An expression of the form Document(directive1 ... φdirectiven ) , called a disjunctive formula. When n=0 , we get Or() as a special case; itΓ) is treated asa contradiction, i.e.,RIF-BLD document formula (or simply a document formula that is always false. Existentials :), if
    • φΓ is a well-formedgroup formula and ?Vthat makes the actual logical content of the document.
    • directive1, ..., ?V n are variables then Exists ?V 1 ... ?Vdirectiven (φ) is an existential formula. Formulas constructed using the above definitionsare called RIF-BLD conditionsdirectives. The following defines the notion ofA RIF-BLD rule. Rule implication : If φ isdirective can be an import directive, a well-formed atomic formula and ψ isprefix directive, or a RIF-BLD condition then φ :- ψ isbase directive.
      • A well-formed formula, called rule implicationbase directive has the form Base(iri), provided that φwhere iri is not an externally defined term (i.e.,a term ofunicode string in the form External(...) ). Quantified rule : If φ is a rule implication and ?V 1 , ..., ?V nof an IRI.

        Like prefix directives, base directives do not affect the semantics. They are variables then Forall ?V 1 ... ?V n (φ) isused as syntactic shortcuts for expanding relative IRIs into full IRIs, as described in Section Constants and Symbol Spaces of [RIF-DTB].

      • A well-formed formula, called quantified rule . Itprefix directive has the form Prefix(p v), where p is requiredan alphanumeric string that all the free (i.e., non-quantified) variables in φ occur inserves as the prefix Forall ?V 1 ... ?V n . Quantified rules will also be referred to as RIF-BLD rules . Group : If φname and v is a frame term and ρ 1 , ..., ρ n are RIF-BLD rules or group formulas (they can be mixed) then Group φ 1 ... ρ n ) and Group 1 ... ρ n ) are group formulas . Group formulasmacro-expansion for p -- a string that forms an IRI.

        Prefix directives do not affect the semantics of RIF documents. Instead, they are used as shorthands to represent setsallow more concise representation of rules annotated with metadata.IRI constants. This metadatamechanism is specified using an optional frame term φexplained in [RIF-DTB], Section Constants and Symbol Spaces.

      • Note that some of the ρ i 's can be group formulas themselves, which means that groupsAn import directive can be nested. This allowshave one to attach metadata to various subsets of rules, which may be inside larger rule sets, which in turn can be annotated. Document : An expressionof the form Document(φ Import 1 ... Import n Γ) is a document formula , if φ is a frame term, which is intended to represent the metadata associated with the document. Γ is a group formula that makes the actual logical content of the document. Import 1 , ..., Import n are import directives , which have the formthese two forms: Import(t) or Import(t p) , where. Here t is an IRI constant and p is a term. The constant t indicates the addresslocation of another rule setdocument to be imported and p is called the profile of import.

        Section Direct Specification of RIF-BLD Semantics of this document defines the semantics for the directive Import(t) only. The semantics of the directive Import(t p) is given in the document RIF RDF and OWL Compatibility .[RIF-RDF+OWL]. It is used for importing non-RIF-BLD logical entities, such as RDF data and OWL ontologies. The profile specifies what kind of entity is being imported and under what semantics (for instance, the various RDF entailment regimes).

      There can be at most one Base directive in the sequence of directives in a document formula. It must be the first directive in the sequence, if present, followed by a sequence of Prefix directives (again, if present), followed by a sequence of Import directives.

    • All parts of thea document formula, the metadata,formula -- the directives,directives and the group formula -- are optional and can be omitted.

  ☐ It canIn this definition, the component formulas φ, φi, ψi, and Γ are said to be seen fromsubformulas of the definitionsrespective formulas (condition, rule, group, etc.) that are built with the help of these components.   ☐


The above definitions endow RIF-BLD haswith a wide variety of syntactic forms for terms and formulas. This provides theformulas, which creates infrastructure for exchanging syntactically diverse rule languages that support rich collections of syntactic forms.languages. Systems that do not support some of the syntax directly can still support it through syntactic transformations. For instance, disjunctions in the rule body can be eliminated through a standard transformation, such as replacing p :- Or(q r) with a pair of rules p :- q,   p :- r. Terms with named arguments can be reduced to positional terms by ordering the arguments by their names and incorporating them into the predicate name. For instance, p(bb->1 aa->2) can be represented as p_aa_bb(2,1).


2.5 EBNF Grammar for2.4 RIF-BLD Annotations in the Presentation Syntax

ofRIF-BLD So far, the syntaxallows every term and formula (including terms and formulas that occur inside other terms and formulas) to be optionally preceded by an annotation of RIF-BLD has been specified in mathematical English. Tool developers, however, may prefer EBNF notation, which providesthe form (* id φ *), where id is a more succinct overviewrif:iri constant and φ is a frame formula or a conjunction of frame formulas. Both items inside the syntax. Several points should be kept in mind regarding this notation.annotation are optional. The syntax of first-order logic is not context-free, so EBNF does not captureid part represents the syntaxidentifier of RIF-BLD precisely. For instance, it cannot capturethe section on well-formedness conditions , i.e.,term/formula to which the requirement that each symbol in RIF-BLD can occur in at most one context. As a result,annotation is attached and φ is the EBNF grammar defines a strict supersetmetadata part of RIF-BLD (not all rules that are derivable using the EBNF grammar are well-formed rules in RIF-BLD).the EBNF syntax is not a concrete syntax: itannotation. RIF-BLD does not address the details of how constants and variables are represented, and itimpose any restrictions on φ apart from what is not sufficiently precise about the delimitersstated above. In particular, it may include variables, function symbols, rif:local constants, and escape symbols. Instead, white space is informally usedso on.

Document formulas with and without annotations will be referred to as RIF-BLD documents.

A delimiter, and white spaceconvention is impliedused to avoid a syntactic ambiguity in productions that use Kleene star.the above definition. For instance, TERM* is toin (* id φ *) t[w -> v] the metadata annotation could be understood as TERM TERM ... TERM , where each ' ' abstracts from oneattributed to the term t or more blanks, tabs, newlines, etc. Thisto the entire frame t[w -> v]. The convention in RIF-BLD is done intentionally,that the above annotation is considered to be syntactically attached to the entire frame. Yet, since RIF's presentation syntaxφ is used asa tool for specifyingconjunction, some conjuncts can be used to provide metadata targeted to the semantics and for illustrationobject part, t, of the main RIF concepts through examples.frame. Generally, the convention associates each annotation to the largest term or formula it precedes.

It is not intended as a concrete syntax for a rule language. RIF defines a concrete syntax onlysuggested to use Dublin Core, RDFS, and OWL properties for exchanging rules,metadata, along the lines of Section 7.1 of [OWL-Reference]-- specifically owl:versionInfo, rdfs:label, rdfs:comment, rdfs:seeAlso, rdfs:isDefinedBy, dc:creator, dc:description, dc:date, and foaf:maker.

2.5 Well-formed Formulas

Not all formulas and thus not all documents are well-formed in RIF-BLD: a requirement is that syntaxno constant is XML-based, obtainedallowed to appear in more than one context. What this means precisely is explained below.

The set of all constant symbols, Const, is partitioned into several subsets as a refinementfollows:

  • Subsets of positional predicate symbols:
    • one subset per symbol arity (defined below)
    • symbols for externally defined predicates are in their own subsets.
  • Subsets of predicate symbols with named arguments:

    Again, one subset per symbol arity and serializationsymbols for externally defined predicates are in their own subsets.

  • Subsets of the EBNF syntax.positional and named function symbols:

    As before, one subset per symbol arity and symbols with named arguments and for allexternally defined predicates are in their own subsets.

  • A subset of individuals.

    The above reasons,symbols in Const that belong to the EBNF syntax is not normativeprimitive datatypes are required to be individuals.

Each predicate and function symbol has precisely one arity.

  • 2.5.1 EBNFFor the RIF-BLD Condition Language The Condition Language represents formulaspositional symbols, an arity is a non-negative integer that can be used in the body of RIF-BLD rules.tells how many arguments the EBNF grammarsymbol can take.
  • For symbols that take named arguments, an arity is a supersetset {s1 ... sk} of argument names (si ArgNames) that are allowed for that symbol.

An important point is that neither the RIF-BLD condition language is as follows. FORMULA ::= 'And' '(' FORMULA* ')' | 'Or' '(' FORMULA* ')' | 'Exists' Var+ '(' FORMULA ')' | ATOMIC | 'External' '(' ATOMIC ')' ATOMIC ::= Atom | Equal | Member | Subclass | Frame Atom ::= UNITERM UNITERM ::= Const '(' (TERM* | (Name '->' TERM)*) ')' Equal ::= TERM '=' TERM Member ::= TERM '#' TERM Subclass ::= TERM '##' TERM Frame ::= TERM '[' (TERM '->' TERM)* ']' TERM ::= Const | Var | Expr | 'External' '(' Expr ')' Expr ::= UNITERM Const ::= '"' UNICODESTRING '"^^' SYMSPACE Name ::= UNICODESTRING Var ::= '?' UNICODESTRING SYMSPACE ::= UNICODESTRING The production rule forabove partitioning of constant symbols nor the non-terminal FORMULA represents RIF condition formulas (defined earlier).arity are specified explicitly. Instead, the connectives And and Or define conjunctionsarity of a symbol and disjunctionsits type is determined by the context in which the symbol is used.

Definition (Context of conditions, respectively. Exists introduces existentially quantified variables. Here Var+ stands fora symbol). The listcontext of variables that are freean occurrence of a symbol, s∈Const, in FORMULA . RIF-BLD conditions permit only existential variables.a RIF-BLD FORMULA can also beformula, φ, is determined as follows:

  • If s occurs as an atomic term, i.e. an Atom , External Atom , Equal , Member , Subclass , or Frame . A TERMsubformula of the form s(...) with arity α (the arity can becorrespond to a constant, variable, Expr ,positional occurrence of s or External Expr . The RIF-BLD presentation syntax does not committo any particular vocabulary and permits arbitrary Unicode stringsan occurrence with named arguments) then s occurs in constant symbols, argument names, and variables. Constant symbols havethe form: "UNICODESTRING"^^SYMSPACE , where SYMSPACE is a Unicode string that represents an identifier or an aliascontext of thea predicate symbol spacewith arity α.
  • If s occurs as a term (not subformula) of the constant, and UNICODESTRING is a Unicode string fromform s(...) with arity α then s occurs in the lexical spacecontext of that symbol space. Names are denoted by Unicode character sequences. Variables are denoted bya UNICODESTRING prefixedfunction symbol with a ?-sign. Equality, membership, and subclass terms are self-explanatory.arity α.
  • If s occurs as an Atom and Expr (expression) can either be positional oratomic subformula External(s(...)) with named arguments. A frame term is a term composedarity α then s occurs in the context of an object Id andexternal predicate symbol with arity α.
  • If s occurs as a collectionterm (not subformula) External(s(...)) with arity α then s occurs in the context of attribute-value pairs.an external ( ATOMICfunction symbol with arity α.   ☐

Definition (Imported document). Let Δ be a document formula and Import(t) be one of its import directives, where t is a call toan externally defined predicate, equality, membership, subclassing, or frame. Likewise, External ( Expr )IRI constant that identifies another document formula, Δ'. We say that Δ' is directly imported into Δ.

A calldocument formula Δ' is said to an externally defined function. Example 1 (RIF-BLD conditions). This example shows conditionsbe imported into Δ if it is either directly imported into Δ or it is imported (directly or not) into some other formula that are composed of atoms, expressions, frames, and existentials.is directly imported into Δ.    


Definition (Well-formed formula). A formula φ is well-formed iff:

  • every constant symbol (whether rif:local or not) mentioned in frame formulas variablesφ occurs in exactly one context.
  • if φ is a document formula and Δ'1, ..., Δ'k are shownall of its imported documents, then every non-rif:local constant symbol mentioned in φ or any of the positionsimported Δ'is must occur in exactly one context (in all of object Ids, object properties, and property values. For brevity, we usethe compact URI notation [ CURIE ], prefix:suffix , which should be understood asΔ'is).
  • Whenever a macro that expands intoformula contains a concatenationterm or a subformula of the prefix definition and suffix . Thus, if bks is a prefix that expands into http://example.com/books# then bks:LeRif shouldform External(t), t must be understood merely asan abbreviationinstance of the coherent set of external schemas (Section Schemas for http://example.com/books#LeRif .Externally Defined Terms of [RIF-DTB]) associated with the compact URI notationlanguage of RIF-BLD.   ☐
  • If t is not partan instance of the RIF-BLD syntax. Compact URI prefixes: bks expands into http://example.com/books# auth expands into http://example.com/authors# cpt expands into http://example.com/concepts# Positional terms: "cpt:book"^^rif:iri("auth:rifwg"^^rif:iri "bks:LeRif"^^rif:iri) Exists ?X ("cpt:book"^^rif:iri(?X "bks:LeRif"^^rif:iri)) Termscoherent set of external schemas associated with named arguments: "cpt:book"^^rif:iri(cpt:author->"auth:rifwg"^^rif:iri cpt:title->"bks:LeRif"^^rif:iri) Exists ?X ("cpt:book"^^rif:iri(cpt:author->?X cpt:title->"bks:LeRif"^^rif:iri)) Frames: "bks:wd1"^^rif:iri["cpt:author"^^rif:iri->"auth:rifwg"^^rif:iri "cpt:title"^^rif:iri->"bks:LeRif"^^rif:iri] Exists ?X ("bks:wd2"^^rif:iri["cpt:author"^^rif:iri->?X "cpt:title"^^rif:iri->"bks:LeRif"^^rif:iri]) Exists ?X (And ("bks:wd2"^^rif:iri#"cpt:book"^^rif:iri "bks:wd2"^^rif:iri["cpt:author"^^rif:iri->?X "cpt:title"^^rif:iri->"bks:LeRif"^^rif:iri])) Exists ?I ?X (?I["cpt:author"^^rif:iri->?X "cpt:title"^^rif:iri->"bks:LeRif"^^rif:iri]) Exists ?I ?X (And (?I#"cpt:book"^^rif:iri ?I["cpt:author"^^rif:iri->?X "cpt:title"^^rif:iri->"bks:LeRif"^^rif:iri])) Exists ?S ("bks:wd2"^^rif:iri["cpt:author"^^rif:iri->"auth:rifwg"^^rif:iri ?S->"bks:LeRif"^^rif:iri]) Exists ?X ?S ("bks:wd2"^^rif:iri["cpt:author"^^rif:iri->?X ?S->"bks:LeRif"^^rif:iri]) Exists ?I ?X ?S (And (?I#"cpt:book"^^rif:iri ?I[author->?X ?S->"bks:LeRif"^^rif:iri])) 2.5.2 EBNF forthe RIF-BLD Rulelanguage then t can occur only as External(t), i.e., as an external term or atomic formula.


Definition (Language of RIF-BLD). The presentation syntax forlanguage of RIF-BLD rules extendsconsists of the syntax in Sectionset of all well-formed formulas and is determined by:

  • the alphabet of the language and
  • a set of coherent external schemas, which determine the available built-ins and other externally defined predicates and functions.   ☐


2.6 EBNF Grammar for RIF-BLD Condition Language withthe following productions. Editor's Note:Presentation Syntax of RIF-BLD

So far, the metadatasyntax andof RIF-BLD has been specified in mathematical English. Tool developers, however, may prefer EBNF notation, which provides a more succinct overview of the approach to rule identification presentedsyntax. Several points should be kept in mind regarding this draft are currently under discussion bynotation.


2.6.1 EBNF for the Condition Language

The Condition Language represents formulas that can be used in the body of RIF-BLD rules. The EBNF grammar for a superset of the RIF-BLD condition language is as follows.

  FORMULA        ::= IRIMETA? 'And' '(' FORMULA* ')' |
                     IRIMETA? 'Or' '(' FORMULA* ')' |
                     IRIMETA? 'Exists' Var+ '(' FORMULA ')' |
                     ATOMIC |
                     IRIMETA? 'External' '(' Atom | Frame ')'
  ATOMIC         ::= IRIMETA? (Atom | Equal | Member | Subclass | Frame)
  Atom           ::= UNITERM
  UNITERM        ::= Const '(' (TERM* | (Name '->' TERM)*) ')'
  Equal          ::= TERM '=' TERM
  Member         ::= TERM '#' TERM
  Subclass       ::= TERM '##' TERM
  Frame          ::= TERM '[' (TERM '->' TERM)* ']'
  TERM           ::=  ConstIRIMETA? (Const | Var | Expr | 'External' '(' Expr  ')'')')
  Expr           ::= UNITERM
  Const          ::= '"' UNICODESTRING '"^^' SYMSPACE | CONSTSHORT
  IRICONST       ::= '"' IRI '"^^' 'rif:iri'
  Name           ::= UNICODESTRING
  Var            ::= '?' UNICODESTRING
  SYMSPACE       ::=  UNICODESTRING A RIF-BLD Document consists of an optional Directive and an optional Group annotated with optional metadata,ANGLEBRACKIRI | CURIE
 
  IRIMETA         . A Directive can contain any number of Import s. A::= '(*' IRICONST? (Frame | 'And' '(' Frame* ')')? '*)'

As explained in Section RIF-BLD Group is a nested collection ofAnnotations in the Presentation Syntax, RIF-BLD rules annotatedformulas and terms can be prefixed with optional metadata,annotations, IRIMETA ., for identification and metadata. IRIMETA areis represented using (*...*)-brackets that contain an optional IRI constant, IRICONST, as identifier followed by an optional Frame s. A Group can contain any numberor conjunction of RULEFrames along with any numberas metadata. The IRI of nested Group s. Rules are generated by CLAUSE , which can be inan IRICONST has the scopeform of a Forall quantifier. If a CLAUSE inan internationalized resource identifier as defined by [RFC-3987].

The RULEproduction has a free (non-quantified) variable, it must occur inrule for the Var+ sequence. Frame , Var , ATOMIC , andnon-terminal FORMULA were defined as part ofrepresents RIF condition formulas (defined earlier). The syntaxconnectives And and Or define conjunctions and disjunctions of conditions, respectively. Exists introduces existentially quantified variables. Here Var+ stands for positive conditionsthe list of variables that are free in Section EBNF for RIF-BLD Condition LanguageFORMULA. In the CLAUSE productionRIF-BLD conditions permit only existential variables. A RIF-BLD FORMULA can also be an ATOMIC is treated as a rule withterm, i.e. an empty condition part -- in which case it is usually called a factAtom, External Atom, Equal, Member, Subclass, or Frame. Note that, byA definition in Section FormulasTERM can be a constant, variable, Expr, formulasor External Expr.

The RIF-BLD presentation syntax does not commit to any particular vocabulary and permits arbitrary Unicode strings in constant symbols, argument names, and variables. Constant symbols can have this form: "UNICODESTRING"^^SYMSPACE, where SYMSPACE is a ANGLEBRACKIRI or CURIE that query externallyrepresents an identifier of the symbol space of the constant, and UNICODESTRING is a Unicode string from the lexical space of that symbol space. ANGLEBRACKIRI and CURIE are defined atoms (i.e., formulasin Section Shortcuts for Constants in RIF's Presentation Syntax of [RIF-DTB]. Constant symbols can also have several shortcut forms, which are represented by the form External(Atom(...)) )non-terminal CONSTSHORT. These shortcuts are not allowedalso defined in the conclusion partsame section of [RIF-DTB]. One of them is the CURIE shortcut, which is extensively used in the examples in this document. Names are Unicode character sequences. Variables are composed of UNICODESTRING symbols prefixed with a ?-sign.

Equality, membership, and subclass terms are self-explanatory. An Atom and Expr (expression) can either be positional or with named arguments. A frame term is a term composed of an object Id and a rulecollection of attribute-value pairs. An External( ATOMIC does not expandAtom) is a call to an externally defined predicate; External ).(Frame) is a call to an externally defined frame. Likewise, External(Expr) is a call to an externally defined function.


Example 2 (RIF-BLD rules).conditions).

This example shows a business rule borrowed from the document RIF Use Cases and Requirements : If an item is perishableconditions that are composed of atoms, expressions, frames, and it is delivered to John more than 10 days after the scheduled delivery date thenexistentials. In frame formulas variables are shown in the item will be rejected by him. As before,positions of object Ids, object properties, and property values. For better readabilitybrevity, we use the compact URI notation. Compact URI prefixes: ppl expands into http://example.com/people# cpt expands into http://example.com/concepts# op expands into the yet-to-be-determined IRICURIE shortcut notation prefix:suffix for RIF builtin predicates a. Universal form: Forall ?item ?deliverydate ?scheduledate ?diffduration ?diffdays ( "cpt:reject"^^rif:iri("ppl:John"^^rif:iri ?item) :- And("cpt:perishable"^^rif:iri(?item) "cpt:delivered"^^rif:iri(?item ?deliverydate "ppl:John"^^rif:iri) "cpt:scheduled"^^rif:iri(?item ?scheduledate) External("fn:subtract-dateTimes-yielding-dayTimeDuration"^^rif:iri(?deliverydate ?scheduledate ?diffduration)) External("fn:get-days-from-dayTimeDuration"^^rif:iri(?diffduration ?diffdays)) External("op:numeric-greater-than"^^rif:iri(?diffdays "10"^^xsd:integer))) ) b. Universal-existential form: Forall ?item ( "cpt:reject"^^rif:iri("ppl:John"^^rif:iri ?item ) :- Exists ?deliverydate ?scheduledate ?diffduration ?diffdays ( And("cpt:perishable"^^rif:iri(?item) "cpt:delivered"^^rif:iri(?item ?deliverydate "ppl:John"^^rif:iri) "cpt:scheduled"^^rif:iri(?item ?scheduledate) External("fn:subtract-dateTimes-yielding-dayTimeDuration"^^rif:iri(?deliverydate ?scheduledate ?diffduration)) External("fn:get-days-from-dayTimeDuration"^^rif:iri(?diffduration ?diffdays)) External("op:numeric-greater-than"^^rif:iri(?diffdays "10"^^xsd:integer))) ) ) Example 3 (A RIF-BLD group annotated with metadata). This example shows a group formula that consists of two RIF-BLD rules. The first of these rules is copied from Example 2a. The groupconstant symbols, which is annotated with Dublin Core metadata representedunderstood as a frame. Compact URI prefixes: ppl expands into http://example.com/people# cpt expands into http://example.com/concepts# dc expands into http://purl.org/dc/terms/ w3macro that expands into http://www.w3.org/ Group " http://sample.org "^^rif:iri["dc:publisher"^^rif:iri->"w3:W3C"^^rif:iri "dc:date"^^rif:iri->"2008-04-04"^^xsd:date] ( Forall ?item ?deliverydate ?scheduledate ?diffduration ?diffdays ( "cpt:reject"^^rif:iri("ppl:John"^^rif:iri ?item) :- And("cpt:perishable"^^rif:iri(?item) "cpt:delivered"^^rif:iri(?item ?deliverydate "ppl:John"^^rif:iri) "cpt:scheduled"^^rif:iri(?item ?scheduledate) External("fn:subtract-dateTimes-yielding-dayTimeDuration"^^rif:iri(?deliverydate ?scheduledate ?diffduration)) External("fn:get-days-from-dayTimeDuration"^^rif:iri(?diffduration ?diffdays)) External("op:numeric-greater-than"^^rif:iri(?diffdays "10"^^xsd:integer))) ) Forall ?item ( "cpt:reject"^^rif:iri("ppl:Fred"^^rif:iri ?item) :- "cpt:unsolicited"^^rif:iri(?item) ) ) 3 Direct Specification of RIF-BLD Semantics This normative section specifies the semanticsan IRI obtained by concatenation of RIF-BLD directly, without relying on RIF-FLD . 3.1 Truth Valuesthe set TV of truth values in RIF-BLD consists of just two values, tprefix definition and fsuffix. 3.2 Semantic Structures The key concept in a model-theoretic semantics of a logic languageThus, if bks is the notion ofa semantic structure . The definition, below,prefix that expands into http://example.com/books# then bks:LeRif is a little bit more general than necessary. This is done in order to better see the connection with the semantics of the RIF framework . Definition (Semantic structure)an abbreviation for "http://example.com/books#LeRif"^^rif:iri. A semantic structure , I , is a tuple of the form < TV , DTS , D , D ind , D func , I C , I V , I F , I frame , I SF , I sub , I isa , I = , I external , I truth >. Here D is a non-empty set of elements called the domain of I ,This and D ind , D funcother shortcuts are nonempty subsets of D . D ind is used to interpret the elements of Const , which denote individuals and D func is used to interpretdefined in [RIF-DTB]. Assume that the elements of Const , which denote function symbols. As before, Const denotesfollowing prefix directives appear in the set of all constant symbols and Varpreamble to the set of all variable symbols. TV denotesdocument:

Prefix(bks  http://example.com/books#)
Prefix(auth http://example.com/authors#)
Prefix(cpt  http://example.com/concepts#)
Positional terms:
  
  cpt:book(auth:rifwg bks:LeRif)
  Exists ?X (cpt:book(?X bks:LeRif))

Terms with named arguments:

  cpt:book(cpt:author->auth:rifwg  cpt:title->bks:LeRif)
  Exists ?X (cpt:book(cpt:author->?X cpt:title->bks:LeRif))

Frames:

  bks:wd1[cpt:author->auth:rifwg cpt:title->bks:LeRif]
  Exists ?X (bks:wd2[cpt:author->?X  cpt:title->bks:LeRif])
  Exists ?X (And (bks:wd2#cpt:book  bks:wd2[cpt:author->?X  cpt:title->bks:LeRif]))
  Exists ?I ?X (?I[cpt:author->?X  cpt:title->bks:LeRif])
  Exists ?I ?X (And (?I#cpt:book ?I[cpt:author->?X  cpt:title->bks:LeRif]))
  Exists ?S (bks:wd2[cpt:author->auth:rifwg ?S->bks:LeRif])
  Exists ?X ?S (bks:wd2[cpt:author->?X ?S->bks:LeRif])
  Exists ?I ?X ?S (And (?I#cpt:book  ?I[author->?X ?S->bks:LeRif]))


2.6.2 EBNF for the set of truth values thatRule Language

The semantic structure uses and DTS ispresentation syntax for RIF-BLD rules extends the set of primitive data types usedsyntax in I (please refer toSection Primitive Data Types of RIF-FLDEBNF for RIF-BLD Condition Language with the semantics of data types). Editor's Note: In the future versions of this document, the above reference will point to thefollowing productions.

 Document   Data Types and Builtins instead::= IRIMETA? 'Document' '(' Base? Prefix* Import* Group? ')'
 Base      ::= 'Base' '(' IRI ')'
 Prefix    ::= 'Prefix' '(' Name IRI ')'
 Import    ::= IRIMETA? 'Import' '(' IRICONST PROFILE? ')'
 Group     ::= IRIMETA? 'Group' '(' (RULE | Group)* ')'
 RULE      ::= (IRIMETA? 'Forall' Var+ '(' CLAUSE ')') | CLAUSE
 CLAUSE    ::= Implies | ATOMIC
 Implies   ::= IRIMETA? (ATOMIC | 'And' '(' ATOMIC* ')') ':-' FORMULA
 PROFILE   ::= TERM

For convenience, we reproduce the condition language part of RIF-FLD.the other componentsEBNF below.

  FORMULA        ::= IRIMETA? 'And' '(' FORMULA* ')' |
                     IRIMETA? 'Or' '(' FORMULA* ')' |
                     IRIMETA? 'Exists' Var+ '(' FORMULA ')' |
                     ATOMIC |
                     IRIMETA? 'External' '(' Atom | Frame ')'
  ATOMIC         ::= IRIMETA? (Atom | Equal | Member | Subclass | Frame)
  Atom           ::= UNITERM
  UNITERM        ::= Const '(' (TERM* | (Name '->' TERM)*) ')'
  Equal          ::= TERM '=' TERM
  Member         ::= TERM '#' TERM
  Subclass       ::= TERM '##' TERM
  Frame          ::= TERM '[' (TERM '->' TERM)* ']'
  TERM           ::= IRIMETA? (Const | Var | Expr | 'External' '(' Expr ')')
  Expr           ::= UNITERM
  Const          ::= '"' UNICODESTRING '"^^' SYMSPACE | CONSTSHORT
  IRICONST       ::= '"' IRI '"^^' 'rif:iri'
  Name           ::= UNICODESTRING
  Var            ::= '?' UNICODESTRING
  SYMSPACE       ::= ANGLEBRACKIRI | CURIE
 
  IRIMETA        ::= '(*' IRICONST? (Frame | 'And' '(' Frame* ')')? '*)'

Recall that an IRI has the form of I are total mappings definedan internationalized resource identifier as follows: I C maps Const to D . This mapping interprets constant symbols. In addition: Ifdefined by [RFC-3987].

A constant, c  ∈  Const , denotesRIF-BLD Document consists of an individual then it is required that I C ( c ) ∈  D ind . If c  ∈  Constoptional Base, denotes a function symbol (positional or with named arguments) then it is required that I C ( c ) ∈  D func . I V maps Var to D indfollowed by any number of Prefixes, followed by any number of Imports, followed by an optional Group. This mapping interprets variable symbols. I F maps DBase and Prefix just serve as shortcut mechanisms for (long) IRIs. An Import indicates the location of a document to functions D* ind D (here D* indbe imported and an optional profile. A RIF-BLD Group is a setnested collection of all sequencesany number of RULE elements along with any finite length overnumber of nested Groups.

Rules are generated using CLAUSE elements. The domain D ind ) This mapping interprets positional terms.RULE production has two alternatives:

  • In addition: If d D func then I F ( d ) must be a function D* ind D ind . This means that whenthe first, a function symbolCLAUSE is applied to argumentsin the scope of the Forall quantifier. In that case, all variables mentioned in CLAUSE are individual objects then the result is also an individual object. I SF maps Drequired to also appear among the set of total functionsvariables in the Var+ sequence.
  • In the second alternative, CLAUSE appears on its own. In that case, CLAUSE cannot have variables.

Frame, Var, ATOMIC, and FORMULA were defined as part of the form SetOfFiniteSets ( ArgNames × D ind ) Dsyntax for positive conditions in Section EBNF for RIF-BLD Condition Language. This mapping interprets function symbols with named arguments.In addition: If d D func then I SF ( d ) must be a function SetOfFiniteSets ( ArgNames × D ind ) D ind . This is analogous tothe interpretation of positional terms with two differences: Each pair < s,v > ArgNames × D ind representsCLAUSE production, an argument/value pair instead of justATOMIC is what is usually called a value in the case offact. An Implies rule can have an ATOMIC or a positional term. The argumentsconjunction of ATOMIC elements as conclusion; it has a term with named arguments constitute a finite set of argument/value pairs rather thanFORMULA as premise. Note that, by a finite ordered sequencedefinition in Section Formulas, formulas that query externally defined atoms (i.e., formulas of simple elements. So,the order ofform External(Atom(...))) are not allowed in the argumentsconclusion part of a rule (ATOMIC does not matter. I frame maps D indexpand to total functions of the form SetOfFiniteBags ( D ind × D ind ) D .External).


Example 3 (RIF-BLD rules).

This mapping interprets frame terms. An argument, d D ind , to I frame representexample shows a business rule borrowed from the document RIF Use Cases and Requirements:

If an objectitem is perishable and the finite bag {< a1,v1 >, ..., < ak,vk >} represents a bag of attribute-value pairs for d . We will see shortly how I frameit is useddelivered to determineJohn more than 10 days after the truth valuation of frame terms. Bags (multi-sets) are used here becausescheduled delivery date then the order ofitem will be rejected by him.

As before, for better readability we use the attribute/value pairscompact URI notation defined in a frame is immaterial[[RIF-DTB], Section Constants and pairs may repeat: o[a->b a->b]Symbol Spaces. Such repetitions arise naturally when variables are instantiated with constants. For instance, o[?A->?B ?C->?D] becomes o[a->b a->b] if variables ?A and ?CAgain, prefix directives are instantiated withassumed in the symbol a and ?B , ?D with b . I sub gives meaningpreamble to the subclass relationship. It is a mappingdocument. Then, two versions of the form D ind × D ind D .main part of the operator ## is required to be transitive, i.e., c1 ## c2 and c2 ## c3 must imply c1 ## c3 .document are given.

Prefix(ppl  http://example.com/people#)
Prefix(cpt  http://example.com/concepts#)
Prefix(func http://www.w3.org/2007/rif-builtin-function#)
Prefix(pred http://www.w3.org/2007/rif-builtin-predicate#)

a. Universal form:

   Forall ?item ?deliverydate ?scheduledate ?diffduration ?diffdays (
        cpt:reject(ppl:John ?item) :-
            And(cpt:perishable(?item)
                cpt:delivered(?item ?deliverydate ppl:John)
                cpt:scheduled(?item ?scheduledate)
                ?diffduration = External(func:subtract-dateTimes(?deliverydate ?scheduledate))
                ?diffdays = External(func:days-from-duration(?diffduration))
                External(pred:numeric-greater-than(?diffdays 10)))
   )

b. Universal-existential form:

   Forall ?item (
        cpt:reject(ppl:John ?item ) :-
            Exists ?deliverydate ?scheduledate ?diffduration ?diffdays (
                 And(cpt:perishable(?item)
                     cpt:delivered(?item ?deliverydate ppl:John)
                     cpt:scheduled(?item ?scheduledate)
                     ?diffduration = External(func:subtract-dateTimes(?deliverydate ?scheduledate))
                     ?diffdays = External(func:days-from-duration(?diffduration))
                     External(pred:numeric-greater-than(?diffdays 10)))
            )
   )



Example 4 (A RIF-BLD document containing an annotated group).

This is ensured byexample shows a restriction in Section Interpretation of Formulas . I isa gives meaning to class membership. It iscomplete document containing a mapping of the form D ind × D ind D . The relationships # and ## are required to have the usual propertygroup formula that all members of a subclass are also membersconsists of two RIF-BLD rules. The superclass, i.e., o # cl and cl ## scl must imply o # scl . This is ensured by a restriction in Section Interpretationfirst of Formulas . I =these rules is a mappingcopied from Example 3a. The group is annotated with an IRI identifier and frame-represented Dublin Core metadata.

Document(
  Prefix(ppl  http://example.com/people#)
  Prefix(cpt  http://example.com/concepts#)
  Prefix(dc   http://purl.org/dc/terms/)
  Prefix(func http://www.w3.org/2007/rif-builtin-function#)
  Prefix(pred http://www.w3.org/2007/rif-builtin-predicate#)
  Prefix(xs   http://www.w3.org/2001/XMLSchema#)
  
  (* "http://sample.org"^^rif:iri pd[dc:publisher -> http://www.w3.org/
                                     dc:date -> "2008-04-04"^^xs:date] *)
  Group
  (
    Forall ?item ?deliverydate ?scheduledate ?diffduration ?diffdays (
        cpt:reject(ppl:John ?item) :-
            And(cpt:perishable(?item)
                cpt:delivered(?item ?deliverydate ppl:John)
                cpt:scheduled(?item ?scheduledate)
                ?diffduration = External(func:subtract-dateTimes(?deliverydate ?scheduledate))
                ?diffdays = External(func:days-from-duration(?diffduration))
                External(pred:numeric-greater-than(?diffdays 10)))
    )
 
    Forall ?item (
        cpt:reject(ppl:Fred ?item) :- cpt:unsolicited(?item)
    )
  )
)



3 Direct Specification of RIF-BLD Semantics

This normative section specifies the form D ind × D ind D . It gives meaning tosemantics of RIF-BLD directly, without relying on [RIF-FLD].

Recall that the equality operator. I truth is a mappingpresentation syntax of RIF-BLD allows the form D TV . Ituse of macros, which are specified via the Prefix and Base directives. The semantics, below, is used to definedescribed using the full syntax, i.e., the description assumes that all macros have already been expanded as explained in [RIF-DTB], Section Constants and Symbol Spaces.

3.1 Truth valuation for formulas. I external is a mapping fromValues

The coherentset TV of schemas for externally defined functions to total functions D * Dtruth values in RIF-BLD consists of just two values, t and f.

For each external schema σ = (?X 1 ... ?X n ; τ)3.2 Semantic Structures

The key concept in a model-theoretic semantics of a logic language is the coherent setnotion of such schemas associateda semantic structure. The definition, below, is a little bit more general than necessary. This is done in order to better see the connection with the languagesemantics of the RIF framework described in [RIF-FLD].

Definition (Semantic structure). A semantic structure, I external ( σ ), is a functiontuple of the form D n D . For every external schema, σ<TV, DTS, D, Dind, Dfunc, IC, IV, IF, Iframe, ISF, Isub, Iisa, I=, associated with the language,Iexternal ( σ ) is assumed to be specified externally in some document (hence the name external schema ). In particular, if σ, Itruth>. Here D is a schemanon-empty set of elements called the domain of a RIF builtin predicate or function,I external ( σ ), and Dind, Dfunc are nonempty subsets of D. Dind is specified inused to interpret the document Data Typeselements of Const that are individuals and Builtins so that: If σDfunc is a schemaused to interpret the elements of a builtinConst that are function then I external ( σ ) must besymbols. As before, Const denotes the function defined inset of all constant symbols and Var the aforesaid document. If σ is a schemaset of a builtin predicate then I truth ο ( I external ( σ )) (the compositionall variable symbols. TV denotes the set of Itruth values that the semantic structure uses and I external ( σ ),DTS is a truth-valued function) must be as specified in Data Types and Builtins .set of identifiers for convenience, we also define the following mapping I from termsprimitive datatypes (please refer to D :Section Datatypes of [RIF-DTB] for the semantics of datatypes).

The other components of I ( k ) =are total mappings defined as follows:

  1. IC ( k ),maps Const to D.

    This mapping interprets constant symbols. In addition:

    • If k isa symbol inconstant, c ∈ Const, is an individual then it is required that IC( ?v ) = I V ( ?v ),c) ∈ Dind.
    • If ?vc ∈ Const, is a variable in Var I ( f(t 1 ... t n ) ) = I F ( I ( f ))( I ( t 1 ),..., I ( t n )) I ( f(s 1 ->v 1 ... s n ->v n ) ) = I SF (function symbol (positional or with named arguments) then it is required that IC( f ))({< s 1 ,c) ∈ Dfunc.
  2. I (V 1 )>,...,< s n ,maps Var to Dind.

    This mapping interprets variable symbols.

  3. I ( v n )>}) Here we use {...}F maps D to denotefunctions D*ind D (here D*ind is a set of argument/value pairs.all sequences of any finite length over the domain Dind).

    This mapping interprets positional terms. In addition:

    • If d Dfunc then IF( o[a 1 ->v 1 ... a k ->v k ]d) = I frame ( I ( o ))({< I (must be a 1 ), I ( v 1 )>, ..., < I (function D*ind Dind.
    • This means that when a n ),function symbol is applied to arguments that are individual objects then the result is also an individual object.
  4. I ( v n )>}) Here {...} denotes a bagSF maps D to the set of attribute/value pairs. I ( c1##c2 ) = I sub ( I ( c1 ), I ( c2 )) Itotal functions of the form SetOfFiniteSets( o#cArgNames × Dind) = I isa ( I ( o ), I ( c )) D.

    This mapping interprets function symbols with named arguments. In addition:

    • If d Dfunc then ISF( x=yd) = I = ( I (x), I (y)) Imust be a function SetOfFiniteSets( External(t)ArgNames × Dind) = I externsl ( σ )( I ( s 1 ), ..., I ( s n )), if t is an instance of the external schema σ = (?X 1 ... ?X n ; τ) by substitution ?X 1 /s 1 ... ?X n /s 1 Dind.
    • Note that, by definition, External(t) is well formed only if tThis is an instance of an external schema. Furthermore, byanalogous to the definition of coherent setsinterpretation of external schemas , t can bepositional terms with two differences:
      • Each pair <s,v> ArgNames × Dind represents an instanceargument/value pair instead of at most one such schema, so I ( External(t) ) is well-defined.just a value in the effectcase of data types. The data types in DTS imposea positional term.
      • The following restrictions. If dt isarguments of a symbol space identifierterm with named arguments constitute a finite set of argument/value pairs rather than a data type, let LS dt denotefinite ordered sequence of simple elements. So, the lexical spaceorder of dt , VS dt denote its value space, and L dt : LS dt VS dt the lexical-to-value-space mapping (forthe definitions of these concepts, see Section Primitive Data Typesarguments does not matter.
  5. Iframe maps Dind to total functions of RIF-FLD). Thenthe following must hold: VS dt form SetOfFiniteBags(Dind ; and For each constant "lit"^^dt× Dind) D.

    This mapping interprets frame terms. An argument, d LS dtDind, to I C ( "lit"^^dt ) = L dt ( lit ). That is, I C must mapframe represent an object and the constants offinite bag {<a1,v1>, ..., <ak,vk>} represents a data type dt in accordance with L dtbag of attribute-value pairs for d. RIF-BLD does not impose restrictions onWe will see shortly how I C for constants in the lexical spaces that do not correspondframe is used to primitive datatypes in DTS .   ☐ 3.3 Interpretation of Formulas Definition (Truth valuation) .determine the truth valuation for well-formed formulasof frame terms.

    Bags (multi-sets) are used here because the order of the attribute/value pairs in RIF-BLDa frame is determined usingimmaterial and pairs may repeat: o[a->b a->b]. Such repetitions arise naturally when variables are instantiated with constants. For instance, o[?A->?B ?C->?D] becomes o[a->b a->b] if variables ?A and ?C are instantiated with the following function, denoted TVal I : Positional atomic formulas : TVal I ( r(t 1 ... t n ) ) = I truth (symbol a and ?B, ?D with b.

  6. I ( r(t 1 ... t n ) )) Atomic formulas with named arguments : TVal I ( p(s 1 ->v 1 ... s k ->v k ) ) = I truth ( I ( p(s 1 ->v 1 ... s k ->v k ) )). Equality : TVal I ( x = y ) = I truth ( I ( x = y )).sub gives meaning to ensure that equality has preciselythe expected properties,subclass relationship. It is required that: I truth ( I ( x = y )) = t if and only if I ( x ) = I ( y ) and that I truth ( I ( x = y )) = f otherwise. This is tantamount to saying that TVal I ( x = y ) = t if I (x) = I (y). Subclass : TVal I ( sc ## cl ) = I truth ( I ( sc ## cl )). To ensure thata mapping of the form Dind × Dind D.

    The operator ## is required to be transitive, i.e., c1 ## c2 and c2 ## c3 must imply c1 ## c3 , the following. This is required: For all c1 , c2 , c3 D ,   if TVal I ( c1 ## c2 ) = TVal I ( c2 ## c3 ) = t   then TVal I ( c1 ## c3 ) = tensured by a restriction in Section Interpretation of Formulas.

  7. Membership : TVal I ( o # cl ) = I truth (I ( o # cl )).isa gives meaning to ensureclass membership. It is a mapping of the form Dind × Dind D.

    The relationships # and ## are required to have the usual property that all members of a subclass are also members of the superclass, i.e., o # cl and cl ## scl implies o # scl , the following is required: For all o , cl , scl D ,   if TVal I ( o # cl ) = TVal I ( cl ## scl ) = t   then   TVal I (must imply o # scl ) = t. Frame : TVal I ( o[a 1 ->v 1 ...This is ensured by a k ->v k ] ) = I truth (restriction in Section Interpretation of Formulas.

  8. I ( o[a 1 ->v 1 ...= is a k ->v k ] )). Since the bag of attribute/value pairs represents the conjunctionsmapping of allthe pairs,form Dind × Dind D.

    It gives meaning to the following is required: TValequality operator.

  9. I ( o[a 1 ->v 1 ...truth is a k ->v k ] ) = t if and only if TVal I ( o[a 1 ->v 1 ] ) = ... = TVal I ( o[a k ->v k ] ) = tmapping of the form D TV.

    Externally defined atomic formula : TVal I ( External(t) ) = IIt is used to define truth (valuation for formulas.

  10. Iexternal ( σ )( I ( s 1 ), ..., I ( s n ))), if t is an atomic formula thatis an instance ofa mapping from the coherent set of schemas for externally defined functions to total functions D* D. For each external schema σ = (?X1 ... ?Xn ; τ) by substitution ?X 1 /s 1 ... ?X n /s 1 . Note that, by definition, External(t) is well-formed only if t is an instance; τ) in the [[DTB#def-external-schema-set|coherent set of anexternal schema. Furthermore, byschemas] associated with the definition of coherent setslanguage, Iexternal(σ) is a function of the form Dn D.

    For every external schemasschema, σ, t canassociated with the language, Iexternal(σ) is assumed to be an instancespecified externally in some document (hence the name external schema). In particular, if σ is a schema of at most one such schema, soa RIF built-in predicate or function, Iexternal( External(t)σ) is well-defined. Conjunction : TValspecified in [RIF-DTB] so that:

    • If σ is a schema of a built-in function then Iexternal( And( c 1 ... c n )σ) = tmust be the function defined in the aforesaid document.
    • If σ is a schema of a built-in predicate then Itruth ο (Iexternal(σ)) (the composition of Itruth and only if TValI (c 1 ) = ... = TValexternal(σ), a truth-valued function) must be as specified in [RIF-DTB].

For convenience, we also define the following mapping I (c n ) = t . Otherwise, TValfrom terms to D:

  • I( And( c 1 ... c n )k) = f . The empty conjunctionIC(k), if k is treated asa tautology, so TValsymbol in Const
  • I( And()?v) = t . Disjunction : TValIV( Or( c?v), if ?v is a variable in Var
  • I(f(t1 ... ctn)) = IF if and only if TVal(I (c 1 ) = ... = TVal(f))(I (c(t1),...,I(tn ) = f . Otherwise, TVal))
  • I( Or( cf(s1->v1 ... csn->vn)) = t . The empty disjunction is treated as a contradiction, so TValISF(I( Or() ) =f . Quantification : TVal))({<s1,I( Exists ?vv1 ... ?v)>,...,<sn (φ) ) = t if and only if for some,I *, described below, TVal I*( φ ) = t . TValvn)>})
  • Here we use {...} to denote a set of argument/value pairs.

  • I( Forall ?vo[a1 ... ?v n (φ))->v1 ... ak->vk]) = t if and only if for everyI *, described below, TVal I*frame( φ ) = t . HereI * is(o))({<I(a semantic structure of the form1),I(v1)>, ..., < TV , DTS , D , D ind , D func ,I C ,(an),I *(v ,n)>})
  • Here {...} denotes a bag of attribute/value pairs.

  • I F ,(c1##c2) = I frame ,sub(I SF ,(c1), I sub ,(c2))
  • I(o#c) = Iisa ,(I(o), I(c))
  • I(x=y) = ,I externsl ,=(I truth >, which is exactly like(x), I , except that the mapping(y))
  • I * V , is used instead of(External(t)) = I V .  external(σ)(I * V is defined to coincide with I V on all variables except, possibly, on ?v(s1 ,..., ?v n . Rule implication : TVal), ..., I( conclusion  :- condition ) = t ,sn)), if either TVal I ( conclusion )=t or TVal I ( condition )= f . TVal I ( conclusion  :- condition ) = f   otherwise. Groups of rules : If Γis a group formulaan instance of the form Group φ external schema σ = (?X1 ... ρ... ?Xn ) or Group ; τ) by substitution ?X1 ... ρ n ) then TVal I ( Γ ) = t if and only if TVal I ( ρ/s1 ) = t , ..., TVal I ( ρ... ?Xn ) = t/s1.

    TVal I ( Γ ) = f   otherwise. This means that a group of rulesNote that, by definition, External(t) is treated as a conjunction. The metadatawell formed only if t is ignored for purposesan instance of an external schema. Furthermore, by the RIF-BLD semantics. A modeldefinition of a group formula, Γcoherent sets of external schemas, is a semantic structure It can be an instance of at most one such that TValschema, so I( ΓExternal(t)) = t . In this case, we write I   |= Γ .   ☐ Note that although metadata associated with RIF-BLD formulasis ignored bywell-defined.

The semantics, it can be extracted by XML tools. Since metadata is represented by frame terms, it can be reasoned with by RIF-BLD rules. 3.4 Interpretationeffect of Documents Document formulas are interpreted using semantic multi-structures . Definition (Semantic multi-structures). A semantic multi-structure is a tuple ( I 1datatypes. The set DTS must include the datatypes described in Section Primitive Datatypes of [RIF-DTB].


The datatype identifiers in DTS impose the following restrictions. Given dt DTS, let LSdt denote the lexical space of dt, VSdt denote its value space, and Ldt: LSdt VSdt the lexical-to-value-space mapping (for the definitions of these concepts, see Section Primitive Datatypes of [RIF-DTB]. Then the following must hold:

  • VSdt Dind; and
  • For each constant "lit"^^dt such that lit LSdt, ...,I n ), n>0, whereC("lit"^^dt) = Ldt(lit).

That is, I 1 , ...,C must map the constants of a datatype dt in accordance with Ldt.

RIF-BLD does not impose restrictions on I n are semantic structures, which are identicalC for constants in all respects exceptsymbol spaces that are not datatypes mentioned in DTS.   ☐


3.3 RIF-BLD Annotations in the Semantics

RIF-BLD annotations are stripped before the mappings that constitue RIF-BLD semantic structures are applied. Likewise, they are stripped before applying the truth valuation, TValI 1 C, ..., I n C may differin the next section. Thus, identifiers and metadata have no effect on the constants in Constformal semantics.

Note that belong toalthough identifiers and metadata associated with RIF-BLD formulas are ignored by the rif:local symbol space.     Definition (Imported document). Let Δsemantics, they can be a document formula and Import(t)extracted by XML tools. The frame terms used to represent RIF-BLD metadata can then be one of its import directives, which references another document formula, Δ' . In this case, we same that Δ' is directly imported into Δ . A document formula Δ' is said to be imported into Δ if it is either directly imported into Δ or it is imported (directly or not) into another formula, which is directly importedfed into Δ .     With the helpother RIF-BLD rules, thus enabling reasoning about metadata.


3.4 Interpretation of Non-document Formulas

This section defines how a semantic multi-structures we can now explainstructure, I, determines the semantics of RIF documents. Definition (Truth valuationtruth value TValI(φ) of document formulas). Let Δ bea document formula and let Δ 1 , ..., Δ k be all theRIF-BLD document formulas that are imported (directly or indirectly, according to the previous definition) into Δ . Let Γ , Γ 1formula, φ, ..., Γ k denote the respective group formulas associated with these documents. If any of these Γ i is missing (whichwhere φ is any formula other than a possibility, since every partdocument formula. Truth valuation of adocument formulas is optional), assume that it is a tautology, such as a =defined in the next section.

To this end, we define a , so that everymapping, TVal function maps such a ΓI to, from the truth value tset of all non-document formulas to TV. Let I = ( I 0 , I 1 , ..., I n ) be a semantic multi-structure suchNote that the definition implies that n≥k. Then we define:TValI( Δφ) = t if andis defined only if TValthe set DTS of the datatypes of I 0 ( Γ ) =includes all the datatypes mentioned in φ and Iexternal is defined on all externally defined functions and predicates in φ.


Definition (Truth valuation). Truth valuation for well-formed formulas in RIF-BLD is determined using the following function, denoted TValI:

  1. Positional atomic formulas: TValI 1( Γr(t1 ... tn)) = Itruth(I(r(t1 ... =tn)))
  2. Atomic formulas with named arguments: TValI(p(s1->v1 ... sk->vk)) = Itruth( ΓI(p(s1->v1 ... sk->vk))).
  3. Equality: TValI(x = y) = t . Note that this definition considers only those document formulasItruth(I(x = y)).
    • To ensure that are reachable viaequality has precisely the one-argument import directives. Two argument import directives are ignored here. Their semanticsexpected properties, it is defined by the document RIF RDF and OWL Compatibility .         The above definitions make the intent behind the rif:local constants clear: rif:local constants that occur in different documents can be interpreted differently evenrequired that:
      Itruth(I(x = y)) = t if they have the same name. Therefore, each document can choose the names for the rif:local constants freelyand without regard to the names of such constants used in the imported documents. A model of a document formula Δ is a semantic multi-structure I such that TValonly if I( Δx) = t . In this case, we writeI   |= Δ . 3.5 Logical Entailment We now define what it means for a set of RIF-BLD rules (such as a group or a document formula) to entail a RIF-BLD condition. We say(y) and that a RIF-BLD condition formula φItruth(I(x = y)) = f otherwise.
    • This is existentially closed ,tantamount to saying that TValI(x = y) = t if I(x) = I(y).
  4. Subclass: TValI(sc ## cl) = Itruth(I(sc ## cl)).

    To ensure that the operator ## is transitive, i.e., c1 ## c2 and only if every variable, ?Vc2 ## c3 imply c1 ## c3, in φ occurs in a subformula ofthe form Exists ...?V...(ψ) . Definition (Logical entailment). Let Γ be a RIF-BLD group or document formula and φ an existentially closed RIF-BLD condition formula. We say that Γ entails φfollowing is required:

    For all c1, written as Γ |= φc2, c3 D,   if and only if for every model of Γ it is the case thatTValI( φc1 ## c2) = TValI(c2 ## c3) = t   then TValI(c1 ## c3) = t.
  5. Equivalently, we can say that Γ |= φ holds iff wheneverMembership: TValI   |=   Γ it follows(o # cl) = Itruth(I(o # cl)).

    To ensure that all members of a subclass are also I   |= φ .   ☐ 4 XML Serialization Syntax for RIF-BLD Editor's Note: The XML syntax, includingmembers of the element tags, is being discussed bysuperclass, i.e., o # cl and cl ## scl implies o # scl, the Working Group. Inputfollowing is welcome. See Issue-49 The XML serializationrequired:

    For RIF-BLD is alternating or fully striped [ ANF01 ]. A fully striped serialization views XML documents as objects and dividesall XML tags into class descriptors, called type tagso, and property descriptors, called role tags . We use capitalized names for type tags and lowercase names for role tags. The all-uppercase classes in the presentation syntax, such as FORMULAcl, become XML Schema groups in Appendix XML Schema for BLD . They act like macros and are not visible in instance markup. The other classes as well as non-terminals and symbols (such as Exists orscl D,   if TValI(o # cl) = TValI(cl ## scl) become XML elements with optional attributes, as shown below. 4.1 XML for= t   then   TValI(o # scl) = t.
  6. Frame: TValI(o[a1->v1 ... ak->vk]) = Itruth(I(o[a1->v1 ... ak->vk])).

    Since the RIF-BLD Condition Language XML serializationbag of attribute/value pairs represents the presentation syntaxconjunctions of Section EBNF for RIF-BLD Condition Language usesall the pairs, the following tags. -is required, if k > 0:

    TValI(o[a1->v1 ... ak->vk]) = t if and (conjunction) - Or (disjunction) - Exists (quantifiedonly if TValI(o[a1->v1]) = ... = TValI(o[ak->vk]) = t.
  7. Externally defined atomic formula for 'Exists', containing declare and formula roles) - declare (declare role, containing a Var) - formula (formula role, containing a FORMULA) - Atom (atom formula, positional or with named arguments) -: TValI(External(t)) = Itruth(Iexternal (external call, containing a content role) - content (content role, containing(σ)(I(s1), ..., I(sn))), if t is an Atom, for predicates, or Expr, for functions) - Member (member formula) - Subclass (subclass formula) - Frame (Frame formula) - object (Member/Frame role, containing a TERM oratomic formula that is an object description) - op (Atom/Expr role for predicates/functions as operations) - arg (positional argument role) - upper (Member/Subclass upper class role) - lower (Member/Subclass lower instance/class role) - slot (Atom/Expr/Frame slot role, containing a Prop) - Prop (Property, prefix version of slot infix '->') - key (Prop key role, containing a Const) - val (Prop val role, containing a TERM) - Equal (prefix version of term equation '=') - Expr (expression formula, positional or with named arguments) - side (Equal left-hand side and right-hand side role) - Const (individual, function, or predicate symbol, with optional 'type' attribute) - Name (name of named argument) - Var (logic variable) For the XML Schema Definition (XSD)instance of the RIF-BLD condition language see Appendix XMLexternal schema for BLDσ = (?X1 ... ?Xn; τ) by substitution ?X1/s1 ... ?Xn/s1.

    Note that, by definition, External(t) is well-formed only if t is an instance of an external schema. Furthermore, by the XML syntax for symbol spaces utilizes the type attribute associated with XML term elements such as Const . For instance, a literal in the xsd:dateTime data typedefinition of coherent sets of external schemas, t can be representedan instance of at most one such schema, so I(External(t)) is well-defined.

  8. Conjunction: TValI(And(c1 ... cn)) = t if and only if TValI(c1) = ... = TValI(cn) = t. Otherwise, TValI(And(c1 ... cn)) = f.
  9. The empty conjunction is treated as <Const type="xsd:dateTime">2007-11-23T03:55:44-02:30</Const>a tautology, so TValI(And()) = t.

  10. Example 4 (A RIF conditionDisjunction: TValI(Or(c1 ... cn)) = f if and its XML serialization). This example illustrates XML serialization for RIF conditions. As before,only if TValI(c1) = ... = TValI(cn) = f. Otherwise, TValI(Or(c1 ... cn)) = t.
  11. The compact URI notationempty disjunction is usedtreated as a contradiction, so TValI(Or()) = f.

  12. Quantification:
    • TValI(Exists ?v1 ... ?vn (φ)) = t if and only if for better readability. Compact URI prefixes: bks expands into http://example.com/books# cpt expands into http://example.com/concepts# curr expands into http://example.com/currencies# RIF conditionsome I*, described below, TValI*(φ) = t.
    • TValI(Forall ?v1 ... ?vn (φ)) = t if and (Exists ?Buyer ("cpt:purchase"^^rif:iri(?Buyer ?Seller "cpt:book"^^rif:iri(?Author "bks:LeRif"^^rif:iri) "curr:USD"^^rif:iri("49"^^xsd:integer))) ?Seller=?Authoronly if for every I*, described below, TValI*(φ) XML serialization <And> <formula> <Exists> <declare><Var>Buyer</Var></declare> <formula> <Atom> <op><Const type="rif:iri">cpt:purchase</Const></op> <arg><Var>Buyer</Var></arg> <arg><Var>Seller</Var></arg> <arg> <Expr> <op><Const type="rif:iri">cpt:book</Const></op> <arg><Var>Author</Var></arg> <arg><Const type="rif:iri">bks:LeRif</Const></arg> </Expr> </arg> <arg> <Expr> <op><Const type="rif:iri">curr:USD</Const></op> <arg><Const type="xsd:integer">49</Const></arg> </Expr> </arg> </Atom> </formula> </Exists> </formula> <formula> <Equal> <side><Var>Seller</Var></side> <side><Var>Author</Var></side> </Equal> </formula> </And> Example 5 (A RIF condition with named arguments and its XML serialization). This example illustrates XML serialization= t.

    Here I* is a semantic structure of RIF conditions that involve terms with named arguments. Compact URI prefixes: bks expands into http://example.com/books# cpt expands into http://example.com/concepts# curr expands into http://example.com/currencies# RIF condition: And (Exists ?Buyer ?P ( And (?P#"cpt:purchase"^^rif:iri ?P["cpt:buyer"^^rif:iri->?Buyer "cpt:seller"^^rif:iri->?Seller "cpt:item"^^rif:iri->"cpt:book"^^rif:iri(cpt:author->?Author cpt:title->"bks:LeRif"^^rif:iri) "cpt:price"^^rif:iri->"49"^^xsd:integer "cpt:currency"^^rif:iri->"curr:USD"^^rif:iri])) ?Seller=?Author) XML serialization: <And> <formula> <Exists> <declare><Var>Buyer</Var></declare> <declare><Var>P</Var></declare> <formula> <And> <formula> <Member> <lower><Var>P</Var></lower> <upper><Const type="rif:iri">cpt:purchase</Const></upper> </Member> </formula> <formula> <Frame> <object> <Var>P</Var> </object> <slot> <Prop> <key><Const type="rif:iri">cpt:buyer</Const></key> <val><Var>Buyer</Var></val> </Prop> </slot> <slot> <Prop> <key><Const type="rif:iri">cpt:seller</Const></key> <val><Var>Seller</Var></val> </Prop> </slot> <slot> <Prop> <key><Const type="rif:iri">cpt:item</Const></key> <val> <Expr> <op><Const type="rif:iri">cpt:book</Const></op> <slot> <Prop> <key><Name>cpt:author</Name></key> <val><Var>Author</Var></val> </Prop> </slot> <slot> <Prop> <key><Name>cpt:title</Name></key> <val><Const type="rif:iri">bks:LeRif</Const></val> </Prop> </slot> </Expr> </val> </Prop> </slot> <slot> <Prop> <key><Const type="rif:iri">cpt:price</Const></key> <val><Const type="xsd:integer">49</Const></val> </Prop> </slot> <slot> <Prop> <key><Const type="rif:iri">cpt:currency</Const></key> <val><Const type="rif:iri">curr:USD</Const></val> </Prop> </slot> </Frame> </formula> </And> </formula> </Exists> </formula> <formula> <Equal> <side><Var>Seller</Var></side> <side><Var>Author</Var></side> </Equal> </formula> </And> 4.2 XML forthe RIF-BLD Rule Language We now extendform <TV, DTS, D, Dind, Dfunc, IC, I*V, IF, Iframe, ISF, Isub, Iisa, I=, Iexternal, Itruth>, which is exactly like I, except that the RIF-BLD serialization from Section XML for RIF-BLD Condition Language by including rules as described in Section EBNF for RIF-BLD Rule Languagemapping I*V, is used instead of IV. The extended serialization uses the following additional tags. - Document (document, containing directives and optional payload annotated  I*V is defined to coincide with metadata) - directive (directive role, containing Import) - payload (payload role, containing Group) - Import (importation, containing address and optional manner) - address (address role, containing IRI) - manner (manner role, containing PROFILE) - Group (nested collection of sentences annotated with metadata) - meta (meta role, containing metadata, which is represented as a Frame) - sentence (sentence role, containingIV on all variables except, possibly, on ?v1,...,?vn.

  13. Rule or Group) - Forall (quantified formula for 'Forall', containing declare and formula roles) - Implies (implication, containing if and then roles) -implication:
    • TValI(conclusion :- condition) = t, if (antecedent role, containing FORMULA) - then (consequent role, containing ATOMIC) The XML Schema Definitioneither TValI(conclusion)=t or TValI(condition)=f.
    • TValI(conclusion :- condition) = f   otherwise.
  14. Groups of RIF-BLDrules:

    If Γ is given in Appendix XML Schema for BLD . Example 6 (Serializing a RIF-BLD group annotated with metadata). This example showsa serialization for the group from Example 3. For convenience, thegroup is reproduced atformula of the top andform Group(φ1 ... φn) then

    • is followed by its serialization. Compact URI prefixes: bks expands into http://example.com/books# auth expands into http://example.com/authors# cpt expands into http://example.com/concepts# dc expands into http://purl.org/dc/terms/ w3 expands into http://www.w3.org/ Presentation syntax: Group " http://sample.org "^^rif:iri["dc:publisher"^^rif:iri->"w3:W3C"^^rif:iri "dc:date"^^rif:iri->"2008-04-04"^^xsd:date]TValI( Forall ?item ?deliverydate ?scheduledate ?diffduration ?diffdaysΓ) = t if and only if TValI( "cpt:reject"^^rif:iri("ppl:John"^^rif:iri ?item) :- And("cpt:perishable"^^rif:iri(?item) "cpt:delivered"^^rif:iri(?item ?deliverydate "ppl:John"^^rif:iri) "cpt:scheduled"^^rif:iri(?item ?scheduledate) External("fn:subtract-dateTimes-yielding-dayTimeDuration"^^rif:iri(?deliverydate ?scheduledate ?diffduration)) External("fn:get-days-from-dayTimeDuration"^^rif:iri(?diffduration ?diffdays)) External("op:numeric-greater-than"^^rif:iri(?diffdays "10"^^xsd:integer)))φ1) Forall ?item= t, ..., TValI( "cpt:reject"^^rif:iri("ppl:Fred"^^rif:iri ?item) :- "cpt:unsolicited"^^rif:iri(?item)φn) = t.
    • TValI(Γ) XML syntax: <Group> <meta> <Frame> <object> <Const type="rif:iri"> http://sample.org </Const> </object> <slot> <Prop> <key><Const type="rif:iri">dc:publisher</Const></key> <val><Const type="rif:iri">w3:W3C</Const></val> </Prop> </slot> <slot> <Prop> <key><Const type="rif:iri">dc:date</Const></key> <val><Const type="xsd:date">2008-04-04</Const></val> </Prop> </slot> </Frame> </meta> <sentence> <Forall> <declare><Var>item</Var></declare> <declare><Var>deliverydate</Var></declare> <declare><Var>scheduledate</Var></declare> <declare><Var>diffduration</Var></declare> <declare><Var>diffdays</Var></declare> <formula> <Implies> <if> <And> <formula> <Atom> <op><Const type="rif:iri">cpt:perishable</Const></op> <arg><Var>item</Var></arg> </Atom> </formula> <formula> <Atom> <op><Const type="rif:iri">cpt:delivered</Const></op> <arg><Var>item</Var></arg> <arg><Var>deliverydate</Var></arg> <arg><Const type="rif:iri">ppl:John</Const></arg> </Atom> </formula> <formula> <Atom> <op><Const type="rif:iri">cpt:scheduled</Const></op> <arg><Var>item</Var></arg> <arg><Var>scheduledate</Var></arg> </Atom> </formula> <formula> <External> <content> <Atom> <op><Const type="rif:iri">fn:subtract-dateTimes-yielding-dayTimeDuration</Const></op> <arg><Var>deliverydate</Var></arg> <arg><Var>scheduledate</Var></arg> <arg><Var>diffduration</Var></arg> </Atom> </content> </External> </formula> <formula> <External> <content> <Atom> <op><Const type="rif:iri">fn:get-days-from-dayTimeDuration</Const></op> <arg><Var>diffduration</Var></arg> <arg><Var>diffdays</Var></arg> </Atom> </content> </External> </formula> <formula> <External> <content> <Atom> <op><Const type="rif:iri">op:numeric-greater-than</Const></op> <arg><Var>diffdays</Var></arg> <arg><Const type="xsd:long">10</Const></arg> </Atom> </content> </External> </formula> </And> </if> <then> <Atom> <op><Const type="xsd:long">reject</Const></op> <arg><Const type="rif:iri">ppl:John</Const></arg> <arg><Var>item</Var></arg> </Atom> </then> </Implies> </formula> </Forall> </sentence> <sentence> <Forall> <declare><Var>item</Var></declare> <formula> <Implies> <if> <Atom> <op><Const type="rif:iri">cpt:unsolicited</Const></op> <arg><Var>item</Var></arg> </Atom> </if> <then> <Atom> <op><Const type="rif:iri">cpt:reject</Const></op> <arg><Const type="rif:iri">ppl:Fred</Const></arg> <arg><Var>item</Var></arg> </Atom> </then> </Implies> </formula> </Forall> </sentence> </Group> 4.3 Translation Between the RIF-BLD Presentation and XML Syntaxes We now show how to translate between the presentation and XML syntaxes of RIF-BLD. Editor's Note: This XML syntax translation table is expected to be made more formal in future versions of= f   otherwise.

    This draft. 4.3.1 Translation of the RIF-BLD Condition Language The translation between the presentation syntax and the XML syntaxmeans that a group of the RIF-BLD Condition Languagerules is specified by the table below. Since the presentation syntaxtreated as a conjunction.   ☐


3.5 Interpretation of RIF-BLDDocuments

Document formulas are interpreted using semantic multi-structures.

Definition (Semantic multi-structure). A semantic multi-structure is context sensitive, the translationa set {IΔ1, ..., IΔn}, n>0, where IΔ1, ..., IΔn are semantic structures labeled with document formulas. These structures must differentiate between the terms that occurbe identical in all respects except that the position ofmappings ICΔ1, ..., ICΔn might differ on the individuals from termsconstants in Const that occur as atomic formulas.belong to this end, inthe translation table,rif:local symbol space. The positional and named argument terms that occur inabove set is allowed to have at most one semantic structure with the context of atomic formulas are denoted bysame label.    

With the expressionshelp of semantic multi-structures we can now explain the form pred (...)semantics of RIF documents.

Definition (Truth valuation of a document formula). Let Δ be a document formula and let Δ1, ..., Δk be all the termsRIF-BLD document formulas that occur as individualsare denoted by expressions of the form func (...). The prime symbol (for instance, variable 'imported (directly or indirectly, according to Definition Imported document) indicates thatinto Δ. Let Γ, Γ1, ..., Γk denote the translationrespective group formulas associated with these documents. If any of these Γi is missing (which is a possibility, since every part of a document is optional), assume that it is a tautology, such as a = a, so that every TVal function defined by the table must be applied recursively (i.e.,maps such a Γi to variable in our example). Presentation Syntax XML Syntax And ( conjunct 1 . .the truth value t. conjunct n ) <And> <formula> conjunctLet I = {IΔ, IΔ1 ' </formula> . . . <formula> conjunct n ' </formula> </And> Or ( disjunct, ..., IΔk, ...} be a semantic multi-structure, which contains semantic structures labeled with at least the documents Δ, Δ1, ..., Δk. . . disjunct nThen we define:

TValI(Δ) <Or> <formula> disjunct 1 ' </formula> . . . <formula> disjunct n ' </formula> </Or> Exists variable 1 . . . variable n= t if and only if TValIΔ( bodyΓ) <Exists> <declare> variable= TValIΔ1 ' </declare> . . . <declare> variable n ' </declare> <formula> body' </formula> </Exists> pred( argument 1 . . . argument n ) <Atom> <op> pred' </op> <arg> argumentΓ1 ' </arg> . . . <arg> argument n ' </arg> </Atom> External ( atomicexpr) <External> <content> atomicexpr' </content> </External> func= ... = TValIΔk( argument 1 . . . argument nΓk) <Expr> <op> func' </op> <arg> argument 1 ' </arg> . .= t.

<arg>Note that this definition considers only those document formulas that are reachable via the one-argument import directives. Two argument n ' </arg> </Expr> pred ( unicodestring 1 -> filler 1 . . . unicodestring n -> filler n ) <Atom> <op> pred' </op> <slot> <Prop> <key><Name> unicodestring 1 </Name></key> <val> filler 1 ' </val> </Prop> </slot> . . . <slot> <Prop> <key><Name> unicodestring n </Name></key> <val> filler n ' </val> </Prop> </slot> </Atom> func ( unicodestring 1 -> filler 1 . . . unicodestring n -> filler n ) <Expr> <op> func' </op> <slot> <Prop> <key><Name> unicodestring 1 </Name></key> <val> filler 1 ' </val> </Prop> </slot> . . . <slot> <Prop> <key><Name> unicodestring n </Name></key> <val> filler n ' </val> </Prop> </slot> </Expr> instimport directives are ignored here. Their semantics is defined by the document RIF RDF and OWL Compatibility [ key 1 -> filler 1 . . . key n -> filler n ] <Frame> <object> inst' </object> <slot> <Prop> <key> key 1 ' </key> <val> filler 1 ' </val> </Prop> </slot> . . . <slot> <Prop> <key> key n ' </key> <val> filler n ' </val> </Prop> </slot> </Frame> inst # class <Member> <lower> inst' </lower> <upper> class' </upper> </Member> sub ## super <Subclass> <lower> sub' </lower> <upper> super' </upper> </Subclass> left = right <Equal> <side> left' </side> <side> right' </side> </Equal> unicodestring ^^ space <Const type=" space "> unicodestring </Const> ? unicodestring <Var> unicodestring </Var> 4.3.2 Translation of the RIF-BLD Rule LanguageRIF-RDF+OWL].        


The translation betweenabove definitions make the presentation syntax andintent behind the XML syntaxrif:local constants clear: occurrences of such constants in different documents can be interpreted differently even if they have the RIF-BLD Rule Language is given bysame name. Therefore, each document can choose the table below, which extendsnames for the translation tablerif:local constants freely and without regard to the names of Section Translationsuch constants used in the imported documents.


3.6 Logical Entailment

We now define what it means for a set of RIF-BLD Condition Language . Presentation Syntax XML Syntax Group ( clause 1 . . . clause n ) <Group> <sentence> clause 1 ' </sentence> . . . <sentence> clause n ' </sentence> </Group> Group metaframe ( clause 1 . . . clause n ) <Group> <meta> metaframe' </meta> <sentence> clause 1 ' </sentence> . . . <sentence> clause n ' </sentence> </Group> Forall variable 1 . . . variable n ( rule ) <Forall> <declare> variable 1 ' </declare> . . . <declare> variable n ' </declare> <formula> rule' </formula> </Forall> conclusion :- condition <Implies> <if> condition' </if> <then> conclusion' </then> </Implies> 5 RIF-BLDrules (such as a Specializationgroup or a document formula) to entail another RIF-BLD formula. In RIF-BLD we are mostly interested in entailment of theRIF Framework This normative section describescondition formulas, which can be viewed as queries to RIF-BLD by specializing RIF-FLD. The readerdocuments. Therefore, entailment of condition formulas provides formal underpinning to RIF-BLD queries.


From now on, every formula is assumed to be familiar with RIF-FLD as described in RIF Framework for Logic-Based Dialects . The reader whopart of some document. If it is not interested in how RIF-BLD is derived from the framework can skip this section. 5.1 The Syntaxphysically part of RIF-BLD asany document, it will be said to belong to a Specialization of RIF-FLD This section defines the precise relationship betweenspecial query document. If I is a semantic multi-structure, Δ is the syntaxdocument of RIF-BLDφ, and IΔ is the syntactic framework of RIF-FLD. The syntax of the RIF Basic Logic Dialectcomponent structure in I that corresponds to Δ, then TValI(φ) is defined by specialization from the syntax of the RIF Syntactic Framework for Logic Dialects . Section Syntax of a RIF Dialectas TValIΔ(φ). Otherwise, TValI(φ) is undefined.

Definition (Models). A Specialization of the RIF Framework in that document lists the parametersmulti-structure I is a model of the syntactic framework in mathematical English, whicha formula, φ, written as I |= φ, iff TValI(φ) is defined and equals t.   ☐

Definition (Logical entailment). Let Γ and φ be RIF-BLD formulas. We will now specializesay that Γ entails φ, written as Γ |= φ, if and only if for RIF-BLD. Alphabetevery multi-structure, I, for which both TValI(Γ) and TValI(φ) are defined, I |= Γ implies I |= φ.   ☐


Note that one consequence of the alphabetmulti-document semantics of RIF-BLD is that local constants specified in one document cannot be queried from another document. In particular, they cannot be returned as query answers. For instance, if one document, Δ', has the alphabet of RIF-FLD with the negation symbols Neg and Naf excluded. Assignment of signatures to each constant and variable symbol . The signature set of RIF-BLD contains the following signatures: Basic. individual{ } atomic{ } The signature individual{ } representsfact "http://example.com/ppp"^^rif:iri("abc"^^rif:local) while another document formula, Δ, imports Δ' and has the context in which individual objects (butrule "http://example.com/qqq"^^rif:iri(?X) :- "http://example.com/ppp"^^rif:iri(?X) , then Δ |= "http://example.com/qqq"^^rif:iri("abc"^^rif:local) does not atomic formulas) can appear.hold. This is because "abc"^^rif:local in Δ' and "abc"^^rif:local in the signature atomic{ } representsquery on the context where atomic formulas can occur. For every integer n 0 , thereright-hand side of |= are signatures f n {(individual ... individual) individual} -- for n-ary function symbols, p n {(individual ... individual) atomic} --treated as different constants by semantic multi-structures.


4 XML Serialization Syntax for n-ary predicates. These represent function and predicate symbols of arity n (each ofRIF-BLD

The above cases has n individual s as arguments insideRIF-BLD XML serialization defines

Recall that the syntax of symbols s1 ,..., sk ArgNames , there are signatures f s1...sk {(s1->individual ... sk->individual) individual}RIF-BLD is not context-free and p s1...sk {(s1->individual ... sk->individual) atomic} . These are signatures for termsthus cannot be fully captured by EBNF and predicatesXML Schema. Still, validity with arguments named s1 , ..., sk , respectively. Inrespect to XML Schema can be a useful test. To reflect this specializationstate of RIF-FLD, the argument names s1 , ..., sk must be pairwise distinct. A symbol in Const can have exactly one signature, individual , f n , or p n , where n 0 , or f s1...sk {(s1->individual ... sk->individual) individual} , p s1...sk {(s1->individual ... sk->individual) atomic} , for some s1 ,..., sk ArgNames . It cannot haveaffairs, we define two notions of syntactic correctness. The signature atomic , sinceweaker notion checks correctness only complex terms can have such signatures. Thus, by itself a symbol cannot be a proposition in RIF-BLD, but a term ofwith respect to XML Schema, while the form p() can be. Thus,stricter notion represents "true" syntactic correctness.

Definition (Valid BLD document in RIF-BLD each constant symbol can be either an individual, a function of one particular arity or with certain argument names,XML syntax). A predicate of one particular arity or with certain argument names, an externally defined function of one particular arity, orvalid BLD document in the XML syntax is an externally defined predicate symbol of one particular arity -- itXML document that is not possiblevalid w.r.t. the XML schema in Appendix XML Schema for BLD.   ☐

Definition (Conformant BLD document in XML syntax). A conformant BLD document in the same symbol to play more than one role.XML syntax is a valid BLD document in the constant symbolsXML syntax that belong tois the supported RIF data types (XML Schema data types, rdf:XMLLiteral , rif:textimage of a well-formed RIF-BLD document in the presentation syntax (see Definition Well-formed formula in Section Formulas) all haveunder the signature individualpresentation-to-XML syntax mapping χbld defined in RIF-BLD.Section Translation Between the symbols of type rif:iriRIF-BLD Presentation and rif:local can haveXML Syntaxes.   ☐

The following signatures in RIF-BLD: individual , f n , or p n ,XML serialization for n = 0,1,.... ;RIF-BLD is alternating or f s1...sk , p s1...sk , for some argument names s1 ,..., sk ArgNames .fully striped [ANF01]. A fully striped serialization views XML documents as objects and divides all variables are associated with signature individual{ }XML tags into class descriptors, called type tags, so they can range only over individuals.and property descriptors, called role tags [TRT03]. We follow the signaturetradition of using capitalized names for equality is ={(individual individual) atomic} . This means that equality can compare only those terms whose signature is individual ; it cannot compare predicatetype tags and lowercase names or function symbols. Equality terms are also not allowed to occur inside other terms, since the above signature implies that any term offor role tags.

The form t = s has signature atomic and not individual .all-uppercase classes in the frame signature, ->presentation syntax, such as FORMULA, is ->{(individual individual individual) atomic}become XML Schema groups in Appendix XML Schema for BLD. Note that this precludesThey act like macros and are not visible in instance markup. The possibility that a frame term might occurother classes as an argument to a predicate, a function,well as non-terminals and symbols (such as Exists or inside some other term.=) become XML elements with optional attributes, as shown below.

RIF-BLD uses [XML1.0] for its XML syntax.


4.1 XML for the membership signature, # , is #{(individual individual) atomic} . Note that this precludesCondition Language

XML serialization of RIF-BLD in Section EBNF for RIF-BLD Condition Language uses the possibility thatfollowing elements.

- And       (conjunction)
- Or        (disjunction)
- Exists    (quantified formula for 'Exists', containing declare and formula roles)
- declare   (declare role, containing a  membership term might occur as an argument toVar)
- formula   (formula role, containing a  predicate,FORMULA)
- Atom      (atom formula, positional or with named arguments)
- External  (external call, containing a  function,content role)
- content   (content role, containing an Atom, for predicates, or  inside some other term. The signatureExpr, for  thefunctions)
- Member    (member formula)
- Subclass   relationship is ##{(individual individual)  atomic} . As with frames and membership terms, this precludes the possibility that(subclass formula)
- Frame     (Frame formula)
- object    (Member/Frame role, containing a  subclassTERM  might occur inside some other term. RIF-BLD uses no special syntaxor an object description)
- op        (Atom/Expr role for  declaring signatures. Instead, the author specifies signatures contextually . That is, since RIF-BLD requires that each symbol is associated with a unique signature, the signature is determined from the context in which the symbol is used. If a symbol is used in more than one context, the parser must treat thispredicates/functions as operations)
- args      (Atom/Expr positional arguments role, containing n TERMs)
- instance  (Member instance role)
- class     (Member class role)
- sub       (Subclass sub-class role)
- super     (Subclass super-class role)
- slot      (Atom/Expr or Frame slot role, containing a  syntax error. If no errors are found, all terms and atomic formulas are guaranteed to be well-formed. Thus, signatures are not part of the RIF-BLD language, and individual and atomic are not reserved keywords in RIF-BLD. Supported types of terms . RIF-BLD supports all theName or TERM  types definedfollowed by  the syntactic framework (see the Section Termsa TERM)
- Equal     (prefix version of  RIF-FLD): constants variablesterm equation '=')
- Expr      (expression formula, positional or with named  arguments equality frame membership subclass external Compared to RIF-FLD, terms (both positional andarguments)
- left      (Equal left-hand side role)
- right     (Equal right-hand side role)
- Const     (individual, function, or predicate symbol, with optional 'type' attribute)
- Name      (name of named  arguments) have significant restrictions. This is so in order to give BLDargument)
- Var       (logic variable)
   
- id        (identifier role, containing IRICONST)
- meta      (meta role, containing metadata as a  relatively compact nature.Frame or Frame conjunction)

The signature forid and meta elements, which are expansions of the variable symbols does not permit them toIRIMETA element, can occur inoptionally as the contextinitial children of predicates, functions, or formulas. In particular, inany Class element.

For the RIF-BLD specializationXML Schema definition of RIF-FLD, a variable is not an atomic formula. Likewise, athe RIF-BLD condition language see Appendix XML Schema for BLD.

The XML syntax for symbol cannot be an atomic formula by itself. That is, if p spaces utilizes the type attribute associated with XML term elements such as Const then p is not. For instance, a well-formed atomic formula. However, p()literal in the xs:dateTime datatype can be an atomic formula. Signatures permit only constant symbolsrepresented as <Const type="&xs;dateTime">2007-11-23T03:55:44-02:30</Const>. RIF-BLD also utilizes the ordered attribute to occur inindicate the contextorderedness of children of function or predicate names. Indeed, RIF-BLD signatures ensure that all variables havethe signature individual{ }elements args and all other terms, exceptslot it is associated with.


Example 5 (A RIF condition and its XML serialization).

This example illustrates XML serialization for RIF conditions. As before, the constants from Const , can have either the signature individual{ } or atomic{ } . Therefore, if t is a (non- Const ) term then t(...)compact URI notation is not a well-formed term. Supported symbol spaces . RIF-BLD supports allused for better readability. Assume that the symbol spaces definedfollowing prefix directives are found in Section Symbol Spaces ofthe syntactic framework: xsd:string xsd:decimal xsd:time xsd:date xsd:dateTime rdf:XMLLiteral rif:text rif:iri rif:local Supported formulas . RIF-BLD supportspreamble to the following typesdocument:

Prefix(bks    http://example.com/books#)
Prefix(cpt    http://example.com/concepts#)
Prefix(curr   http://example.com/currencies#)
Prefix(rif    http://www.w3.org/2007/rif#)
Prefix(xs     http://www.w3.org/2001/XMLSchema#)
RIF condition

   And (Exists ?Buyer (cpt:purchase(?Buyer ?Seller
                                    cpt:book(?Author bks:LeRif)
                                    curr:USD(49)))
        ?Seller=?Author )

XML serialization

   <And>
     <formula>
       <Exists>
         <declare><Var>Buyer</Var></declare>
         <formula>
           <Atom>
             <op><Const type="&rif;iri">&cpt;purchase</Const></op>
             <args ordered="yes">
               <Var>Buyer</Var>
               <Var>Seller</Var>
               <Expr>
                 <op><Const type="&rif;iri">&cpt;book</Const></op>
                 <args ordered="yes">
                   <Var>Author</Var>
                   <Const type="&rif;iri">&bks;LeRif</Const>
                 </args>
               </Expr>
               <Expr>
                 <op><Const type="&rif;iri">&curr;USD</Const></op>
                 <args ordered="yes"><Const type="&xs;integer">49</Const></args>
               </Expr>
             </args>
           </Atom>
         </formula>
       </Exists>
     </formula>
     <formula>
       <Equal>
         <left><Var>Seller</Var></left>
         <right><Var>Author</Var></right>
       </Equal>
     </formula>
   </And>


Example 6 (A RIF condition with named arguments and its XML serialization).

This example illustrates XML serialization of formulas (see Well-formedRIF conditions that involve terms with named arguments. As in Example 5, we assume the following prefix directives:

Prefix(bks    http://example.com/books#)
Prefix(cpt    http://example.com/concepts#)
Prefix(curr   http://example.com/currencies#)
Prefix(rif    http://www.w3.org/2007/rif#)
Prefix(xs     http://www.w3.org/2001/XMLSchema#)
RIF condition:

   And  Formulas(Exists ?Buyer ?P (
                 And (?P#cpt:purchase
                      ?P[cpt:buyer->?Buyer
                         cpt:seller->?Seller
                         cpt:item->cpt:book(cpt:author->?Author cpt:title->bks:LeRif)
                         cpt:price->49
                         cpt:currency->curr:USD]))
        ?Seller=?Author)


XML serialization:

   <And>
     <formula>
       <Exists>
         <declare><Var>Buyer</Var></declare>
         <declare><Var>P</Var></declare>
         <formula>
           <And>
             <formula>
               <Member>
                 <instance><Var>P</Var></instance>
                 <class><Const type="&rif;iri">&cpt;purchase</Const></class>
               </Member>
             </formula>
             <formula>
               <Frame>
                 <object>
                   <Var>P</Var>
                 </object>
                 <slot ordered="yes">
                   <Const type="&rif;iri">&cpt;buyer</Const>
                   <Var>Buyer</Var>
                 </slot>
                 <slot ordered="yes">
                   <Const type="&rif;iri">&cpt;seller</Const>
                   <Var>Seller</Var>
                 </slot>
                 <slot ordered="yes">
                   <Const type="&rif;iri">&cpt;item</Const>
                   <Expr>
                     <op><Const type="&rif;iri">&cpt;book</Const></op>
                     <slot ordered="yes">
                       <Name>&cpt;author</Name>
                       <Var>Author</Var>
                     </slot>
                     <slot ordered="yes">
                       <Name>&cpt;title</Name>
                       <Const type="&rif;iri">&bks;LeRif</Const>
                     </slot>
                   </Expr>
                 </slot>
                 <slot ordered="yes">
                   <Const type="&rif;iri">&cpt;price</Const>
                   <Const type="&xs;integer">49</Const>
                 </slot>
                 <slot ordered="yes">
                   <Const type="&rif;iri">&cpt;currency</Const>
                   <Const type="&rif;iri">&curr;USD</Const>
                 </slot>
               </Frame>
             </formula>
           </And>
         </formula>
       </Exists>
     </formula>
     <formula>
       <Equal>
         <left><Var>Seller</Var></left>
         <right><Var>Author</Var></right>
       </Equal>
     </formula>
   </And>


4.2 XML for the definitions):Rule Language

We now extend the RIF-BLD condition Aserialization from Section XML for RIF-BLD Condition is an atomic formula, a conjunctive or disjunctive combination of atomic formulas with optional existential quantification of variables, or an external atomic formula. RIF-BLD rule ALanguage by including rules, along with their enclosing groups and documents, as described in Section EBNF for RIF-BLD Rule is a universally quantified RIF-FLD rule with the following restrictions:Language. The head (or conclusion) ofextended serialization uses the rule is an atomic formula, whichfollowing additional tags. While there is not externally defined (i.e., it cannot havea RIF-BLD element tag for the form External(...) ).Import directive, there are none for the body (or premise)Prefix and Base directives: they are handled as discussed in Section Mapping of the rule is aRIF-BLD condition. All free (non-quantified) variables in theRule must be quantified withLanguage.


- Document  (document, containing optional directive and payload roles)
- directive (directive role, containing Import)
- payload   (payload role, containing Group)
- Import    (importation, containing location and optional profile)
- location  (location role, containing IRICONST)
- profile   (profile role, containing PROFILE)
- Group     (nested collection of sentences)
- sentence  (sentence role, containing RULE or Group)
- Forall     outside(quantified formula for 'Forall', containing declare and formula roles)
- Implies   (implication, containing if and then roles)
- if        (antecedent role, containing FORMULA)
- then      (consequent role, containing ATOMIC or conjunction of ATOMICs)

The rule (i.e., Forall ?vars (head :- body) ). RIF-BLD group AXML Schema Definition of RIF-BLD groupis given in Appendix XML Schema for BLD.


Example 7 (Serializing a RIF-FLD group that contains onlyRIF-BLD rulesdocument containing an annotated group).

This example shows a serialization for the document from Example 4. For convenience, the document is reproduced at the top and RIF-BLD groups. Recall that negation (classical or default)then is not supportedfollowed by RIF-BLD in either the rule head or the body. Editor's Note:its serialization.

Presentation syntax:

Document(
  Prefix(ppl  http://example.com/people#)
  Prefix(cpt  http://example.com/concepts#)
  Prefix(dc   http://purl.org/dc/terms/)
  Prefix(rif  http://www.w3.org/2007/rif#)
  Prefix(func http://www.w3.org/2007/rif-builtin-function#)
  Prefix(pred http://www.w3.org/2007/rif-builtin-predicate#)
  Prefix(xs   http://www.w3.org/2001/XMLSchema#)
  
  (* "http://sample.org"^^rif:iri pd[dc:publisher -> http://www.w3.org/
                                     dc:date -> "2008-04-04"^^xs:date] *)
  Group
  (
    Forall ?item ?deliverydate ?scheduledate ?diffduration ?diffdays (
        cpt:reject(ppl:John ?item) :-
            And(cpt:perishable(?item)
                cpt:delivered(?item ?deliverydate ppl:John)
                cpt:scheduled(?item ?scheduledate)
                ?diffduration = External(func:subtract-dateTimes(?deliverydate ?scheduledate))
                ?diffdays = External(func:days-from-duration(?diffduration))
                External(pred:numeric-greater-than(?diffdays 10)))
    )
 
    Forall ?item (
        cpt:reject(ppl:Fred ?item) :- cpt:unsolicited(?item)
    )
  )
)


XML syntax:

<!DOCTYPE Document [
  <!ENTITY ppl  "http://example.com/people#">
  <!ENTITY cpt  "http://example.com/concepts#">
  <!ENTITY dc   "http://purl.org/dc/terms/">
  <!ENTITY rif  "http://www.w3.org/2007/rif#">
  <!ENTITY func "http://www.w3.org/2007/rif-builtin-function#">
  <!ENTITY pred "http://www.w3.org/2007/rif-builtin-predicate#">
  <!ENTITY xs   "http://www.w3.org/2001/XMLSchema#">
]>

<Document 
    xmlns="http://www.w3.org/2007/rif#"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xs="http://www.w3.org/2001/XMLSchema#">
  <payload>
   <Group>
    <id>
      <Const type="&rif;iri">http://sample.org</Const>
    </id>
    <meta>
      <Frame>
        <object>
          <Const type="&rif;local">pd</Const>
        </object>
        <slot ordered="yes">
          <Const type="&rif;iri">&dc;publisher</Const>
          <Const type="&rif;iri">http://www.w3.org/</Const>
        </slot>
        <slot ordered="yes">
          <Const type="&rif;iri">&dc;date</Const>
          <Const type="&xs;date">2008-04-04</Const>
        </slot>
      </Frame>
    </meta>
    <sentence>
     <Forall>
       <declare><Var>item</Var></declare>
       <declare><Var>deliverydate</Var></declare>
       <declare><Var>scheduledate</Var></declare>
       <declare><Var>diffduration</Var></declare>
       <declare><Var>diffdays</Var></declare>
       <formula>
         <Implies>
           <if>
             <And>
               <formula>
                 <Atom>
                   <op><Const type="&rif;iri">&cpt;perishable</Const></op>
                   <args ordered="yes"><Var>item</Var></args>
                 </Atom>
               </formula>
               <formula>
                 <Atom>
                   <op><Const type="&rif;iri">&cpt;delivered</Const></op>
                   <args ordered="yes">
                     <Var>item</Var>
                     <Var>deliverydate</Var>
                     <Const type="&rif;iri">&ppl;John</Const>
                   </args>
                 </Atom>
               </formula>
               <formula>
                 <Atom>
                   <op><Const type="&rif;iri">&cpt;scheduled</Const></op>
                   <args ordered="yes">
                     <Var>item</Var>
                     <Var>scheduledate</Var>
                   </args>
                 </Atom>
               </formula>
               <formula>
                 <Equal>
                   <left><Var>diffduration</Var></left>
                   <right>
                     <External>
                       <content>
                         <Atom>
                           <op><Const type="&rif;iri">&func;subtract-dateTimes</Const></op>
                           <args ordered="yes">
                             <Var>deliverydate</Var>
                             <Var>scheduledate</Var>
                           </args>
                         </Atom>
                       </content>
                     </External>
                   </right>
                 </Equal>
               </formula>
               <formula>
                 <Equal>
                   <left><Var>diffdays</Var></left>
                   <right>
                     <External>
                       <content>
                         <Atom>
                           <op><Const type="&rif;iri">&func;days-from-duration</Const></op>
                           <args ordered="yes">
                             <Var>diffduration</Var>
                           </args>
                         </Atom>
                       </content>
                     </External>
                   </right>
                 </Equal>
               </formula>
               <formula>
                 <External>
                   <content>
                     <Atom>
                       <op><Const type="&rif;iri">&pred;numeric-greater-than</Const></op>
                       <args ordered="yes">
                         <Var>diffdays</Var>
                         <Const type="&xs;integer">10</Const>
                       </args>
                     </Atom>
                   </content>
                 </External>
               </formula>
             </And>
           </if>
           <then>
             <Atom>
               <op><Const type="&rif;iri">&cpt;reject</Const></op>
               <args ordered="yes">
                 <Const type="&rif;iri">&ppl;John</Const>
                 <Var>item</Var>
               </args>
             </Atom>
           </then>
         </Implies>
       </formula>
     </Forall>
    </sentence>
    <sentence>
     <Forall>
       <declare><Var>item</Var></declare>
       <formula>
         <Implies>
           <if>
             <Atom>
               <op><Const type="&rif;iri">&cpt;unsolicited</Const></op>
               <args ordered="yes"><Var>item</Var></args>
             </Atom>
           </if>
           <then>
             <Atom>
               <op><Const type="&rif;iri">&cpt;reject</Const></op>
               <args ordered="yes">
                 <Const type="&rif;iri">&ppl;Fred</Const>
                 <Var>item</Var>
               </args>
             </Atom>
           </then>
         </Implies>
       </formula>
     </Forall>
    </sentence>
   </Group>
  </payload>
 </Document>


4.3 Mapping from the list of supported symbol spaces will movePresentation Syntax to another document, Data Types and Built-Ins . Any existing discrepancies will be fixed at that time. 5.2the Semantics of RIF-BLD as a Specialization of RIF-FLDXML Syntax

This normativesection defines a normative mapping, χbld, from the precise relationship between the semantics of RIF-BLD andpresentation syntax to the semantic framework of RIF-FLD. SpecificationXML syntax of RIF-BLD. The semantics that does not rely on RIF-FLDmapping is given in Section Direct Specification of RIF-BLD Semantics .via tables where each row specifies the semanticsmapping of a particular syntactic pattern in the RIF Basic Logic Dialect is defined by specialization frompresentation syntax. These patterns appear in the semanticsfirst column of the Semantic Framework for Logic Dialectstables and the bold-italic symbols represent metavariables. The second column represents the corresponding XML patterns, which may contain applications of RIF. Section Semanticsthe mapping χbld to these metavariables. When an expression χbld(metavar) occurs in an XML pattern in the right column of a RIF Dialecttranslation table, it should be understood as a Specialization of the RIF Framework in that document lists the parametersrecursive application of the semantic framework, which one need to specialize. Thus, for RIF-BLD, we needχbld to look atthe following parameters:presentation syntax represented by the effect ofmetavariable. The XML syntax . RIF-BLD does not support negation. Thisresult of such an application is substituted for the only obvious simplificationexpression χbld(metavar). A sequence of terms containing metavariables with respect to RIF-FLD as farsubscripts is indicated by an ellipsis. A metavariable or a well-formed XML subelement is marked as optional by appending a bold-italic question mark, ?, on its right.


4.3.1 Mapping of the semantics is concerned.Condition Language

The restrictions onχbld mapping from the signaturespresentation syntax to the XML syntax of symbols inthe RIF-BLD do not affectCondition Language is specified by the semantics intable below. Each row "Presentation | XML" indicates a significant way. Truth valuesχbld translation: χbld(Presentation) = XML. Since the set TVpresentation syntax of truth values inRIF-BLD consists of just two values, t and f such that f < t t . The order < tis total. Data types . RIF-BLD supports allcontext sensitive, the data types listedmapping must differentiate between the terms that occur in Section Primitive Data Typesthe position of RIF-FLD: xsd:long xsd:integer xsd:decimal xsd:string xsd:time xsd:dateTime rdf:XMLLiteral rif:text Logical entailment . Recallthe individuals from terms that logical entailmentoccur as atomic formulas. To this end, in RIF-FLD is defined with respect to an unspecified set of intended semantic structuresthe translation table, the positional and named argument terms that dialects of RIF must make this notion concrete. For RIF-BLD, this set is definedoccur in onethe context of atomic formulas are denoted by the two following equivalent ways: as a setexpressions of all models; or asthe unique minimal model. These two definitionsform pred(...) and the terms that occur as individuals are equivalent for entailment of existentially closed RIF-BLD conditionsdenoted by RIF-BLD setsexpressions of formulas, since all rulesthe form func(...). In RIF-BLD are Horn -- itthe table, each metavariable for an (unnamed) positional argumenti is a classical result of Van Emden and Kowalski [ vEK76 ]. Editor's Note:assumed to be instantiated to values unequal to the listinstantiations of supported data types will move to another document, Data Types and Built-Insnamed arguments unicodestringj -> fillerj.

Any existing discrepancies will be fixed at that time. 6 References 6.1 Normative References [RDF-CONCEPTS] Resource Description Framework (RDF): Concepts and AbstractPresentation Syntax , Klyne G., Carroll J. (Editors), W3C Recommendation, 10 February 2004, http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/XML Syntax
And (
  conjunct1
  .  Latest version available at http://www.w3.org/TR/rdf-concepts/.  [RDF-SEMANTICS] RDF Semantics , Patrick Hayes, Editor, W3C Recommendation, 10 February 2004, http://www.w3.org/TR/2004/REC-rdf-mt-20040210/.
   Latest version available at http://www.w3.org/TR/rdf-mt/conjunctn
    )
<And>
  <formula>χbld(conjunct1)</formula>
   .  [RDF-SCHEMA] RDF Vocabulary Description Language 1.0: RDF Schema , Brian McBride, Editor, W3C Recommendation 10 February 2004, http://www.w3.org/TR/rdf-schema/.  [RFC-3066] RFC 3066 - Tags for the Identification of Languages , H. Alvestrand, IETF, January 2001. This document is http://www.isi.edu/in-notes/rfc3066.txt.
   [RFC-3987] RFC 3987 - Internationalized Resource Identifiers (IRIs) , M. Duerst and M. Suignard, IETF, January 2005. This document is http://www.ietf.org/rfc/rfc3987.txt<formula>χbld(conjunctn)</formula>
</And>
Or (
  disjunct1
  .  [XML-SCHEMA2] XML Schema Part 2: Datatypes , W3C Recommendation, World Wide Web Consortium, 2 May 2001. This version is http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/.  The latest version is available at http://www.w3.org/TR/xmlschema-2/.
   6.2 Informational References [ANF01] Normal Form Conventions for XML Representations of Structured Data , Henry S. Thompson. October 2001. [KLW95] Logical foundations of object-oriented and frame-based languages, M. Kifer, G. Lausen, J. Wu. Journal of ACM, July 1995, pp. 741--843. [CKW93] HiLog: A Foundation for higher-order logic programming , W. Chen, M. Kifer, D.S. Warren. Journal of Logic Programming, vol. 15, no. 3, February 1993, pp. 187--230. [CK95] Sorted HiLog: Sorts in Higher-Order Logic Data Languages , W. Chen, M. Kifer. Sixth Intl. Conference on Database Theory, Prague, Czech Republic, January 1995, Lecture Notes in Computer Science 893, Springer Verlag, pp. 252--265. [RDFSYN04] RDF/XML Syntax Specification (Revised) , Dave Beckett, Editor, W3C Recommendation, 10 February 2004, http://www.w3.org/TR/2004/REC-rdf-syntax-grammar-20040210/disjunctn
   )
<Or>
  <formula>χbld(disjunct1)</formula>
   .  Latest version available at http://www.w3.org/TR/rdf-syntax-grammar/.  [Shoham87] Nonmonotonic logics: meaning and utility , Y. Shoham. Proc. 10th International Joint Conference on Artificial Intelligence, Morgan Kaufmann, pp. 388--393, 1987. [CURIE] CURIE Syntax 1.0: A syntax for expressing Compact URIs , Mark Birbeck, Shane McCarron. W3C Working Draft 2 April 2008. Available at http://www.w3.org/TR/curie/.
   [GRS91] The Well-Founded Semantics for General Logic Programs , A. Van Gelder, K.A. Ross, J.S. Schlipf. Journal of ACM, 38:3, pages 620-650, 1991. [GL88] The Stable Model Semantics for Logic Programming , M. Gelfond and V. Lifschitz. Logic Programming: Proceedings of the Fifth Conference and Symposium, pages 1070-1080, 1988. [vEK76] The semantics of predicate logic as a programming language , M. van Emden and R. Kowalski. Journal of the ACM 23 (1976), 733-742. 7 Appendix: XML Schema for RIF-BLD The namespace of RIF is http://www.w3.org/2007/rif#<formula>χbld(disjunctn)</formula>
</Or>
Exists
  variable1
  .  XML schemas for the RIF-BLD sublanguages are available below and online , with examples. 7.1 Condition Language <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs=" http://www.w3.org/2001/XMLSchema ". .
  variablen (
             body
            )
<Exists>
  <declare>χbld(variable1)</declare>
   . . .
  <declare>χbld(variablen)</declare>
  <formula>χbld(body)</formula>
</Exists>
External (
  atomframexpr
         )
<External>
  <content>χbld(atomframexpr)</content>
</External>
pred (
  argument1
  . . .
  argumentn
     )
<Atom>
  <op>χbld(pred)</op>
  <args ordered="yes">
    χbld(argument1)
    . . .
    χbld(argumentn)
  </args>
</Atom>
func (
  argument1
  . . .
  argumentn
     )
<Expr>
  <op>χbld(func)</op>
  <args ordered="yes">
    χbld(argument1)
    . . .
    χbld(argumentn)
  </args>
</Expr>
pred (
  unicodestring1 -> filler1
  . . .
  unicodestringn -> fillern
     )
<Atom>
  <op>χbld(pred)</op>
  <slot ordered="yes">
    <Name>unicodestring1</Name>
    χbld(filler1)
  </slot>
   . . .
  <slot ordered="yes">
    <Name>unicodestringn</Name>
    χbld(fillern)
  </slot>
</Atom>
func (
  unicodestring1 -> filler1
  . . .
  unicodestringn -> fillern
     )
<Expr>
  <op>χbld(func)</op>
  <slot ordered="yes">
    <Name>unicodestring1</Name>
    χbld(filler1)
  </slot>
   . . .
  <slot ordered="yes">
    <Name>unicodestringn</Name>
    χbld(fillern)
  </slot>
</Expr>
inst [
  key1 -> filler1
  . . .
  keyn -> fillern
     ]
<Frame>
  <object>χbld(inst)</object>
  <slot ordered="yes">
    χbld(key1)
    χbld(filler1)
  </slot>
   . . .
  <slot ordered="yes">
    χbld(keyn)
    χbld(fillern)
  </slot>
</Frame>
inst # class
<Member>
  <instance>χbld(inst)</instance>
  <class>χbld(class)</class>
</Member>
sub ## super
<Subclass>
  <sub>χbld(sub)</sub>
  <super>χbld(super)</super>
</Subclass>
left = right
<Equal>
  <left>χbld(left)</left>
  <right>χbld(right)</right>
</Equal>
unicodestring^^symspace
<Const type="symspace">unicodestring</Const>
?unicodestring
<Var>unicodestring</Var>


4.3.2 Mapping of the Rule Language

The χbld mapping from the presentation syntax to the XML syntax of the RIF-BLD Rule Language is specified by the table below. It extends the translation table of Section Translation of RIF-BLD Condition Language. While the Import directive is handled by the presentation-to-XML syntax mapping, the Prefix and Base directives are not. Instead, these directives should be dealt with by macro-expanding the associated shortcuts (compact URIs). Namely, a prefix name declared in a Prefix directive is expanded into the associated IRI, while relative IRIs are completed using the IRI declared in the Base directive. The mapping χbld applies only to such macro-expanded documents. RIF-BLD also allows other treatments of Prefix and Base provided that they produce equivalent XML documents. One such treatment is employed in the examples in this document, especially Example 7. It replaces prefix names with definitions of XML entities as follows. Each Prefix declaration becomes an ENTITY declaration [XML1.0] within a DOCTYPE DTD attached to the RIF-BLD Document. The Base directive is mapped to the xml:base attribute [XML-Base] in the XML Document tag. Compact URIs of the form prefix:suffix are then mapped to &prefix;suffix.

Presentation Syntax XML Syntax
Document(
  Import(loc1 prfl1?)
   . . .
  Import(locn prfln?)
  group
        )
<Document>
  <directive>
    <Import>
      <location>χbld(loc1)</location>
      <profile>χbld(prfl1)</profile>?
    </Import>
  </directive>
   . . .
  <directive>
    <Import>
      <location>χbld(locn)</location>
      <profile>χbld(prfln)</profile>?
    </Import>
  </directive>
  <payload>χbld(group)</payload>
</Document>
Group(
  clause1
   . . .
  clausen
     )
<Group>
  <sentence>χbld(clause1)</sentence>
   . . .
  <sentence>χbld(clausen)</sentence>
</Group>
Forall
  variable1
   . . .
  variablen (
             rule
            )
<Forall>
  <declare>χbld(variable1)</declare>
   . . .
  <declare>χbld(variablen)</declare>
  <formula>χbld(rule)</formula>
</Forall>
conclusion :- condition
<Implies>
  <if>χbld(condition)</if>
  <then>χbld(conclusion)</then>
</Implies>

4.3.3 Mapping of Annotations

The χbld mapping from RIF-BLD annotations in the presentation syntax to the XML syntax is specified by the table below. It extends the translation tables of Sections Translation of RIF-BLD Condition Language and Translation of RIF-BLD Rule Language. The metavariable Typetag in the presentation and XML syntaxes stands for any of the class names And, Or, External, Document, or Group, and Quantifier for Exists or Forall. The dollar sign, $, stands for any of the binary infix operator names #, ##, =, or :-, while Binop stands for their respective class names Member, Subclass, Equal, or Implies. Again, each metavariable for an (unnamed) positional argumenti is assumed to be instantiated to values unequal to the instantiations of named arguments unicodestringj -> fillerj.

Presentation Syntax XML Syntax
(* iriconst? frameconj? *)
Typetag ( e1 . . . en )
<Typetag>
  <id>χbld(iriconst)</id>?
  <meta>χbld(frameconj)</meta>?
  e1' . . . en'
</Typetag>

where e1', . . ., en' are defined by the equation
χbld(Typetag(e1 . . . en)) = <Typetag>e1' . . . en'</Typetag>
(* iriconst? frameconj? *)
Quantifier variable1 . . . variablen ( body )
<Quantifier>
  <id>χbld(iriconst)</id>?
  <meta>χbld(frameconj)</meta>?
  <declare>χbld(variable1)</declare>
  . . .
  <declare>χbld(variablen)</declare>
  <formula>χbld(body)</formula>
</Quantifier>
(* iriconst? frameconj? *)
pred (
  argument1
  . . .
  argumentn
     )
<Atom>
  <id>χbld(iriconst)</id>?
  <meta>χbld(frameconj)</meta>?
  <op>χbld(pred)</op>
  <args ordered="yes">
    χbld(argument1)
    . . .
    χbld(argumentn)
  </args>
</Atom>
(* iriconst? frameconj? *)
func (
  argument1
  . . .
  argumentn
     )
<Expr>
  <id>χbld(iriconst)</id>?
  <meta>χbld(frameconj)</meta>?
  <op>χbld(func)</op>
  <args ordered="yes">
    χbld(argument1)
    . . .
    χbld(argumentn)
  </args>
</Expr>
(* iriconst? frameconj? *)
pred (
  unicodestring1 -> filler1
  . . .
  unicodestringn -> fillern
     )
<Atom>
  <id>χbld(iriconst)</id>?
  <meta>χbld(frameconj)</meta>?
  <op>χbld(pred)</op>
  <slot ordered="yes">
    <Name>unicodestring1</Name>
    χbld(filler1)
  </slot>
   . . .
  <slot ordered="yes">
    <Name>unicodestringn</Name>
    χbld(fillern)
  </slot>
</Atom>
(* iriconst? frameconj? *)
func (
  unicodestring1 -> filler1
  . . .
  unicodestringn -> fillern
     )
<Expr>
  <id>χbld(iriconst)</id>?
  <meta>χbld(frameconj)</meta>?
  <op>χbld(func)</op>
  <slot ordered="yes">
    <Name>unicodestring1</Name>
    χbld(filler1)
  </slot>
   . . .
  <slot ordered="yes">
    <Name>unicodestringn</Name>
    χbld(fillern)
  </slot>
</Expr>
(* iriconst? frameconj? *)
inst [
  key1 -> filler1
  . . .
  keyn -> fillern
     ]
<Frame>
  <id>χbld(iriconst)</id>?
  <meta>χbld(frameconj)</meta>?
  <object>χbld(inst)</object>
  <slot ordered="yes">
    χbld(key1)
    χbld(filler1)
  </slot>
   . . .
  <slot ordered="yes">
    χbld(keyn)
    χbld(fillern)
  </slot>
</Frame>
(* iriconst? frameconj? *)
e1 $ e2
<Binop>
  <id>χbld(iriconst)</id>?
  <meta>χbld(frameconj)</meta>?
  e1' e2'
</Binop>

where Binop, e1', e2' are defined by the equation
χbld(e1 $ e2) = <Binop>e1' e2'</Binop>
(* iriconst? frameconj? *)
unicodestring^^symspace
<Const type="symspace">
  <id>χbld(iriconst)</id>?
  <meta>χbld(frameconj)</meta>?
  unicodestring
</Const>
(* iriconst? frameconj? *)
?unicodestring
<Var>
  <id>χbld(iriconst)</id>?
  <meta>χbld(frameconj)</meta>?
  unicodestring
</Var>


5 Conformance Clauses

RIF-BLD does not require or expect the conformant systems to implement the RIF-BLD presentation syntax. Instead, conformance is described in terms of semantics-preserving transformations.

Let Τ be a set of datatypes, which includes the datatypes specified in [RIF-DTB], and suppose Ε is a set of external predicates and functions, which includes the built-ins listed in [RIF-DTB]. Let D be a RIF dialect (e.g., RIF-BLD). We say that a formula φ is a DΤ,Ε formula iff

  • it is a formula in the dialect D,
  • all the datatypes used in φ are in Τ, and
  • all the externally defined functions and predicates used in φ are in Ε.

A RIF processor is a conformant DΤ,Ε consumer iff it implements a semantics-preserving mapping, μ, from the set of all DΤ,Ε formulas to the language L of the processor.

Formally, this means that for any pair φ, ψ of DΤ,Ε formulas for which φ |=D ψ is defined, φ |=D ψ iff μ(φ) |=L μ(ψ). Here |=D denotes the logical entailment in the RIF dialect D and |=L is the logical entailment in the language L of the RIF processor.

A RIF processor is a conformant DΤ,Ε producer iff it implements a semantics-preserving mapping, μ, from a subset of the language L of the processor to a set of DΤ,Ε formulas.

Formally this means that for any pair φ, ψ of formulas in L for which φ |=L ψ is defined, φ |=L ψ iff μ(φ) |=D μ(ψ).


A conformant document is one which conforms to all the syntactic constraints of the dialect, including ones that cannot be checked by an XML Schema validator (cf. Definition Conformant BLD document in XML syntax).


RIF-BLD specific clauses

  • Conformant BLD producers and consumers are required to support only the entailments of the form φ |=BLD ψ, where ψ is a closed RIF condition formula, i.e., an existentially quantified RIF condition in which every variable, ?V, is in the scope of a quantifier of the form Exists ?V.
  • A conformant RIF-BLD consumer is a conformant BLDΤ,Ε consumer if Τ consists only of the datatypes and Ε consists only of the externally defined terms that are required by RIF-BLD. These datatypes and externally defined terms (called built-ins) are specified in the [RIF-DTB]. A conformant RIF-BLD consumer must reject all inputs which do not match the syntax of BLD. If it implements extensions, it may do so under user control -- having a "strict BLD" mode and a "run-with-extensions" mode.
  • A conformant BLD producer produces documents that include only the datatypes and externals that are required by BLD.

Feature At Risk #3: Strictness Requirement

Note: This feature is "at risk" and may be removed from this specification based on feedback. Please send feedback to public-rif-comments@w3.org.

The two preceding clauses are features AT RISK. In particular, the "strictness" requirement is under discussion.

  • A round-tripping of a conformant BLD document is its semantics-preserving mapping to a document in any language L followed by a semantics-preserving mapping from the L document back to a conformant BLD document. While semantically equivalent, the original and the round-tripped BLD documents need not be identical. Metadata SHOULD survive BLD round-tripping.


6 RIF-BLD as a Specialization of the RIF Framework [RIF-FLD]

This normative section describes RIF-BLD by specializing RIF-FLD. The reader is assumed to be familiar with RIF-FLD as described in RIF Framework for Logic-Based Dialects [RIF-FLD]. The reader who is not interested in how RIF-BLD is derived from the framework can skip this section.


6.1 The Presentation Syntax of RIF-BLD as a Specialization of RIF-FLD

This section defines the precise relationship between the presentation syntax of RIF-BLD and the syntactic framework of RIF-FLD.

The presentation syntax of the RIF Basic Logic Dialect is defined by specialization from the presentation syntax of the RIF Syntactic Framework for Logic Dialects described in [RIF-FLD]. Section Syntax of a RIF Dialect as a Specialization of the RIF Framework in [RIF-FLD] lists the parameters of the syntactic framework in mathematical English, which we will now specialize for RIF-BLD.


  1. Alphabet.
  2. The alphabet of the RIF-BLD presentation syntax is the alphabet of RIF-FLD with the symbols Dialect, Neg, and Naf excluded.
  3. Assignment of signatures to each constant and variable symbol.
  4. The signature set of RIF-BLD contains the following signatures:

    1. Basic.
      • individual{ }
      • atomic{ }

      The signature individual{ } represents the context in which individual objects (but not atomic formulas) can appear.
      The signature atomic{ } represents the context where atomic formulas can occur.

    2. For every integer n 0, there are signatures
      • fn{(individual ... individual) individual} -- for n-ary function symbols,
      • pn{(individual ... individual) atomic} -- for n-ary predicates.

      These represent function and predicate symbols of arity n (each of the above cases has n individuals as arguments inside the parentheses).

    3. For every set of symbols s1,...,sk ArgNames, there are signatures fs1...sk{(s1->individual ... sk->individual) individual} and ps1...sk{(s1->individual ... sk->individual) atomic}. These are signatures for terms and predicates with arguments named s1, ..., sk, respectively. In this specialization of RIF-FLD, the argument names s1, ..., sk must be pairwise distinct.
    4. A symbol in Const can have exactly one signature, individual, fn, or pn, where n 0, or fs1...sk{(s1->individual ... sk->individual) individual}, ps1...sk{(s1->individual ... sk->individual) atomic}, for some s1,...,sk ArgNames. It cannot have the signature atomic, since only complex terms can have such signatures. Thus, by itself a symbol cannot be a proposition in RIF-BLD, but a term of the form p() can be.

      Thus, in RIF-BLD each constant symbol can be either an individual, a function of one particular arity or with certain argument names, a predicate of one particular arity or with certain argument names, an externally defined function of one particular arity, or an externally defined predicate symbol of one particular arity -- it is not possible for the same symbol to play more than one role.

    5. The constant symbols that belong to the primitive RIF datatypes (XML Schema datatypes, rdf:XMLLiteral, rif:text, etc.) all have the signature individual in RIF-BLD.
    6. The symbols of type rif:iri and rif:local can have the following signatures in RIF-BLD: individual, fn, or pn, for n = 0,1,....; or fs1...sk, ps1...sk, for some argument names s1,...,sk ArgNames.
    7. All variables are associated with signature individual{ }, so they can range only over individuals.
    8. The signature for equality is ={(individual individual) atomic}.

      This means that equality can compare only those terms whose signature is individual; it cannot compare predicate names or function symbols. Equality terms are also not allowed to occur inside other terms, since the above signature implies that any term of the form t = s has signature atomic and not individual.

    9. The frame signature, ->, is ->{(individual individual individual) atomic}.

      Note that this precludes the possibility that a frame term might occur as an argument to a predicate, a function, or inside some other term.

    10. The membership signature, #, is #{(individual individual) atomic}.

      Note that this precludes the possibility that a membership term might occur as an argument to a predicate, a function, or inside some other term.

    11. The signature for the subclass relationship is ##{(individual individual) atomic}.

      As with frames and membership terms, this precludes the possibility that a subclass term might occur inside some other term.

    RIF-BLD uses no special syntax for declaring signatures. Instead, the author specifies signatures contextually. That is, since RIF-BLD requires that each symbol is associated with a unique signature, the signature is determined from the context in which the symbol is used. If a symbol is used in more than one context, the parser must treat this as a syntax error. If no errors are found, all terms and atomic formulas are guaranteed to be well-formed. Thus, signatures are not part of the RIF-BLD language, and individual and atomic are not reserved keywords.

  5. Supported types of terms.
    • RIF-BLD supports the following types of terms defined by the syntactic framework (see the Section Terms of [RIF-FLD]):
      1. constants
      2. variables
      3. positional
      4. with named arguments
      5. equality
      6. frame
      7. membership
      8. subclass
      9. external
    • Compared to RIF-FLD, terms (both positional and with named arguments) have significant restrictions. This is so in order to give BLD a relatively compact nature.
      • The signature for the variable symbols does not permit them to occur in the context of predicates, functions, or formulas. In particular, in the RIF-BLD specialization of RIF-FLD, a variable is not an atomic formula.
      • Likewise, a symbol cannot be an atomic formula by itself. That is, if p Const then p is not a well-formed atomic formula. However, p() can be an atomic formula.
      • Signatures permit only constant symbols to occur in the context of function or predicate names. Indeed, RIF-BLD signatures ensure that all variables have the signature individual{ } and all other terms, except for the constants from Const, can have either the signature individual{ } or atomic{ }. Therefore, if t is a (non-Const) term then t(...) is not a well-formed term.
      • In an externally defined term, External(t), t can be only a positional, named-argument, or a frame term. Compared to RIF-FLD, the above restricts t in that it cannot be a constant.
      • Combined with the fact that in a well-formed term of the form External(t) the subterm t must be an instance of an external schema (by the definition of well-formed external terms in RIF-FLD), it follows that a predicate or a function symbol, p, that occurs in an external term External(p(...)) cannot also occur as a non-external symbol.

      • If a term, t, is an instance of an externally defined schema from the coherent set of external schemas associated with the language, then t can occur only as External(t), i.e., as an external term or atomic formula.
  6. Required symbol spaces.
  7. RIF-BLD requires the following symbol spaces defined in Section Constants and Symbol Spaces of [RIF-DTB].

  8. Supported formulas.
  9. RIF-BLD supports the following types of formulas (see Well-formed Terms and Formulas in [RIF-FLD] for the definitions):

    • RIF-BLD condition
    • A RIF-BLD condition is an atomic formula, a conjunctive or disjunctive combination of atomic formulas with optional existential quantification of variables, or an external atomic formula.

    • RIF-BLD rule
    • A RIF-BLD rule is a universally quantified RIF-FLD rule with the following restrictions:

      • The head (or conclusion) of the rule is an atomic formula or a conjunction of atomic formulas.

        Note: This feature (Equality in the rule conclusion) is "at risk". See feature at risk #2

      • None of the atomic formulas mentioned in the rule head is externally defined (i.e., cannot have the form External(...)).
      • The body (or premise) of the rule is a RIF-BLD condition.
      • All free (non-quantified) variables in the rule must be quantified with Forall outside of the rule (i.e., Forall ?vars (head :- body)).
    • Universal fact

      A universal fact is a universally quantified atomic formula with no free variables.

    • RIF-BLD group

      A RIF-BLD group is a RIF-FLD group that contains only RIF-BLD rules, universal facts, variable-free rule implications, variable-free atomic formulas, and RIF-BLD groups.

    • RIF-BLD document

      A RIF-BLD document is a RIF-FLD document that consists of directives and a RIF-BLD group formula. There is no Dialect directive and the Import(loc) directive (with one argument) can import RIF-BLD documents only. There are no BLD-specific restrictions on the two-argument directive Import.

Recall that negation (classical or default) is not supported by RIF-BLD in either the rule head or the body.


6.2 The Semantics of RIF-BLD as a Specialization of RIF-FLD

This normative section defines the precise relationship between the semantics of RIF-BLD and the semantic framework of RIF-FLD. Specification of the semantics that does not rely on RIF-FLD is given in Section Direct Specification of RIF-BLD Semantics.

The semantics of the RIF Basic Logic Dialect is defined by specialization from the semantics of the Semantic Framework for Logic Dialects of RIF. Section Semantics of a RIF Dialect as a Specialization of the RIF Framework in [RIF-FLD] lists the parameters of the semantic framework, which one need to specialize. Thus, for RIF-BLD, we need to look at the following parameters:

  • The effect of the syntax.
  • RIF-BLD does not support negation. This is the only obvious simplification with respect to RIF-FLD as far as the semantics is concerned. The restrictions on the signatures of symbols in RIF-BLD do not affect the semantics in a significant way.

  • Truth values.
  • The set TV of truth values in RIF-BLD consists of just two values, t and f such that f <t t. The order <t is total.

  • Datatypes.
  • RIF-BLD supports the datatypes listed in Section Datatypes of [RIF-DTB].

  • Logical entailment.
  • Recall that logical entailment in RIF-FLD is defined with respect to an unspecified set of intended semantic structures and that dialects of RIF must make this notion concrete. For RIF-BLD, this set is defined in one of the two following equivalent ways:

    • as a set of all models; or
    • as the unique minimal model, if it exists. (Note that such a model might not exist because of equality and built-in predicates associated with the RIF-BLD required datatypes).

    These two definitions are equivalent for entailment of existentially closed RIF-BLD conditions by RIF-BLD documents (i.e., formulas where every variable, ?V, occurs in a subformula of the form Exists ...?V...(ψ)), since all rules in RIF-BLD are Horn -- it is a classical result of Van Emden and Kowalski [vEK76].

  • Import directive.
  • The semantics of the two-argument Import directive is given in [RIF-RDF+OWL]. The semantics of the one-argument directive is the same as in RIF-FLD.

6.3 The XML Serialization of RIF-BLD as a Specialization of RIF-FLD

Section Mapping from the RIF-FLD Presentation Syntax to the XML Syntax of [RIF-FLD] defines a mapping, χfld, from the presentation syntax of RIF-FLD to its XML serialization. When restricted to well-formed RIF-BLD formulas, χfld coincides with the BLD-to-XML mapping χbld. In this way, the XML serialization of RIF-BLD is a specialization of the RIF-FLD XML Serialization Framework defined in [RIF-FLD].

7 Acknowledgements

This document is the product of the Rules Interchange Format (RIF) Working Group (see below) whose members deserve recognition for their time and commitment. Special thanks to: Jos de Bruijn, David Hirtle, Stella Mitchell, Leora Morgenstern, Igor Mozetic, Axel Polleres, and Dave Reynolds, for their thorough reviews and insightful discussions. The working group chairs, Chris Welty and Christian de Sainte-Marie, provided invaluable technical help and inspirational leadership throughout the long and difficult trials leading to this draft. Last, but not least, our W3C team contact, Sandro Hawke, was a constant source of ideas, help, and feedback.


The regular attendees at meetings of the Rule Interchange Format (RIF) Working Group at the time of the publication were: Adrian Paschke (REWERSE), Axel Polleres (DERI), Chris Welty (IBM), Christian de Sainte Marie (ILOG), Dave Reynolds (HP), Gary Hallmark (ORACLE), Harold Boley (NRC), Hassan Aït-Kaci (ILOG), Igor Mozetic (JFI), John Hall (OMG), Jos de Bruijn (FUB), Leora Morgenstern (IBM), Michael Kifer (Stony Brook), Mike Dean (BBN), Sandro Hawke (W3C/MIT), and Stella Mitchell (IBM). We would also like to thank two past members of the working group, Allen Ginsberg and Paula-Lavinia Patranjan.

8 References

8.1 Normative References

[RDF-CONCEPTS]
Resource Description Framework (RDF): Concepts and Abstract Syntax, Klyne G., Carroll J. (Editors), W3C Recommendation, 10 February 2004, http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/. Latest version available at http://www.w3.org/TR/rdf-concepts/.

[RFC-3066]
RFC 3066 - Tags for the Identification of Languages, H. Alvestrand, IETF, January 2001. This document is http://www.isi.edu/in-notes/rfc3066.txt.

[RFC-3987]
RFC 3987 - Internationalized Resource Identifiers (IRIs), M. Duerst and M. Suignard, IETF, January 2005. This document is http://www.ietf.org/rfc/rfc3987.txt.

[RIF-DTB]
RIF Datatypes and Built-Ins 1.0 Axel Polleres, Harold Boley, Michael Kifer, eds. W3C Editor's Draft, 17 July 2008, http://www.w3.org/2005/rules/wg/draft/ED-rif-dtb-20080717/. Latest version available at http://www.w3.org/2005/rules/wg/draft/rif-dtb/.

[RIF-FLD]
RIF Framework for Logic Dialects Harold Boley, Michael Kifer, eds. W3C Editor's Draft, 17 July 2008, http://www.w3.org/2005/rules/wg/draft/ED-rif-fld-20080717/. Latest version available at http://www.w3.org/2005/rules/wg/draft/rif-fld/.

[XML1.0]
Extensible Markup Language (XML) 1.0 (Fourth Edition), W3C Recommendation, World Wide Web Consortium, 16 August 2006, edited in place 29 September 2006. This version is http://www.w3.org/TR/2006/REC-xml-20060816.

[XML-Base]
XML Base, W3C Recommendation, World Wide Web Consortium, 27 June 2001. This version is http://www.w3.org/TR/2001/REC-xmlbase-20010627/. The latest version is available at http://www.w3.org/TR/xmlbase/.

[XML-SCHEMA2]
XML Schema Part 2: Datatypes, W3C Recommendation, World Wide Web Consortium, 2 May 2001. This version is http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/. The latest version is available at http://www.w3.org/TR/xmlschema-2/.

8.2 Informational References

[ANF01]
Normal Form Conventions for XML Representations of Structured Data, Henry S. Thompson. October 2001. Available at http://www.ltg.ed.ac.uk/~ht/normalForms.html.

[CL73]
Symbolic Logic and Mechanical Theorem Proving, C.L. Chang and R.C.T. Lee. Academic Press, 1973.

[CURIE]
CURIE Syntax 1.0: A syntax for expressing Compact URIs, Mark Birbeck, Shane McCarron. W3C Working Draft 2 April 2008. Available at http://www.w3.org/TR/curie/.

[KLW95]
Logical foundations of object-oriented and frame-based languages, M. Kifer, G. Lausen, J. Wu. Journal of ACM, July 1995, pp. 741--843.
[OWL-Reference]
OWL Web Ontology Language Reference, M. Dean, G. Schreiber, Editors, W3C Recommendation, 10 February 2004, http://www.w3.org/TR/2004/REC-owl-ref-20040210/. Latest version available at http://www.w3.org/TR/owl-ref/.

[RDFSYN04]
RDF/XML Syntax Specification (Revised), Dave Beckett, Editor, W3C Recommendation, 10 February 2004, http://www.w3.org/TR/2004/REC-rdf-syntax-grammar-20040210/. Latest version available at http://www.w3.org/TR/rdf-syntax-grammar/.

[RIF-RDF+OWL]
RIF RDF and OWL Compatibility Jos de Bruijn, eds. W3C Editor's Draft, 17 July 2008, http://www.w3.org/2005/rules/wg/draft/ED-rif-rdf-owl-20080717/. Latest version available at http://www.w3.org/2005/rules/wg/draft/rif-rdf-owl/.

[RIF-UCR]
RIF Use Cases and Requirements Adrian Paschke, David Hirtle, Allen Ginsberg, Paula-Lavinia Patranjan, Frank McCabe, eds. W3C Editor's Draft, 17 July 2008, http://www.w3.org/2005/rules/wg/draft/ED-rif-ucr-20080717/. Latest version available at http://www.w3.org/2005/rules/wg/draft/rif-ucr/.

[TRT03]
Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms, H. Boley. Springer LNCS 2876, Oct. 2003, pp. 1-16. Preprint at http://iit-iti.nrc-cnrc.gc.ca/publications/nrc-46502_e.html.

[vEK76]
The semantics of predicate logic as a programming language, M. van Emden and R. Kowalski. Journal of the ACM 23 (1976), pp. 733-742.


9 Appendix: XML Schema for RIF-BLD

The namespace of RIF is http://www.w3.org/2007/rif#.

XML schemas for the RIF-BLD sublanguages are defined below and are also available here with additional examples.


9.1 Condition Language

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema 
 xmlns:xs="http://www.w3.org/2001/XMLSchema"
 xmlns="http://www.w3.org/2007/rif#"
 targetNamespace="http://www.w3.org/2007/rif#"
 elementFormDefault="qualified"
 version="Id: BLDCond.xsd, v. 1.0, 2008-07-14, dhirtle/hboley">

 <xs:annotation>
   <xs:documentation>
   This is the XML schema for the Condition Language as defined by
   the Last Call Draft of the RIF Basic Logic Dialect.
   
   The schema is based on the following EBNF for the RIF-BLD Condition Language:

 FORMULA        ::= IRIMETA? 'And' '(' FORMULA* ')' |
                    IRIMETA? 'Or' '(' FORMULA* ')' |
                    IRIMETA? 'Exists' Var+ '(' FORMULA ')' |
                    ATOMIC |
                    IRIMETA? 'External' '(' Atom | Frame ')'
 ATOMIC         ::= IRIMETA? (Atom | Equal | Member | Subclass | Frame)
 Atom           ::= UNITERM
 UNITERM        ::= Const '(' (TERM* | (Name '->' TERM)*) ')'
 Equal          ::= TERM '=' TERM
 Member         ::= TERM '#' TERM
 Subclass       ::= TERM '##' TERM
 Frame          ::= TERM '[' (TERM '->' TERM)* ']'
 TERM           ::= IRIMETA? (Const | Var | Expr | 'External' '(' Expr ')')
 Expr           ::= UNITERM
 Const          ::= '"' UNICODESTRING '"^^' SYMSPACE | CONSTSHORT
 IRICONST       ::= '"' IRI '"^^' 'rif:iri'
 Name           ::= UNICODESTRING
 Var            ::= '?' UNICODESTRING
 SYMSPACE       ::= ANGLEBRACKIRI | CURIE

 IRIMETA        ::= '(*' IRICONST? (Frame | 'And' '(' Frame* ')')? '*)'

   </xs:documentation>
 </xs:annotation>
 
 <xs:group name="FORMULA">  
   <xs:choice>
     <xs:element ref="And"/>
     <xs:element ref="Or"/>
     <xs:element ref="Exists"/>
     <xs:group ref="ATOMIC"/>
     <xs:element name="External" type="External-FORMULA.type"/>
   </xs:choice>
 </xs:group>
 
 <xs:complexType name="External-FORMULA.type">
   <xs:sequence>
     <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
     <xs:element name="content" type="content-FORMULA.type"/>
   </xs:sequence>
 </xs:complexType>
 
 <xs:complexType name="content-FORMULA.type">
   <xs:sequence>
     <xs:choice>
       <xs:element ref="Atom"/>
       <xs:element ref="Frame"/>
     </xs:choice>
   </xs:sequence>
 </xs:complexType>

 <xs:element name="And">
   <xs:complexType>
     <xs:sequence>
       <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
       <xs:element ref="formula" minOccurs="0" maxOccurs="unbounded"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>
 
 <xs:element name="Or">
   <xs:complexType>
     <xs:sequence>
       <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
       <xs:element ref="formula" minOccurs="0" maxOccurs="unbounded"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>
 
 <xs:element name="Exists">
   <xs:complexType>
     <xs:sequence>
       <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
       <xs:element ref="declare" minOccurs="1" maxOccurs="unbounded"/>
       <xs:element ref="formula"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>
 
 <xs:element name="formula">
   <xs:complexType>
     <xs:sequence>
       <xs:group ref="FORMULA"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>
 
 <xs:element name="declare">
   <xs:complexType>
     <xs:sequence>
       <xs:element ref="Var"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>

 <xs:group name="ATOMIC">
   <xs:choice>
     <xs:element ref="Atom"/>
     <xs:element ref="Equal"/>
     <xs:element ref="Member"/>
     <xs:element ref="Subclass"/>
     <xs:element ref="Frame"/>
   </xs:choice>
 </xs:group>
 
 <xs:element name="Atom">
   <xs:complexType>
     <xs:sequence>
       <xs:group ref="UNITERM"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>  
 
 <xs:group name="UNITERM">
   <xs:sequence>
     <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
     <xs:element ref="op"/>
     <xs:choice>
       <xs:element ref="args" minOccurs="0" maxOccurs="1"/>
       <xs:element name="slot" type="slot-UNITERM.type" minOccurs="0" maxOccurs="unbounded"/>
     </xs:choice>
   </xs:sequence>
 </xs:group>

 <xs:element name="op">
   <xs:complexType>
     <xs:sequence>
       <xs:element ref="Const"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>
 
 <xs:element name="args">
   <xs:complexType>
     <xs:sequence>
       <xs:group ref="TERM" minOccurs="0" maxOccurs="unbounded"/>
     </xs:sequence>
     <xs:attribute name="ordered" type="xs:string" fixed="yes"/>
   </xs:complexType>
 </xs:element>

 <xs:complexType name="slot-UNITERM.type">
   <xs:sequence>
     <xs:element ref="Name"/>
     <xs:group ref="TERM"/>
   </xs:sequence>
   <xs:attribute name="ordered" type="xs:string" fixed="yes"/>
 </xs:complexType>

 <xs:element name="Equal">
   <xs:complexType>
     <xs:sequence>
       <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
       <xs:element ref="left"/>
       <xs:element ref="right"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>

 <xs:element name="left">
   <xs:complexType>
     <xs:sequence>
       <xs:group ref="TERM"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>

 <xs:element name="right">
   <xs:complexType>
     <xs:sequence>
       <xs:group ref="TERM"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>

 <xs:element name="Member">
   <xs:complexType>
     <xs:sequence>
       <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
       <xs:element ref="instance"/>
       <xs:element ref="class"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>

 <xs:element name="Subclass">
   <xs:complexType>
     <xs:sequence>
       <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
       <xs:element ref="sub"/>
       <xs:element ref="super"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>
 
 <xs:element name="instance">
   <xs:complexType>
     <xs:sequence>
       <xs:group ref="TERM"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>
 
 <xs:element name="class">
   <xs:complexType>
     <xs:sequence>
       <xs:group ref="TERM"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>
 
 <xs:element name="sub">
   <xs:complexType>
     <xs:sequence>
       <xs:group ref="TERM"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>
 
 <xs:element name="super">
   <xs:complexType>
     <xs:sequence>
       <xs:group ref="TERM"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>
   
 <xs:element name="Frame">
   <xs:complexType>
     <xs:sequence>
       <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
       <xs:element ref="object"/>
       <xs:element name="slot" type="slot-Frame.type" minOccurs="0" maxOccurs="unbounded"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>

 <xs:element name="object">
   <xs:complexType>
     <xs:sequence>
       <xs:group ref="TERM"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>

 <xs:complexType name="slot-Frame.type">
   <xs:sequence>
     <xs:group ref="TERM"/>
     <xs:group ref="TERM"/>
   </xs:sequence>
   <xs:attribute name="ordered" type="xs:string" fixed="yes"/>
 </xs:complexType>

 <xs:group name="TERM">  
     <xs:choice>
        <xs:element ref="Const"/>
        <xs:element ref="Var"/>
        <xs:element ref="Expr"/>
        <xs:element name="External" type="External-TERM.type"/>
     </xs:choice>
 </xs:group>
 
 <xs:complexType name="External-TERM.type">
   <xs:sequence>
     <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
     <xs:element name="content" type="content-TERM.type"/>
   </xs:sequence>
 </xs:complexType>
 
 <xs:complexType name="content-TERM.type">
   <xs:sequence>
     <xs:element ref="Expr"/>
   </xs:sequence>
 </xs:complexType>

 <xs:element name="Expr">
   <xs:complexType>
     <xs:sequence>
       <xs:group ref="UNITERM"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>

 <xs:element name="Const">
   <xs:complexType mixed="true">
     <xs:sequence>
       <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
     </xs:sequence>
     <xs:attribute name="type" type="xs:anyURI" use="required"/>
   </xs:complexType>
 </xs:element>
 
 <xs:element name="Name" type="xs:string">
 </xs:element>

 <xs:element name="Var">
   <xs:complexType mixed="true">
     <xs:sequence>
       <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>

 <xs:group name="IRIMETA">
   <xs:sequence>
     <xs:element ref="id" minOccurs="0" maxOccurs="1"/>
     <xs:element ref="meta" minOccurs="0" maxOccurs="1"/>
   </xs:sequence>
 </xs:group>

 <xs:element name="id">
   <xs:complexType>
     <xs:sequence>
       <xs:element name="Const" type="IRICONST.type"/>   
     </xs:sequence>
   </xs:complexType>
 </xs:element>

 <xs:element name="meta">
   <xs:complexType>
    <xs:choice>
      <xs:element ref="Frame"/>
      <xs:element name="And" type="And-meta.type"/>
    </xs:choice>
   </xs:complexType>
 </xs:element>
 
 <xs:complexType name="And-meta.type">
   <xs:sequence>
     <xs:element name="formula" type="formula-meta.type" minOccurs="0" maxOccurs="unbounded"/>
   </xs:sequence>
 </xs:complexType>

 <xs:complexType name="formula-meta.type">
   <xs:sequence>
     <xs:element ref="Frame"/>
   </xs:sequence>
 </xs:complexType>
 
 <xs:complexType name="IRICONST.type" mixed="true">
   <xs:sequence/>
   <xs:attribute name="type" type="xs:anyURI" use="required" fixed="http://www.w3.org/2007/rif#iri"/>
 </xs:complexType>
 
</xs:schema>

9.2 Rule Language

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema 
 xmlns:xs="http://www.w3.org/2001/XMLSchema"
 xmlns="http://www.w3.org/2007/rif#"
 targetNamespace="http://www.w3.org/2007/rif#"
 elementFormDefault="qualified"
 version="Id:  BLDCond.xsd,v 0.8 2008-04-14BLDRule.xsd, v. 1.0, 2008-07-16, dhirtle/hboley">

 <xs:annotation>
   <xs:documentation>
   This is the XML schema for the  ConditionRule Language as defined by
    Workingthe Last Call Draft  2of the RIF Basic Logic Dialect.
   
   The schema is based on the following EBNF for the RIF-BLD  ConditionRule Language:
 
  FORMULADocument  ::=  'And'IRIMETA? 'Document' '('  FORMULA*Base? Prefix* Import* Group? ')'
  | 'Or'Base      ::= 'Base' '('  FORMULA*IRI ')'
  | 'Exists' Var+Prefix    ::= 'Prefix' '('  FORMULAName IRI ')'
  | ATOMIC | 'External'Import    ::= IRIMETA? 'Import' '('  ATOMICIRICONST PROFILE? ')'
  ATOMIC ::= Atom | Equal | Member | Subclass | Frame Atom ::= UNITERM UNITERMGroup     ::=  ConstIRIMETA? 'Group' '('  (TERM*(RULE |  (Name '->' TERM)*)Group)* ')'
  Equal ::= TERM '=' TERM Member ::= TERM '#' TERM Subclass ::= TERM '##' TERM Frame ::= TERM '[' (TERM '->' TERM)* ']' TERMRULE      ::=  Const(IRIMETA? 'Forall' Var+ '(' CLAUSE ')') |  VarCLAUSE
 CLAUSE    ::= Implies |  ExprATOMIC
 Implies   ::= IRIMETA? (ATOMIC |  'External''And' '('  Expr ')' Expr ::= UNITERM Const ::= '"' UNICODESTRING '"^^' SYMSPACE Name ::= UNICODESTRING Var ::= '?' UNICODESTRING </xs:documentation> </xs:annotation> <xs:group name="FORMULA"> <xs:choice> <xs:element ref="And"/> <xs:element ref="Or"/> <xs:element ref="Exists"/> <xs:group ref="ATOMIC"/> <xs:element name="External" type="External-FORMULA.type"/> </xs:choice> </xs:group> <xs:complexType name="External-FORMULA.type"> <xs:sequence> <xs:element name="content" type="content-FORMULA.type"/> </xs:sequence> </xs:complexType> <xs:complexType name="content-FORMULA.type"> <xs:sequence> <xs:group ref="ATOMIC"/> </xs:sequence> </xs:complexType> <xs:element name="And"> <xs:complexType> <xs:sequence> <xs:element ref="formula" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Or"> <xs:complexType> <xs:sequence> <xs:element ref="formula" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Exists"> <xs:complexType> <xs:sequence> <xs:element ref="declare" minOccurs="1" maxOccurs="unbounded"/> <xs:element ref="formula"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="formula"> <xs:complexType> <xs:sequence> <xs:group ref="FORMULA"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="declare"> <xs:complexType> <xs:sequence> <xs:element ref="Var"/> </xs:sequence> </xs:complexType> </xs:element> <xs:group name="ATOMIC"> <xs:choice> <xs:element ref="Atom"/> <xs:element ref="Equal"/> <xs:element ref="Member"/> <xs:element ref="Subclass"/> <xs:element ref="Frame"/> </xs:choice> </xs:group>ATOMIC* ')') ':-' FORMULA
 PROFILE   ::= TERM
     
   Note that this is an extension of the syntax for the RIF-BLD Condition Language (BLDCond.xsd).
   </xs:documentation>
 </xs:annotation>

 <xs:include schemaLocation="BLDCond.xsd"/>

 <xs:element  name="Atom">name="Document">
   <xs:complexType>
     <xs:sequence>
       <xs:group  ref="UNITERM"/> </xs:sequence> </xs:complexType> </xs:element> <xs:group name="UNITERM"> <xs:sequence> <xs:element ref="op"/> <xs:choice> <xs:element ref="arg"ref="IRIMETA" minOccurs="0"  maxOccurs="unbounded"/>maxOccurs="1"/>
       <xs:element  name="slot" type="slot-UNITERM.type"ref="directive" minOccurs="0" maxOccurs="unbounded"/>
        </xs:choice> </xs:sequence> </xs:group> <xs:element name="op"> <xs:complexType> <xs:sequence><xs:element  ref="Const"/>ref="payload" minOccurs="0" maxOccurs="1"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>

 <xs:element  name="arg">name="directive">
   <xs:complexType>
     <xs:sequence>
        <xs:group ref="TERM"/> </xs:sequence> </xs:complexType> </xs:element> <xs:complexType name="slot-UNITERM.type"> <xs:sequence><xs:element  name="Prop" type="Prop-UNITERM.type"/>ref="Import"/>
     </xs:sequence>
   </xs:complexType>
  <xs:complexType name="Prop-UNITERM.type"> <xs:sequence> <xs:element name="key" type="key-UNITERM.type"/></xs:element>

 <xs:element  ref="val"/> </xs:sequence> </xs:complexType> <xs:complexType name="key-UNITERM.type">name="payload">
   <xs:complexType>
     <xs:sequence>
       <xs:element  ref="Name"/>ref="Group"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>
 
 <xs:element  name="val">name="Import">
   <xs:complexType>
     <xs:sequence>
       <xs:group  ref="TERM"/>ref="IRIMETA" minOccurs="0" maxOccurs="1"/> 
       <xs:element ref="location"/>
       <xs:element ref="profile" minOccurs="0" maxOccurs="1"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>

 <xs:element  name="Equal">name="location">
   <xs:complexType>
     <xs:sequence>
       <xs:element  ref="side"/> <xs:element ref="side"/>name="Const" type="IRICONST.type"/>   
     </xs:sequence>
   </xs:complexType>
 </xs:element>

 <xs:element  name="side">name="profile">
   <xs:complexType>
     <xs:sequence>
       <xs:group ref="TERM"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>
 
 <xs:element  name="Member">name="Group">
   <xs:complexType>
     <xs:sequence>
       <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
       <xs:element  ref="lower"/> <xs:element ref="upper"/>ref="sentence" minOccurs="0" maxOccurs="unbounded"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>

 <xs:element  name="Subclass">name="sentence">
  <xs:complexType>
     <xs:sequence> <xs:element ref="lower"/><xs:choice>
      <xs:group ref="RULE"/>
      <xs:element  ref="upper"/> </xs:sequence>ref="Group"/>
    </xs:choice>
  </xs:complexType>
</xs:element>
 
 <xs:group name="RULE">
   <xs:choice>
     <xs:element ref="Forall"/>
     <xs:group ref="CLAUSE"/>
   </xs:choice>
 </xs:group>

 <xs:element  name="lower">name="Forall">
   <xs:complexType>
     <xs:sequence>
       <xs:group  ref="TERM"/> </xs:sequence> </xs:complexType> </xs:element>ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
       <xs:element ref="declare" minOccurs="1" maxOccurs="unbounded"/>
       <xs:element  name="upper">name="formula">
         <xs:complexType>
            <xs:sequence><xs:group  ref="TERM"/>ref="CLAUSE"/>
         </xs:complexType>
       </xs:element>
     </xs:sequence>
   </xs:complexType>
 </xs:element>

 <xs:group name="CLAUSE">  
   <xs:choice>
     <xs:element  name="Frame">ref="Implies"/>
     <xs:group ref="ATOMIC"/>
   </xs:choice>
 </xs:group>
 
 <xs:element name="Implies">
   <xs:complexType>
     <xs:sequence>
       <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
       <xs:element  ref="object"/>ref="if"/>
       <xs:element  name="slot" type="slot-Frame.type" minOccurs="0" maxOccurs="unbounded"/>ref="then"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>

 <xs:element  name="object">name="if">
   <xs:complexType>
     <xs:sequence>
       <xs:group  ref="TERM"/>ref="FORMULA"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>
 
  <xs:complexType name="slot-Frame.type"> <xs:sequence> <xs:element name="Prop" type="Prop-Frame.type"/> </xs:sequence> </xs:complexType> <xs:complexType name="Prop-Frame.type"> <xs:sequence><xs:element  name="key" type="key-Frame.type"/> <xs:element ref="val"/> </xs:sequence> </xs:complexType> <xs:complexType name="key-Frame.type"> <xs:sequence> <xs:group ref="TERM"/> </xs:sequence> </xs:complexType> <xs:group name="TERM">name="then">
   <xs:complexType>
    <xs:choice>
      <xs:group ref="ATOMIC"/>
      <xs:element  ref="Const"/> <xs:element ref="Var"/> <xs:element ref="Expr"/> <xs:element name="External" type="External-TERM.type"/>name="And" type="And-then.type"/>
    </xs:choice>
    </xs:group> <xs:complexType name="External-TERM.type"> <xs:sequence> <xs:element name="content" type="content-TERM.type"/> </xs:sequence></xs:complexType>
 </xs:element>

 <xs:complexType  name="content-TERM.type">name="And-then.type">
   <xs:sequence>
     <xs:element  ref="Expr"/>name="formula" type="formula-then.type" minOccurs="0" maxOccurs="unbounded"/>
   </xs:sequence>
 </xs:complexType>

  <xs:element name="Expr"> <xs:complexType><xs:complexType name="formula-then.type">
   <xs:sequence>
     <xs:group  ref="UNITERM"/>ref="ATOMIC"/>
   </xs:sequence>
 </xs:complexType>
  
 </xs:element> <xs:element name="Const"> <xs:complexType mixed="true"> <xs:sequence/> <xs:attribute name="type" type="xs:string" use="required"/> </xs:complexType> </xs:element> <xs:element name="Name" type="xs:string"> </xs:element> <xs:element name="Var" type="xs:string"> </xs:element></xs:schema>

7.210 Appendix: RIF Media Type Registration

The anticipated RIF media type is "application/rif+xml". The draft registration for this media type (pending IETF discussion and approval by the IESG) follows.

   Type name: application

   Subtype name: rif+xml

   Required parameters: none

   Optional parameters: charset, as per RFC 3023 (XML Media Types)

   Encoding considerations: same as RFC 3023 (XML Media Types)

   Security considerations: 

       Systems which consume RIF documents are potentially vulnerable
       to attack by malicious producers of RIF documents.  The
       vulnerabilities and forms of attack are similar to those of
       other Web-based formats with programming or scripting
       capabilities, such as HTML with embedded Javascript.

       Excessive Resource Use / Denial of Service Attacks

          Full and complete processing of a RIF document, even one
          conforming to the RIF-BLD dialect, may require unlimited CPU
          and memory resources.  Through the use of "import", it may
          also require arbitrary URI dereferencing, which may consume
          all available network resources on the consuming system or
          other systems.  RIF consuming systems SHOULD implement
          reasonable defenses against these attacks.

       Exploiting Implementation Flaws

          RIF is a relatively complex format, and rule  Language <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs=" http://www.w3.org/2001/XMLSchema " xmlns=" http://www.w3.org/2007/rif# " targetNamespace=" http://www.w3.org/2007/rif# " elementFormDefault="qualified" version="Id: BLDRule.xsd,v 0.8 2008-04-09 dhirtle/hboley"> <xs:annotation> <xs:documentation>engines can be
          extremely sophisticated, so it is likely that some RIF
          consuming systems will have bugs which allow specially
          constructed RIF documents to perform inappropriate
          operations. We urge RIF implementors to make systems which
          carefully anticipate and handle all possible inputs,
          including those which present syntactic or semantic errors.

       External (Application) Functions

          Because RIF may be extended with local, application defined
          datatypes and functions, arbitrary vulnerabilities may be
          introduced.  Before being installed on systems which consume
          untrusted RIF documents, these external functions should be
          closely reviewed for their own vulnerabilities and for the
          vulnerabilities that may occur when they are used in
          unexpected combinations, like "cross-site scripting"
          attacks.
       
       In addition, as this media type uses the "+xml" convention, it
       shares the same security considerations as other XML formats;
       see RFC 3023 (XML Media Types).


   Interoperability considerations: 

       This media type is intended to be shared with other RIF
       dialects, to be specified in the future.  Interoperation
       between the dialects is governed by the RIF specifications.

   Published specification: 

       RIF Basic Logic Dialect
       W3C Working Draft (Recommendation Track)
       http://www.w3.org/TR/rif-bld/

       This media type is intended to be shared with other RIF
       dialects, to be specified in the future.

   Applications that use this media type: 

       Unknown at the time of this draft.  Multiple applications are
       expected, however, before the specification reaches W3C
       Proposed Recommendation status.

   Additional information:

     Magic number(s): 

           As with XML in general (See RFC 3023 (XML Media Types)),
           there is no magic number for this format.

           However, the XML namespace "http://www.w3.org/ns/rif" will
           normally be present in the document.  It may theoretically
           be missing if the document uses XML  schema forentities in an
           obfuscatory manner.

           The  Rule Language as defined by Working Draft 2hex form of that namespace will depend on the  RIF Basic Logic Dialect.charset.
           For utf-8, the  schema is basedhex is: 68 74 74 70 3a 2f 2f 77 77 77 2e 77
           33 2e 6f 72.
           
     File extension(s): 

           .rif (or .xml)

     Macintosh file type code(s): 

           "TEXT" (like other XML)

   Person & email address to contact for further information:

       Sandro Hawke, sandro@w3.org.  Please send technical comments
       and questions about RIF to public-rif-comments@w3.org, a
       mailing list a public archive at
       http://lists.w3.org/Archives/Public/public-rif-comments/ 

   Intended usage: 

       COMMON

   Restrictions on usage: 

       None

   Author:

       The  following EBNFeditor and contact for this media type registration is
       Sandro Hawke, sandro@w3.org.

   Change controller: 

       RIF is a product of the  RIF-BLDRule  Language: Document ::= GroupInterchange Format (RIF) Working
       Group  ::= 'Group' IRIMETA? '(' (RULE | Group)* ')' IRIMETA ::= Frame RULE ::= 'Forall' Var+ '(' CLAUSE ')' | CLAUSE CLAUSE ::= Implies | ATOMIC Implies ::= ATOMIC ':-' FORMULA Note that this is an extensionof the  syntaxWorld Wide Web Consortium (W3C).  See
       http://www.w3.org/2005/rules/wg for information on the  RIF-BLD Condition Language (BLDCond.xsd). </xs:documentation> </xs:annotation> <xs:include schemaLocation="BLDCond.xsd"/> <xs:element name="Document"> <xs:complexType> <xs:sequence> <xs:element ref="Group"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Group"> <xs:complexType> <xs:sequence> <xs:element ref="meta" minOccurs="0" maxOccurs="1"/> <xs:element ref="sentence" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="meta"> <xs:complexType> <xs:sequence> <xs:group ref="IRIMETA"/> </xs:sequence> </xs:complexType> </xs:element> <xs:group name="IRIMETA"> <xs:sequence> <xs:element ref="Frame"/> </xs:sequence> </xs:group> <xs:element name="sentence"> <xs:complexType> <xs:choice> <xs:element ref="Group"/> <xs:group ref="RULE"/> </xs:choice> </xs:complexType> </xs:element> <xs:group name="RULE"> <xs:choice> <xs:element ref="Forall"/> <xs:group ref="CLAUSE"/> </xs:choice> </xs:group> <xs:element name="Forall"> <xs:complexType> <xs:sequence> <xs:element ref="declare" minOccurs="1" maxOccurs="unbounded"/> <xs:element name="formula"> <xs:complexType> <xs:group ref="CLAUSE"/> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:group name="CLAUSE"> <xs:choice> <xs:element ref="Implies"/> <xs:group ref="ATOMIC"/> </xs:choice> </xs:group> <xs:element name="Implies"> <xs:complexType> <xs:sequence> <xs:element ref="if"/> <xs:element ref="then"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="if"> <xs:complexType> <xs:sequence> <xs:group ref="FORMULA"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="then"> <xs:complexType> <xs:sequence> <xs:group ref="ATOMIC"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>group.
       The W3C (currently acting through this working group) has
       change control over the RIF specification.



   (Any other information that the author deems interesting may be added
   below this line.)