<> a <../../2000/10/swap/logic.n3#N3Document>. # Ugly!

@prefix dc: <http://purl.org/dc/elements/1.1/>.

<>
  <rcs#id> "$Id: charmod.n3,v 1.3 2001/03/30 07:36:57 connolly Exp $";
  <http://www.w3.org/2000/10/swap/pim/doc#obsoletes> <../02/cmf/charmod.n3>;
  dc:source <http://www.w3.org/TR/2001/WD-charmod-20010126>.
  # esp section 3.2 Digital Representation of Characters

<http://www.w3.org/TR/2001/WD-charmod-20010126>
  dc:title "Character Model for the World Wide Web 1.0";
  a <../02pd/rec54#WD>;
  dc:date "2001-01-26".

@prefix u: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix dt: <http://www.w3.org/2001/XMLSchema#>.  # dependency should go the other way, probably.
@prefix daml: <http://www.daml.org/2000/12/daml+oil#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.

@prefix : <charmod#>.

:String = dt:string.

@prefix l: <http://www.w3.org/2000/10/swap/log.n3#>.

@prefix v: <#>.
<> l:forAll v:ccs, v:r.

:Character a u:Class;
  u:label "character";
  u:comment "@@spec says to avoid this term; I don't see why.".

:Repertoire u:subClassOf u:Class;
  u:label "Repertoire";
  u:comment "a repertoire is a set of characters".

{ v:r a :Repertoire } l:means { v:r u:subClassOf :Character }.

:CodedCharacterSet u:subClassOf u:Property;
  u:label "coded character set";
  :aka "CCS";
  u:comment "a coded character set is a function [functional property]
	between a repertoire and the non-negative integers.".

#@@ write the range constraint using daml+oil restrictions in stead?
{ v:ccs a :CodedCharacterSet }
   l:means
{ v:ccs a daml:UniqueProperty;
   u:domain [ a :Repertoire ];
   u:range dt:nonNegativeInteger;
  }.

:UCS a :CodedCharacterSet.

:CodePoint = dt:nonNegativeInteger;
  u:label "code point";
  :aka "character number".

:CES
  u:label "serialization scheme", "character encoding scheme".

<> l:forAll v:ces.

{ v:ces a :CES }
   l:means
{ v:ces a daml:UniqueProperty;
   u:domain :String;
   u:range :Binary;
 }.

:US-ASCII a :CES.

[ is :bytes of () ] is :US-ASCII of "".

:string a daml:UniqueProperty;
  u:domain daml:List;
  u:range :String.
() :string "".
{{ v:str :length :_1 } l:implies { (v:str) :string v:str }} l:forAll v:str.
  
:bytes a daml:UniqueProperty;
  u:domain daml:List;
  u:range :OctetSequence.
() :bytes :emptyBinary.

  
{

{ v:octets is :US-ASCII of v:chars.
  v:char :UCS v:octet.
  v:octet a :_SevenBit }
    l:implies
  { [ is :bytes of [ daml:first v:octet; daml:rest v:octets]] :US-ASCII
	[ is :string of [ daml:first v:char; daml:rest v:chars ]] }.
}
 l:forAll v:octet, v:octets, v:char, v:chars.


:_SevenBit u:subClassOf dt:int;
  dt:maxExclusive :_128.

:_65 :decimalNumeral "65".
:_66 :decimalNumeral "66".
:_128 :decimalNumeral "128".

# theorems...
( :_65 ) is :US-ASCII of "A".
( :_65 :_66 ) is :US-ASCII of "AB".


####
#
# Utility stuff

:aka u:subPropertyOf u:label.


##
# I'd put these in timbl's schema directly, but
# (a) deep hierarchies are bad, and I don't think the concept of "obsoletes"
# is intrinsicly related to personal information management nor swap, and
# (b) his schema has stuff about IPR that is very messy.

<http://www.w3.org/2000/10/swap/pim/doc#obsoletes> u:seeAlso
  <http://www.rfc-editor.org/rfc/rfc1327.txt>.

<http://www.rfc-editor.org/rfc/rfc1327.txt>
  dc:title "Mapping between X.400(1988) / ISO 10021 and RFC 822";
  dc:date "1992-05".


