dokieli logodokieli

dokieli documentation

More details about this document
Identifier
https://dokie.li/docs
Published
Modified
License
CC BY 4.0
Feedback
GitHub dokieli/dokieli (pull requests, new issue, open issues)
Language
English
Document Type
Article

Abstract

This documentation is intended to help brave developers and authors. It explains dokieli's principles, architectural and design patterns.

Principles

Towards improving the write dimension of the read-write Web, dokieli's design subscribes to the following principles: freedom of expression, interoperability, decentralisation, evolvability, universal access, separation of concerns, █ + █ > = █ █.

Structure and Semantics

This section describes dokieli's practices, and offers some guidelines for developers and authors that would like to maintain uniformity in what they create. Consumers of dokieli should not treat the information here as a profile, or as a yet another super or subset of HTML+RDFa when they author or build new functionality. Creating articles, annotations, and notifications in dokieli is intended to be done through its UI, where it takes care of majority of the semantic content generation. The information here however can be useful for authors that would like to combine hand coding with the functionality that dokieli's UI provides. Takeaway what you find useful, there is no proprietary lock-in here.

dokieli adopts progressive enhancement strategy for the structural, presentational, and behavioural layers to allow content and base functionality to be accessible through different media and devices. The content in HTML+RDFa that dokieli produces is accessible (readable) without requiring any CSS or JavaScript, ie. text-browser safe. Breaking this "rule" in future development should be considered an anti-pattern (or a bug) in dokieli.

dokieli can serialise articles, annotations, and notifications in HTML+RDFa, Turtle, and JSON-LD, depending on server content-negotiation. Articles are represented in HTML+RDFa so that information is usable by both humans and machine consumers while maintaining lowest requirements for publishing, eg. a single URL with full payload in HTML+RDFa can be accessible from any HTTP server. No additional requirements necessary from clients (eg. JavaScript support and enabled) or servers (eg. additional RDF based content-negotiation). For annotations and notifications, dokieli first meets interoperability requirements (for protocols and vocabularies), and remains flexible about the serialisation that servers prefer. Similarly for consuming content, it can work with any of the serialisations as mentioned.

dokieli takes the approach of having all human-visible content in HTML, and all structured statements be made in context of their content in RDFa. This is optimal in avoiding data duplication in the same document which happens to be the case with the other serialisations in RDF. The approach also helps to avoid the creation and usage of multiple data islands, ie. separately for humans and machines. It is efficient in that it has no dependency on JavaScript in order to make the hidden machine-readable content be consumable from a human user interface. One exception to this rule is allowing authors to use the Embed Data feature to include Turtle, JSON-LD, or TriG data blocks for alternative reasons.

dokieli documents

Is there such thing as a "dokieli" document? Must there be?

Article
An article may contain RDF classes like schema:CreativeWork sioc:Post prov:Entity schema:Article, otherwise, there is no unique data that would indicate that it is a "dokieli" document. If the HTML+RDFa representation includes dokieli.js and the DOM is ready, the DO: Object { C: {…}, U: {…} } will be available.
Annotation
An annotation has the oa:Annotation class. It is possible to know that the article was rendered by dokieli: ?s oa:renderedVia <https://dokie.li/>, and we can assume that the annotation was created by it as well. This is not strictly true since that property could have been put there by something else. Annotations represented in HTML+RDFa do not include dokieli.js.
Notification
A notification may have one of the following classes: as:Announce, as:Like, as:Dislike, as:Relationship. Notifications represented in HTML+RDFa do not include dokieli.js.

HTML patterns

One of the goals of dokieli is not to impose arbitrary restrictions on type of nodes as well as the order they should be in HTML+RDFa. It has its own design patterns. It is an ongoing work to make dokieli as flexible as it can be on what it can consume. Ultimately, well-formed and valid HTML - along with accompanying RDFa, Turtle, JSON-LD, TriG etc - is the only requirement here. Take what you like:

Markup syntax
HTML5 Polyglot Markup is used to ensure that when content is processed or served as HTML or XHTML (text/html, application/xhtml+xml), they can generally be used in both HTML and XML ecosystems without further intervention. See also getDocument (dokieli.js) for details on DOM normalisation.
Identifiers
Unique identifiers (@id) may be placed on any element. Identifiers are auto-generated by normalising some input eg. sections use their heading's text content as input, tables from caption. Anything of importance should have an identifier, and aimed to be included for common patterns out of the box. @id values are reused in RDFa. See also generateAttributeId (dokieli.js) and its application in different places.
Outline
  • title is used.
  • main > article (querySelector) is considered to be the location of the primary content.
  • h1 is typically the first element node after main > article
  • There is a resource type, eg. schema:Article that can be found in main > article which is about the article. body may contain broad classes.
Section
Sectioning is declared with section and typically have a heading, eg. h2 as its first child. Subsections may appear as a child of parent section, or as a child of div (which is a child of parent section), ie. section section or section div section. The headings of subsections are enumerated eg. section h2 would have a subsection with section h3. Sections ids and heading text are used to dynamically build the table of contents.
<section>
  <h2>
  <div>
    <section>
      <h3>
      <div>
      <div>
      <aside>
<section>
  <h2>
  <section>
    <h3>
