Warning:
This wiki has been archived and is now read-only.

Document Services

From Argumentation Community Group
(Redirected from Argumentation Markup)
Jump to: navigation, search

Introduction

Document services are a generalization over services for documents such as: spelling checking, grammar checking, proofreading, fact checking, and mathematical proof and argumentation checking. Document services are relevant to both document authoring and document reviewing scenarios. Imagine being able to check, in real-time, if a document has any informational, warning, or error messages with respect to its factuality or any steps of its reasoning. Tools for authoring and reviewing documents, in these regards, would be useful across sectors, across industry, academia, military, and government, with specific applicability to journalism, encyclopedias, digital textbooks, and science.

Presented, herein, is an approach for declaring and describing document services utilizing document metadata.

Varieties of Document Services

Thus far considered are three varieties of document services. Firstly, there are services which adhere to an informational message, warning, error pattern. Secondly, there are services which offer corrections, recommendations, or options for users. Thirdly, there are services which provide metadata about documents, document elements, or ranges (e.g. word count, reading level).

User Interface Discussion

Users could make use of application menus to have entire documents processed by document services. Users could also utilize context menus on specific document elements.

For those services which return informational messages, warnings or errors about documents, document elements, or ranges, there could be table views or grid views (see also: software development IDE’s) for collecting together and presenting multi-source informational messages, warnings, and errors.

For those services which offer corrections, recommendations, or options for users, interactive contextual panels or widgets could be of use.

For those services which return metadata about documents, document elements, or ranges, the visualization of such metadata is also a user interface topic.

Styling Documents for Document Services

It may be possible for document authors to style their documents for interoperation with various document services.

Various text decorations and background colors could be utilized.

Inline graphical symbols such as green checkmark symbols, white information icon symbols, yellow warning symbols, and red error symbols could be utilized.

See also: https://www.w3.org/TR/css-highlight-api-1/

Author-recommended and Reader-specified Services

When reviewing documents, there is an envisioned interplay between author-recommended and reader-specified services. For example, for the fact-checking scenario, document authors could indicate recommended fact-checking services to make use of and readers could have their own services configured.

Multiple Simultaneous Services

Multiple document services could be utilized simultaneously. The informational messages, warnings, and errors from multiple services could be merged. Similarly, corrections, recommendations, or options from multiple services could be merged. Similarly, metadata about documents, document elements, or ranges from multiple services could be merged.

URI-addressability of Document Content

Content of interest in documents could be URI-addressable in a number of ways.

  1. https://www.example.org/document.xhtml#fact-123
  2. https://www.example.org/document.xhtml#xpointer(...)
  3. https://www.example.org/document.xhtml#:~:text=...

Firstly, document authors could make use of the id attribute. Secondly, XPointer could be utilized to address document content with URI. Thirdly, text fragments could be utilized with URI.

Document Metadata and Selectors

It is possible to utilize document metadata to declare document services without having to specify how document authors should use document markup.

Namespace-prefixable Selectors

There are numerous ways that document authors might use markup to indicate facts or claims. For example, some are:

  1. new markup elements (e.g. <fact> or <claim>)
  2. extensible markup elements (e.g. <ext:fact xmlns:ext="...">)
  3. class names (e.g. <span class="fact">)
  4. role attribute (e.g. <span role="fact">)
  5. EPUB type attribute (e.g. <span epub:type="fact">)

For each way, one can select the facts or claims in a document.

With a CSS-based syntax:

  1. fact
  2. @namespace ext url(...); ext|fact
  3. .fact
  4. [role~='fact']
  5. @namespace epub url(...); [epub|type~='fact']

With an XPath-based syntax:

  1. //fact
  2. xmlns(ext=...) //ext:fact
  3. //*[contains(concat(' ',normalize-space(@class),' '),' fact ')]
  4. //*[contains(concat(' ',normalize-space(@role),' '),' fact ')]
  5. xmlns(epub=...) //*[contains(concat(' ',normalize-space(@epub:type),' '),' fact ')]

Using the namespace-prefixable selectors, above, one could use document metadata to indicate which document elements in a document were facts or claims.

With a CSS-based syntax:

  1. <meta name="fact-checking-selector" content="fact" />
  2. <meta name="fact-checking-selector" content="@namespace ext url(...); ext|fact" />
  3. <meta name="fact-checking-selector" content=".fact" />
  4. <meta name="fact-checking-selector" content="[role~='fact']" />
  5. <meta name="fact-checking-selector" content="@namespace epub url(...); [epub|type~='fact']" />

With an XPath-based syntax:

  1. <meta name="fact-checking-selector" content="//fact" />
  2. <meta name="fact-checking-selector" content="xmlns(ext=...) //ext:fact" />
  3. <meta name="fact-checking-selector" content="//*[contains(concat(' ',normalize-space(@class),' '),' fact ')]" />
  4. <meta name="fact-checking-selector" content="//*[contains(concat(' ',normalize-space(@role),' '),' fact ')]" />
  5. <meta name="fact-checking-selector" content="xmlns(epub=...) //*[contains(concat(' ',normalize-space(@epub:type),' '),' fact ')]" />

