Skip to content

Commit

Permalink
isLANG and LANGDIR
Browse files Browse the repository at this point in the history
  • Loading branch information
afs committed Jul 13, 2023
1 parent 6f17438 commit 571ef20
Showing 1 changed file with 84 additions and 17 deletions.
101 changes: 84 additions & 17 deletions spec/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6253,7 +6253,7 @@ <h5>LANG</h5>
</div>

<p>@@LANGDIR@@ Revisions for LANGDIR</p>
<table role="table">
<table>
<thead>
<tr>
<th>Function</th>
Expand Down Expand Up @@ -6286,29 +6286,96 @@ <h5>LANG</h5>
</section>
<section id="func-islang">
<h5>isLANG</h5>
<pre class="prototype nohighlight"> <span class="return">xsd:string</span> <span class="operator">isLANG</span> (<span class="type"><span class="type literal">literal</span></span> <span class="name">ltrl</span>)
<pre class="prototype nohighlight"> <span class="return">xsd:string</span> <span class="operator">isLANG</span> (<span class="type">RDF term</span> <span class="name">term</span>)
</pre>
<p>@@LANGDIR@@</p>
<pre>
isLANG(?x) -> ( DATATYPE(?x) = rdf:i18nString || DATATYPE(?x) = rdf:langString )
</pre>

<p>
The function <code>isLang</code> returns <code>true</code> if the
argument is a literal with a language
tag. Otherwise, the function returns false.
</p>
<p>If the argument is a lteral, the function is
equivalent to testing for the datatype of the
literal being either <code>rdf:langString</code>
or <code>rdf:dirLangString</code>.
</p>
<div class="result">
<table>
<thead>
<tr>
<th>Expression</th>
<th><code>Result</code></th>
</tr>
</thead>
<tbody>
<tr>
<td><code>isLANG("abc"@en)</code></td>
<td><code>true</code></td>
</tr>
<tr>
<td><code>isLANG(1)</code></td>
<td><code>false</code></td>
</tr>
<tr>
<td><code>isLANG(&lt;http://example/&gt;)</code></td>
<td><code>false</code></td>
</tr>
<tr>
<td><code>isLANG("abc@en--ltrl"</code></td>
<td><code>true</code></td>
</tr>
<tr>
<td><code>isLANG("تصميم المواقع"@ar-ltr)</code></td>
<td><code>true</code></td>
</tr>
</tbody>
</table>
</div>
</section>
<section id="func-langdir">
<h5>LANGDIR</h5>
<pre class="prototype nohighlight"> <span class="return">xsd:string</span> <span class="operator">LANGDIR</span> (<span class="type"><span class="type literal">literal</span></span> <span class="name">ltrl</span>)
</pre>
<p>@@LANGDIR@@</p>
<pre>
LANGDIR("abc"@ar--rtl) -> "rtl"
LANGDIR("abc"@ar) -> ""
LANGDIR("abc") -> ""
LANGDIR(1) -> ""
LANGDIR(<uri>) -> error
</pre>
<p>
If the argument is a literal,
The function <code>LANGDIR</code> returns the
language direction of a leiterl with datatype
<code>rdf:dirLangString</code>.
Otherwise, the function return the empty
string.
</p>
<div class="result">
<table>
<thead>
<tr>
<th>Expression</th>
<th><code>Result</code></th>
</tr>
</thead>
<tbody>
<tr>
<td><code>LANGDIR("abc"@en--ltr)</code></td>
<td><code>"ltr"</code></td>
</tr>
<tr>
<td><code>LANGDIR("abc"@en)</code></td>
<td><code>""</code></td>
</tr>
<tr>
<td><code>LANGDIR("abc")</code></td>
<td><code>""</code></td>
</tr>
<tr>
<td><code>LANGDIR(1)</code></td>
<td><code>""</code></td>
</tr>
<tr>
<td><code>LANGDIR(&lt;http://example/&gt;)</code></td>
<td><code>error</code></td>
</tr>
</tbody>
</table>
</div>
</section>


<section id="func-datatype">
<h5>DATATYPE</h5>
<pre class="prototype nohighlight"> <span class="return"><span class="type IRI">iri</span></span> <span class="operator">DATATYPE</span> (<span class="type"><span class="type">literal</span></span> <span class="name">literal</span>)
Expand Down

0 comments on commit 571ef20

Please sign in to comment.