h2 and h3 are used for section titles, div as a typical wrapper (eg. for descriptions), as well as to contain further sub-sectioned content.
Aside
asides can technically appear anywhere, but tend to appear as the last element node in section, eg. for related content, footnotes. If the aside is introduced to the DOM via JavaScript for like annotations, they have a similar structure to section.
Division
divs within section are used to wrap a block of arbitrary markup and content. See also RDFa below.
Figure
figures typically have figcaptions for things like audio, canvas, iframe, img, object, pre, video, math. For code scripts, figure class="listing" is used, and pre for the code itself with code The listing class is intended to have a collection of figures, which could also have a unique presentation, for example with line numbers or have its caption be prefixed with Listing and counter.
<section>
  <h2>
  <div>
    <section>
Snippet of section source code
Comparison of systems
d1 d2 d3 m1
Foomon1
Barkey2
Baz!@#3
Table columns list the dimensions: d1, d2, d3, and the measure: m1.
Math
For mathematical equations figure class="equation" can be used to hint at an equation display. MathML base equation with <math xmlns="http://www.w3.org/1998/Math/MathML"> root can be included here (see also source). Alternatively, if MathJax JavaScript is available in the document, (La)TeX, eg. \lim_{x \to \infty} \exp(-x) = 0 and ASCIIMath, eg. sum_(i=1)^n i^3=((n(n+1))/2)^2, syntaxes can be input within the authoring mode (via Edit).
lim n x = 0
Embedding Turtle, JSON-LD, and TriG
Turtle, JSON-LD, and TriG syntaxes are placed within respective script blocks in head eg. <script id="meta-json-ld" type="application/ld+json" title="JSON-LD"></script>. Data is enclosed in CDATA sections. This pattern is detected, visible and editable from Embed Data in dokieli menu. See also showEmbedData (dokieli.js).
CSS
Multiple stylesheets can be included with @media, and when accompanied with @title, some user-agents can provide options for the user to switch between them, as well as from the dokieli menu, eg.
<!-- Primary stylesheet -->
<link href="media/css/basic.css" media="all" rel="stylesheet" title="Basic" />
<!-- Alternate stylesheet -->
<link href="media/css/acm.css" media="all" rel="stylesheet alternate" title="ACM" />
<!-- Applied by default-->
<link href="https://dokie.li/media/css/dokieli.css" media="all" rel="stylesheet" />
See also showViews (dokieli.js).
RDFa
dokieli can consume and produce RDFa Core 1.1 syntax.
To preserve the order of content, @inlist is used eg. <section inlist="", <dd id="Sarven-Capadisli" inlist="" rel="bibo:authorList" resource="http://csarven.ca/#i">.
A sections @id value is used as part of section's @resource as a fragment, eg. <section id="introduction" rel="schema:hasPart" resource="#introduction">. This allows the same identifier to be used for humans and machines, the value is derived from normalising its heading value as mentioned earlier.
Relating parts is done with rel="schema:hasPart", eg. sections with subsection:
<section id="structure-and-semantics" inlist="" rel="schema:hasPart" resource="#structure-and-semantics">
  <section id="html-patterns" inlist="" rel="schema:hasPart" resource="#html-patterns">
divs are used to hold a block of HTML markup and types of content together eg. <div datatype="rdf:HTML" property="schema:description" resource="#introduction" typeof="deo:Introduction"> makes it possible to declare that it contains HTML markup, and describes an introductory text.
Some of the prefixes (@prefix) on the body element are defined in the RDFa Core Initial Context. These prefixes are defined in dokieli for the purpose of being compact, robust, and to minimise potential errors for consumers.

Note

There is a work in progress to have a distribution version of dokeli, requiring only dokieli.css and dokieli.js in templates.

Servers should use UTF-8 character encoding in their HTTP responses to articles, annotations, and notifications. <meta charset="utf-8" /> is used in HTML.

Article

See also createNoteDataHTML (dokieli.js)

<!DOCTYPE html>
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta charset="utf-8" />
    <title></title>
    <meta content="width=device-width, initial-scale=1" name="viewport" />
    <link href="https://dokie.li/media/css/basic.css" media="all" rel="stylesheet" title="Basic" />
    <link href="https://dokie.li/media/css/dokieli.css" media="all" rel="stylesheet" />
    <script src="https://dokie.li/scripts/dokieli.js"></script>
  </head>

  <body about="" prefix="rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# rdfs: http://www.w3.org/2000/01/rdf-schema# owl: http://www.w3.org/2002/07/owl# xsd: http://www.w3.org/2001/XMLSchema# dcterms: http://purl.org/dc/terms/ dctypes: http://purl.org/dc/dcmitype/ foaf: http://xmlns.com/foaf/0.1/ pimspace: http://www.w3.org/ns/pim/space# skos: http://www.w3.org/2004/02/skos/core# prov: http://www.w3.org/ns/prov# mem: http://mementoweb.org/ns# qb: http://purl.org/linked-data/cube# schema: http://schema.org/ void: http://rdfs.org/ns/void# rsa: http://www.w3.org/ns/auth/rsa# cert: http://www.w3.org/ns/auth/cert# wgs: http://www.w3.org/2003/01/geo/wgs84_pos# bibo: http://purl.org/ontology/bibo/ sioc: http://rdfs.org/sioc/ns# doap: http://usefulinc.com/ns/doap# dbr: http://dbpedia.org/resource/ dbp: http://dbpedia.org/property/ sio: http://semanticscience.org/resource/ opmw: http://www.opmw.org/ontology/ deo: http://purl.org/spar/deo/ doco: http://purl.org/spar/doco/ cito: http://purl.org/spar/cito/ fabio: http://purl.org/spar/fabio/ oa: http://www.w3.org/ns/oa# as: https://www.w3.org/ns/activitystreams# ldp: http://www.w3.org/ns/ldp# solid: http://www.w3.org/ns/solid/terms# acl: http://www.w3.org/ns/auth/acl# dio: https://w3id.org/dio# rel: https://www.w3.org/ns/iana/link-relations/relation#" typeof="schema:CreativeWork prov:Entity">
    <main>
      <article about="" typeof="schema:Article">

      </article>
    </main>
  </body>
