@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<http://www.w3.org/2000/10/swap/grammar/bnf> <http://purl.org/dc/elements/1.1/creator>
    <http://www.w3.org/People/Berners-Lee/card#i>;
  rdfs:comment """
    This ontology contains terms for defining a context-free grammar.
    The basic property is mustBeOneSequence which is equivalent to
    the expression of a production in the original simple BNF.
    Rules can be used to convert into and out of shorthand forms such
    as optional, repeating and token-separated list forms.
    Terminals are described either as a string, which is represented by itself,
    or are defined by a regular expression using cfg:matches. 
    """;
  <http://www.w3.org/2000/10/swap/pim/doc#rules> <http://www.w3.org/2000/10/swap/grammar/bnf-rules> .

<http://www.w3.org/2000/10/swap/grammar/bnf#Token> rdfs:comment """A terminal, aka atomic, production,
	defined as string or regexp""";
  rdfs:label "token";
  rdfs:subClassOf <http://www.w3.org/2000/10/swap/grammar/bnf#Production> .

<http://www.w3.org/2000/10/swap/grammar/bnf#canStartWith> a rdf:Property;
  rdfs:comment """The production can only start with the given
		representative character. In the case that a token starts
		with always the same character, that is the one given.
		In th eevent that it can start with alpha character, 'a'
		is given; if it can start with a numeric, '0' is given
		as the value for this predicate.  This predicate is used
		only when a predictive parser is possible and desired.""";
  rdfs:domain <http://www.w3.org/2000/10/swap/grammar/bnf#Production>;
  rdfs:label "can start with";
  rdfs:range <http://www.w3.org/2000/10/swap/grammar/bnf#String> .

<http://www.w3.org/2000/10/swap/grammar/bnf#commaSeparatedPeriodTerminatedListOf>
  rdfs:domain <http://www.w3.org/2000/10/swap/grammar/bnf#Production>;
  rdfs:label "comma-separated period-terminated list of";
  rdfs:range <http://www.w3.org/2000/10/swap/grammar/bnf#Production> .

<http://www.w3.org/2000/10/swap/grammar/bnf#matches> a rdf:Property;
  rdfs:comment """The given token is defined by the
		regular expression which a token must match""";
  rdfs:domain <http://www.w3.org/2000/10/swap/grammar/bnf#Token>;
  rdfs:label "matches";
  rdfs:range <http://www.w3.org/2000/10/swap/grammar/bnf#RegularExpression> .

<http://www.w3.org/2000/10/swap/grammar/bnf#mustBe> rdfs:domain <http://www.w3.org/2000/10/swap/grammar/bnf#Production>;
  rdfs:range <http://www.w3.org/2000/10/swap/grammar/bnf#Production> .

<http://www.w3.org/2000/10/swap/grammar/bnf#mustBeOneSequence> a rdf:Property;
  rdfs:comment """This is the core property you need to define a BNF production.
It defines the list of the only sequences to which a given 
term may expand.  Each sequence is just a list of other productions in order.
""";
  rdfs:domain <http://www.w3.org/2000/10/swap/grammar/bnf#Production>;
  rdfs:label "productions";
  rdfs:range <http://www.w3.org/2000/10/swap/grammar/bnf#ListOfSequencesOfProductions> .

<http://www.w3.org/2000/10/swap/grammar/bnf#zeroOrMore> rdfs:domain <http://www.w3.org/2000/10/swap/grammar/bnf#Term>;
  rdfs:label "zero or more";
  rdfs:range <http://www.w3.org/2000/10/swap/grammar/bnf#Production> .