Namespace-prefixable Attribute Selectors

There is also the matter of using document metadata to indicate which attributes, if any, are utilized by a document author to reference inline or external resources on selected document elements.

With a CSS-based syntax:

  1. attr(something url)
  2. @namespace ext url(...); attr(ext|something url)

With an XPath-based syntax:

  1. @something
  2. xmlns(ext=...) @ext:something

One could indicate which attributes on those document elements were for specifying resources by using document metadata.

With a CSS-based syntax:

  1. <meta name="fact-checking-resource" content="attr(something url)" />
  2. <meta name="fact-checking-resource" content="@namespace ext url(...); attr(ext|something url)" />

With an XPath-based syntax:

  1. <meta name="fact-checking-resource" content="@something" />
  2. <meta name="fact-checking-resource" content="xmlns(ext=...) @ext:something" />

Document Service Providers

One could indicate which document service providers were recommended by a document author using document metadata.

  1. <link rel="fact-checking-service-provider" href="https://www.wikidata.org/wiki/Special:FactCheck" />

Examples

A number of document metadata examples are provided.

Spelling Checking

<html>
  <head>
    <base href="https://www.example.org/document.xhtml" />
    <link rel="spelling-checking-service-provider" href="https://www.services.org/spelling-checking" />
  </head>
  <body>
    <p>HTML and MathML Content</p>
  </body>
</html>

Grammar Checking

<html>
  <head>
    <base href="https://www.example.org/document.xhtml" />
    <link rel="grammar-checking-service-provider" href="https://www.services.org/grammar-checking" />
  </head>
  <body>
    <p>HTML and MathML Content</p>
  </body>
</html>

Proofreading

<html>
  <head>
    <base href="https://www.example.org/document.xhtml" />
    <link rel="proofreading-service-provider" href="https://www.services.org/proofreading" />
  </head>
  <body>
    <p>HTML and MathML Content</p>
  </body>
</html>

Fact Checking

<html>
  <head>
    <base href="https://www.example.org/document.xhtml" />
    <meta name="fact-checking-selector" content="[role~='fact']" />
    <link rel="fact-checking-service-provider" href="https://www.wikidata.org/wiki/Special:FactCheck" />
  </head>
  <body>
    <span role="fact">HTML and MathML content</span>
    <div  role="fact">HTML and MathML content</div>
  </body>
</html>

Metadata

<html xmlns:ext="http://www.namespace.org/extensibility#">
  <head>
    <base href="https://www.example.org/document.xhtml" />
    <meta name="metadata-selector" content="@namespace ext url('http://www.namespace.org/extensibility#'); [ext|meta]" />
    <meta name="metadata-resource" content="@namespace ext url('http://www.namespace.org/extensibility#'); attr(ext|meta url)" />
    <script id="inline-metadata-123" type="...">...</script>
  </head>
  <body>
    <span ext:meta="#inline-metadata-123">HTML and MathML Content</span>
    <div  ext:meta="external-metadata-124.php">HTML and MathML Content</div>
  </body>
</html>

Provenance

<html xmlns:ext="http://www.namespace.org/extensibility#">
  <head>
    <base href="https://www.example.org/document.xhtml" />
    <meta name="provenance-selector" content="@namespace ext url('http://www.namespace.org/extensibility#'); [ext|provo]" />
    <meta name="provenance-resource" content="@namespace ext url('http://www.namespace.org/extensibility#'); attr(ext|provo url)" />
    <script id="inline-provenance-123" type="...">...</script>
  </head>
  <body>
    <span ext:provo="#inline-provenance-123">HTML and MathML Content</span>
    <div  ext:provo="external-provenance-124.php">HTML and MathML Content</div>
  </body>
</html>

Mathematical Proof

<html xmlns:ext="http://www.namespace.org/extensibility#">
  <head>
    <base href="https://www.example.org/document.xhtml" />
    <meta name="proof-selector" content="@namespace ext url('http://www.namespace.org/extensibility#'); [ext|proof]" />
    <meta name="proof-resource" content="@namespace ext url('http://www.namespace.org/extensibility#'); attr(ext|proof url)" />
    <script id="inline-proof-123" type="...">...</script>
  </head>
  <body>
    <math ext:proof="#inline-proof-123">MathML Content</math>
    <math ext:proof="external-proof-124.php">MathML Content</math>
  </body>
</html>
<html>
  <head>
    <base href="https://www.example.org/document.xhtml" />
    <meta name="proof-selector" content="math.proveable" />
    <link rel="proof-service-provider" href="https://www.services.org/proof" />
  </head>
  <body>
    <math class="proveable">MathML Content</math>
    <math class="proveable">MathML Content</math>
  </body>
</html>

Mathematical Proof Checking