</html>
Example article HTML

The subject of the following statements may be anywhere in a document. They tend to give some provenance level information and intended to bring more context and attract reuse of the document in different ways.

<dl id="document-identifier">
  <dt>Identifier</dt>
  <dd><a href="http://csarven.ca/dokieli-rww" rel="owl:sameAs">http://csarven.ca/dokieli-rww</a></dd>
</dl>

The owl:sameAs indirectly gives this article, ie. any copy, an identifier. The identifier is typically where an article was originally made accessible from, so having this by default for copy distribution helps to keep its connection to source.

<dl id="document-inbox">
  <dt>Notifications Inbox</dt>
  <dd><a href="https://linkedresearch.org/inbox/csarven.ca/dokieli-rww/" rel="ldp:inbox">inbox/</a></dd>
</dl>

ldp:inbox relation gives an article its own Inbox where it can receive notifications about eg. annotations or activities relevant to an article. The notifications can be consumed by applications to offer additional content and interactive possibilities. dokieli can both send and consume notifications by way of discovering an article's inbox. Notifications are created for activities like announcements, creating, (dis)liking, and consumed in order to be displayed in context of available content. The protocol to send and consume notifications in dokieli uses Linked Data Notifications.

<dl id="document-annotation-service">
  <dt>Annotation Service</dt>
  <dd><a href="https://linkedresearch.org/annotation/csarven.ca/dokieli-rww/" rel="oa:annotationService">annotation/</a></dd>
</dl>

An article may refer to an annotation service (oa:annotationService) that conforms to the Web Annotation Protocol. See also DO.C.AnnotationService in dokieli.js.

<dl id="document-in-reply-to">
  <dt>In Reply To</dt>
  <dd><a href="https://linkedresearch.org/calls" rel="as:inReplyTo">Call for Linked Research</a></dd>
</dl>

If an article is a reply to objects(s), it can have a property like as:inReplyTo.

<dl id="document-published">
  <dt>Published</dt>
  <dd><time content="2017-02-27T00:00:00Z" datatype="xsd:dateTime" datetime="2017-02-27T00:00:00Z" property="schema:datePublished">2017-02-27</time></dd>
</dl>

<dl id="document-modified">
  <dt>Modified</dt>
  <dd><time content="2017-03-12T00:00:00Z" datatype="xsd:dateTime" datetime="2017-03-12T00:00:00Z" property="schema:dateModified">2017-03-18</time></dd>
</dl>

Dates, you know.. kinda useful. The example above duplicates the ISO date in @content and @datetime, but only one needs to be there, given that there parsers for different RDFa versions.

<dl id="document-license">
  <dt>License</dt>
  <dd><a href="https://creativecommons.org/licenses/by/4.0/" rel="schema:license" title="Creative Commons Attribution 4.0 Unported">CC BY 4.0</a></dd>
</dl>

Nice to declare a license or rights to signal under what conditions the document may be reused, reshared or remixed, eg. via Creative Commons license. Articles and notifications tend to use schema:license and annotations use dcterms:rights (given Web Annotation Vocabulary).

<dl id="document-derived-from">
  <dt>Derived From</dt<
  <dd><a href="https://dokie.li/" rel="prov:wasDerivedFrom">https://dokie.li/</a></dd>
</dl>

<dl id="document-derived-on">
  <dt>Derived On</dt>
  <dd><time datetime="2017-08-06T00:29:45.342Z">2017-08-06T00:29:45.342Z</time></dd>
</dl>

If a document is derived from another using the Save As operation, derived from and derived on information is declared.

The markup for an anonymous profile is like:

<span typeof="schema:Person">Lunatic Scholar</span>

The markup for a WebID profile including their name:

<span about="http://csarven.ca/#i" property="schema:name">Sarven Capadisli</span>

If they have an image:

<img alt="" height="48" rel="schema:image" src="http://csarven.ca/media/images/sarven-capadisli.jpg" width="48" />

Progressively described name, image, and URL is useful in templates:

<span about="http://csarven.ca/#i" typeof="schema:Person"><img alt="" height="48" rel="schema:image" src="http://csarven.ca/media/images/sarven-capadisli.jpg" width="48" /> <a href="http://csarven.ca/" rel="schema:url"><span about="http://csarven.ca/#i" property="schema:name">Sarven Capadisli</span></a></span>

Alternatively applying the DRY principle:

<a about="http://csarven.ca/#i" href="http://csarven.ca/" property="schema:name" rel="schema:url" typeof="schema:Person">Sarven Capadisli</a>

If they are one of the authors of a document, the profile can be wrapped like:

