<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="lib/rfc2629.xslt"?>
<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes"?>
<?rfc subcompact="no" ?>
<?rfc linkmailto="no" ?>
<?rfc editing="no" ?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc rfcedstyle="yes"?>
<?rfc-ext allow-markup-in-artwork="yes" ?>
<?rfc-ext include-index="no" ?>

<rfc ipr="trust200902"
     category="exp"
     docName="draft-thierry-bulk-rdf-00"
     xmlns:x="http://purl.org/net/xml2rfc/ext">
  <x:feedback template="mailto:pierre@nothos.net"/>
  <front>
    <title abbrev="BULK-RDF">BULK RDF namespace</title>

    <author initials="P." surname="Thierry" fullname="Pierre Thierry">
      <organization>Thierry Technologies</organization>
      <address>
        <email>pierre@nothos.net</email>
      </address>
    </author>

    <date day="7" month="August" year="2013" />
    <keyword>binary</keyword>

    <abstract>
      <t>
        This specification describes a BULK serialization of RDF ontologies and graphs.
      </t>
    </abstract>

  </front>

  <middle>
    <section anchor="intro" title="Introduction">
      <section title="Conventions and Terminology">
        <t>
          The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD
          NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as
          described in <xref target="RFC2119">RFC 2119</xref>.
        </t>
        <t>
          Literal numerical values are provided in decimal or hexadecimal as appropriate.
          Hexadecimal literals are prefixed with <spanx style="verb">0x</spanx> to distinguish them
          from decimal literals.
        </t>
	<t>
	  BULK bytes sequences and expressions are described with the same conventions than used in
	  the <xref target="BULK1">BULK 1.0 specification</xref>
	</t>
      </section>
    </section>

    <section title="BULK RDF namespace">
      <t>
	The RDF namespace is an official namespace identified by the UUID <eref
	target="urn:uuid:ed460331-a89b-5742-a8de-907dff727779"/> (BULK,
	"http://www.w3.org/1999/02/22-rdf-syntax-ns#"). Its first purpose is to serialize both RDF
	ontologies and graphs, but as RDF is deeply rooted in the World Wide Web and the REST
	architecture, some of the names and forms defined in this specification are intended to be
	used in applications related to those.
      </t>
      <t>
	This specification defines the type <spanx style="verb">URIString</spanx>, which is an array
	whose content is a string conforming to the "URI-reference" production in <xref
	target="RFC3986"/> (section 4.1).
      </t>

      <section title="URI reference">
	<t>
	  <list style="hanging">
	    <t hangText="name"><spanx style="verb">0x1</spanx> (mnemonic: <spanx
	    style="verb">uriref</spanx> )</t>
	    <t hangText="shape"><spanx style="verb">( uriref URIString )</spanx></t>
	  </list>
	</t>
	<t>
	  This form makes it possible to differentiate a string containing a URI from a URI
	  reference itself.
	</t>
	<t>Type: <spanx style="verb">URIRef</spanx></t>
      </section>

      <section title="Base URI">
	<t>
	  <list style="hanging">
	    <t hangText="name"><spanx style="verb">0x2</spanx> (mnemonic: <spanx style="verb">base</spanx> )</t>
	    <t hangText="shape"><spanx style="verb">( base URIString )</spanx></t>
	  </list>
	</t>
	<t>
	  This form changes the current base URI for URI resolution. If the given URI is relative,
	  it must be resolved with the current base URI.
	</t>
      </section>

      <section title="URI prefix">
	<t>
	  <list style="hanging">
	    <t hangText="name"><spanx style="verb">0x3</spanx> (mnemonic: <spanx style="verb">prefix</spanx> )</t>
	    <t hangText="shape"><spanx style="verb">( prefix {uri} )</spanx></t>
	  </list>
	</t>
	<t>
	  <list style="hanging">
	    <t hangText="Name's type">EagerFunction</t>
	    <t hangText="Form's type">EagerFunction</t>
	    <t hangText="Form's value">a function that returns a URIRef whose content is the
	    concatenation of {uri} and its only argument (or returns {uri} if called without
	    arguments)</t>
	  </list>
	</t>
	<t>
	  {uri} can be of type <spanx style="verb">URIString</spanx> or <spanx
	  style="verb">URIRef</spanx>. If it is of type URIRef, the above description should be
	  taken as if the form is of shape <spanx style="verb">( prefix ( uriref {uri} ) )</spanx>.
	</t>
      </section>

      <section title="blank">
	<t>
	  <list style="hanging">
	    <t hangText="name"><spanx style="verb">0x4</spanx> (mnemonic: <spanx style="verb">blank</spanx> )</t>
	    <t hangText="shape"><spanx style="verb">( blank )</spanx></t>
	  </list>
	</t>
	<t>
	  <list style="hanging">
	    <t hangText="Name's type">EagerFunction</t>
	    <t hangText="Form's type">Expr</t>
	    <t hangText="Form's value">a new blank node. If a same blank node must be used in
	    several forms, it should be made the value of a name.</t>
	  </list>
	</t>
      </section>

      <section title="RDF literals">
	<t>
	  Literals are arbitrary data that can be an object in an RDF triple. It is important to
	  note that their BULK serialization doesn't need to denote the string of their lexical
	  form.
	</t>
	<t>
	  Any array used as object in an RDF triple has the semantics of a plain literal without
	  language tag.
	</t>
	<section title="Plain literal">
	  <t>
	    <list style="hanging">
	      <t hangText="name"><spanx style="verb">0x5</spanx> (mnemonic: <spanx style="verb">plain</spanx> )</t>
	      <t hangText="shape"><spanx style="verb">( plain {lang}:Array {literal}:Array )</spanx></t>
	    </list>
	  </t>
	  <t>
	    This is a plain RDF literal. {lang} is the language tag.
	  </t>
	</section>

	<section title="Typed literal">
	  <t>
	    <list style="hanging">
	      <t hangText="name"><spanx style="verb">0x6</spanx> (mnemonic: <spanx style="verb">type</spanx> )</t>
	      <t hangText="shape"><spanx style="verb">( type {id}:URIRef {literal} )</spanx></t>
	    </list>
	  </t>
	  <t>
	    This is a typed RDF literal. {id} is the datatype URI. Each type defines what is legal as
	    <spanx style="verb">{literal}</spanx>.
	  </t>
	</section>

	<section title="XMLLiteral">
	  <t>
	    <list style="hanging">
	      <t hangText="name"><spanx style="verb">0x7</spanx> (mnemonic: <spanx style="verb">xmlliteral</spanx> )</t>
	      <t hangText="value"><spanx style="verb">( uriref
	      "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral" )</spanx></t>
	    </list>
	  </t>
	  <t>
	    A literal with this type SHOULD contain a BULK serialization of XML (cf. <xref
	    target="BULK-XML"/>). An application MUST NOT use an array for this literal for anyhting
	    else than a string that belongs to the lexical space defined for <eref
	    target="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"/>.
	  </t>
	</section>

      </section>

      <section title="Triples">
	<t>
	  <list style="hanging">
	    <t hangText="name"><spanx style="verb">0x8</spanx> (mnemonic: <spanx style="verb">triples</spanx> )</t>
	    <t hangText="shape"><spanx style="verb">( triples {triples} )</spanx></t>
	  </list>
	</t>
	<t>
	  <spanx style="verb">{triples}</spanx> must be a sequence of <spanx style="verb">(
	  {subj}:URIRef {pred}:URIRef {obj} )</spanx>.
	</t>
      </section>

      <section title="Turtle-like statements">
	<t>
	  <list style="hanging">
	    <t hangText="name"><spanx style="verb">0x9</spanx> (mnemonic: <spanx style="verb">turtle</spanx> )</t>
	    <t hangText="shape"><spanx style="verb">( turtle {statements} )</spanx></t>
	  </list>
	</t>
	<t>
	  <spanx style="verb">{statements}</spanx> MUST be a sequnce of <spanx style="verb">(
	  {subj}:URIRef {preds} )</spanx>, where <spanx style="verb">{preds}</spanx> MUST be a
	  sequence of <spanx style="verb">( {pred}:URIRef {objs} )</spanx>, where <spanx
	  style="verb">{objs}</spanx> is a sequence.
	</t>
      </section>

      <section title="RDF vocabulary">
	<t>
	  The following names are associated with <spanx style="verb">uriref</spanx> forms, with a
	  base URI of <eref target="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>. Their mnemonic
	  is the lowercased URI reference.
	</t>
	<list style="hanging">
	  <t hangText="0xA">type</t>
	  <t hangText="0xB">Property</t>
	  <t hangText="0xC">Statement</t>
	  <t hangText="0xD">subject</t>
	  <t hangText="0xE">predicate</t>
	  <t hangText="0xF">object</t>
	  <t hangText="0x10">Bag</t>
	  <t hangText="0x11">Seq</t>
	  <t hangText="0x12">Alt</t>
	  <t hangText="0x13">value</t>
	  <t hangText="0x14">List</t>
	  <t hangText="0x15">nil</t>
	  <t hangText="0x16">first</t>
	  <t hangText="0x17">rest</t>
	  <t hangText="0x18">PlainLiteral</t>
	</list>
      </section>

      <section title="RDF embedding">
	<t>
	  <list style="hanging">
	    <t hangText="name"><spanx style="verb">0x20</spanx> (mnemonic: <spanx style="verb">this-resource</spanx> )</t>
	    <t hangText="shape"><spanx style="verb">this-resource</spanx></t>
	  </list>
	</t>
	<t>
	  This expression is intended to help embedding RDF metadata alongside or within a
	  resource. It has the semantics of a blank node that designates this resource. What makes a
	  resource the current described resource is application-dependent.
	</t>
      </section>

    </section>

    <section title="Security Considerations" anchor="sec">
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <reference anchor="RFC2119">
        <front>
          <title>
            Key words for use in RFCs to Indicate Requirement Levels
          </title>
          <author initials="S." surname="Bradner" fullname="Scott Bradner">
            <organization>Harvard University</organization>
            <address><email>sob@harvard.edu</email></address>
          </author>
          <date month="March" year="1997"/>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="2119"/>
      </reference>

      <reference anchor="RFC3986">
        <front>
          <title>
	    Uniform Resource Identifiers (URI): Generic Syntax
          </title>
          <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
            <organization>W3C/MIT</organization>
          </author>
          <author initials="R." surname="Fielding" fullname="Roy T. Fielding">
            <organization>Day Software</organization>
          </author>
          <author initials="L." surname="Masinter" fullname="L. Masinter">
            <organization>Adobe Systems</organization>
          </author>
          <date month="January" year="2005"/>
        </front>
        <seriesInfo name="RFC" value="3986"/>
        <seriesInfo name="STD" value="66"/>
      </reference>


      <reference anchor="BULK1">
	<front>
	  <title>Binary Uniform Language Kit 1.0</title>
	  <date day="7" month="August" year="2013"/>
	  <author initials="P." surname="Thierry" fullname="Pierre Thierry">
	    <organization>Thierry Technologies</organization>
	    <address>
	      <email>pierre@nothos.net</email>
	    </address>
	  </author>
	</front>
	<seriesInfo name="Internet-Draft" value="draft-thierry-bulk-02"/>
      </reference>

    </references>


    <references title="Informative references">
      <reference anchor="RDF-CONCEPTS" target="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/">
	<front>
	  <title>Resource Description Framework (RDF): Concepts and Abstract Syntax</title>
	  <date day="10" month="February" year="2004"/>
	  <author initials="G." surname="Klyne" fullname="Graham Klyne">
	    <organization>Nine by Nine</organization>
	    <address>
	      <email>GK@NineByNine.org</email>
	    </address>
	  </author>
	  <author initials="J.J." surname="Carroll" fullname="Jeremy J. Carroll">
	    <organization>Hewlett Packard Labs</organization>
	    <address>
	      <email>jjc@hpl.hp.com</email>
	    </address>
	  </author>
	</front>
      </reference>

      <reference anchor="BULK-XML">
	<front>
	  <title>BULK Simple XML namespace</title>
	  <date day="7" month="August" year="2013"/>
	  <author initials="P." surname="Thierry" fullname="Pierre Thierry">
	    <organization>Thierry Technologies</organization>
	    <address>
	      <email>pierre@nothos.net</email>
	    </address>
	  </author>
	</front>
	<seriesInfo name="Internet-Draft" value="draft-thierry-bulk-xml-00"/>
      </reference>

    </references>

    <section title="Example: RDF Schema vocabulary">
      <figure>
	<preamble>Here is the text notation of a BULK stream defining references for each element in
	the RDF Schema vocabulary. The whole stream is 444 bytes in length.</preamble>
	<artwork>
