summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/stex/schema/rnc/owl.rnc
blob: a262df3fc310f2e95f9e58510059d551e574f2b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#   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}