# A simplified RelaxNG for OWL (so that we can generate OWL from sTeX # https://kwarc.info/repos/kwarc/repos/stex/rnc/omdoc+ltxml.rnc # (c) 2010 Michael Kohlhase, released under the GNU Public License (GPL) namespace owl = "http://www.w3.org/2002/07/owl#" namespace rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#" namespace rdfs = "http://www.w3.org/2000/01/rdf-schema#" namespace stex = "http://kwarc.info/ns/sTeX" namespace local = "" nonlocal-attribs = attribute * - (local:* | owl:* | rdf:* | rdfs:*) {xsd:string} start = RDF RDF = element rdf:RDF {nonlocal-attribs & Ontology} Ontology.attribs = nonlocal-attribs* & about.attrib? Ontology.model = Class* & Property* Ontology = element owl:Ontology {Ontology.attribs & Ontology.model} about.attrib = attribute rdf:about {xsd:anyURI} resource.attrib = attribute rdf:resource {xsd:anyURI} label.attrib = attribute rdfs:label {text} comment.attrib = attribute rdfs:comment {text} Class.attribs = nonlocal-attribs* & about.attrib? & label.attrib? & comment.attrib? Class.model = rdftype* & subClassOf* & disjointWith* & isDefinedBy? Class = element rdfs:Class {Class.attribs & Class.model} Property.attribs = nonlocal-attribs* & about.attrib? & label.attrib? & comment.attrib? Property.model = rdftype* & domain? & range & isDefinedBy? Property = element rdf:Property {Property.attribs & Property.model} rdftype.attribs = nonlocal-attribs* & resource.attrib #rdftype.model = notAllowed rdftype = element rdf:type {rdftype.attribs} subClassOf = element rdfs:subClassOf {resource.attrib} isDefinedBy = element rdfs:isDefinedBy {resource.attrib} disjointWith = element owl:disjointWith {resource.attrib} range = element rdfs:range {resource.attrib} domain = element rdfs:domain {resource.attrib}