<dd id="Sarven-Capadisli" inlist="" rel="bibo:authorList" resource="http://csarven.ca/#i"><span about="" rel="schema:creator schema:publisher schema:author"><!-- profile --></span></dd>

See also getUserHTML (dokieli.js)

Annotation

Annotations have their own URL, fetched, parsed, and then introduced into the DOM. They are normally appended at the bottom of a node (section) in which the annotation has a reference to. It is not required to introduce all of the annotation content into the DOM, nor all of it has to be human-visible. This is a run-time inclusion and typically included within <aside class="note do"></aside>. Write operations like Save, Save As, Export will exclude this (class~="do") when it normalises the DOM to HTML.

Currently dokieli uses oa:replying, oa:commenting, oa:describing, oa:assessing, oa:bookmarking for motivations, and oa:describing and oa:tagging for annotation purpose.

See also createNoteDataHTML (dokieli.js)

Here is an annotation resource at https://linkedresearch.org/annotation/csarven.ca/dokieli-rww/b6738766-3ce5-4054-96a9-ced7f05b439f with all information human-visible and machine-readable (HTML+RDFa):

A reply Web Annotation with replying motivation

Its source:

<!DOCTYPE html>
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta charset="utf-8" />
    <title>https://linkedresearch.org/annotation/csarven.ca/dokieli-rww/b6738766-3ce5-4054-96a9-ced7f05b439f</title>
  </head>
  <body>
    <main>
      <article id="b6738766-3ce5-4054-96a9-ced7f05b439f" about="i:" typeof="oa:Annotation" prefix="rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# schema: http://schema.org/ dcterms: http://purl.org/dc/terms/ oa: http://www.w3.org/ns/oa# as: https://www.w3.org/ns/activitystreams# i: https://linkedresearch.org/annotation/csarven.ca/dokieli-rww/b6738766-3ce5-4054-96a9-ced7f05b439f">
        <h1 property="schema:name">Sarven Capadisli <span rel="oa:motivatedBy" resource="oa:replying">replies</span></h1>

        <dl class="author-name">
          <dt>Authors</dt>
          <dd><span rel="schema:creator"><span about="http://csarven.ca/#i" typeof="schema:Person"><img alt="" height="48" rel="schema:image" src="http://csarven.ca/media/images/sarven-capadisli.jpg" width="48" /> <a href="http://csarven.ca/" rel="schema:url"><span about="http://csarven.ca/#i" property="schema:name">Sarven Capadisli</span></a></span></span></dd>
        </dl>

        <dl class="published">
          <dt>Published</dt>
          <dd><a href="https://linkedresearch.org/annotation/csarven.ca/dokieli-rww/b6738766-3ce5-4054-96a9-ced7f05b439f"><time datetime="2017-04-15T21:24:58.293Z" datatype="xsd:dateTime" property="schema:datePublished" content="2017-04-15T21:24:58.293Z">2017-04-15 21:24:58</time></a>
          </dd>
        </dl>

        <dl class="rights">
          <dt>Rights</dt>
          <dd><a href="https://creativecommons.org/licenses/by/4.0/" rel="dcterms:rights" title="Creative Commons Attribution">CC BY 4.0</a></dd>
        </dl>

        <dl class="canonical">
          <dt>Canonical</dt>
          <dd about="i:" rel="oa:canonical" resource="urn:uuid:48355bb0-0afd-4f73-9a18-f1e8b6fb415b">48355bb0-0afd-4f73-9a18-f1e8b6fb415b</dd>
        </dl>

        <dl class="target">
          <dt><a href="http://csarven.ca/dokieli-rww#abstract" rel="oa:hasTarget">In reply to</a> (<a about="http://csarven.ca/dokieli-rww#abstract" href="http://csarven.ca/dokieli-rww" rel="oa:hasSource" typeof="oa:SpecificResource">part of</a>)</dt>
          <dd>
            <blockquote about="http://csarven.ca/dokieli-rww#abstract" cite="http://csarven.ca/dokieli-rww#abstract">
              <div rel="oa:hasSelector" resource="i:#fragment-selector" typeof="oa:FragmentSelector">
                <dl class="conformsto">
                  <dt>Fragment selector conforms to</dt>
                  <dd><a property="rdf:value" content="abstract" xml:lang="" lang="" rel="dcterms:conformsTo" href="https://tools.ietf.org/html/rfc3987">RFC3987</a></dd>
                </dl>

                <dl class="refinedby" rel="oa:refinedBy" resource="i:#text-quote-selector" typeof="oa:TextQuoteSelector">
                  <dt>Refined by</dt>
                  <dd><span property="oa:prefix" xml:lang="en" lang="en">rchitecture and implementation, </span><mark property="oa:exact" xml:lang="en" lang="en">demonstrating advanced document authoring and interaction without a single point of control</mark><span property="oa:suffix" xml:lang="en" lang="en">. Such an environment provides t</span></dd>
                </dl>
              </div>
            </blockquote>
          </dd>
        </dl>

        <dl class="renderedvia">
          <dt>Rendered via</dt>
          <dd><a about="http://csarven.ca/dokieli-rww#abstract" href="https://dokie.li/" rel="oa:renderedVia">dokieli</a></dd>
        </dl>

        <section id="note-b6738766-3ce5-4054-96a9-ced7f05b439f" rel="oa:hasBody" resource="i:#note-b6738766-3ce5-4054-96a9-ced7f05b439f">
          <h2 property="schema:name">Note</h2>

          <dl class="rights">
            <dt>Rights</dt>
            <dd><a href="https://creativecommons.org/licenses/by/4.0/" rel="dcterms:rights" title="Creative Commons Attribution">CC BY 4.0</a></dd>
          </dl>

          <div datatype="rdf:HTML" property="rdf:value schema:description" resource="i:#note-b6738766-3ce5-4054-96a9-ced7f05b439f" typeof="oa:TextualBody">What are you trying to tell me? That I can dodge bullets?</div>
        </section>
      </article>
    </main>
  </body>
