CS 6795 Semantic Web Techniques

Lab 1


Syllabus
Assigns
Notes
Labs
Project
Resources

Create your own XML DTD

Consider these examples of XML documents for clause sets consisting of zero or more facts f (Prolog: f.) and zero or more 'backward' rules c ¬ p (Prolog: c :- p.), in any order ("myurl" will be replaced as explained below):

<?xml version="1.0" standalone="no"?>
<!DOCTYPE clauses SYSTEM "myurl">
 <clauses>
    <fact> f </fact>
    <rule> <conc> c </conc> <prem> p </prem> </rule>
 </clauses>
 
<?xml version="1.0" standalone="no"?>
<!DOCTYPE clauses SYSTEM "myurl">
<clauses>
    <rule> <conc> c1 </conc> <prem> p1 </prem> </rule>
    <fact> f1 </fact>
    <rule> <conc> c2 </conc> <prem> p2 </prem> </rule>
    <fact> f2 </fact>
    <fact> f3 </fact>
</clauses>

 

Inductively complete this XML DTD (overwrite the "..." lines) for such clause sets:

 

<!ELEMENT clauses   (................)>
<!ELEMENT rule   (................)>
<!ELEMENT fact    (#PCDATA)>
<!ELEMENT ........    (................)>
<!ELEMENT ........    (................)>

Put a file containing (just) your completed DTD somewhere in your personal Web space under a URL of your choice, here called "myurl".

Validate the above document examples and other ones online:
 
> Go to

http://www.stg.brown.edu/service/xmlvalid/

 

> Paste in and edit the examples at

Text:

 Suppress warning messages
 Relax namespace checks

  

 

 
> Hit the 'Validate' button
> You should basically get:
Document validates OK.
 

You can now experiment with variations of the original XML DTD and document examples.  If you also reformulate the original XML DTD into an XML Schema, W3C's Validator for XML Schema at http://www.w3.org/2001/03/webdata/xsv can be employed instead.


Maintained by Bruce Spencer