<html>
  <head>
    <base href="https://www.example.org/document.xhtml" />
    <meta name="proof-selector" content="math.proveable" />
    <meta name="proof-resource" content="attr(data-proof url)" />
    <link rel="proof-checking-service-provider" href="https://www.services.org/proof-checking" />
    <script id="inline-proof-123" type="...">...</script>
  </head>
  <body>
    <math class="proveable" data-proof="#inline-proof-123">MathML Content</math>
    <math class="proveable" data-proof="external-proof-124.php">MathML Content</math>
  </body>
</html>

Argumentation

<html xmlns:ext="http://www.namespace.org/extensibility#">
  <head>
    <base href="https://www.example.org/document.xhtml" />
    <meta name="argumentation-selector" content="@namespace ext url('http://www.namespace.org/extensibility#'); [ext|argu]" />
    <meta name="argumentation-resource" content="@namespace ext url('http://www.namespace.org/extensibility#'); attr(ext|argu url)" />
    <script id="inline-argu-123" type="...">...</script>
  </head>
  <body>
    <span ext:argu="#inline-argu-123">HTML and MathML Content</span>
    <div  ext:argu="external-argu-124.php">HTML and MathML Content</div>
  </body>
</html>

Argumentation Checking

<html xmlns:ext="http://www.namespace.org/extensibility#">
  <head>
    <base href="https://www.example.org/document.xhtml" />
    <meta name="argumentation-selector" content="@namespace ext url('http://www.namespace.org/extensibility#'); [ext|argu]" />
    <meta name="argumentation-resource" content="@namespace ext url('http://www.namespace.org/extensibility#'); attr(ext|argu url)" />
    <link rel="argumentation-checking-service-provider" href="https://www.services.org/argumentation-checking" />
    <script id="inline-argu-123" type="...">...</script>
  </head>
  <body>
    <span ext:argu="#inline-argu-123">HTML and MathML Content</span>
    <div  ext:argu="external-argu-124.php">HTML and MathML Content</div>
  </body>
</html>

Types of Resources

A number of types of resources could be involved in document services scenarios.

Service-specific Data Formats

Data could be served in data formats specific to document services, e.g. mathematical proofs and argumentation, and these service-specific formats could be consumed by other document services, e.g. mathematical proof checking and argumentation checking.

Hypertext-embedded Data Formats

Data could be served embedded in HTML documents, e.g. with RDFa or microdata, for simultaneous machine-utilizability and human-readability.

Markup for Informational Messages, Warnings, and Errors

<messages xmlns="..." xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <m kind="info" type="..." about="https://www.example.org/document.xhtml#fact-123">This is an informative message.</m>
  <m kind="info" type="..." about="https://www.example.org/document.xhtml#xpointer(...)">This is an informative message.</m>
  <m kind="info" type="..." about="https://www.example.org/document.xhtml#:~:text=...">This is an informative message.</m>
</messages>

or

<messages xmlns="..." xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <m kind="info" type="..." start="https://www.example.org/document.xhtml#xpointer(...)" end="https://www.example.org/document.xhtml#xpointer(...)">This is an informative message.</m>
</messages>

See also: https://dom.spec.whatwg.org/#concept-range

Document and Document Element Metadata Formats

Information about documents or document elements could be provided in service response data. Example scenarios include providing the word count or reading level of a document or portion of a document.

<response xmlns="...">
  <metadata type="application/rdf+xml">
    <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ext="...">
      <rdf:Description rdf:about="https://www.example.org/document.xhtml">
        <ext:wordCount rdf:datatype="http://www.w3.org/2001/XMLSchema#int">1234</ext:wordCount>
      </rdf:Description>
    </rdf:RDF>
  </metadata>
</response>

URL-formulation Formats

Technologies such as OpenSearch utilize XML to provide URL-addressable services using a curly-brackets-based syntax for specifying how URL's should be formed from data. OpenSearch description documents are served with the MIME type of application/opensearchdescription+xml.

An example of OpenSearch markup:

<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
  <ShortName>Wikipedia (en)</ShortName>
  <Description>Wikipedia (en)</Description>
  <Image height="16" width="16" type="image/x-icon">https://en.wikipedia.org/static/favicon/wikipedia.ico</Image>
  <Url type="text/html" method="get" template="https://en.wikipedia.org/w/index.php?title=Special:Search&amp;search={searchTerms}" />
  <Url type="application/x-suggestions+json" method="get" template="https://en.wikipedia.org/w/api.php?action=opensearch&amp;search={searchTerms}&amp;namespace=0" />
  <Url type="application/x-suggestions+xml" method="get" template="https://en.wikipedia.org/w/api.php?action=opensearch&amp;format=xml&amp;search={searchTerms}&amp;namespace=0" />
  <moz:SearchForm>https://en.wikipedia.org/wiki/Special:Search</moz:SearchForm>
</OpenSearchDescription>

Web Services Description Language

Web Services Description Language (WSDL) is an XML language for describing Web services. It is served with the MIME type of application/wsdl+xml.

Conclusion

Some ideas were presented towards facilitating document services, such as real-time fact-checking and reasoning-checking, for HTML documents.