Skip to content

describing property-based indexing as a variant of data indexing #145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 17, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GIT
remote: git://github.com/ruby-rdf/json-ld.git
revision: 32935901cd7390b256c6904c096645681db3668f
revision: 3ad421e9e0328be7225809012f0091c269e84b5c
branch: develop
specs:
json-ld (3.0.2)
Expand Down Expand Up @@ -80,9 +80,9 @@ GEM
nokogumbo (1.5.0)
nokogiri
public_suffix (3.0.3)
rack (2.0.6)
rack (2.0.7)
rake (12.3.2)
rdf (3.0.10)
rdf (3.0.11)
hamster (~> 3.0)
link_header (~> 0.0, >= 0.0.8)
rdf-aggregate-repo (2.2.1)
Expand Down Expand Up @@ -131,8 +131,8 @@ GEM
rdf-turtle (3.0.5)
ebnf (~> 1.1)
rdf (~> 3.0)
rdf-vocab (3.0.4)
rdf (~> 3.0)
rdf-vocab (3.0.5)
rdf (~> 3.0, >= 3.0.11)
rdf-xsd (3.0.1)
rdf (~> 3.0)
shex (0.5.2)
Expand Down
2 changes: 1 addition & 1 deletion common/extract-examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def dataset_to_table(repo)

File.open(input, "r") do |f|
doc = Nokogiri::HTML.parse(f.read)
doc.css(".example, .illegal-example").each do |element|
doc.css(".example").each do |element|
error = nil
warn = nil
example_number += 1 if %w(pre aside).include?(element.name)
Expand Down
194 changes: 192 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6166,8 +6166,8 @@ <h3>Using the Document Base for the Default Vocabulary</h3>

<p>Databases are typically used to make access to
data more efficient. Developers often extend this sort of functionality into
their application data to deliver similar performance gains. Often this
data does not have any meaning from a Linked Data standpoint, but is
their application data to deliver similar performance gains.
This data may have no meaning from a Linked Data standpoint, but is
still useful for an application.</p>

<p>JSON-LD introduces the notion of <a>index maps</a>
Expand Down Expand Up @@ -6552,6 +6552,196 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
-->
</pre>
</aside>

