XML Common Logic (XCL) 1.0a concrete syntax for Common Logic in XML
|
|||||||||||||
Copyright ©2003 Murray Altheim. All Rights Reserved. |
XCL 1.0 is an XML markup language designed as a concrete (serialization) syntax for Common Logic [CL]. This specification describes two markup languages: the first, a simple expression of CL-in-XML; the second, a superset of the first, includes linking and other features designed to enable interchange and interoperation of CL expressions across the World Wide Web.
This is an early draft document is intended for review and comment by interested parties. It is a “work in progress,” currently has no formal status, and its publication should not be construed as being a work of, nor endorsed by, any corporate, academic or other organization. This document may be updated, replaced, rendered obsolete by other documents, or removed from circulation at any time. It is inappropriate to use this document as reference material, or cite it as anything other than a “work in progress.” Distribution of this document is unlimited.
XCL is an XML markup language designed as a concrete (serialization) syntax for Common Logic [CL]. XCL is designed as two related syntaxes, the first a proper subset of the second:
For purposes of interchange, this document also establishes a set of PSIs for its concepts. PSIs are described further in Published Subjects, and were introduced in Section 2.3 of [XTM].
The XCL syntax is further described in XCL Level 1 Syntax and XCL Level 2 Syntax.
Ed.Note: Editorial notes appearing within the text (such as this one) are considered temporary and will be removed from the final text. Notes marked simply as "Note:" are considered part of the final text.
Ed.Note: If the font size of the markup examples is too small, this can be changed in the stylesheet. Having a smaller size eliminated the need to adjust the margin, and will likely help printing, but it may be hard on some people's eyes.
The following terms are used in this specification. These terms extend the definitions in [RFC2119] in ways based upon similar definitions in ISO/IEC 9945-1:1990 [POSIX.1]. When these terms appear in the text in bold face, they are to be interpreted as follows:
Following is a list of design goals, derived in part from both the Design Principles of XML and the Design Goals of KIF. The order of this list is not presented according to any priority, and intermixes various design aspects. (Clicking on a list number provides a link to that list item.)
XCL documents shall be processable using commonly-available XML parsers. This means compliance with the normative requirements of XML 1.0 (Second Edition), such as Unicode, use of IETF and ISO standards for the identification of languages and countries, etc.
Consideration for the changes included with XML 1.1 shall be part of the design, as 1.1 reaches Recommendation status.
Where existing features in the family of XML specifications exist, these features shall be not be reinvented for XCL. For example, expression of the base URI of an XCL document shall use XML Base rather than inventing a new syntax.
No design elements shall be adopted which would impair the usability or extensibility of XCL documents in other contexts or applications.
In particular, it shall be straightforwardly possible to construct useful XCL applications which do not require processing of an XCL schema/DTD.
As a result of this, any XCL document has a high probability of being handled successfully by any XCL processor.
Whereas RDF encourages and often requires document authors to design new RDF markup, and HTML prohibits this (i.e., all HTML authors use the elements and attributes provided them in the "HTML tool kit"), there shall be a clear delineation between markup and document content in XCL, as in HTML. XCL document authors will use only XCL 1.0 markup, e.g., development of predicates will occur via PSIs rather than new XML elements or attributes.
Note: this is contrasted to extensions to XCL, which may require creation of XML markup (in an XML Namespace different than XCL 1.0). But when it is possible for such extensions to use the existing XCL syntax, designers are encouraged to avoid creation of new markup as much as possible.
As a result of this, the core syntax of an extended XCL document still has a high probability of being handled successfully by any XCL processor.
This is to be accomplished partly by providing a core XCL syntax that does not use arcane or unnecessary XML features such as XML Namespace prefixes. Three DTDs will be provided: an unprefixed DTD, a prefix-enabled DTD (whose default is no prefix but is modifiable by instances' internal subsets), and a default prefixed ("xcl:") DTD. Note: all three DTDs express the same syntax; differences are only in XML Namespace prefix.
A first draft of the XCL design should be ready for distribution and comment by end of summer 2003; a version should be ready for production use by the end of winter 2003.
While this is a difficult goal to provide a metric for, this is to be met by keeping the core syntax as simple as possible.
XCL should be simple and easy for implementors to grasp; its reference documentation should not exceed 20 pages, which should contain mostly formal grammar and very little normative text, if any. Note: normative text is not the same as descriptive or explanatory text.
It should be a straightforward task (though possibly labor-intensive) to create valid XCL documents by hand (i.e. without a validating authoring tool).
It should be a straightforward task (though possibly labor-intensive) to create a validating XCL authoring system.
Minimizing keystrokes is not deemed important in achieving any of the above goals, but other things being equal a concise notation should be preferred to a verbose.
Note: XCL Level 2 goals include by extension all XCL Level 1 goals.
It shall be possible to author XCL documents whose expressions span multiple files, for purposes of modularization and reuse.
Rather than creating a proprietary linking syntax, the linking syntax for XCL shall be XLink 1.0, the linking language for XML.
XCL expressions shall be capable of being distributed across the Internet, for purposes of sharing and interchange (the latter requires that two expressions have a means of declaring concept identities).
When XCL documents are shared, or when concepts within a published XCL document are used by other XCL documents, the ability to establish subject identity is necessary. This is a concept derived from Topic Maps (ISO 13250:2000) essential for information interchange. E.g., absent subject identity, it is impossible to determine whether the logical terms in two different XCL documents refer to the same subject.
All components of the XCL syntax shall enable sharing and identity matching of concepts using Published Subject Indicators (PSIs). [PSIs are simply URIs used as canonical identifiers for a subject, similar to RDF's use of "namespaces" based on URIs.]
The documentation features for XCL shall use a different XML Namespace, with XCL 1.0 supporting simple text data, and subsequent (extension) versions to use a subset of XHTML.
All extensions to XCL shall occur as either PSIs within the existing XCL 1.0 syntax, or as extensions within a different XML Namespace. The latter is discouraged as this limits interchange.
XCL Level 1 syntax is quite simple, consisting of a document element, a formula element, four core expression elements, a quantifier type element, and finally, a documentation element. The XCL Level 2 syntax is based upon Level 1, primarily adding linking features.
Legend: xcl | formula | quant | type | conn | pred | term | doc
An XCL document may use an <xcl> element as the document element (or wrapper). This specification does not require XCL documents to use the <xcl> as a document element, but XML documents must have a single document element, hence it may be used when needed, as a semantic-free wrapper.
element type | description |
---|---|
<xcl> |
document element |
Table 3.1. XCL Document Element
<?xml version="1.0"?> <xcl xmlns="http://purl.org/xcl/1.0/"> </xcl>
The XML namespace identifier [XMLNS] for XML Common Logic 1.0 is the following PURL (Permanent URL):
http://purl.org/xcl/1.0/
For more information on PURLs, see purl.org.
XCL Level 1 and Level 2 documents must be well-formed in conformance with [XML 1.0], and must conform to the constraints of [XMLNS]. XCL documents must declare the XCL namespace on the document element (as shown in the example in Section 3.1).
XCL documents should include a DOCTYPE declaration and validate according to an XCL 1.0 DTD, though this is not explicitly required by this specification. An example is shown below:
<?xml version="1.0"?> <!DOCTYPE xcl PUBLIC "-//purl.org/xcl//DTD XML Common Logic (XCL) 1.0//EN" "http://purl.org/xcl/1.0/xcl1.dtd"> <xcl xmlns="http://purl.org/xcl/1.0/"> </xcl>
Ed.Note: Should validation according to an approved schema be a requirement? Why? Why not?
An XCL document contains zero or more <formula> elements. As such, it can be considered a set of formulas, though no explicit semantics are implied by such a set, nor is the sequence of formulas within a document considered significant.
element type | description |
---|---|
<formula> |
formula |
Table 3.2. XCL Formula Element
<?xml version="1.0"?> <xcl xmlns="http://purl.org/xcl/1.0/"> <formula> </formula> </xcl>
Within a <formula> element, there are zero or more of the four core elements (<quant>, <conn>, <pred>, <term>), in any order. As is typical in logical notations, order within a formula is considered significant. The <type> element is only declared as content on the <quant> element type, and may be used to declare the variable's type.
element type | description |
---|---|
<quant> |
quantifier |
<type> |
quantifier type |
<conn> |
connective |
<pred> |
predicate |
<term> |
term |
Table 3.3. XCL Core Elements
Note: the quantifier type is expressed as as element content rather than as an attribute so that in XCL Level 2 it may contain character data or a link to an externally-defined type. This is expected to be used to refer to concepts in existing online vocabularies, taxonomies, ontologies, or other Published Subjects.
A simple example of each of the core elements is shown below. The examples in this section are derived from those found in Section 1.3 of [KR, p.21].
(∀x:TrailerTruck) ⊃ eighteenWheeler(x)
This may be read as "For every trailer truck x, x is an eighteen wheeler." Shown as XCL markup, it appears as:
<?xml version="1.0"?> <xcl xmlns="http://purl.org/xcl/1.0/"> <formula> <conn name="implies"> <quant name="forall" variable="x"> <type>TrailerTruck</type> </quant> <pred name="eighteenWheeler"> <term name="x"/> </pred> </conn> </formula> </xcl>
A more complex example is found further in [KR, p.21] showing an expression in typed predicate calculus as follows:
(∀x:TrailerTruck)(∃s:Set)(s@18 ∧ (∀w∈s)(wheel(w) ∧ part(x,w))).
The expression of this in KIF notation is as follows:
(forall (?x trailer_truck) (exists (?s set) (and (count ?s 18) (forall (?w in ?s) (and (wheel ?w) (part ?x ?w))) )))
This may be read in English as "For all x of type trailer truck, there exists a set s, where the count of s is 18, and for all w in s, w is a wheel and x has w as part." and is shown below as XCL markup (the document wrapper is shown in grey). Note that case is not significant in KIF, whereas in XCL (as in XML) it is.
<?xml version="1.0"?> <xcl xmlns="http://purl.org/xcl/1.0/"> <formula> <quant name="forall" variable="x"> <type>TrailerTruck</type> <quant name="exists" variable="s"> <type>Set</type> <conn name="and"> <pred name="count"> <term name="s"/> <term name="18"/> </pred> <quant name="forall" variable="w"> <pred name="in"> [see note] <term name="s"/> </pred> <conn name="and"> <pred name="wheel"> <term name="w"/> </pred> <pred name="part"> <term name="x"/> <term name="w"/> </pred> </conn> </quant> </conn> </quant> </quant> </formula> </xcl>
Ed.Note: Note above that I'm not sure what to do with "(forall (?w in ?s) ...)", and solved it with a 'in' predicate. Is there another, more correct or more elegant way?
Reference elements are a linking feature of XCL Level 2 and are not defined in Level 1. This section is included for consistency between the Level 1 and 2 numbered sections.
Most XCL elements may include human-readable documentation in the form of ASCII text characters within a <doc> element. This documentation may occur as labels, notes or descriptions; the interpretation of <doc> element content is unspecified.
element type | description |
---|---|
<doc> |
documentation |
Table 3.5. XCL Documentation Element
Another example from Section 1.3 of [KR, p.21-22], this time with surrounding documentation:
<?xml version="1.0"?> <xcl xmlns="http://purl.org/xcl/1.0/"> <doc> A frequently used type or predicate such as trailerTruck may be defined by an equation like the following: </doc> <formula> <pred name="equals"> <pred name="TrailerTruck"> <term name="x"/> </pred> <conn name="and"> <pred name="truck"> <term name="x"/> </pred> <quant name="exists" variable="y"> <type>Trailer</type> <pred name="part"> <term name="x"/> <term name="y"/> </pred> </quant> </conn> </pred> </formula> <doc> In English, "A trailer truck x is a truck for which there exists a trailer y and x has as part y." </doc> </xcl>
This example may be read alternately as "The dog is on the mat" (in English), or as "Le chien est sur le paillasson" (in French). Also note the use of <formula> as the document element:
<?xml version="1.0"?> <formula xmlns="http://purl.org/xcl/1.0/"> <pred name="on"> <doc xml:lang="en">is on</doc> <doc xml:lang="fr">est sur</doc> <term name="Dog"> <doc xml:lang="en">the dog</doc> <doc xml:lang="fr">le chien</doc> </term> <term name="Mat"> <doc xml:lang="en">the mat</doc> <doc xml:lang="fr">le paillasson</doc> </term> </pred> </formula>
Some XCL elements require a name attribute, whose value acts as the mnemonic for that element. For example, a predicate element whose name attribute value is "P", containing a term element whose name attribute value is "x" would be the equivalent of the CL formula P(x). Within an XCL document, names do not have to be unique. However, within a specific formula all instances of a specific name are considered as references to the same component. This may be considered the "formula namespace".
Any XCL element may include an id attribute*, in order that it may act as the target of a linking element. While XCL Level 1 documents do not have linking features, they may include link targets for XCL 1.0 Level 2 or other documents. Within an XCL document, there is what is considered an "ID namespace" (this is the same as the XML ID namespace of the document). All IDs within a single XCL document must be unique.
attribute | description | <conn> |
<quant> |
<pred> |
<term> |
---|---|---|---|---|---|
id |
canonical identifier | optional | optional | optional | optional |
name |
mnemonic | required | required | required | required |
variable |
variable identifier | n/a | required | n/a | n/a |
Table 3.6. XCL Attributes
* Note: Absent the availability and processing of an XCL schema (e.g., the XCL 1.0 DTD), XML processors are unaware of which attributes are declared as type "ID", hence the ID namespace of a document appears empty. In this case, linking via ID does not function and ID uniqueness within a document cannot be validated. This is a problem for XML in general, not just XCL. A rather inelegant solution (as usually taken in HTML applications) is to hardwire awareness of the id attribute as of type ID.
Rather than hardcode a fixed set of predicates or quantifiers as XML element types or attributes (e.g., a <exists> element, etc.), all document-specific semantics in XCL are document content (i.e., element or attribute content). The core XCL language uses a fixed set of tokens to establish the meaning of its quantifiers, connectives, and predicates. These tokens are considered reserved names, and are shorthands for a set of PSIs which canonically identify their subjects. For more information on these PSIs, see XCL Level 2 Reserved Names.
Note that using a reserved name token as the name of a different XCL element than that specified as "defined on" in the below table is considered an error, and such use is unspecified (i.e., it has no defined meaning within this specification).
token | description | defined on |
---|---|---|
"exists" | existential quantifier (∃) | <quant> |
"forall" | universal quantifier (∀) | <quant> |
"and" | conjunction (∧) | <conn> |
"or" | disjunction (∨) | <conn> |
"xor" | exclusive or () | <conn> |
"implies" | implication (⊃) | <conn> |
"not" | negation (—) | <conn> |
"equiv" | equivalence or iff (≡) | <conn> |
"equal" | equality (=) | <pred> |
Table 3.7. XCL Level 1 Reserved Names
The statement "there exists an x of type TrailerTruck" is shown below in typed predicate logic notation:
(∃x:TrailerTruck)
which would be rendered in XCL as:
<quant name="exists" variable="x"/> <type>TrailerTruck</type> </quant>
XCL Level 2 syntax adds linking features to the Level 1 syntax to create intra- and inter-document links, enabling the establishment and use of Published Subjects, and other features.
Legend: xcl | formula | quant | quantRef | type | conn | connRef | pred | predRef | term | termRef | doc | docRef
Any XCL 1.0 element may be used as the document (or "root") element of an XCL document. All XML documents must have a single root element, so in cases where a semantic-free wrapper is needed (or, in the general case), the <xcl> element may be used.
XCL 1.0 Level 1 and Level 2 documents may be distinguished from each other by the presence of the required XML Namespace declaration for XLink 1.0 (i.e., the xmlns:xlink attribute) on the document element of Level 2 documents. See the example later in this section. XCL 1.0 Level 1 processors must either fail or alert the user (or both) upon encountering an XCL 1.0 Level 2 document.
element type | description | PSI |
---|---|---|
<xcl> |
document element | http://purl.org/xcl/1.0/#xcl |
Table 4.1. XCL Document Element
This shows an unprefixed XCL 1.0 Level 2 document:
<?xml version="1.0"?> <xcl xmlns="http://purl.org/xcl/1.0/" xmlns:xlink="http://www.w3.org/1999/xlink"> <formula> </formula> </xcl>
For examples of namespace-prefixed XCL documents, see Appendix D.
An XCL document contains zero or more <formula> elements. As such, it can be considered a set of formulas, though no explicit semantics are implied by such a set, nor is the sequence of formulas within a document considered significant.
element type | description | PSI |
---|---|---|
<formula> |
formula | http://purl.org/xcl/1.0/#formula |
Table 4.2. XCL Formula Element
Within a <formula> element, there are zero or more of the four core elements, in any order (order here within the formula is considered significant):
element type | description | PSI |
---|---|---|
<conn> |
connective | http://purl.org/xcl/1.0/#conn |
<quant> |
quantifier | http://purl.org/xcl/1.0/#quant |
<type> |
quantifier type | http://purl.org/xcl/1.0/#type |
<pred> |
predicate | http://purl.org/xcl/1.0/#pred |
<term> |
term | http://purl.org/xcl/1.0/#term |
Table 4.3. XCL Core Elements
See Example 1 and Example 2 in Section 3.3.
For each of the four core elements, there is a reference (linking) element that may be used within an XCL Level 2 document wherever its referenced type is allowed. The target of the link must be an element of its reference type (e.g., a <predRef> must link to a <pred> element within the same XCL document or in an external XCL document).
element type | description | PSI |
---|---|---|
<connRef> |
link to <conn> (connective) |
http://purl.org/xcl/1.0/#conn |
<quantRef> |
link to <quant> (quantifier) |
http://purl.org/xcl/1.0/#quant |
<predRef> |
link to <pred> (predicate) |
http://purl.org/xcl/1.0/#pred |
<termRef> |
link to <term> (term) |
http://purl.org/xcl/1.0/#term |
Table 4.4. XCL Reference Elements
Note: the PSI of each reference element is the same as its like-named core element, given that the interpretation of each in context is identical.
A previous example could also be expressed using reference elements. This shows: 1. the predicate "Truck" includes a documentation reference into the Cyc ontology (in HTML); 2. two of the predicates in the formula reference the "TrailerTruck" and "Truck" predicates via <predRef> elements; and 3. the quantifier type references the "Trailer" term via a <termRef>.
Note that the order of occurrence within the <xcl> element is not significant (i.e., the term and two predicate elements could have occurred after the formula element). Also note that references link via ID values, not the value of name attributes (the latter are not guaranteed to be unique).
<xcl xmlns="http://purl.org/xcl/1.0/" xmlns:xlink="http://www.w3.org/1999/xlink"> <pred id="tr_truck" name="TrailerTruck"> <term name="x"/> </pred> <pred id="truck" name="Truck"> <term name="x"/> <docRef xlink:href= "http://www.cyc.com/cycdoc/vocab/transportation-vocab.html#$Truck"/> </pred> <term id="trailer" name="Trailer" /> <formula> <pred name="equals"> <predRef xlink:href="#tr_truck"/> <conn name="and"> <predRef xlink:href="#truck"/> <quant name="exists" variable="y"> <type> <termRef xlink:href="#trailer"/> </type> <pred name="part"> <term name="x"/> <term name="y"/> </pred> </quant> </conn> </pred> </formula> </xcl>
Ed.Note: ...not entirely sure of the Trailer termRef; should it be a pred/predRef instead?
Each of the above XCL elements may include human-readable documentation in the form of ASCII text characters within a <doc> element. The documentation may take the form of labels, notes or descriptions; the interpretation of <doc> element content is unconstrained by this specification.
The <docRef> element is a reference to external documentation, and is allowed anywhere a <doc> element is allowed. The target of a <docRef> element may be either a <doc> element in the same or another XCL document, or to HTML or XHTML content, preferably the latter in applications when such content is expected to be machine-processed.
As noted in Possible Extensions, future development in XCL may include direct inclusion of XHTML markup wherever <doc> or <docRef> elements occur.
element type | description | PSI |
---|---|---|
<doc> |
documentation | http://purl.org/xcl/1.0/#doc |
<docRef> |
link to <doc> (documentation) |
http://purl.org/xcl/1.0/#doc |
Table 4.5. XCL Documentation Elements
In the below example, the example from Level 1 has been expanded to include links to subject documentation (as in the case of #$Dog and #$on-Physical from Cyc), and natural language-based (English and French) external documentation.
<xcl xmlns="http://purl.org/xcl/1.0/" xmlns:xlink="http://www.w3.org/1999/xlink"> <term id="dog" name="Dog"> <doc xml:lang="en">the dog</doc> <doc xml:lang="fr">le chien</doc> <docRef xlink:href="http://www.cyc.com/cycdoc/vocab/biology-vocab.html#Dog"> </term> <term id="mat" name="Mat"> <docRef xml:lang="en" xlink:href="http://www.mats.org/en/description.html" /> <docRef xml:lang="fr" xlink:href="http://www.mats.org/fr/description.html" /> </term> <formula> <pred name="On"> <doc xml:lang="en">on</doc> <doc xml:lang="fr">sur</doc> <docRef xlink:href="http://www.cyc.com/cycdoc/vocab/spatial-vocab.html#on-Physical"> <termRef xlink:href="#dog" /> <termRef xlink:href="#mat" /> </pred> </formula> </xcl>
Note: the terms above should be interpreted as "Mat" and "Dog" (note capitalization), not "mat" and "dog", as the latter are simply XML IDs and have no impact on the interpretation of the formula.
Ed.Note: What is the relationship between the value of the 'name' attribute and any <doc> elements used as labels? Should names be considered as first class characteristics of XCL language components or as mere referents? If teh latter, then IDs should be removed and names used exclusively, and a new <name> element similar to XTM's <baseName> considered. This would allow general scoping such as is alluded to above in the use of the xml:lang attribute.
Attributes in XCL 1.0 Level 2 differ from Level 1 in including new attributes on the document element (see Section 4.1), and in the XLink xlink:href attribute on reference elements. The xlink:href attribute contains a value of type "URI reference". to link to a resource either within the current document, or in an external document.
attribute | description | <conn> |
<connRef> |
<quant> |
<quantRef> |
<pred> |
<prefRef> |
<term> |
<termRef> |
---|---|---|---|---|---|---|---|---|---|
id |
canonical identifier | optional | optional | optional | optional | optional | optional | optional | optional |
name |
mnemonic | required | optional ¹ | required | optional ¹ | required | optional ¹ | required | optional ¹ |
xlink:href |
link | n/a | required ² | n/a | required ² | n/a | required ² | n/a | required ² |
variable |
variable identifier | n/a | n/a | required ¹ | optional ¹ ² | n/a | n/a | n/a | n/a |
type |
canonical identifier | n/a | n/a | optional ¹ | optional ¹ ² | n/a | n/a | n/a | n/a |
Table 4.6. XCL Attributes
¹ A reference element (e.g., <termRef>) and its target (e.g., <term>) may both include a the same attribute. If the value of one is in conflict with the value of the other, this is considered a validation error. But because it is not expected that all XCL processors will necessarily flag such errors, the value used in such circumstances shall be contents of the attribute of the reference element (since it is immediately available without traversing the link).
² Each reference element is a link to (and may occur in the same places in an XCL document as) its like-named core element, <connRef> to <conn>, <quantRef> to <quant>, <predRef> to <pred>, <termRef> to <term>. The presence of a reference element is semantically identical to its target.
Ed.Note: It is certainly possible to create XCL documents whose references are entirely within the local document using the XLink syntax, but it is impossible to limit such links; URIs can link anywhere. A simplification that would prohibit external links would be to replace all xlink:href attributes with an attribute of type IDREF. IDREF-to-ID links are always within the local document. This would restrict all link tokens to XML Names (so that tokens beginning with numeric characters would be invalid), and would also create a language that did not satisfy a a number of goals, including the ability to establish subject identity, share XCL concepts across the Internet, as well as others (though, admittedly, IDREFs are part of XML and not "proprietary").
XCL 1.0 Level 2 does not define any further reserved names than those described in Level 1. For simplicity' sake the reserved names were described in Level 1 as simply a set of name tokens, whereas in Level 2 each is explicitly associated with a Published Subject Indicator (a URI used as an identifier). The two sets are semantically identical; as mentioned previously, the set of reserved names are "shorthands" for a set of PSIs which canonically identify their subjects, as shown in the following table.
Note that using a reserved name token as the name of a different XCL element than that specified as "defined on" in the below table is considered an error, and such use is unspecified (i.e., it has no defined meaning within this specification).
token | description | defined on | PSI |
---|---|---|---|
"exists" | existential quantifier (∃) | <quant> | http://purl.org/xcl/1.0/#exists |
"forall" | universal quantifier (∀) | <quant> | http://purl.org/xcl/1.0/#forall |
"and" | conjunction (∧) | <conn> | http://purl.org/xcl/1.0/#and |
"or" | disjunction (∨) | <conn> | http://purl.org/xcl/1.0/#or |
"xor" | exclusive or () | <conn> | http://purl.org/xcl/1.0/#xor |
"implies" | implication (⊃) | <conn> | http://purl.org/xcl/1.0/#implies |
"not" | negation (—) | <conn> | http://purl.org/xcl/1.0/#not |
"equiv" | equivalence or iff (≡) | <conn> | http://purl.org/xcl/1.0/#equiv |
"equal" | equality (=) | <pred> | http://purl.org/xcl/1.0/#equal |
Table 4.7. XCL Level 2 Reserved Names
Ed.Note: Once the set of PSIs are available from the CL abstract syntax, these may be related directly to (i.e., establishing identity with) the above set of PSIs.
Note that each PSI (i.e., as a URI reference) resolves to its documentation within this specification. For the core set of tokens shown above, the token and its respective PSI should be understood as equivalent by XCL processors.
XCL 1.0 does not provide a feature enabling the definition of further tokens, but PSIs for any set of concepts can be created and reused.
The two quantifiers below are considered to have identical semantics:
<quant name="exists" variable="x"> ... </quant> <quant name="http://purl.org/xcl/1.0/quant.xcl#exists" variable="x"> ... </quant>
The following shows definition and use of a user-defined predicate to express On(Bunzilla,Mat). The first document establishes a canonical identifier for Bunzilla (a rather healthy houserabbit):
<xcl xmlns="http://purl.org/xcl/1.0/" xmlns:xlink="http://www.w3.org/1999/xlink" xml:base="http://www.altheim.com/bunny/bun.xcl" > ... <term id="bid0537" name="Bunzilla" /> ... </xcl>
Followed by the actual XCL statement:
<xcl xmlns="http://purl.org/xcl/1.0/" xmlns:xlink="http://www.w3.org/1999/xlink"> <pred name="On" /> <termRef name="Bunzilla" xlink:href="http://purl.org/ceryle/bunny/bun.xcl#bid0537"/> <term name="Mat"/> </pred> </xcl>
To satisfy goal 2.4, the ability to create a reference to a canonical identifier as a published subject identifier (i.e., a URI used as a stable subject identifier) is necessary. For example, if someone wishes to reuse an OpenCyc constant or predicate, a reference within an XCL document can establish subject identity with the existing OpenCyc constant or predicate by referencing its HTML description (which is considered stable). See the example under section 4.5.
Ed.Note: This feature is not yet supported. Should it merely be a linking attribute, or a new subelement? Must be able to differentiate subject indicators vs. subject constituters (i.e., a resource indicating a subject vs. a resource as a subject).
TBD
Nothing exists in a vacuum, and this specification did not arise out of thin air. The author wishes to acknowledge the existing CL and SCL documents posted publicly (as found in the References section below), as well as public and private discussions over the past few years with various individuals, including Jon Awbrey, Patrick Hayes, Chris Menzel, John Sowa, and Tanel Tammet. The basic XML syntax of this specification is derived from XML concrete syntax early internal draft [SCL-TT] by Tanel Tammet.
Following is the Published Subject Indicator (PSI) metadata for the XCL 1.0 Specification:
Property | Value |
---|---|
Description | A set of published subjects for XML Common Logic (XCL). |
Publisher | http://www.altheim.com/murray/ |
Creator | http://www.altheim.com/murray/ |
Language | http://www.topicmaps.org/xtm/1.0/language.xtm#en |
Version | $Id: index.html,v 1.8 2003/05/14 02:29:25 altheim Exp $ |
Status | Draft |
Date Published | 2003/05/07 |
Table A.1. PSI Metadata
This is the complete list of Published Subjects established by the XCL 1.0 specification. Not noted previously is that the PURL (permanent URL) for this specification is both the XML Namespace URI for and may be used as the PSI to refer to the XCL 1.0 Specification.
Subject | PSI |
---|---|
XCL 1.0 Specification | http://purl.org/xcl/1.0/ |
xcl | http://purl.org/xcl/1.0/#xcl |
formula | http://purl.org/xcl/1.0/#formula |
conn | http://purl.org/xcl/1.0/#conn |
quant | http://purl.org/xcl/1.0/#quant |
type | http://purl.org/xcl/1.0/#type |
pred | http://purl.org/xcl/1.0/#pred |
term | http://purl.org/xcl/1.0/#term |
doc | http://purl.org/xcl/1.0/#doc |
exists | http://purl.org/xcl/1.0/#exists |
forall | http://purl.org/xcl/1.0/#forall |
and | http://purl.org/xcl/1.0/#and |
or | http://purl.org/xcl/1.0/#or |
xor | http://purl.org/xcl/1.0/#xor |
implies | http://purl.org/xcl/1.0/#implies |
not | http://purl.org/xcl/1.0/#not |
equiv | http://purl.org/xcl/1.0/#equiv |
equal | http://purl.org/xcl/1.0/#equal |
Table A.2. Index of XCL 1.0 PSIs
Note that each subject in the first column above is a link to its documentation herein.
The XCL 1.0 Level 1 DTD is shown below, but is also available as a separate file, xcl1.dtd. A package of files, including the DTD, XML catalog file, SGML declarations for XML (one compatible with James Clark's nsgmls), and a short sample XCL test file, is available as a zip file xcl-files.zip (42K). I've also included some auto-generating web page documentation showing the document models declared by the XCL DTD Level 1 and 2, for those who find DTD syntax arcane, ugly, and/or a crime against nature. These are in the "docl1" and "docl2" directories.
The XCL 1.0 Level 2 DTD is available in two versions, the default (unprefixed) version xcl1-2.dtd and a prefixed version xcl1-2p.dtd (using an "xcl" prefix).
Ed.Note: The Level 2 DTDs are not currently available, as there is considerable work in implementing the XML namespace feature -- this will be done once the Level 1 DTD is relatively stable.
<!-- ....................................................................... --> <!-- XML Common Logic 1.0 Level 1 DTD ..................................... --> <!-- file: xcl1.dtd --> <!-- XML Common Logic 1.0 Level 1 DTD This is XCL, a formulation of Common Logic as an XML application. Copyright 2003 Murray Altheim, All Rights Reserved. Permission to use, copy, modify and distribute the XCL DTD and its accompanying documentation for any purpose and without fee is hereby granted in perpetuity, provided that the above copyright notice and this paragraph appear in all copies. The copyright holders make no representation about the suitability of the DTD for any purpose. It is provided "as is" without expressed or implied warranty. Authors: Murray M. Altheim <m.altheim@open.ac.uk> Status: Preliminary Revision: $Id: xcl1.dtd,v 1.4 2003/05/14 02:26:26 altheim Exp $ This is the driver file for version 1.0 of the XCL DTD. Please use the formal public identifier to identify it: "-//purl.org/xcl//DTD XML Common Logic (XCL) 1.0//EN" --> <!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: --> <!-- extension feature .................. --> <!ENTITY % xcl-redecl.module "IGNORE" > <![%xcl-redecl.module;[ %xcl-redecl.mod; <!-- end of xcl-redecl.module -->]]> <!-- a Uniform Resource Identifier, see [URI] --> <!ENTITY % URI.datatype "CDATA" > <!-- declare "IGNORE" for Level 1, "INCLUDE" for Level 2 features --> <!ENTITY % XCL.level2 "IGNORE" > <!-- XML namespace support ....................................... --> <!-- XML namespace for XCL 1.0 --> <!ENTITY % XCL.xmlns "http://purl.org/xcl/1.0/" > <!ENTITY % XCL.xmlns.attrib "xmlns %URI.datatype; #FIXED '%XCL.xmlns;'" > <!-- XLink support --> <![%XCL.level2;[ <!ENTITY % XLINK.xmlns.attrib "xmlns:xlink %URI.datatype; #FIXED 'http://www.w3.org/1999/xlink'" > ]]> <!ENTITY % XLINK.xmlns.attrib "" > <!-- begin content declarations .................................. --> <![%XCL.level2;[ <!ENTITY % Quantifier.class "quant | quantRef" > <!ENTITY % Connective.class "| conn | connRef" > <!ENTITY % Predicate.class "| pred | predRef" > <!ENTITY % Term.class "| term | termRef" > <!ENTITY % Documentation.class "| doc | docRef" > ]]> <!ENTITY % Quantifier.class "quant " > <!ENTITY % Connective.class "| conn " > <!ENTITY % Predicate.class "| pred " > <!ENTITY % Term.class "| term " > <!ENTITY % Documentation.class "| doc " > <!ENTITY % Formula.content "( %Quantifier.class; %Connective.class; %Predicate.class; %Term.class; %Documentation.class; )*" > <!-- reserved names .............................................. --> <!-- These are name tokens used as attribute values on quantifiers, connectives, and predicates. The parameter entities *.extra; can be declared to include more values (e.g., "| foo | bar"), When %XCL.strict; is declared to "IGNORE", the attribute values are all declared as "NMTOKEN", allowing any value. --> <!ENTITY % XCL.strict "IGNORE" > <![%XCL.strict;[ <!ENTITY % Quantifier.extra "" > <!ENTITY % Quantifier.reserved "( exists | forall %Quantifier.extra; )" > <!ENTITY % Connective.extra "" > <!ENTITY % Connective.reserved "( and | or | xor | implies | not | equiv %Connective.extra; )" > <!ENTITY % Predicate.extra "" > <!ENTITY % Predicate.reserved "( equal %Predicate.extra; )" > ]]> <!ENTITY % Quantifier.reserved "NMTOKEN" > <!ENTITY % Connective.reserved "NMTOKEN" > <!ENTITY % Predicate.reserved "NMTOKEN" > <!-- theory: XML Common Logic document element ................... --> <!-- predicates and terms may be established outside of formulas and referenced via predRef and termRef elements (resp.). Documentation elements existing at the document root are considered to refer to the document as a whole. --> <!ENTITY % Xcl.content "( formula %Predicate.class; %Term.class; %Documentation.class; )*" > <!ELEMENT xcl %Xcl.content; > <!ATTLIST xcl %XCL.xmlns.attrib; id ID #IMPLIED %XLINK.xmlns.attrib; xml:base %URI.datatype; #IMPLIED > <!-- formulas .......................................... --> <!ELEMENT formula %Formula.content; > <!ATTLIST formula id ID #IMPLIED > <!-- quantifiers ....................................... --> <!ELEMENT quant ( type?, %Formula.content; ) > <!ATTLIST quant %XCL.xmlns.attrib; id ID #IMPLIED name %Quantifier.reserved; #REQUIRED variable NMTOKEN #REQUIRED > <![%XCL.level2;[ <!ELEMENT quantRef EMPTY > <!ATTLIST quantRef %XCL.xmlns.attrib; name %Quantifier.reserved; #REQUIRED xlink:href %URI.datatype; #REQUIRED > ]]> <!-- optional quantifier type ........... --> <![%XCL.level2;[ <!ENTITY % Type.content "( #PCDATA %Predicate.class; %Term.class; )*" > ]]> <!ENTITY % Type.content "( #PCDATA )*" > <!ELEMENT type %Type.content; > <!ATTLIST type %XCL.xmlns.attrib; > <!-- connectives ....................................... --> <!ELEMENT conn %Formula.content; > <!ATTLIST conn %XCL.xmlns.attrib; id ID #IMPLIED name %Connective.reserved; #REQUIRED > <![%XCL.level2;[ <!ELEMENT connRef EMPTY > <!ATTLIST connRef %XCL.xmlns.attrib; name %Connective.reserved; #REQUIRED xlink:href %URI.datatype; #REQUIRED > ]]> <!-- predicates ........................................ --> <!ELEMENT pred %Formula.content; > <!ATTLIST pred %XCL.xmlns.attrib; id ID #IMPLIED name %Predicate.reserved; #REQUIRED > <![%XCL.level2;[ <!ELEMENT predRef EMPTY > <!ATTLIST predRef %XCL.xmlns.attrib; name %Predicate.reserved; #REQUIRED xlink:href %URI.datatype; #REQUIRED > ]]> <!-- terms ............................................. --> <!ELEMENT term ( #PCDATA )* > <!ATTLIST term %XCL.xmlns.attrib; id ID #IMPLIED name NMTOKEN #REQUIRED > <![%XCL.level2;[ <!ELEMENT termRef EMPTY > <!ATTLIST termRef %XCL.xmlns.attrib; name NMTOKEN #IMPLIED xlink:href %URI.datatype; #REQUIRED > ]]> <!-- documentation ..................................... --> <!ELEMENT doc ( #PCDATA )* > <!ATTLIST doc %XCL.xmlns.attrib; id ID #IMPLIED xml:lang CDATA #IMPLIED > <![%XCL.level2;[ <!ELEMENT docRef EMPTY > <!ATTLIST docRef %XCL.xmlns.attrib; xml:lang CDATA #IMPLIED xlink:href %URI.datatype; #REQUIRED > ]]> <!-- end of xcl1.dtd ........ --> <!-- $Log: xcl1.dtd,v $ Revision 1.4 2003/05/14 02:26:26 altheim first functional version; includes level 1 and 2 via marked sections Revision 1.3 2003/05/11 04:15:12 altheim marked sections for level 2 and xmlns support (still rough) Revision 1.2 2003/05/10 16:19:26 altheim moved quantifier type from attribute to element to allow type links in Level 2 -->
This section includes information on namespace-prefixed use of XCL as well as extensions to XCL, which are either:
This shows a well-formed, namespace-prefixed XCL 1.0 Level 2 document (using a prefix of "woo"):
<?xml version="1.0"?> <woo:xcl xmlns:woo="http://purl.org/xcl/1.0/" xmlns:xlink="http://www.w3.org/1999/xlink"> <woo:formula> </woo:formula> </woo:xcl>
This shows a valid, namespace-prefixed XCL 1.0 Level 2 document (using the prefix of "xcl"). This is accomplished by including a DOCTYPE declaration for the XCL 1.0 Level 2 Prefixed DTD.
<?xml version="1.0"?> <!DOCTYPE xcl PUBLIC "-//purl.org/xcl//DTD XML Common Logic (XCL) 1.0 Level 2 Prefixed//EN" "http://purl.org/xcl/1.0/xcl1-2p.dtd"> <xcl:xcl xmlns:xcl="http://purl.org/xcl/1.0/" xmlns:xlink="http://www.w3.org/1999/xlink"> <xcl:formula> </xcl:formula> </xcl:xcl>
This shows a valid, namespace-prefixed XCL 1.0 Level 2 document (using a prefix of "woo"). This is accomplished by including a DOCTYPE declaration for the XCL 1.0 Level 2 DTD, and redeclaring the default namespace prefix (an empty string) in the internal subset:
<?xml version="1.0"?> <!DOCTYPE xcl PUBLIC "-//purl.org/xcl//DTD XML Common Logic (XCL) 1.0 Level 2//EN" "http://purl.org/xcl/1.0/xcl1-2.dtd"[ <!ENTITY % NS.prefixed "INCLUDE"> <!ENTITY % XCL.pfx "woo"> ]> <woo:xcl xmlns:woo="http://purl.org/xcl/1.0/" xmlns:xlink="http://www.w3.org/1999/xlink"> <woo:formula> </woo:formula> </woo:xcl>
Note: Admittedly, this is beyond the syntactical complexity most people are willing to deal with, so an XCL DTD is provided declaring "xcl" as a namespace prefix. See Appendix C. This example is included here for those wishing to use a different prefix, or intermix XCL with other XML markup whilst still being able to validate their XCL documents. The first entity declaration enables namespace prefixing, the second declares the prefix value.
A planned extension to XCL Level 2 is to include XHTML markup (in appropriate locations within the document model) for documentation purposes. Other extensions (within a separate XCL-based namespace) might be to add a single <modal:constraint> element that could express the modal logic constraint within which a statement is true. Given that such constraints are similar conceptually to "scope" in Topic Maps, XCL Level 2 could possibly be used as a serialization syntax for Topic Maps. Likewise, Conceptual Graphs expressed in XCL would immediately be "web-friendly".
Many extensions to XCL Level 2 are expected to be handled within the existing Level 2 syntax by creating canonical identifiers (Published Subject Indicators, or PSIs) for new quantifiers, connectives and predicates. Because of the basic graph structure of XCL it is as flexible as RDF or XTM in expressing semantic structures.
<?xml version="1.0"?> <!DOCTYPE xcl PUBLIC "-//purl.org/xcl//DTD XML Common Logic (XCL) 1.0//EN" "http://purl.org/xcl/1.0/xcl1.dtd"> <xcl xmlns="http://purl.org/xcl/1.0/" xmlns:xlink=""> </xcl>
XCL is designed as an interchange syntax for Common Logic, hence the intermixing of "arbitrary" XML markup within an XCL document would introduce an unknown measure of ambiguity. Would the added markup change the interpretation of a formula? Is it only a documentation feature? These are not properly the kinds of questions a computer can answer without assistance. To provide this assistance, all extensions to XCL should include (for humans) publicly-available documentation of the extensions, as well as an appropriate schema (e.g., XML 1.0 DTD<>, RELAX-NG schema, XML Schema). For the benefit of computers, extended XCL documents should be clearly marked, preferably with a DOCTYPE declaration.
$Log: index.html,v $ Revision 1.8 2003/05/14 02:29:25 altheim functional DTD, test docs, tweaks on text Revision 1.7 2003/05/11 11:11:16 altheim broke off quantifier type as element type; finished several examples Revision 1.6 2003/05/11 04:20:43 altheim divided into two levels; improved examples; finished some sections; added Acknowledgements Revision 1.5 2003/05/08 02:09:32 altheim moved everything into 1.0 subdirectory and modified doc accordingly Revision 1.4 2003/05/08 01:48:03 altheim general cleanup, added PSIs and PSI metadata and index in appendix (first public draft)