Skip to content

Commit

Permalink
#97 Basic → Extended conversion requires JSON-LD intermediate form
Browse files Browse the repository at this point in the history
  • Loading branch information
anatoly-scherbakov committed May 13, 2023
1 parent 97c6fda commit de053b1
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion spec/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2416,7 +2416,9 @@ <h2>Convert Extended YAML-LD to Basic YAML-LD and back</h2>
<dt><code>basic_to_extended(basic_document: YAML-LD) → YAML-LD</code></dt>
<dd>
<ul>
<li>Performs JSON-LD expansion to the given Basic YAML-LD document</li>
<li>Converts YAML-LD → JSON</li>
<li>Performs JSON-LD expansion → the resulting JSON-LD document</li>
<li>Converts Expanded JSON-LD document back to YAML-LD</li>
<li>
Converts it to the Extended form, making
use of YAML-LD features to express the document more concisely.
Expand All @@ -2425,6 +2427,19 @@ <h2>Convert Extended YAML-LD to Basic YAML-LD and back</h2>
</dd>
</dl>

<div class="note">
ou won't typically need to perform these steps manually
because libraries such as <code>rdflib</code> will take care of them
under the covers, but it can help with troubleshooting and
optimization to know what's going on. So, you start with YAML,
convert it to JSON, perform JSON-LD Expansion, convert that to
YAML-LD, and do any necessary basic → extended or extended → basic
conversion on the YAML-LD. Alternatively, your library might do
YAML-LD expansion directly on the initial YAML document, and then
do any necessary basic → extended or extended → basic conversion on
the YAML-LD.
</div>

<p>
Both of these functions recursively process the source document.
Every branch and leaf are copied as is, unless they match one of the following
Expand Down

0 comments on commit de053b1

Please sign in to comment.