Difference between revisions of "WebSchemas/LookInside"

From W3C Wiki
Jump to: navigation, search
(Mark-up examples)
(Mark-up examples)
Line 5: Line 5:
 
The goal of this proposal is to help bridge between data tables and triples, by providing a simple mechanism to describe data tables so that their contents can be understood in terms of entities and properties.
 
The goal of this proposal is to help bridge between data tables and triples, by providing a simple mechanism to describe data tables so that their contents can be understood in terms of entities and properties.
  
== Mark-up examples ==
+
== Mark-up example ==
  
 
Here is an example of the mark-up for an HTML table, in RDFa:
 
Here is an example of the mark-up for an HTML table, in RDFa:
Line 25: Line 25:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Here is the equivalent JSON-LD, for a CSV table:
+
 
 +
The table is annotated with typeof="SetOf/Painting", which means each row contains a [http://schema.org/Painting Painting] instance. Each column is annotated with the name of a property of the [http://schema.org/Painting Painting] type.
 +
 
 +
== JSON-LD example ==
 +
 
 +
For non-HTML tables, an equivalent description can be provided in JSON-LD. Assuming the same table is available as a CSV at http://wp.org/rembrandt-paintings.csv :
  
 
<syntaxhighlight lang="javascript" line start="1" highlight="2,3">
 
<syntaxhighlight lang="javascript" line start="1" highlight="2,3">
Line 39: Line 44:
  
  
More information is available in the [http://lists.w3.org/Archives/Public/public-vocabs/2013Aug/att-0057/Lookinginsidetables.html full proposal].
+
More details are available in the [http://lists.w3.org/Archives/Public/public-vocabs/2013Aug/att-0061/Lookinginsidetables.html full proposal].

Revision as of 14:28, 16 August 2013

Overview

Many useful data exist in the form of tables, either inside HTML documents, or as standalone files in various formats (CSV, XLS, ODF), or in relational database management systems. While tables are a natural representation of data for many applications, they do not provide the necessary semantics to enable search engines to effectively index, and surface to users the information they contain.

The goal of this proposal is to help bridge between data tables and triples, by providing a simple mechanism to describe data tables so that their contents can be understood in terms of entities and properties.

Mark-up example

Here is an example of the mark-up for an HTML table, in RDFa:

  1. <table typeof="SetOf/Painting" vocab="http://schema.org/">
  2.   <thead>
  3.     <tr>
  4.       <th property="image">Image</th>
  5.       <th property="name">Title</th>
  6.       <th property="dateCreated">Year</th>
  7.       <th>Technique</th>
  8.       <th>Dimensions</th>
  9.       <th property="contentLocation">Gallery</th>
  10.     </tr>
  11.   </thead>
  12. <tbody>...</tbody>
  13. </table>


The table is annotated with typeof="SetOf/Painting", which means each row contains a Painting instance. Each column is annotated with the name of a property of the Painting type.

JSON-LD example

For non-HTML tables, an equivalent description can be provided in JSON-LD. Assuming the same table is available as a CSV at http://wp.org/rembrandt-paintings.csv :

  1. {
  2.   "@context": "http://schema.org/",
  3.   "@type": "SetOf/Painting",
  4.   "name": "{http://wp.org/rembrandt-paintings.csv#col:Title}",
  5.   "dateCreated" : "{http://wp.org/rembrandt-paintings.csv#col:Year}",
  6.   "contentLocation" : "{http://wp.org/rembrandt-paintings.csv#col:Gallery}",
  7.   "author": "http://en.wikipedia.org/wiki/Rembrandt"
  8. }


More details are available in the full proposal.