ldp-primer/ldp-primer.html
author Andrei Sambra <andrei@w3.org>
Thu, 26 Mar 2015 10:38:48 -0400
changeset 958 2f25528e103a
parent 876 715fcd4d4710
child 959 b2d2d631693e
permissions -rw-r--r--
Added Link headers to examples. Moved LDPC creation before LDPR
806
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
     1
<?xml version='1.0' encoding='UTF-8' ?>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
     2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
     3
<html xmlns="http://www.w3.org/1999/xhtml" prefix="td: http://www.w3.org/2006/03/test-description# tn: http://ldp.example.org/NewTestDefinitions# ht: http://www.w3.org/2011/http#">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
     4
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
     5
<head>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
     6
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
     7
  <title>Linked Data Platform 1.0 Primer</title>
839
afb8592c533f add noRecTracked Respec config
Arnaud Le Hors <lehors@us.ibm.com>
parents: 831
diff changeset
     8
  <!-- Changed by: , 25-Sep-2014 -->
806
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
     9
  <style type="text/css">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    10
    div.syntaxmenu {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    11
      border: 1px dotted black;
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    12
      padding: 0 0 0 0.5em;
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    13
      margin: 0em;
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    14
    }
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    15
    div.code {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    16
      font-family: monospace;
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    17
      font-size: 110%;
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    18
    }
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    19
    th {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    20
      text-align: left;
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    21
    }
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    22
    td {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    23
      vertical-align: top;
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    24
      padding-right: 2em;
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    25
    }
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    26
    td.col1 {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    27
      width: 300px;
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    28
    }
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    29
  </style>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    30
  <script type="text/javascript">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    31
    var displayed = [];
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    32
    displayed["turtle"] = 1;
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    33
    displayed["jsonld"] = 0;
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    34
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    35
    function primerOnLoad() {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    36
      setTimeout(function () {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    37
        display('turtle', '');
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    38
        set_display_by_id('hide-ts', '');
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    39
        set_display_by_id('show-ts', 'none');
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    40
        display('jsonld', 'none');
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    41
        set_display_by_id('hide-js', 'none');
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    42
        set_display_by_id('show-js', '');
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    43
      }, 3000)
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    44
    }
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    45
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    46
    function display(syntax, status) {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    47
      var howmany = 0;
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    48
      if (status == 'none') {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    49
        displayed[syntax] = 0;
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    50
      } else {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    51
        displayed[syntax] = 1;
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    52
      }
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    53
      for (i in displayed) {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    54
        howmany = howmany + displayed[i];
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    55
      }
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    56
      set_display_by_class('div', syntax, status);
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    57
      if (howmany == 1) {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    58
        set_display_by_class('b', 'syntax-head', 'none');
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    59
      } else {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    60
        set_display_by_class('b', 'syntax-head', '');
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    61
      }
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    62
    }
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    63
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    64
    function getElementsByClassName(oElm, strTagName, oClassNames) {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    65
      var arrElements = (!(!(strTagName == "*") || !(oElm.all))) ? oElm.all : oElm.getElementsByTagName(strTagName);
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    66
      var arrReturnElements = new Array();
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    67
      var arrRegExpClassNames = new Array();
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    68
      if (typeof oClassNames == "object") {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    69
        for (var i = 0; !(i >= oClassNames.length); i++) { /*>*/
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    70
          arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames[i].replace(/\-/g, "\\-") + "(\\s|$)"));
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    71
        }
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    72
      } else {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    73
        arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames.replace(/\-/g, "\\-") + "(\\s|$)"));
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    74
      }
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    75
      var oElement;
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    76
      var bMatchesAll;
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    77
      for (var j = 0; !(j >= arrElements.length); j++) { /*>*/
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    78
        oElement = arrElements[j];
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    79
        bMatchesAll = true;
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    80
        for (var k = 0; !(k >= arrRegExpClassNames.length); k++) { /*>*/
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    81
          if (!arrRegExpClassNames[k].test(oElement.className)) {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    82
            bMatchesAll = false;
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    83
            break;
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    84
          }
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    85
        }
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    86
        if (bMatchesAll) {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    87
          arrReturnElements.push(oElement);
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    88
        }
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    89
      }
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    90
      return (arrReturnElements)
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    91
    }
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    92
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    93
    function set_display_by_class(el, cls, newValue) {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    94
      var e = getElementsByClassName(document, el, cls);
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    95
      if (e != null) {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    96
        for (var i = 0; !(i >= e.length); i++) {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    97
          e[i].style.display = newValue;
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    98
        }
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
    99
      }
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   100
    }
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   101
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   102
    function set_display_by_id(id, newValue) {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   103
      var e = document.getElementById(id);
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   104
      if (e != null) {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   105
        e.style.display = newValue;
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   106
      }
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   107
    }
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   108
  </script>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   109
  <script src='https://www.w3.org/Tools/respec/respec-w3c-common' class='remove'></script>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   110
  <script class='remove'>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   111
    var respecConfig = {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   112
      // specification status (e.g. WD, LCWD, NOTE, etc.). If in doubt use ED.
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   113
      specStatus: "ED",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   114
839
afb8592c533f add noRecTracked Respec config
Arnaud Le Hors <lehors@us.ibm.com>
parents: 831
diff changeset
   115
      // This is NOT a Rec Track document
afb8592c533f add noRecTracked Respec config
Arnaud Le Hors <lehors@us.ibm.com>
parents: 831
diff changeset
   116
      noRecTrack: "true",
afb8592c533f add noRecTracked Respec config
Arnaud Le Hors <lehors@us.ibm.com>
parents: 831
diff changeset
   117
806
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   118
      // the specification's short name, as in http://www.w3.org/TR/short-name/
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   119
      shortName: "ldp-primer",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   120
      // TODO: Confirm short name
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   121
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   122
      // if your specification has a subtitle that goes below the main
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   123
      // formal title, define it here
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   124
      // subtitle   :  "an excellent document",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   125
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   126
      // if you wish the publication date to be other than today, set this
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   127
      // publishDate:  "2009-08-06",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   128
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   129
      // if the specification's copyright date is a range of years, specify
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   130
      // the start date here:
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   131
      // copyrightStart: "2005"
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   132
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   133
      // if there is a previously published draft, uncomment this and set its YYYY-MM-DD date
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   134
      // and its maturity status
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   135
      //previousPublishDate:  "2013-03-07",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   136
      //previousMaturity:   "FPWD",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   137
      //previousURI:      "http://www.w3.org/TR/2013/WD-ldp-20130307/",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   138
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   139
      // if there a publicly available Editor's Draft, this is the link
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   140
      edDraftURI: "http://www.w3.org/2012/ldp/hg/ldp-primer/ldp-primer.html",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   141
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   142
      // if this is a LCWD, uncomment and set the end of its review period
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   143
      // lcEnd: "2009-08-05",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   144
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   145
      // if you want to have extra CSS, append them to this list
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   146
      // it is recommended that the respec.css stylesheet be kept
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   147
      //extraCSS:             ["https://dvcs.w3.org/hg/ldpwg/css/respec.css"],
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   148
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   149
      // editors, add as many as you like
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   150
      // only "name" is required
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   151
      editors: [{
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   152
        name: "Nandana Mihindukulasooriya",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   153
        url: "http://mayor2.dia.fi.upm.es/oeg-upm/index.php/en/universitystaff/290-nandana",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   154
        company: "Ontology Engineering Group, Universidad Politécnica de Madrid",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   155
        companyURL: "http://www.oeg-upm.net/"
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   156
      }, {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   157
        name: "Roger Menday",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   158
        url: "#",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   159
        company: "Fujitsu Laboratories of Europe Limited, London",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   160
        companyURL: "#"
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   161
      }, ],
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   162
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   163
      // authors, add as many as you like. 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   164
      // This is optional, uncomment if you have authors as well as editors.
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   165
      // only "name" is required. Same format as editors.
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   166
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   167
      //authors:  [
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   168
      //    { name: "Your Name", url: "http://example.org/",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   169
      //      company: "Your Company", companyURL: "http://example.com/" },
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   170
      //],
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   171
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   172
      // name of the WG
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   173
      wg: "Linked Data Platform Working Group",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   174
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   175
      // URI of the public WG page
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   176
      wgURI: "http://www.w3.org/2012/ldp",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   177
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   178
      // name (without the @w3c.org) of the public mailing to which comments are due
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   179
      wgPublicList: "public-ldp-comments",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   180
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   181
      // URI of the patent status for this WG, for Rec-track documents
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   182
      // !!!! IMPORTANT !!!!
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   183
      // This is important for Rec-track documents, do not copy a patent URI from a random
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   184
      // document unless you know what you're doing. If in doubt ask your friendly neighbourhood
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   185
      // Team Contact.
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   186
      wgPatentURI: "http://www.w3.org/2004/01/pp-impl/55082/status",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   187
      doRDFa: "1.1",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   188
      localBiblio: {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   189
        "LDP-BP": {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   190
          title: "LDP Best Practices and Guidelines",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   191
          href: "http://www.w3.org/2012/ldp/hg/ldp-bp/ldp-bp.html",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   192
          authors: [
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   193
            "Cody Burleson",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   194
            "Miguel Esteban Gutiérrez",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   195
            "Nandana Mihindukulasooriya"
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   196
          ],
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   197
          status: "WD",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   198
          deliveredBy: [
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   199
            "http://www.w3.org/2012/ldp/"
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   200
          ],
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   201
          publisher: "W3C"
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   202
        },
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   203
        "LDP-TESTS": {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   204
          title: "Linked Data Platform 1.0 Test Cases",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   205
          href: "http://www.w3.org/2012/ldp/hg/tests/ldp-testsuite.html",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   206
          authors: [
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   207
            "Raúl García-Castro",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   208
            "Fernando Serena",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   209
            "Steve Speicher"  
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   210
          ],
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   211
          status: "WD",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   212
          deliveredBy: [
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   213
            "http://www.w3.org/2012/ldp/"
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   214
          ],
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   215
          publisher: "W3C"
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   216
        }
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   217
      }
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   218
    };
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   219
     // Replaces HTML characters (brackets and quotes) with legal HTML representations
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   220
     // The following example would include a code example from another file and then 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   221
     // call this function to make the included code renderable in a browser.
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   222
     //
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   223
     // <pre class='example' data-include='include-rdf-type.ttl' data-oninclude='fixCode'></pre>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   224
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   225
    function fixCode(r, content) {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   226
      var result = content;
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   227
      result = result.replace(/</g, "&lt;").replace(/>/g, "&gt;");
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   228
      result = result.replace(/'/g, "&apos;").replace(/"/g, "&quot;");
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   229
      var ss = result.split('---')
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   230
      var s1 = "<div class='turtle' style='font-family: sans-serif;'>Turtle:</div><div class='turtle'><pre>" + ss[0] + "</pre></div>";
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   231
      var s2 = "<div class='jsonld' style='font-family: sans-serif;'>JSON-LD:</div><div class='jsonld'><pre>" + ss[1] + "</pre></div>";
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   232
      return s1 + s2;
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   233
    }
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   234
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   235
    function highlight(r, content) {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   236
      return '<span style="background-color:#ccffcc">' + content + '</span>';
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   237
    }
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   238
  </script>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   239
</head>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   240
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   241
<body onLoad="primerOnLoad()">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   242
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   243
  <section id='abstract'>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   244
    This primer provides an introduction to the Linked Data Platform (LDP), with examples illustrating the principal concepts such as the notion of an LDP resource and the LDP container and how they can be used by Web clients. 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   245
    Two sample scenarios show how an LDP client can interact with a LDP server in the context of a read-write Linked Data application i.e. how to use HTTP for accessing, updating, creating and deleting resources from servers that expose their resources as Linked Data.
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   246
  </section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   247
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   248
  <section id='sotd'>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   249
    <p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   250
      This is the first draft of LDP Primer Note from the <a href="http://www.w3.org/2012/ldp">W3C LDP working group</a>.
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   251
    </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   252
  </section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   253
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   254
  <section id="intro-section">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   255
    <h1 id="intro">Introduction</h1>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   256
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   257
    <p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   258
      The term "Linked Data" [[LINKED-DATA]] refers to an approach to publishing data that puts linking at the heart of the notion of data, and uses the linking technologies provided by the Web to enable the weaving of a global distributed database. 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   259
     By naming real world entities - be they web resources, physical objects such as the Eiffel Tower, or even more abstract things such as relations or concepts - with http(s) URLs, whose meaning can be determined by dereferencing the document at that URL, and by using the relational framework provided by RDF, data can be published and linked in the same way web pages can. 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   260
    The Linked Data Protocol specifies how web applications can, using the HTTP protocol, find resources and follow links, publish new resources, edit and delete existing ones. 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   261
    </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   262
    <p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   263
   The Primer aims to provide introductory examples and guidance in the use of the LDP protocol, in accordance with best practices [[LDP-BP]]. 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   264
  For a systematic description of the protocol the reader should consult the normative LDP reference [[LDP]]. 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   265
  For an overview of the use cases for LDP and the elicited requirements that guided its design, the reader should consult the LDP Use Cases and Requirements [[LDP-UCR]]; for best practices and guidelines, the reader should consult the LDP Best Practices and Guidelines document [[LDP-BP]].
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   266
    </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   267
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   268
    <b id="conventions">Conventions Used in This Document</b>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   269
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   270
    <p>The examples in this guide are given as a serialization of RDF graphs using the Turtle [[turtle]] and JSON-LD [[json-ld]] syntaxes of RDF.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   271
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   272
    <div class="syntaxmenu">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   273
      <p>The buttons below can be used to show or hide the available syntaxes.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   274
      <form>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   275
        <p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   276
          <input id="hide-ts" onclick="display('turtle', 'none'); set_display_by_id('hide-ts', 'none'); set_display_by_id('show-ts', ''); return false;" type="button" value="Hide Turtle Syntax" />
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   277
          <input id="show-ts" onclick="display('turtle', ''); set_display_by_id('hide-ts', ''); set_display_by_id('show-ts', 'none'); return false;" style="display:none" type="button" value="Show Turtle Syntax" />
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   278
          <input id="hide-js" onclick="display('jsonld','none'); set_display_by_id('hide-js', 'none'); set_display_by_id('show-js', ''); return false;" type="button" value="Hide JSON-LD Syntax" />
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   279
          <input id="show-js" onclick="display('jsonld',''); set_display_by_id('hide-js', ''); set_display_by_id('show-js', 'none'); return false;" style="display:none" type="button" value="Show JSON-lD Syntax" />
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   280
        </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   281
      </form>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   282
    </div>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   283
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   284
    <!--p>The JSON-LD examples refer to the following (external) context document:</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   285
    <pre style="word-wrap: break-word; white-space: pre-wrap;"> 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   286
      { 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   287
       "@context":
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   288
       {
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   289
         "rdf":     "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   290
         "rdfs":    "http://www.w3.org/2000/01/rdf-schema#",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   291
         "owl":     "http://www.w3.org/2002/07/owl#",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   292
         "ldp":     "http://www.w3.org/ns/ldp#",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   293
         "xsd":     "http://www.w3.org/2001/XMLSchema#",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   294
         "dcterms": "http://purl.org/dc/terms/",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   295
         "foaf":    "http://xmlns.com/foaf/0.1/",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   296
         "wdrs":    "http://www.w3.org/2007/05/powder-s#",
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   297
         "bt":      "http://example.org/vocab/bugtracker#"
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   298
       }  
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   299
      }
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   300
  </pre-->
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   301
    <p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   302
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   303
    </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   304
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   305
    <h2>LDP concepts in a glance</h2>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   306
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   307
    <p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   308
      A server hosting Linked Data Platform Resources (LDPRs) may manage two kinds of LDPRs: those resources whose state is represented using RDF (called LDP RDF Sources (LDP-RSs)), and those using other formats (called LDP Non-RDF Sources (LDP-NRs)) such as HTML files, images, other binary files, etc. Resoures respond to retrieval operations using HTTP GET. Often a description conveyed in the response document will describe a specific domain entity; Status, Friendship, Product, Order, Bug, etc. On the other hand, it might contain a description of a number of different concepts. The links contained in the descriptions lead to the subsequent discovery and processing of other resources. Affordances offered by the server make discoverable the forward paths in the application. Together the resources, links and associated affordances together specify what might be termed the API. 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   309
    </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   310
	<blockquote>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   311
    <p>Types of LDPRs:
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   312
      <img src="images/resources.png" />
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   313
    </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   314
	</blockquote>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   315
    <p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   316
      The LDP protocol covers read and write interactions with Resources. Writable aspects include creation of new resources (using POST or PUT), updates (using PUT or PATCH), and deletion of resources. Resource creation is an essential feature providing structured creation of resources. Affordances published by the server show that some Resources can be used to create other Resources. This common pattern is often seen in cases where one resource is made up of a number of others, e.g. a Document Store consists of Documents, a Bug Tracker consists of Bug Reports, a Photo Album consists of Photos, the Net Worth of a person consists of Assets and Liabilities. LDP defines creation for a special kind of Resource called a Container (LDPC), which is able to respond to requests to create new resources, in addition to the general mechanisms HTTP defines. During creation the created resource is added to its Container and a containment link between the Container and the new entry is made.
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   317
    </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   318
    <p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   319
      Therefore a LDPC is a specialization of a LDP-RS representing a collection of links to LDPRs or information resources [[WEBARCH]] that responds to client requests for creation, modification, and/or enumeration of its linked members and documents. The simplest container is the Basic Container (LDP-BC). It defines the basic containment described using a generic vocabulary. This can be used in a generic storage service to manage a containment hierarchy of arbitrary resources.
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   320
    </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   321
    <figure id="fig-bc">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   322
      <img src="images/bc.png" alt=".." />
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   323
      <figcaption>Generic document storage using a Basic Container.</figcaption>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   324
    </figure>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   325
    <p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   326
      Such servers do not impose any restriction on LDPRs and generally act as storage systems without any domain specific application logic and vocabularies. The <a href="#docstore">first scenario in this document</a> concerns a document storage system based on Basic Containers.
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   327
    </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   328
    <p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   329
      A Direct Container is a specialisation of a Basic Container. Additional assertions called membership triples which use a domain-specific vocabulary are made by a Direct Container as part of the creation process. The membership triples augment the containment triples maintained by all containers. For example, one aspect of a Product inventory system concerns the how a Direct Container is used for the management of a Product portfolio, where use of existing vocabularly is preferable.  
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   330
    </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   331
    <figure id="fig-dc1">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   332
      <img src="images/dc1.png" alt=".." />
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   333
      <figcaption>Using domain vocabularly with a Direct container.</figcaption>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   334
    </figure>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   335
    <p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   336
      Direct Container membership triples can be about subjects other than the Container resource. An example is a Photo management application where a Photo Container is used for the management of Photos, and where membership triples then express the relationship between a User and a Photo. 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   337
    </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   338
    <figure id="fig-dc_photos">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   339
      <img src="images/dc_photos.png" alt=".." />
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   340
      <figcaption>Membership triples with a non-Container subject.</figcaption>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   341
    </figure>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   342
    <p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   343
      Another common pattern is where different facets of a Resource be managed using multiple Containers. For example, a Bug Report is has an associated list of Comments as well as supportive media resources.
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   344
    </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   345
    <figure id="fig-dc_bugs">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   346
      <img src="images/dc_bugs.png" alt=".." />
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   347
      <figcaption>Managing multiple facets of a Bug with two Direct Containers.</figcaption>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   348
    </figure>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   349
    <p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   350
      One important usage concerns using LDP to expose the data and services of existing applications. These systems impose restrictions on LDPRs since the LDP interactions should consider the constraints of the underlying business logic and data model. The <a href="#bugtracker">bug tracker example</a> presented in the latter part of this primer is an example of an application specific LDP server.
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   351
    </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   352
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   353
    <p class="note">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   354
      Formal definitions of the terms LDPR, LDPC, and other concepts introduced by LDP can be found in the 'Terminology' section of the Linked Data Platform 1.0 specification [[LDP]]
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   355
    </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   356
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   357
    <p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   358
      The following provide a set of examples to show the Linked Data Platform interactions. Note, this is a primer and should not be considered as a canonical example of ideal LDP modeling.
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   359
    </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   360
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   361
  </section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   362
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   363
  <section id="docstore">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   364
    <h1>Online document store example (LDP Basics)</h1>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   365
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   366
    <p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   367
      This section provides a set of examples of using an online document store application. These examples will demonstrate the behaviour of both types of LDPRs and LDP Basic Containers. Registration with the online document store application by a user results in some data storage space (a root Basic Container) where the application's web resources are stored. Using this root Basic Container a user can create new documents and also child containers to further organize her documents stored in this application.
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   368
    </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   369
    <p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   370
      APIs of web applications are commonly documented by listing valid operations which can operate on URLs, where the URLs are described as templates. A description of our exemplary LDP based document store is in the following table. We note with emphasis that it is important for servers to use links as the main mechanism to reveal the location of resources. If it would be necessary to encode such templates into client applications, this would be a strong indicator that the design breaches a number of good design principles. </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   371
    </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   372
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   373
    <table class="simple">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   374
      <thead>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   375
        <th>Path</th>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   376
        <th>Method</th>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   377
        <th>Description</th>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   378
      </thead>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   379
      <tbody>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   380
        <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   381
          <td rowspan="5">/{username}/</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   382
          <td>GET</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   383
          <td>Lists all the documents in the root container.</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   384
        </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   385
        <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   386
          <td>POST</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   387
          <td>Create a new document under the root container.</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   388
        </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   389
        <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   390
          <td>PUT</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   391
          <td>Update the description and/or list of files of the root container.</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   392
        </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   393
        <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   394
          <td>PATCH</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   395
          <td>Update the description and/or list of files of the root container.</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   396
        </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   397
        <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   398
          <td>DELETE</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   399
          <td>Not allowed.</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   400
        </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   401
        <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   402
          <td class="col1" rowspan="5">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   403
            <div class='code'>/{username}/{{document}/}*</div>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   404
          </td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   405
          <td>GET</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   406
          <td>Retrieve the document.</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   407
        </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   408
        <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   409
          <td>POST</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   410
          <td>Discovered from the resource affordances.</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   411
        </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   412
        <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   413
          <td>PUT</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   414
          <td>Update the document.</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   415
        </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   416
        <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   417
          <td>PATCH</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   418
          <td>Partial update to the document if PATCH is supported.</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   419
        </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   420
        <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   421
          <td>DELETE</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   422
          <td>Delete the document.</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   423
        </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   424
        <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   425
          <td rowspan="2">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   426
            <div class='code'>/*/*</div>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   427
          </td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   428
          <td>OPTIONS</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   429
          <td>Discover the allowed operations over a resource</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   430
        </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   431
        <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   432
          <td>HEAD</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   433
          <td>Only retrieve meta-information about a resource</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   434
        </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   435
      </tbody>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   436
    </table>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   437
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   438
    <p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   439
      In this example, we will see how Alice, a user of this system, does read / write management of documents using the LDP protocol. A typical interaction with the system would start with Alice registering as a user. It is likely that registration would be a LDP based interaction, but this aspect is out of scope of this example. A consequence of the registration is allocation of space for the storage of documents, and communication of this URL to the user, e.g. a basic container at http://example.org/alice/. This section describes a typical flow of interactions where Alice firsts reads the root document and discovers its affordances. This is followed by subsequent examples of creation, update and delete, and finishes with how the client is able to create nested structure from the containers.  
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   440
    </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   441
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   442
    <section id="filelookup">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   443
      <h2>Looking up a basic container (GET on an LDP-BC) </h2>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   444
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   445
      <p>First Alice looks up her storage by retrieving the LDP Basic Container assigned to her to hold her documents. Alice's LDP client does this by doing a GET request on the URI, http://example.org/alice/. </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   446
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   447
      <pre title="Request - basic container retrieval" class='example' data-include='examples/getbc.txt' data-oninclude='fixCode'></pre> 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   448
      
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   449
      <p>As her document storage was just created, it is an empty container. </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   450
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   451
      <pre title="Response - basic container retrieval" class='example' data-include='examples/getbc_res.txt' data-oninclude='fixCode'></pre> 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   452
      
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   453
      <p> As shown in the example, in addition to the RDF representation of the Basic Container using the requested media type the server provides an etag of the resource representation and Link headers advertising that the requested resource is indeed an LDP Basic Container and it will support the LDP interaction model. </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   454
      
831
f486e0154209 added 'Accept-Post' and 'Accept-Patch' headers to container retrieval responses
Nandana Mihindukulasooriya <nandana.cse@gmail.com>
parents: 830
diff changeset
   455
		<p> In addition, the response also contains "Allow", "Accept-Post" , "Accept-Patch" headers. The "Allow" header advertises which HTTP operations are supported by this LDP Basic Container resource. In this example, it supports OPTIONS,HEAD,GET,POST,PUT,PATCH HTTP verbs. The "Accept-Post" and "Accept-Patch" headers advertise which are the media types supported by the POST and the PATCH method respectively.</p>      
806
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   456
      
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   457
      <p class="note">The Linked Data Platform 1.0 specification [[LDP]] says that all LDP servers MUST support the Turtle media type for LDP-RS resources and SHOULD support JSON-LD media type.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   458
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   459
    </section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   460
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   461
    <section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   462
      <h2> Discovering the affordances (OPTIONS on an LDP-BC) </h2>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   463
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   464
      <p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   465
		 In the previous example, we saw that Alice can discover what operations are allowed on a resource by doing a GET request on the resource. As an alternative, she can use the OPTIONS operation to learn of the permitted operations on any given resource.
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   466
      </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   467
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   468
      <pre title="Request - retreiving OPTIONS of a basic container" class='example'>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   469
 OPTIONS /alice/ HTTP/1.1
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   470
 Host: example.org      
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   471
      </pre> 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   472
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   473
      <pre title="Response - retreiving OPTIONS of a basic container" class='example'>
876
715fcd4d4710 minor change to HTTP status code
Nandana Mihindukulasooriya <nandana.cse@gmail.com>
parents: 843
diff changeset
   474
HTTP/1.1 204 No Content
806
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   475
Allow: OPTIONS,HEAD,GET,POST,PUT,PATCH
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   476
Accept-Post: text/turtle, application/ld+json, image/bmp, image/jpeg
831
f486e0154209 added 'Accept-Post' and 'Accept-Patch' headers to container retrieval responses
Nandana Mihindukulasooriya <nandana.cse@gmail.com>
parents: 830
diff changeset
   477
Accept-Patch: text/ldpatch
830
1006614214e6 add missing Linked headers to responses
Nandana Mihindukulasooriya <nandana.cse@gmail.com>
parents: 810
diff changeset
   478
Link: &lt;http://www.w3.org/ns/ldp#BasicContainer&gt;; rel=&#39;type&#39;, &lt;http://www.w3.org/ns/ldp#Resource&gt;; rel=&#39;type&#39;     
806
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   479
      </pre> 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   480
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   481
      <p>According to the response, HTTP operations {OPTIONS,HEAD, GET,POST,PUT,PATCH} are allowed on her root container. In addition to the allowed operations, Accept-Post and Accept-Patch provides which media types are supported by the respective operations. The rel="type" Link header advertises that this resource supports LDP protocol and it is an LDP Basic Container.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   482
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   483
      <p>In this case, the response tells Alice's LDP client that this is an LDP-Basic Container and the container allows her to POST things of both RDF types (text/turtle, application/ld+json) and images (image/bmp and image/jpeg).</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   484
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   485
    </section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   486
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   487
    <section>
958
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   488
      <h3 id="meta-structure">Creating Containers and Structural Hierarchy</h3>
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   489
      <p>In order for the client to introduce hierarchy to the management of documents, the document store allows creation of container resources, enabling Alice to create a container hierarchy to organise her documents. This can be done by POSTing (a child) container representation to a (parent) container. For instance, it enables Alice to create a child container which she intends to use for image storage.
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   490
      </p>
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   491
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   492
    <figure id="fig-bcs">
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   493
      <img src="images/bcs.png" alt=".." />
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   494
      <figcaption>Child Containers inside a Basic Container.</figcaption>
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   495
    </figure>
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   496
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   497
      <pre title="State of Alice's document store before creating the photo (child) container" class='example' data-include='examples/create_cr_s1.txt' data-oninclude='fixCode'></pre>  
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   498
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   499
      <p>To create a new container for managing photos, Alice POSTs a representation of a container (LDP-BC) to the root container. Alice express her intention that the newly created resource should be an LDP Basic Container by including a Link header in the request with the relationship "type". </p>
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   500
      <pre title="Request - creating a new container" class='example' data-include='examples/create_cr_req.txt' data-oninclude='fixCode'></pre>  
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   501
      <p>If the POST is successful, the server responds with the location of the newly created container for the photos.</p>
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   502
      <pre title="Response - creating a new container" class="example">
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   503
HTTP/1.1 201 Created
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   504
Location: http://example.org/alice/photos/
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   505
Link: &lt;http://www.w3.org/ns/ldp#Resource&gt;; rel=&quot;type&quot;
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   506
Content-Length: 0  
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   507
        </pre>  
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   508
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   509
      <p>This is how the parent container will look like after creating the new container</p>
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   510
      <pre title="State of Alice's document store after creating the photo (child) container" class='example' data-include='examples/create_cr_s2.txt' data-oninclude='fixCode'></pre> 
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   511
      <p>and the photo container will look like the following.</p>
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   512
      <pre title="State of Alice's newly created photo container" class='example' data-include='examples/create_cr_s3.txt' data-oninclude='fixCode'></pre> 
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   513
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   514
    </section> 
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   515
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   516
    <section>
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   517
      <h2> Creating an RDF resource (POST an RDF resource to an LDP-BC) </h2> 
806
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   518
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   519
      <p>
958
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   520
        Alice can upload a social profile document to her store, by POSTing her FOAF personal profile document to her LDP-BC at the root of her document store. Note, the Slug header offers a hint to the server about the URL of the resource to be created. Alice also indicates that the newly created resource should be an LDP Resource by including a Link header in the request with the relationship "type".
806
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   521
      </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   522
      
958
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   523
      <p> The FOAF document includes statements about the resource to be created and other resources relative to the resource to be created. According the LDP specification, Alice can use an empty relative URI (&lt;&gt;) in the request entity body to refer to resource to be created.
806
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   524
      
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   525
      </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   526
958
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   527
      <pre title="Request - creating an RDF resource" class='example' data-include='examples/bccreate.txt' data-oninclude='fixCode'></pre> 
806
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   528
958
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   529
      <pre title="Response - creating an RDF resource" class="example"> 
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   530
        HTTP/1.1 201 Created
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   531
        Location: http://example.org/alice/foaf
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   532
        Link: &lt;http://www.w3.org/ns/ldp#Resource&gt;; rel="type"
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   533
        Content-Length: 0 
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   534
      </pre>
806
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   535
      <p> The response to the create request provides a Link to the newly created resource using the Location header. In this case, the server has honored the hint provided by the slug header and created the new resource in the URL http://example.org/alice/foaf. </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   536
      <p>Knowing the URL of the newly created resource, Alice can check the container again to confirm that the container correctly contains the newly created resource.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   537
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   538
      <pre title="Request - basic container retrieval after resource created" class="example">
958
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   539
        GET /alice/ HTTP/1.1
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   540
        Host: example.org
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   541
        Accept: text/turtle, application/ld+json
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   542
      </pre>
806
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   543
958
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   544
      <pre title="Response - basic container retrieval after resource created" class='example' data-include='examples/bcget_res.txt' data-oninclude='fixCode'/>
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   545
      <p>
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   546
        The ldp:contains containment triple discloses the newly created resource in the response. 
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   547
      </p>
806
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   548
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   549
    </section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   550
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   551
    <section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   552
      <h2> Creating a non-RDF (binary) resource (POST an image to an LDP-BC) </h2> 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   553
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   554
      <p>Next, Alice wants to upload a photo of herself to the document storage. She can create an image by POSTing it in the same way she created the RDF document.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   555
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   556
      <pre title="Request - creating a non-RDF resource" class="example"> 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   557
POST /alice/ HTTP/1.1
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   558
Host: example.org
958
2f25528e103a Added Link headers to examples. Moved LDPC creation before LDPR
Andrei Sambra <andrei@w3.org>
parents: 876
diff changeset
   559
Link: &lt;http://www.w3.org/ns/ldp#Resource&gt;; rel="type"
806
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   560
Slug: avatar
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   561
Content-Type: image/png
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   562
Content- Length: 1020
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   563
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   564
### binary data ###
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   565
   </pre> 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   566
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   567
      <pre title="Response - creating a non-RDF resource" class="example"> 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   568
HTTP/1.1 201 Created
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   569
Location: http://example.org/alice/avatar
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   570
Link: &lt;http://www.w3.org/ns/ldp#Resource&gt;; rel=&quot;type&quot;
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   571
Link: &lt;http://example.org/alice/avatar/meta&gt;; rel=&quot;describedby&quot;
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   572
Content-Length: 0   
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   573
   </pre> 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   574
   
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   575
      <p> </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   576
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   577
      <p>The outcome of creating a non-RDF is similar to creating a RDF resource. If successful, the server will return a 201 success code with a Location header that points to the created resource. Furthermore, in the case of binary resources the server may create an additional file to maintain the metadata about the binary file. In the above example, the server creates a new LDP-RS to maintain metadata about the binary resource such as creation date, owner, etc. and this metadata resource is advertised using a Link header with the relation "describedby". </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   578
      
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   579
      <p> Similar to creating a RDF resource (LDP-RS), a containment triple will be added to the container when a non-RDF (LDP-NR) is created. Thus, the representation of the LDP container after creating the image looks like the following. </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   580
      <pre title="Container representation after the non-RDF resource creation" class='example' data-include='examples/bc_after_bin.txt' data-oninclude='fixCode'></pre> 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   581
    </section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   582
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   583
    <section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   584
      <h2> Update a RDF LDP resource (PUT on an LDP-RS) </h2> 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   585
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   586
      <p>After creating the image as shown in the previous example, Alice now wants to update her FOAF profile with a link to the image. After retrieving her FOAF profile using a HTTP GET operation, she uses HTTP PUT to update the document by amending the RDF with a link to her photo.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   587
      <p> In this example, Alice's LDP client sends the E-tag of the resource representation that it retrieved previously to prevent any lost update problems. </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   588
      <pre title="Request - updating a RDF resource" class="example" data-include='examples/foafupdate.txt' data-oninclude='fixCode'></pre> 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   589
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   590
      <pre title="Response - updating a RDF resource" class="example"> 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   591
HTTP/1.1 204 No Content 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   592
Link: &lt;http://www.w3.org/ns/ldp#Resource&gt;; rel=&quot;type&quot; 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   593
      </pre>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   594
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   595
      <p>If the operation is successful as shown above, the document will be updated with new information.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   596
      
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   597
      <p class="note"> Alice can also use the PATCH operation to update the resource.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   598
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   599
    </section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   600
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   601
    <section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   602
      <h2> Deleting a resource (DELETE on an LDPR) </h2> 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   603
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   604
      <p>If Alice decides to delete the image, she can do that with a delete operation.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   605
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   606
      <pre title="Request - deleting a RDF resource" class="example"> 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   607
DELETE /alice/avatar HTTP/1.1
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   608
Host: example.org       
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   609
   </pre> 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   610
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   611
      <pre title="Response - deleting a RDF resource" class="example"> 
830
1006614214e6 add missing Linked headers to responses
Nandana Mihindukulasooriya <nandana.cse@gmail.com>
parents: 810
diff changeset
   612
HTTP/1.1 204 No Content
1006614214e6 add missing Linked headers to responses
Nandana Mihindukulasooriya <nandana.cse@gmail.com>
parents: 810
diff changeset
   613
Link: &lt;http://www.w3.org/ns/ldp#Resource&gt;; rel=&quot;type&quot;
806
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   614
   </pre>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   615
   
810
b2179c3120c4 Minor grammar fix
Steve Speicher <sspeiche@gmail.com>
parents: 806
diff changeset
   616
     <p> As well as deleting the resource, the server removes the containment triple from the container. For example, a subsequent GET request on the container will return a graph isomorphic to the one shown in the following representation:</p>
806
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   617
     
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   618
     <pre title="Container representation after resource deletion" class="example" data-include='examples/bc_after_del.txt' data-oninclude='fixCode'></pre> 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   619
     
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   620
     <p> For any subsequent request on the deleted resource, the server will respond with the appropriate HTTP response code. </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   621
      <pre title="Request - after deletion" class="example">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   622
    GET /alice/avatar HTTP/1.1
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   623
    Host: example.org
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   624
    Accept: image/png
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   625
     </pre>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   626
     
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   627
      <pre title="Response - after deletion" class="example"> 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   628
HTTP/1.1 410 Gone 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   629
   </pre>     
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   630
    </section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   631
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   632
  </section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   633
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   634
  <section id="bugtracker">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   635
    <h1>Bug Tracker Example (LDP Direct containers)</h1>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   636
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   637
    <p>The previous section provided practical examples of basic LDP interactions using LDP Basic Containers. One of the limitations of LDP Basic Containers is that a fixed LDP vocabulary is used to assert the relations between a container and its contained resources. However, some scenarios require domain specific vocabulary to be used to list the members of a container. For example, an application which already used Linked Data and its own vocabulary may like to continue using the same vocabulary when migrating to LDP protocol. LDP Direct containers introduce the concept of membership triples allowing the flexibility to define the form of the membership. One of these flexibility points is the ability to select the predicate of the membership triple which can be from a domain-specific vocabulary. This is done using the ldp:hasMemberRelation or ldp:isMemberOfRelation predicate of the Direct Containers.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   638
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   639
    <p>In addition, in some scenarios it is necessary to add relationships between the newly created resource and some other resource (which is not necessarily the container or another document / information resource). This allows to define relationship between any other information resource or non-information resource (real world thing) by defining the membership constant subject or the object URI of the membership triples using ldp:membershipResource predicate of the Direct Container. The usage of the ldp:hasMemberRelation predicate as well as the ldp:membershipResource will be explained in the following examples. </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   640
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   641
    <p class="note">For more information on information resources (documents) vs real world entities (things) separation please refer to <a href="http://www.w3.org/TR/webarch/#id-resources">Web Arch (Section 2.2. URI/Resource Relationships) </a>, , <a href="http://www.w3.org/TR/cooluris/#semweb">Cool URIs (Section 3. URIs for Real-World Objects)</a>, <a href="http://www.w3.org/TR/urls-in-data/#landing-pages">URLs in Data (Section 3. Landing Pages and Records)</a>.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   642
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   643
    <p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   644
      The examples in this section will revolve around a very simple Bug Tracker application. Bug Tracker application records the bugs of several products allowing reporting, updating and deleting bugs and products. In contrast to the online document store example, the bug tracker wants to use an existing domain vocabulary, e.g. has_bug, to express membership relationships in the containers. LDP provides the additional interaction capability in the protocol to add the domain specific triples based on the properties defined in the LDP Direct Container.
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   645
    </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   646
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   647
    <p>A RESTful API for a simple Bug Tracker system might be described as follows.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   648
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   649
    <table class="simple">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   650
      <thead>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   651
        <th>Path</th>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   652
        <th>Method</th>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   653
        <th>Description</th>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   654
      </thead>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   655
      <tbody>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   656
        <!--tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   657
        <td rowspan="5">/tracker/</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   658
        <td>GET</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   659
        <td>Lists all the product descriptions.</td>    
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   660
      </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   661
      <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   662
        <td>POST</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   663
        <td>Create a new product description.</td>    
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   664
      </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   665
      <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   666
        <td>PUT</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   667
        <td>Update the app description and/or list of product descriptions</td>   
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   668
      </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   669
      <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   670
        <td>PATCH</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   671
        <td>Update the app description and/or list of product descriptions</td>   
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   672
      </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   673
      <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   674
        <td>DELETE</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   675
        <td>Not allowed.</td>   
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   676
      </tr-->
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   677
        <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   678
          <td class="col1" rowspan="5">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   679
            <div class='code'>/tracker/{product-id}/</div>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   680
          </td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   681
          <td>GET</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   682
          <td>Lists the product description and bug reports associated with a product.</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   683
        </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   684
        <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   685
          <td>POST</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   686
          <td>Create a new bug report associated with a product.</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   687
        </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   688
        <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   689
          <td>PUT</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   690
          <td>Update the project description.</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   691
        </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   692
        <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   693
          <td>PATCH</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   694
          <td>Not supported.</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   695
        </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   696
        <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   697
          <td>DELETE</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   698
          <td>Delete the project description and associated bug reports.</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   699
        </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   700
        <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   701
          <td rowspan="5">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   702
            <div class='code'>/tracker/{product-id}/{bug-id}</div>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   703
          </td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   704
          <td>GET</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   705
          <td>Gets the bug report.</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   706
        </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   707
        <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   708
          <td>POST</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   709
          <td>Not supported.</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   710
        </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   711
        <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   712
          <td>PUT</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   713
          <td>Update the bug report.</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   714
        </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   715
        <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   716
          <td>PATCH</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   717
          <td>Not supported.</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   718
        </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   719
        <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   720
          <td>DELETE</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   721
          <td>Delete the bug report.</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   722
        </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   723
        <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   724
          <td rowspan="2">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   725
            <div class='code'>/tracker/*/*</div>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   726
          </td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   727
          <td>OPTIONS</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   728
          <td>Discover the allowed operations over a resource</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   729
        </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   730
        <tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   731
          <td>HEAD</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   732
          <td>Only retrieve meta information about a resource</td>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   733
        </tr>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   734
      </tbody>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   735
    </table>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   736
    
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   737
    <p> In the examples in this section, we will only focus on the container representation, creation and deletion of resources because that is where the Basic Containers, Direct Containers, and Indirect Containers differ. Other operations such as updating a resource would be similar to what was illustrated in the previous example.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   738
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   739
    <section id="navandret">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   740
      <h2>Navigation and Retrieval (GET on an LDP-DC)</h2>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   741
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   742
      <p>One of the main use cases of the example bug tracker is to list a given product's bugs. Assuming that a user got a URL of a product by out of band means, she can look it up to get more information including the bugs associated with it. To get the description of the product, a user (or her LDP client) can do a GET request on the URI of the known product resource. LDPR servers must provide text/turtle representations of the requested LDPRs and may provide other RDF format representations such as JSON-LD or RDF/XML using standard HTTP content negotiation.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   743
      <pre class="example" title="Request - Product Lookup" data-include='examples/product_lookup_req.txt' data-oninclude='fixCode'></pre>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   744
      <p>If the product resource is available, the server responds with the RDF representation of the Direct Container that corresponds to the given product using the requested media type,
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   745
        <code>text/turtle</code> or <code>application/ld+json</code> in this case.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   746
      <pre title="Response - Product Lookup" class='example' data-include='examples/product_lookup_resp.txt' data-oninclude='fixCode'></pre>  
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   747
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   748
      <p>The representation of the product contains both information about the product such as the title and the bugs associated with the product and information about the product description such as the title of the product description and other properties of the LDP Container. </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   749
      
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   750
      <p>As you can see from the Link Header that is returned and the RDF representation of the container, this example uses an LDP Direct Container. LDP-DCs contain both containment triples and membership triples and  provide the flexibility to the applications to use domain specific vocabulary in the membership triples. For example, in the above example the LDP-DC manages the member relationship, (&lt;?productURI&gt;, bt:hasBug, &lt;?bugURI&gt;), using the application-specific vocabulary term, bt:hasBug. This is done by defining the ldp:hasMemberRelation predicate of the Direct Container to bt:hasBug (&lt;?directContainerURI&gt;, ldp:hasMemberRelation, bt:hasbug). </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   751
      
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   752
    <p class="note"> The Direct Container shown in the above example has the membership triple pattern ( membership-constant-URI , membership-predicate , member-derived-URI ) using ldp:hasMemberRelation where the constant membership resource is in the subject of the triple and the newly created resources will be added as the object of the triple. It is also possible for the Direct Container to have the membership triple pattern ( member-derived-URI , membership-predicate , membership-constant-URI ) using ldp:isMemberOfRelation predicate where the constant member resource will be the object of the triple and the newly created resource will be added as the subject of the triple. </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   753
      
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   754
      <p> In addition, in this example the bugs are associated with the product resource (a non-information resource with a # URI) and not with the product description Direct Container itself. This is done by defining the ldp:membershipResource predicate of the LDP Direct Container as the product non-information resource URI (&lt;?directContainerURI&gt;, ldp:membershipResource, &lt;/tracker/product1/#it&gt;). By doing so one can define the subject of the membership triple any resource of interest.
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   755
      </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   756
            
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   757
      <p>The next example illustrates the behaviour of LDP Direct containers when new resources are created and how aforementioned predicates of the Direct Containers affect the interaction model of LDP.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   758
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   759
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   760
      <!-- <p>Looking up a bug is similar to looking up a product. Based on links in the representation of the Product, the client uses GET to navigate to a known Bug resource.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   761
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   762
        <pre class="example" title="Bug lookup request" 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   763
          data-include='bug_look_up_req.txt' data-oninclude='fixCode'></pre>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   764
        <p>The server responds with the representation of the bug.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   765
                                <pre title="Bug lookup response"
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   766
          class='example' data-include='bug_look_up_resp.txt'
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   767
          data-oninclude='fixCode'></pre -->
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   768
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   769
    </section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   770
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   771
    <section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   772
      <h3 id="BugCreate">Creation (POST a resource to an LDP-DC)</h3>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   773
      <p>Continuing from the previous example, we can report a Bug against the "LDP Demo" product by creating a Bug report (an LDPR representing the bug) under the "LDP Demo" product description LDPC by posting a RDF representation of the Bug report to the LDPC associated with the product description.  </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   774
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   775
      <p> The bug report document includes statements about the resource to be created. According the LDP specification, a client can use null relative URI (<>) in the request entity body to refer to resource to be created.
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   776
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   777
      <pre title="A request for creating a bug" class='example' data-include='examples/bug_create_req.txt' data-oninclude='fixCode'></pre> 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   778
      <p>If the creation is successful, the server responds with location of the newly created resource.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   779
      <pre title="A response of creating new a bug" class='example' data-oninclude='fixCode'>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   780
HTTP/1.1 201 Created
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   781
Location: http://example.org/tracker/ldp-demo/bug67
830
1006614214e6 add missing Linked headers to responses
Nandana Mihindukulasooriya <nandana.cse@gmail.com>
parents: 810
diff changeset
   782
Link: &lt;http://www.w3.org/ns/ldp#Resource&gt;; rel=&quot;type&quot;
806
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   783
Content-Length: 0           
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   784
      </pre>  
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   785
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   786
      <p>If the creation fails, the server will respond with an appropriate status code depending on the error. If successful, the LDP Demo product description LDPC will have the following representation after the creation of new resource.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   787
      <pre title="The state of the product LDPC after the bug creation" class='example' data-include='examples/bug_create_s1.txt' data-oninclude='fixCode'></pre>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   788
      <p> As you can see two new triples are added to the container. That is (&lt;/tracker/ldp-demo/&gt;, &lt;ldp:contains&gt;, &lt;/tracker/ldp-demo/bug67&gt;) and 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   789
       (&lt;/tracker/ldp-demo/#it&gt;, &lt;bt:hasbug&gt;, &lt;/tracker/ldp-demo/bug67&gt;). The former is added in any type of container and the latter is defined by the direct 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   790
       container properties. </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   791
      <p>The created Bug resource will have the following representation. Note that server has added a server managed property, creation date (dcterms:created), and a default value for the state (bt:isInState) to the Bug in addition to what was POSTed.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   792
      <pre title="The state of the bug LDPR" class='example' data-include='examples/bug_create_s2.txt' data-oninclude='fixCode'></pre> 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   793
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   794
    </section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   795
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   796
    <section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   797
      <h3 id="BugDelete">Deletion (DELETE on an LDPR associated with an LDP-DC)</h3>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   798
      
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   799
     This example illustrates the behaviour of a Direct Container when a resource is deleted.
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   800
      
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   801
      <pre class="example">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   802
 DELETE /tracker/ldp-demo/bug3 HTTP/1.1 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   803
 Host: example.org
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   804
 If-Match: W/"123454322"
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   805
        </pre>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   806
      <p>If the  delete is successful, the server will respond with a success status code.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   807
      <pre class="example">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   808
 HTTP/1.1 204 No Content
830
1006614214e6 add missing Linked headers to responses
Nandana Mihindukulasooriya <nandana.cse@gmail.com>
parents: 810
diff changeset
   809
 Link: &lt;http://www.w3.org/ns/ldp#Resource&gt;; rel=&quot;type&quot; 
806
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   810
        </pre>  
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   811
        
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   812
       <p> After the deletion, the representation of the container will look like the following</p> 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   813
       
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   814
       <pre title="The state of the product LDPC after the bug deletion" class='example' data-include='examples/bug_delete_s1.txt' data-oninclude='fixCode'></pre>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   815
       
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   816
       <p> As seen from the LDP Direct Container representation above, both the containment triple (&lt;/tracker/ldp-demo/&gt;, ldp:contains, &lt;/tracker/ldp-demo/bug3&gt;) and the membership triple (&lt;/tracker/ldp-demo/#it&gt;, bt:hasBug, &lt;/tracker/ldp-demo/bug3&gt;) were removed from the container representation. </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   817
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   818
    </section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   819
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   820
  </section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   821
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   822
  <section id="bugtrackerextd">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   823
    <h1>Extended Bug Tracker Example (LDP Indirect containers)</h1>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   824
    
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   825
    <p> In this next example, we will use the same scenario as in the previous example, but change the container type to a LDP Indirect Container to show the differences between LDP Direct Containers and Indirect Containers and when to use LDP Indirect Containers. Though LDP Direct Containers provide the flexibility to define the constant membership URI (the subject of the membership triple when using ldp:hasMemberRelation or the object of the membership triple when using ldp:isMemberOfRelation) and the membership predicate, when creating members the member derived URI is always the newly created document URL. LDP Indirect containers provide more flexibility by allowing the member derived URI to be any resource; it could be either a non-information resource or a document other than the newly created resource. This done by defining the predicate to look for in the representation of the resource to be created by setting the ldp:insertedContentRelation predicate of the LDP Indirect Container. How this done will be explained in the following examples. </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   826
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   827
    <section id="navandretext">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   828
      <h2>Navigation and Retrieval (GET on an LDP-IC) </h2>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   829
      
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   830
      <p> Similar to the previous LDP-DC example, first we will retrieve the representation of the LDP Indirect Container.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   831
      
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   832
      <pre class="example" title="Product lookup request" data-include='examples/product_lookup_req.txt' data-oninclude='fixCode'></pre>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   833
      <p> As a response to the GET request, the server responds with the representation of the product description container.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   834
      <pre title="HTTP response for product lookup" class='example' data-include='examples/ic_product_lookup_resp.txt' data-oninclude='fixCode'></pre>  
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   835
      
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   836
    <p> Now the product container is a LDP Indirect container, which has one main difference: the container has an additional predicate called "ldp:insertedContentRelation". Further, the objects of the containment triples and the membership triples are not the same. While the object of the containment triple is the same (e.g. &lt;/tracker/ldp-demo/bug3&gt;, an information resource) the object of the membership triple is now  (e.g. &lt;/tracker/ldp-demo/bug3#it&gt;, a non-information resource or real world thing). This distinction is because of the ldp:insertedContentRelation definition. How this works will be explained in <a href="#creationext">the next example</a> on creating a new resource.  </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   837
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   838
    </section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   839
    <!-- end navandretext -->
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   840
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   841
    <section id="creationext">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   842
      <h3 id="IndirectCreate">Creation (POST a resource to an LDP-IC) </h3>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   843
      
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   844
      <p>Continuing from the previous example, we can create a new Bug Report against the 'LDP demo' product by creating a Bug Report LDPR under the 'LDP Demo' product description LDPC.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   845
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   846
      <p>The client POSTs a representation of a Bug Report to the Bug Tracker LDPC.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   847
      <pre title="A request for creating a bug" class='example' data-include='examples/ic_bug_create_req.txt' data-oninclude='fixCode'></pre> 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   848
      <p> One thing to note is that the representation of the resource to be created contains a triple (&lt; &gt;, foaf:primaryTopic , &lt;#it&gt;). If the create request is successful, the server responds with location of the newly created resource.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   849
      <pre title="A response of creating new a bug" class='example' data-oninclude='fixCode'>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   850
HTTP/1.1 201 Created
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   851
Location: http://example.org/tracker/ldp-demo/bug67
831
f486e0154209 added 'Accept-Post' and 'Accept-Patch' headers to container retrieval responses
Nandana Mihindukulasooriya <nandana.cse@gmail.com>
parents: 830
diff changeset
   852
Link: &lt;http://www.w3.org/ns/ldp#Resource&gt;; rel=&quot;type&quot;
806
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   853
Content-Length: 0           
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   854
      </pre>        
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   855
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   856
      <p>If the creation fails, the server will respond with an appropriate status code depending on the error. After the resource is creation, the Product A LDPC will have the following representation.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   857
      <pre title="The state of the product LDPC after the bug creation" class='example' data-include='examples/ic_bug_create_s1.txt' data-oninclude='fixCode'></pre>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   858
      <p> As you can see, two new triples are added to the container. That is (&lt;/tracker/ldp-demo/&gt;, &lt;ldp:contains&gt;, &lt;/tracker/ldp-demo/bug67&gt;) and 
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   859
       (&lt;/tracker/ldp-demo/#it&gt;, &lt;bt:hasbug&gt;, &lt;/tracker/ldp-demo/bug67#it&gt;). </p>      
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   860
      
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   861
    </section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   862
    <!-- end creationext -->
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   863
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   864
  </section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   865
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   866
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   867
  <section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   868
    <h1>Security</h1>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   869
    <p>It is not the focus of the Linked Data Platform WG to provide security mechanisms for read/write Linked Data applications; since LDP builds on HTTP, it can re-use any mechanism defined for HTTP. Though most of the security mechanisms that are applicable to general web applications are equally applicable to Linked Data applications, there is still some space to build security mechanisms specific to Linked Data applications by leveraging the Linked Data technologies and providing concrete security requirements for Linked Data applications. In this context, LDP WG has started to create a WG note on Access Control which aims to produce use cases for security scenarios of LDP applications that can be used as the input to a later initiative that will be focused on developing standard security mechanisms for LDP applications.</p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   870
    <!-- TODO: link to Access Control Note -->
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   871
  </section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   872
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   873
  <section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   874
    <h1 id="ldpc">LDP Implementations</h1>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   875
    A list of implementations that plan to be LDP compliant is available in the LDP Implementations <a href="https://www.w3.org/wiki/LDP_Implementations">wiki page</a>. The <a href="http://www.w3.org/2012/ldp/hg/tests/reports/ldp.html">Linked Data Platform 1.0 - Implementation Reports</a> provide the coverage of the specification by each LDP implementation.
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   876
  </section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   877
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   878
  <section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   879
    <h1 id="next">What To Read Next</h1>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   880
    The primer only provide an overview of the Linked Data Platform specifications. LDP WG has produced following documents that contribute to the Linked Data Platform specification.
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   881
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   882
    <ul>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   883
      <li><a href="https://dvcs.w3.org/hg/ldpwg/raw-file/default/TR/ldp-ucr.html">Linked Data Platform Use Cases and Requirements</a> [[LDP-UCR]]</li>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   884
      <li><a href="https://dvcs.w3.org/hg/ldpwg/raw-file/default/ldp.html">Linked Data Platform 1.0 specifcation</a> [[LDP]]</li>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   885
      <li><a href="https://dvcs.w3.org/hg/ldpwg/raw-file/default/ldp-bp/ldp-bp.html">LDP Best Practices and Guidelines</a> [[LDP-BP]]</li>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   886
      <li><a href="https://dvcs.w3.org/hg/ldpwg/raw-file/default/Test%20Cases/LDP%20Test%20Cases.html">Linked Data Platform 1.0 Test Cases</a>[[LDP-TESTS]]</li>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   887
    </ul>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   888
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   889
  </section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   890
  
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   891
  	<section class='appendix'>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   892
		<h2>Acknowledgements</h2>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   893
		<p>Many thanks to John Arwe (IBM), Ashok Malhotra (Oracle), and Henry Story (Apache Software Foundation) for their thorough review on the LDP Primer document and proposed corrections. We also like to thank all members of the Linked Data Platform WG for the valuable feedback. </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   894
	</section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   895
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   896
  <section class='appendix informative' id="history">
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   897
    <h1>Change History</h1>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   898
    <p>The change history is up to the editors to insert a brief summary of changes, ordered by most recent changes first and with heading from which public draft it has been changed from.
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   899
    </p>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   900
    <ul>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   901
      <li>2014-06-16 - Addressing the comments and feedback provided by Ashok, John, and Henry.</li>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   902
      <li>2013-08-05 - Providing JSON-LD representations of the examples.</li>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   903
      <li>2013-07-03 - Moving the content from the wiki to the note.</li>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   904
    </ul>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   905
  </section>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   906
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   907
</body>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   908
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   909
</html>
ff1138b2c53e primer typo fix
Steve Speicher <sspeiche@gmail.com>
parents:
diff changeset
   910