( bulk:version 1 0 )
( bulk:ns 32 rdf )
( bulk:ns* 33 rdfs )
( define rdfs:schema ( prefix "http://www.w3.org/2000/01/rdf-schema#" ) )
( define rdfs:resource ( rdfs:schema "Resource" ) )
( define rdfs:class ( rdfs:schema "Class" ) )
( define rdfs:subclassof ( rdfs:schema "subClassOf" ) )
( define rdfs:subpropertyof ( rdfs:schema "subPropertyOf" ) )
( define rdfs:comment ( rdfs:schema "comment" ) )
( define rdfs:label ( rdfs:schema "label" ) )
( define rdfs:domain ( rdfs:schema "domain" ) )
( define rdfs:range ( rdfs:schema "range" ) )
( define rdfs:seealso ( rdfs:schema "seeAlso" ) )
( define rdfs:isdefinedby ( rdfs:schema "isDefinedBy" ) )
( define rdfs:literal ( rdfs:schema "Literal" ) )
( define rdfs:container ( rdfs:schema "Container" ) )
( define rdfs:containermembershipproperty ( rdfs:schema "ContainerMembershipProperty" ) )
( define rdfs:member ( rdfs:schema "member" ) )
( define rdfs:datatype ( rdfs:schema "Datatype" ) )
( define rdfs:schema* ( rdfs:schema ) )
	</artwork>
      </figure>

      <figure>
	<preamble>Here is the text notation of a BULK stream containg a small part of the RDF Schema
	ontology. The whole stream is 375 bytes in length (the corresponding RDF/XML document would
	be 1525 bytes in length).</preamble>
	<artwork>