<section class="informative changed"><h3>Property-based data indexing</h3>
<p>In its simplest form (as in the examples above),
data indexing assigns no semantics to the keys of an <a>index map</a>.
However, in some situations,
the keys used to index objects are semantically linked to these objects,
and should be preserved not only syntactically, but also semantically.
</p>
<p>If the <a>processing mode</a> is set to <code>json-ld-1.1</code>,
<code>"@container": "@index"</code> in a term description can be accompanied with
an <code>"@index"</code> key. The value of that key must map to an <a>IRI</a>,
which identifies the semantic property linking each object to its key.
</p>
<aside class="example ds-selector-tabs"
title="Property-based data indexing">
<div class="selectors">
<button class="selected" data-selects="original">Original</button>
<button data-selects="expanded">Expanded</button>
<button data-selects="statements">Statements</button>
<button data-selects="turtle">Turtle</button>
<a class="playground" target="_blank"></a>
</div>
<pre class="original selected nohighlight" data-transform="updateExample">
<!--
{
"@context": {
"@version": 1.1,
"schema": "http://schema.org/",
"dc": "http://purl.org/dc/elements/1.1/",
"name": "schema:name",
"body": "schema:articleBody",
"words": "schema:wordCount",
"post": {
"@id": "schema:blogPost",
****"@container": "@index",
"@index": "dc:language"****
}
},
"@id": "http://example.com/",
"@type": "schema:Blog",
"name": "World Financial News",
"post": {
"en": {
"@id": "http://example.com/posts/1/en",
"body": "World commodities were up today with heavy trading of crude oil...",
"words": 1539
},
"de": {
"@id": "http://example.com/posts/1/de",
"body": "Die Werte an Warenbörsen stiegen im Sog eines starken Handels von Rohöl...",
"words": 1204
}
}
}
-->
</pre>
<pre class="expanded nohighlight"
data-transform="updateExample"
data-ignore
data-result-for="Property-based data indexing-original">
<!--
[{
"@id": "http://example.com/",
"@type": ["http://schema.org/Blog"],
"http://schema.org/name": [{"@value": "World Financial News"}],
"http://schema.org/blogPost": [{
"@id": "http://example.com/posts/1/en",
"http://schema.org/articleBody": [
{"@value": "World commodities were up today with heavy trading of crude oil..."}
],
"http://schema.org/wordCount": [
{"@value": 1539}
],
****"http://purl.org/dc/elements/1.1/language": "en"****
}, {
"@id": "http://example.com/posts/1/de",
"http://schema.org/articleBody": [
{"@value": "Die Werte an Warenbörsen stiegen im Sog eines starken Handels von Rohöl..."}
],
"http://schema.org/wordCount": [{"@value": 1204}],
****"http://purl.org/dc/elements/1.1/language": "de"****
}]
}]
-->
</pre>
<table class="statements"
data-ignore
data-result-for="Property-based data indexing-expanded"
data-to-rdf>
<thead><tr>
<th>Subject</th>
<th>Property</th>
<th>Value</th>
<th>Value Type</th>
</tr></thead>
<tbody>
<tr>
<td>http://example.com/</td>
<td>rdf:type</td>
<td>schema:Blog</td>
<td></td>
</tr>
<tr>
<td>http://example.com/</td>
<td>schema:name</td>
<td>World Financial News</td>
<td></td>
</tr>
<tr>
<td>http://example.com/</td>
<td>schema:blogPost</td>
<td>http://example.com/posts/1/de</td>
<td></td>
</tr>
<tr>
<td>http://example.com/</td>
<td>schema:blogPost</td>
<td>http://example.com/posts/1/en</td>
<td></td>
</tr>
<tr>
<td>http://example.com/posts/1/de</td>
<td>schema:articleBody</td>
<td>Die Werte an Warenbörsen stiegen im Sog eines starken Handels von Rohöl...</td>
<td></td>
</tr>
<tr>
<td>http://example.com/posts/1/de</td>
<td>schema:wordCount</td>
<td>1204</td>
<td>xsd:integer</td>
</tr>
<tr>
<td>http://example.com/posts/1/de</td>
<td>dc:language</td>
<td>de</td>
<td></td>
</tr>
<tr>
<td>http://example.com/posts/1/en</td>
<td>schema:articleBody</td>
<td>World commodities were up today with heavy trading of crude oil...</td>
<td></td>
</tr>
<tr>
<td>http://example.com/posts/1/en</td>
<td>schema:wordCount</td>
<td>1539</td>
<td>xsd:integer</td>
</tr>
<tr>
<td>http://example.com/posts/1/en</td>
<td>dc:language</td>
<td>en</td>
<td></td>
</tr>
</tbody>
</table>
<pre class="turtle nohighlight"
data-content-type="text/turtle"
data-ignore
data-result-for="Property-based data indexing-expanded"
data-transform="updateExample"
data-to-rdf>
<!--
@prefix schema: <http://schema.org/> .
@prefix dc: <http://purl.org/dc/elements/1.1/language> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<http://example.com/> a schema:Blog;
schema:blogPost <http://example.com/posts/1/de>,
<http://example.com/posts/1/en>;
schema:name "World Financial News" .

<http://example.com/posts/1/de>
schema:articleBody
"Die Werte an Warenbörsen stiegen im Sog eines starken Handels von Rohöl...";
schema:wordCount 1204;
****dc:language "de"****.

<http://example.com/posts/1/en>
schema:articleBody
"World commodities were up today with heavy trading of crude oil...";
schema:wordCount 1539;
****dc:language "en"****.
-->
</pre>
</aside>
</section>

</section>
<section class="informative"><h2>Language Indexing</h2>

Expand Down