version 0.5 draft syntax (original) (raw)
Classes and Properties
The agent markup language syntax isXML usingXML namespacesand RDF.
These documents will typically use elements and attributes from the RDF namespace(s) directly. The namespace for the base RDF model (defining statements and properties) and the namespace for RDF Schema (defining classes and constraints) are invoked with XML namespace declarations of the form:
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"** **xmlns:s="" title="undefined" rel="noopener noreferrer">http://www.w3.org/2000/02/rdf-schema#">
Classes (or categories) are simply RDFClasses. A class declaration is written in the following way:
<s:Class ID="MyClass" />
Optionally, the RDF documentation properties can be used to include human-readable prose. Class hierarchies are declared using the RDFsubClassOfproperty:
<s:Class ID="MyClass"> <s:comment>MyClass has no superclasses declared
<s:Class ID="MySubClass"> <s:subClassOf resource="#MyClass" /> <s:comment>MyClass is a superclass of MySubClass
Properties (or relations) are simply RDFPropertys. A property declaration is written in the following way:
****XML Schema for Inference Rules
XML Schemaprovides a compact mechanism for describing the structure of a valid document. Inference rules are written using thewtr, andlistRDF classes.
These markup elements are described in aschema for KIFusing XML Schema as:
Here, the type
and equivClass
argumentsdeclare the permitted syntax for these elements. These declarations use XML type declarations from anXML Schema for RDF, reproduced in the next section.
The schema declaration for each of the elements above says that they have the syntax of an RDF typedNode
. A typedNode element is a short-hand expression for declaring an instance of a Class. For example,
<inf:list ID="myRuleBody"/>
is short-hand for
Note that the syntax for declaring classes and properties shown in the previous section is also an application of this same typedNode
syntax. "MyClass" was declared to be an instance of the RDF class 'Class'; that is, it is a Class. And "myProperty" was declared to be an instance of the RDF class 'Property'; i.e. it is a Property.
The wtr class is a subclass of RDFStatement. Instances of the wtrclass use the RDFpredicate,subject, andobjectproperties to identify the elements of the statement.
For example, the statement "there is a weakly true statement that Dan is the author of a program" would be written as:
inf:wtr rdf:subjectDan <rdf:predicate resource="http://...myOntology#isAuthorOf"/> rdf:objectaProgram
The listRDF Class and the RDF propertiesfirst andrestare used to declare the antecedents and conclusion(s) for an instance of a rule.
For example, a definitive list of authors of a program is written as:
myOntology:Program myOntology:authors <l:List> <l:first> myOntology:Person myOntology:givenNameDan <l:rest> inf:null/
This says "there exists a program whose authors are a person whose given name is "Dan" and no others." (This English transcription is not precise about whether "Dan" is the name of the person or the name of the program. This is a common feature of "natural language", however the RDF is unambiguous.)
Variables in a expression are identifiers in a reserved part of the W3C Web address space; there is no special URI scheme that universally means 'this is the name of a variable'. URIs beginning with http://www.w3.org/2000/07/hs78/KIF?word=%3f serve as KIF individual variables. (%3f is the hex encoding of the character '?'.)
The wtr, andlistclasses are used with the propertiespredicate,subject,object,first, andrestand with theOperators=> andandto declare the definitive list of antecedents for a rule.
For example, here is a simple inference rule:
<r:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:inf="http://www.w3.org/2000/07/hs78/KIF#" xmlns:shoeb="http://www.w3.org/2000/04shoe-swell/convert?in=http://www.cs.umd.edu/projects/plus/SHOE/onts/base1.0.html#" />
<kif:wtr shoeb:description="Transitivity of Suborganizations. If subOrganizationOf(x,y) and subOrganizationOf(y,z) then subOrganizationOf(x,z)">
<rdf:predicate
resource="http://www.w3.org/2000/07/hs78/KIF?word=%3d%3e" />
<rdf:subject>
<kif:list>
<kif:first
resource="http://www.w3.org/2000/07/hs78/KIF?word=and" />
<kif:rest>
<kif:list>
<kif:first>
<rdf:Statement>
<rdf:predicate
rdf:resource="http://www.w3.org/2000/04shoe-swell/#subOrganizationOf" />
<rdf:subject
resource="http://www.w3.org/2000/07/hs78/KIF?word=%3fx" />
<rdf:object
resource="http://www.w3.org/2000/07/hs78/KIF?word=%3fy" />
</rdf:Statement>
</kif:first>
<kif:rest>
<kif:list>
<kif:first>
<rdf:Statement>
<rdf:predicate
rdf:resource="http://www.w3.org/2000/04shoe-swell/#subOrganizationOf" />
<rdf:subject
resource="http://www.w3.org/2000/07/hs78/KIF?word=%3fy" />
<rdf:object
resource="http://www.w3.org/2000/07/hs78/KIF?word=%3fz" />
</rdf:Statement>
</kif:first>
<kif:rest>
<kif:null />
</kif:rest>
</kif:list>
</kif:rest>
</kif:list>
</kif:rest>
</kif:list>
</rdf:subject>
<rdf:object>
<kif:list>
<kif:first
resource="http://www.w3.org/2000/07/hs78/KIF?word=and" />
<kif:rest>
<kif:list>
<kif:first>
<rdf:Statement>
<rdf:predicate
rdf:resource="http://www.w3.org/2000/04shoe-swell/#subOrganizationOf" />
<rdf:subject
resource="http://www.w3.org/2000/07/hs78/KIF?word=%3fx" />
<rdf:object
resource="http://www.w3.org/2000/07/hs78/KIF?word=%3fz" />
</rdf:Statement>
</kif:first>
<kif:rest>
<kif:null />
</kif:rest>
</kif:list>
</kif:rest>
</kif:list>
</rdf:object>
You can read this as "there exists an instance of a weakly true statement whose predicate is "=>" (implies), whose subject is the conjunction of the reified statements "x is subOrganizationOf y" and "y is subOrganizationof z", and whose object is the reified statement "x is subOrganizationOf z", where x, y, and z are variables."
Note that we have used a third namespace in this example, an example namespace corresponding to the SHOE base ontology, to incorporate a prose description of the rule intended for human consumption. This illustrates the ease with which an RDF expression can take advantage of properties defined by a variety of sources.
A graphical illustration of this rule for the transitivity of subOrganizationOf is shown below:
XML Schema for RDF
[RDF] uses BNF to specify the syntax of RDF XML expressions. A translation ofthat BNF into XML Schema completes the formal syntactic definition . An annotated version ofthis translation, sufficient our use, is:
XML Schema for RDF
Id:rdf.xsd,v1.172000/08/0414:37:44swickExpId: rdf.xsd,v 1.17 2000/08/04 14:37:44 swick Exp Id:rdf.xsd,v1.172000/08/0414:37:44swickExp
originally derived from Rick Jelliffe's work:
From: Rick JELLIFFE <ricko@allette.com.au>
To: xml-dev@xml.org
Subject: Re: new public working draft of XML Schema
Date: Sat, 26 Feb 2000 23:05:20 +0800
then modified to match the RDF formal grammar
created 2000-12-25, Rick Jelliffe,
Academia Sinica Computing Centre. Thanks to Henry Thompson for help.
RDF Specification at W3C.
</documentation>
this is a "union type"; use xsi:type in the instance to discriminate between concrete subtypes
this is a "union type"; use xsi:type in the instance to discriminate between concrete subtypes. @@hmm... can I mark this as "abstract" somehow?
<!-- these are is constrained to use resource="...";
use xsi:type to do something else -->
With the two XML schemas above, tools such asXSV, XML Schema Validator, can be used to check the conformance of an XML document to this specification.
Ralph Swick Revision:1.20Revision: 1.20 Revision:1.20 of Date:2000/08/2203:21:30Date: 2000/08/22 03:21:30 Date:2000/08/2203:21:30 by Author:connollyAuthor: connolly Author:connolly
change log