</html>
Example annotation HTML
<dl class="canonical">
  <dt>Canonical</dt>
  <dd rel="oa:canonical" resource="urn:uuid:48355bb0-0afd-4f73-9a18-f1e8b6fb415b">48355bb0-0afd-4f73-9a18-f1e8b6fb415b</dd>
</dl>

oa:canonical refers to a canonical IRI that can be used to deduplicate the annotation. If an user chooses to store their annotation at their personal Webspace as well as when an annotation service (if offered), dokieli treats the resource at personal space as the canonical, and the resource at the annotation service as the copy where it refers to the personal space (oa:via).

If an annotation resource is introduced to the article's DOM as part of an aside, they have a structure similar to an article, and may be displayed in different ways, eg. in marginalia:

<aside class="note do">
  <blockquote cite="https://linkedresearch.org/annotation/csarven.ca/dokieli-rww/b6738766-3ce5-4054-96a9-ced7f05b439f">
    <article about="i:" id="461819979" prefix="i: https://linkedresearch.org/annotation/csarven.ca/dokieli-rww/b6738766-3ce5-4054-96a9-ced7f05b439f" typeof="oa:Annotation">
    <!-- Reconstruction of the original annotation (from RDF) -->
    </article>
  </blockquote>
</aside>

An inline reference to that annotation as aside would have a structure like:

<span class="ref do" rel="schema:hasPart" resource="#r-461819979" typeof="dctypes:Text"><mark id="r-461819979" property="schema:description">demonstrating advanced document authoring and interaction without a single point of control</mark><sup class="ref-annotation"><a rel="cito:hasReplyFrom" href="#461819979" resource="https://linkedresearch.org/annotation/csarven.ca/dokieli-rww/b6738766-3ce5-4054-96a9-ced7f05b439f">💬</a></sup></span>

