You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: serialization-html-note/index-respec.html
+68-24Lines changed: 68 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -272,7 +272,7 @@
272
272
273
273
<p>This Note describes and illustrates potential approaches for including annotations
274
274
within HTML documents. Examples also are included illustrating the use within an HTML document
275
-
of annotation Selectors as fragment identifiers. (The Working Group's Selectors and States Reference
275
+
of annotation Selectors as fragment identifiers. (The Working Group's Selectors and States Reference
276
276
Note [[selector-note]] defines the syntax used for Selectors as fragment identifiers.)p>
277
277
278
278
<p>The approaches described in this document are incomplete and preliminary. They do not exhaust the full range of feasible options.
@@ -299,7 +299,7 @@
Introduction
299
299
<p>The Model goes on to define an extensible, interoperable
300
300
framework for expressing such annotations in RDF-based vocabularies. The Model additionally defines
301
301
a JSON-LD [[json-ld]] serialization of that framework. However, the Model does not prescribe a means for including an
302
-
annotation within a Web page (HTML document)--even when the annotation targets all or part of the page itself or
302
+
annotation within a Web page (HTML document)—even when the annotation targets all or part of the page itself or
303
303
all or part of another, external Resource linked from the page.p>
304
304
305
305
<p>For example, the quotation above is simply an HTML blockquote and contains no encoded reference to the quotation
@@ -310,7 +310,7 @@
Introduction
310
310
that references a segment of an HTML document might usefully be embedded within the same or another HTML document.
311
311
In addition to text embedded within the DOM, HTML documents often reference external resources such as
312
312
images that are meant to be considered integral parts of an HTML Document when viewed on the Web,
313
-
e.g., through the use of the HTML <img> element's src attribute. Approaches discussed in this Note
313
+
e.g., through the use of the HTML <code><img>code> element's src attribute. Approaches discussed in this Note
314
314
would facilitate embedding in HTML an annotation targeting (in the context or scope of a Web page) an image
315
315
or other similar Web page component resource external to an HTML document. p>
316
316
@@ -440,7 +440,7 @@
Terminology
440
440
section>
441
441
442
442
<section>
443
-
<h3>Annotations Embedded as JSON-LDh3>
443
+
<h3id="embed-json-ld">Annotations Embedded as JSON-LDh3>
444
444
<p>JSON-LD [[json-ld]] is the serialization format specified in the Web Annotation Data Model [[annotation-model]].
445
445
HTML can accommodate this serialization format directly via the use of the HTML <code><script>code> element with its
446
446
<code>typecode> attribute assigned the media type for a Web Annotation:
@@ -573,8 +573,6 @@
JSON-LD Example 3
573
573
</script>
574
574
pre>
575
575
section>
576
-
577
-
<p>p>
578
576
section>
579
577
580
578
<section>
@@ -584,13 +582,15 @@
Annotations Embedded as RDFa
584
582
Instead point to the application...
585
583
TODO: Summarize comparitive advantages of this approach, e.g., markup of the target with attributes, etc. ...
-->
586
584
587
-
<p>Another approach of embedding annotations into HTML is to use RDFa[[rdfa-primer]]. The advantage of using RDFa is that the annotation features are mixed with the core HTML content, which means that, for example, the text in the HTML source can be also re-used as an annotation textual body. On the other hand, RDFa itself is an RDF serialization syntax, which means that, instead of the JSON-LD encoding used in the [[annotation-model]] document, the RDF vocabulary described in [[annotation-vocab]] must be used. (This may be an issue for some users.)p>
585
+
<p>Another approach of embedding annotations into HTML is to use RDFa[[rdfa-primer]]. The advantage of using RDFa is that the annotation features are mixed with the core HTML content, meaning that, for example, the text in the HTML source can be also re-used as an annotation textual body. In other words, a single resource may become both human visible as well as machine-readable. On the other hand, RDFa is an RDF serialization syntax: the RDF vocabulary described in [[annotation-vocab]] must thefore be used instead of the JSON-LD encoding used in the [[annotation-model]] document. This requirement may be problematic for some users.p>
588
586
589
587
<h4>Exampleh4>
590
588
591
-
<p>This example is a significantly simplified version of a more complex application, that uses an RDFa encoding of annotations within the framework for scholarly article authoring and annotation (see <ahref="https://github.com/linkeddata/dokieli"> for further detailsa>). The example shows one of the advantages of RDFa: the “Communities have various…” text, while readable when the corresponding HTML page is displayed, automatically provides the textual body of the annotation. However, the relative complexity of mixing complex RDFa structures with HTML makes it more suitable for automatic code generation (e.g., through authoring systems) rather than manual editing.p>
589
+
<p>This example is a significantly simplified version of a more complex application that uses an RDFa encoding of annotations within a framework for decentralised article authoring and annotation (see <ahref="https://dokie.li/"> for further detailsa>). The example shows one of the advantages of RDFa: the “Communities have various…” text, while readable when the corresponding HTML page is displayed, automatically provides the textual body of the annotation. However, the relative complexity of mixing complex RDFa structures with HTML makes it more suitable for automatic code generation (e.g., through authoring systems) rather than manual editing.p>
590
+
591
+
<pclass="note">The example below assumes that RDFa parsers use the <ahref="https://www.w3.org/2011/rdfa-context/rdfa-1.1">RDFa Core Initial Contexta> to understand the predefined prefixes.p>
<spanclass="w">span><spanclass="nn">rdf:span><spanclass="nt">valuespan><spanclass="w">span><spanclass="s">"... various semantics for the term <em>decentralisation</em>."span><spanclass="o">^^span><spanclass="ge">rdf:HTMLspan><spanclass="w">span>
641
+
<spanclass="w">span><spanclass="nn">rdf:span><spanclass="nt">valuespan><spanclass="w">span><spanclass="s">"Communities have various semantics for the term <em>decentralisation</em>."span><spanclass="o">^^span><spanclass="ge">rdf:HTMLspan><spanclass="w">span>
<spanclass="w">span><spanclass="nn">oa:span><spanclass="nt">suffixspan><spanclass="w">span><spanclass="s">" Web applications. This permits e"span><spanclass="w">span>
<p>Care should be taken, however, that the exact specification of what it means to mix both RDFa and embedded contents within the same HTML file is not (yet) formally specified. Tools that do understand this type p>
660
661
661
-
section>
662
+
<section>
663
+
<h4>Mixing RDFa with embedded RDF contenth4>
664
+
665
+
<p>The approach used in <ahref="#embed-json-ld">a> can be combined, within the same HTML content, with the usage of RDFa. It is also possible to use the same approach (i.e., a <code><script>code> element with an appropriate media type) to include RDF using other serializations, most notably Turtle (see <ahref="https://www.w3.org/TR/turtle/#in-html">Appendix Aa> of the [[turtle]] specification for more details). I.e, it is possible to modify the <ahref="#dokieli-example">dokieli examplea> above as follows:p>
666
+
667
+
<preid="dokieli-example-modified" class="example" title="Simplified dokieli example with embedded turtle"><script type="text/turtle">
668
+
@prefix oa: <http://www.w3.org/ns/oa#> .
669
+
670
+
<http://example.org/art#abstract> a oa:SpecificResource ;
Communities have various semantics for the term <em>decentralisation</em>.</div>
701
+
</section>
702
+
</article>pre>
703
+
704
+
<p>With an appropriate tools, understanding both RDFa and the embedded Turtle, the results would be identical to <ahref="#dokieli-example-turtle">Example 5a>.p>
664
705
706
+
<p>Care should be taken, however, that the exact details of what it means to mix both RDFa and embedded contents within the same HTML file is not (yet) formally specified. Tools that do understand this type of mix usually parse the various syntaxes into separate RDF Graphs (see [[rdf11-concepts]]) which are then merged following the rules described in the RDF Semantics document [[rdf11-mt]]. This means that, for example, blank nodes are not shared, nor are namespace declarations among the different serializations.p>
707
+
section>
708
+
section>
665
709
666
710
<section>
667
711
<h3>Web Annotation-based Citation URLsh3>
@@ -670,7 +714,7 @@
Web Annotation-based Citation URLs
670
714
examples show how these URLs could be used to reference portions of a Specific Resource on the Web via IRIs:
671
715
p>
672
716
673
-
<h4>Example using <blockquote> and <q> tagsh4>
717
+
<h4>Example using <code><blockquote>code> and <code><q>code> tagsh4>
674
718
675
719
<preclass="example highlight" title="Example blockquote and q tags using the cite attribute">
0 commit comments