( bulk:version 1 0 )
( bulk:ns 32 rdf )
( bulk:ns 33 rdfs )
( turtle
  ( rdfs:resource
    ( rdf:type rdfs:class )
    ( rdfs:isdefinedby rdfs:schema* )
    ( rdfs:label "Resource" )
    ( rdfs:comment "The class resource, everything." ) )
  ( rdfs:class
    ( rdf:type rdfs:class )
    ( rdfs:isdefinedby rdfs:schema* )
    ( rdfs:label "Class" )
    ( rdfs:comment "The class of classes." )
    ( rdfs:subclassof rdfs:resource ) )
  ( rdfs:subclassof
    ( rdf:type rdf:property )
    ( rdfs:isdefinedby rdfs:schema* )
    ( rdfs:label "subClassOf" )
    ( rdfs:comment "The subject is a subclass of a class." )
    ( rdfs:range rdfs:class )
    ( rdfs:domain rdfs:class ) )
  ( rdfs:subpropertyof
    ( rdf:type rdf:property )
    ( rdfs:isdefinedby rdfs:schema* )
    ( rdfs:label "subPropertyOf" )
    ( rdfs:comment "The subject is a subproperty of a property." )
    ( rdfs:range rdf:property )
    ( rdfs:domain rdf:property ) ) )
	</artwork>
      </figure>
    </section>

  </back>
</rfc>