Note that the human-visible anchor hyperlinks (#461819979) to the annotation aside id="461819979".

Notification

Notifications are discovered from LDN Inboxes. An article (or a fragment within) may have an inbox relation (ldp:inbox) which helps dokieli to discover it, and then fetch the notifications.

Notifications are intended to be brief, giving sufficient information for consumers to decide if they want use to them. If the notifications are generated by dokieli, eg. via an annotation activity, they typically include some provenance level data like generation date, actor that triggered it, license, where the annotation can be found, what it annotated, and the motivation for it. Notifications will not include the annotation body, but consumers can fetch their URLs (as mentioned in the annotation section).

See also createNoteDataHTML (dokieli.js)

Here is a notification resource at https://linkedresearch.org/inbox/csarven.ca/dokieli-rww/b6738766-3ce5-4054-96a9-ced7f05b439f with all information human-visible and machine-readable (HTML+RDFa):

A notification referring to an annotation

Its source:

<!DOCTYPE html>
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta charset="utf-8" />
    <title>Notification: Announced</title>
  </head>
  <body prefix="xsd: http://www.w3.org/2001/XMLSchema# rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# as: https://www.w3.org/ns/activitystreams# oa: http://www.w3.org/ns/oa# schema: http://schema.org/">
    <main>
      <article>
        <h1>Notification: Announced</h1>
        <section>
          <dl about="">
            <dt>Types</dt>
            <dd><a about="" href="https://www.w3.org/ns/activitystreams#Announce" typeof="as:Announce">Announce</a></dd>

            <dt>Object</dt>
            <dd><a href="https://linkedresearch.org/annotation/csarven.ca/dokieli-rww/b6738766-3ce5-4054-96a9-ced7f05b439f" property="as:object">https://linkedresearch.org/annotation/csarven.ca/dokieli-rww/b6738766-3ce5-4054-96a9-ced7f05b439f</a></dd>

            <dt>Target</dt>
            <dd><a href="http://csarven.ca/dokieli-rww#abstract" property="as:target">http://csarven.ca/dokieli-rww#abstract</a></dd>

            <dt>Updated</dt>
            <dd><time datetime="2017-04-15T21:31:45.711Z" datatype="xsd:dateTime" property="as:updated" content="2017-04-15T21:31:45.711Z">2017-04-15 21:31:45</time></dd>

            <dt>Actor</dt>
            <dd><a href="http://csarven.ca/#i" property="as:actor">http://csarven.ca/#i</a></dd>

            <dt>License</dt>
            <dd><a href="https://creativecommons.org/publicdomain/zero/1.0/" property="schema:license">https://creativecommons.org/publicdomain/zero/1.0/</a></dd>
          </dl>

          <dl about="https://linkedresearch.org/annotation/csarven.ca/dokieli-rww/b6738766-3ce5-4054-96a9-ced7f05b439f">
            <dt>Object type</dt>
            <dd><a about="https://linkedresearch.org/annotation/csarven.ca/dokieli-rww/b6738766-3ce5-4054-96a9-ced7f05b439f" typeof="oa:Annotation" href="http://www.w3.org/ns/oa#Annotation">Annotation</a></dd>

            <dt>Motivation</dt>
            <dd><a href="http://www.w3.org/ns/oa#replying" property="oa:motivation">replying</a></dd>
          </dl>
        </section>
      </article>
    </main>
  </body>
</html>
Example notification HTML

User interface

Document modes

There UI adapts to the document mode the user is in: author, review, social. By default the social mode is engaged. The dokieli menu allows the user to engage the author mode through the Edit operation, and the review mode with Review. See also setDocumentMode (dokieli.js).

dokieli menu

The dokieli menu enables users to access various features.

Features

Sign in
Allows the user to identify themselves using their WebID where they can also authenticate themselves. dokieli retrieves information related to user's identity to adapt the user interface as well as with operations related to user's actions.
Share
The user can share the current article or a part of it with individuals or groups from their contacts as well as to any specific agent. The list of contacts is generated through a discovery mechanism where dokieli follows foaf:knows relations as well as traversing equivalent profiles (owl:sameAs) and determines their inboxes. dokieli sends a notification to user selected targets with information such as who sent the notification, when it was created, its license and motivation.
Reply
An article can be replied with a note and have its own language and license. The user can use the resource browser to choose the location of the reply in a personal storage or an annotation service.
Notifications
The user can overlay interactions, such as annotations, bookmarks, comments, and reactions, from themselves and their contacts onto the document.
Annotations
Articles can be annotated with various motivations. Annotations themselves can also be annotated. Some kinds of annotations are kept with the article, while others are independent resources stored externally to the article. The user may assign a specific language and a license for some types of annotations.
Bookmarking
The document or selected text can be bookmarked where the user can include a note, assign tags.
Commenting
Node or text level targeting for an annotation including a description and tags.
Describing
A note to indicate a footnote. Used as part of purpose for bookmarking and commenting.
Highlighting
Node or text level targeting that gives the user a URI that they can use for deep-linking and referencing.
Replying
A note to indicate a reply to selected text or node.
Tagging
The user can associate tags (natural language text) to selected text which is used as part of purpose for annotations such as bookmarking, replying, and commenting.
Approve
General agreement with the selected text. Optional note can indicate why the selection is a strong point or a convincing argument.
Disapprove
General disagreement with the selected text. Optional note can indicate why the selection is a weak point, an error, or inaccurate.
Specificity
Request to increase specificity on selected text. Optional note can indicate that a citation or more specificity is needed.
New
This feature allows a new document to be created at specified location. The new document is constructed based on If the user is signed in with their WebID and their personal storage location is identifier, the default location for the new resource will have the storage URL (pim:storage) as its base. If the user does not have a WebID and a storage, and if the article refers to an annotation service (oa:annotationService), it will use that URL instead. The URL can be input directly, and otherwise a name will be autogenerated for the resource. This feature uses the resource browser to navigate HTTP URLs. See also generateAttributeId (dokieli.js). On create, the resulting hyperlink will be shown and a new tab in the browser will be prompted.
Open
Documents can be opened from a local filesystem or by entering an HTTP URL. Both options read the resource's content, and if dokieli's CSS and JavaScript are not present, they are included before updating the DOM and initiating dokieli. This feature uses the resource browser to navigate HTTP URLs. See also openDocument (dokieli.js). There are special handling of data formats such as:
GPS data
The user can view a map (OpenStreetMap) including a track, as well as details about GPS and extension data in a table such as time period, latitude, longitude, altitude, heart rate, cadence, speed, air temperature, water temperature, depth. The table also includes a summary of publication date, publisher, actor, total distance, total time, average pace, average heart rate, elevation gain, elevation lost. The nearest city of the track is also determined and linked to on Wikidata.
Activity collection
A chronological list of (social) activities.
Save
This feature makes a write operation (HTTP PUT) request to the current location of the document (window.location). The document is normalised in that dokieli related items are removed from the DOM before making the request.
Save As
The Save As operation is similar to New for normalising some of the URLs and same as Save operation for normalising the DOM before making the request to specified location. If Derivation data is checked for inclusion, derived from and on information is included in the created document. This feature uses the resource browser to navigate HTTP URLs.
Set Inbox
The user can associate an inbox to an article using the resource browser.
Set Annotation
The user can associate an annotation service to an article using the resource browser so that others' annotations can optionally be copied to this location.
dokielize
Normalises the document to be valid, normalised, as well as includes the dokieli scripts so that the application be used in the derived version.
Accessibility Report
Provides additional accessibility information about the current document so that the user can find ways to improve the content's accessibility.
Storage details
The user can examine information about the storage such as its location, name, description, owners, URI persistence policy, and digital rights policies as well as be informed about any conflicts with their preferred policies, and notification subscription options and subscribing to live changes.
Version
Generates a derived copy of the current document as a mutable resource including provenance.
Immutable
Generates a derived copy of the current document as an immutable or frozen Memento resource including provenance. Creates or updates a Memento TimeMap including a reference to the immutable resource.
Memento
The user can access the memento (version history) of a document.
In order to work around content-drift and link-rot, users can decorate links to include Robust Links, e.g. the URI of a snapshot from the Internet Archive, datetime stamp at the time of linking, and other context.
Archive
Sends an archival request of the current article to the Internet Archive Wayback Machine.
Generate Feed
The user can generate and publish a custom web feed based on a list of documents they have selected from a storage. The user can specify the feed's title, language, license, and format such as RSS or Atom.
Export
The user can export the article as HTML and save to their local filesystem.
Print
Requests to print the current document (window.print()).
Edit
Editor is one of the document modes a user can be in. The available features reflect the edit operation. Edits reside in the DOM until a Save or Save As is triggered. There are content formatting and structuring features to indicate heading, italics, bold, ordered an unordered listing, inline code, preformatted text, hyperlinking, inline quotes, adding images, tables, as well as:
Interactive and embeddable objects
User can include a chart based on statistical data such as sparklines.
Semantic annotation
The user can mark content to be both further machine-readable (RDFa) in addition to being human-readable.
Footnotes and citations
The user can create footnotes and citations for their selected text where they are contextual, robust, and the cited entity can be notified about the citation (for back-referencing). References can be ISBNs or URLs of any kind. For contextual citations for instance, the citing entity (an argument) cites the cited entity (observation results) as source of factual evidence for statements it contains. The user can also search for bibliographic information about technical specifications for the purpose citing.
Authoring widgets
The user can add contributors to the article and send a notification to them about the article. The user can specify the document's language, license, inbox, in reply to, document type (such as article, specification, slideshow), document status, test suite.
Autosaving
While the user is in editing their article, the document is autosaved to local storage. The user can optionally enable autosaving the resource.
Source
The user can edit the current state of the article. Updating, only updates the DOM, where write operations on the article resource itself are handled by features such as Save.
Embed Data
The user can embed and update supplemental data to be stored with the article using RDF syntaxes such as Turtle, JSON-LD, and TriG.
Messages
The user can read the all of the messages that were raised to their attention by dokieli for example as the result of some action.
Views
The dokieli menu will list primary and alternate stylesheets that are detected in HTML. Native is always available and it will essentially disable all other stylesheets, thereby user-agent's default stylesheets are gets applied. When a view is selected, eg. Basic (which happens to be the one that is used on this article as primary), it becomes the primary stylesheet, and the rest of the stylesheets become alternate and disabled.
Graph visualisation
The user can view a graph visualisation of the document's underlying machine-readable semantics (RDFa). The view lists the resources that are in the view, number of statements, number of unique nodes, creator, license, and legend. The visualisation can be exported to an SVG.
List of Stuff
Options to generate and include various content such as:
Contents
For table of contents.
Figures
List of figures in the document and links to them.
Tables
List of tables in the document and links to them.
Abbreviations
List of abbreviations in the document and their definitions.
Quotations
List of quotations in the document and links to them.
Concepts
List of concept schemes and concepts in the document and links to them. The user can include additional concepts that are defined in resources that are externally references from the current document, as well as a graph visualisation of the concepts.
Requirements
Table of conformance requirements and test coverage (of a technical specification) including the requirement subject, level and statement, and test cases per requirement, and links to them. The use can optionally see the difference in changes between the current document and the previous version of the document, as well as the information from the changelog.
Advisements
Table of advisements (in a technical specification) including their levels and statements and links to them.
References
List of tables in the document and links to them.
Document metadata
Based on document's underlying structured data, displays information about its contributors such as editors and authors, number of citations, requirements, advisements, concepts, statements, as well as an estimated reading time, number of characters, words, and bytes.

Components

License
The user can specify the rights and license for their articles and annotations from a list of Creative Commons licenses, e.g., CC BY 4.0. Notifications by default use the CC0 1.0 Universal license.
Language
The user can assign the language of an article or an annotation from a selection (182 languages). Alternatively, the user can use the semantic annotator to specify the language of a text selection or nodes.
Resource browser
The resource browser eg. available for New, Open, Save As operations can be used to navigate through a Webspace. It does this by using the Linked Data Platform's containment rules to retrieve and then display the container's index. If the user's personal storage location is known, it will be used as default location for the resource browser. Alternatively, if the article refers to an annotation service, it will be used as start location.
Base URL selection
To determine the base URL, when new documents are created or saved as, media resources from head link, [src], object[data] (querySelector) will have their URLs normalised to use current document's base URL as its absolute URL (this is the Use references as is option). If Copy to your storage is selected, relative URLs will not be updated as the copy operation reuses the same file paths when resource are copied to destination. The copy operation does an HTTP GET for each source, then HTTP PUT to target.
Clipboard
The user can copy the contents of preformatted text and tables (in CSV format) to their clipboard.
Fragments
The user can see and click on a fragment in the document which is useful for specific referencing.
Tabs view
Navigation items provide a tab view for the user.

Accessibility, Usability, and Inclusion

Accessibility Statement

Measures to support accessibility

dokieli takes the following measures to ensure accessibility of dokieli:

  • Include accessibility throughout our internal policies.
  • Assign clear accessibility goals and responsibilities.
  • Employ formal accessibility quality assurance methods.

Conformance status

The Web Content Accessibility Guidelines (WCAG) defines requirements for designers and developers to improve accessibility for people with disabilities. It defines three levels of conformance: Level A, Level AA, and Level AAA. dokieli is partially conformant with WCAG 2.1 level AA. Partially conformant means that some parts of the content do not fully conform to the accessibility standard.

Feedback

We welcome your feedback on the accessibility of dokieli. Please let us know if you encounter accessibility barriers on dokieli issues.

Technical specifications

Accessibility of dokieli relies on the following technologies to work with the particular combination of web browser and any assistive technologies or plugins installed on your computer:

  • HTML

These technologies are relied upon for conformance with the accessibility standards used.

Assessment approach

dokieli assessed the accessibility of dokieli by the following approaches:

  • Self-evaluation

Authoring accessibility

Authoring tool user interface accessibility

Web-based functionality is accessible
partially
Non web-based functionality is accessible
not applicable
Alternative content available to editors
partially
Description
Possible to add alternative content through dokieli's source editor feature. Improvements in the UI will be available in a future version.
Editing-view presentation can be programmatically determined
yes
Works with keyboard
partially
Description
There are some WAI-ARIA landmarks.
Enough time
yes
Flashing content optional
yes
Content can be navigated by structure
yes
Content searchable
no
Supports display preferences
yes
Previews are accessible
not applicable
Helps editor prevent and correct mistakes
yes
(Accessibility) features documented
partially

Support for producing accessible content

Generates accessible markup
yes
Preserves accessibility information
yes
Accessible content production is possible
yes
Editors guided
partially
Text alternatives can be managed
partially
Accessible templates available
yes
Accessible components/plug-ins available
no
Checks accessibility automatically
yes
Provides suggestions to content editor about accessibility problems
partially
Description
There is an accessibility report provided on 'save as' feature including a list of issues that can be corrected by the content editor.
Accessibility features prominent
no
Documentation promotes accessibility
not provided

HTTP operations

dokieli conforms to Linked Data Platform (LDP) protocol for create, update, and delete operations.

Article operations like New, Save, Save As, Reply use HTTP PUT, Review and other annotation operations use HTTP POST.

Notifications are sent with HTTP POST. Save and Save As normalises the HTML before sending.

Request to send
HTTP method(s) Content-Type
ArticlePUTtext/html
AnnotationOPTIONS, POSTtext/html, application/ld+json, text/turtle
NotificationOPTIONS, POSTtext/html, application/ld+json, text/turtle
Article
Articles typically use text/html with embedded RDFa. Where a server implements GET with text/html, and allows PUT for writing, the assumption is that it can allow text/html. In the future, dokieli can check for the Accept-Put header with OPTIONS to determine a suitable type. At this time, HTML+RDFa is an important default for articles.
Annotation
Annotations use the POST method with Content-Type header value determined by type of location to write to: personal storage space eg. given a profile's pim:storage; made to an annotation service eg. an article's oa:annotationService; sent to profile's outbox's outbox: as:outbox. The Web Annotation Protocol requires application/ld+json by default. dokieli sends an OPTIONS request to check for the Accept-Post header and sends the payload in one of the serializations that the server prefers. If it is not set, it will fallback to application/ld+json as preferred by Wen Annotation and ActivityPub.
Notification
Notifications use OPTIONS to check the response's Accept-Post HTTP header. If it is set and matches one of the acceptable RDF mediatypes that dokieli can parse, it will use that mediatype to serialize the payload before POSTing. If it is not set, it will fallback to application/ld+json as required by the Linked Data Notifications specification.

Due to Mixed Content implementations in Web browsers, ie. fetching of content over unencrypted or unauthenticated connections in the context of an encrypted and authenticated document, is subject to being blocked by the Web browser. Hence, an https document (eg article at https) will not be able to use the contents of an http document (eg. an http WebID). As a workaround, dokieli uses a proxy endpoint by default in order to use the contents of an http resource. An https document fetching an https resource will not use the proxy.

Authentication

dokieli was originally intended to handle different authentication mechanisms. WebID-TLS is currently supported to authenticate with servers.

Storage

Personal storage
WebID's with pim:storage can get to use their personal online data storage with dokieli's read-write operations, eg all annotations, Reply, Review, New, Save As.
Local storage
There is a Local Storage feature which uses user-agent's window.localStorage, with default 1m autosave.

Web Extension

The dokieli Web Extension is a minimal package of dokieli which contains the core CSS and JavaScript that works as a browser add-on. When user triggers it from their browser toolbar, it provides the same functionality as a single-page application, ie. initialised and rendered in the browser DOM.

Currently the extension works with Firefox and Chromium browsers. The extension can be used in the following way:

  1. Clone the dokieli repository from https://github.com/dokieli/dokieli (or forked copy) to your local machine.
  2. Firefox
    From the "Add-ons and themes" menu, select "Debug Add-ons" (or go to about:debugging#/runtime/this-firefox from the addressbar) and import by selecting any file from the cloned dokieli directory (e.g., manifest.json). See also temporary installation in Firefox. Note that if you restart your browser, you'll need to go through this process.
    Chromium
    The general process for browsers such as Chrome, Brave, Vivaldi, etc., are as follows. From the "Extensions" menu (or go to chrome://extensions/, brave://extensions, vivaldi://extensions/ from addressbar), check the "developer mode" option. Import the dokieli directory from "Load unpacked".

Development

git clone https://github.com/dokieli/dokieli
cd dokieli

# Install packages
yarn install

# Build eg. to create scripts/dokieli.js
yarn build

# or automatically rebuild when files change
yarn watch