diff --git a/spec/index.html b/spec/index.html index 8d51a6b..daa397e 100644 --- a/spec/index.html +++ b/spec/index.html @@ -6145,10 +6145,10 @@
-xsd:string STR (literal ltrl) +xsd:string STR (literal literal) xsd:string STR (IRI rsrc)-
Returns the lexical form of ltrl
(a
+
Returns the lexical form of literal
(a
literal); returns the codepoint representation of
rsrc
(an IRI). This is useful for examining
parts of an IRI, for instance, the host-name.
+ Function examples: +
+Expression | +Result | +
---|---|
LANG("abc"@en) |
+ "en" |
+
LANG("abc"@en--ltr) |
+ "en" |
+
LANG("abc") |
+ "" |
+
LANG(1) |
+ "" |
+
LANG(<http://example/>) |
+ error |
+
xsd:string LANGDIR (literal ltrl) ++
+ If the argument is a literal with rdf:dirLangString
+ as its datatype IRI,
+ the function LANGDIR
returns the
+ base direction
+ of this literal.
+ Otherwise, the function returns the empty string.
+
Expression | +Result | +
---|---|
LANGDIR("abc"@en--ltr) |
+ "ltr" |
+
LANGDIR("abc"@en) |
+ "" |
+
LANGDIR("abc") |
+ "" |
+
LANGDIR(1) |
+ "" |
+
LANGDIR(<http://example/>) |
+ error |
+
xsd:string hasLANG (RDF term term) ++
+ The function `hasLANG` returns true
if the
+ argument is a literal with a language
+ tag. Otherwise, the function returns false
.
+
If the argument is a literal, the function is equivalent to + testing for the datatype of the literal being either + `rdf:langString` or `rdf:dirLangString`. +
+Expression | +Result | +
---|---|
hasLANG("abc"@en) |
+ true |
+
hasLANG("abc@"en--ltr) |
+ true |
+
hasLANG("تصميم المواقع"@ar--rtl) |
+ true |
+
hasLANG(1) |
+ false |
+
hasLANG(<http://example/>) |
+ false |
+
xsd:string hasLANGDIR (RDF term term) ++
+ The function `hasLANGDIR` returns true
if the
+ argument is a literal with a language tag and a base direction.
+ Otherwise, the function returns false
.
+
If the argument is a literal, the function is equivalent to + testing for the datatype of the literal being + `rdf:dirLangString`. +
+Expression | +Result | +
---|---|
hasLANGDIR("abc"@en) |
+ false |
+
hasLANGDIR("abc@"en--ltr) |
+ true |
+
hasLANGDIR("تصميم المواقع"@ar--rtl) |
+ true |
+
hasLANGDIR(1) |
+ false |
+
hasLANGDIR(<http://example/>) |
+ false |
+
iri DATATYPE (literal literal)-
Returns the datatype IRI of a
- literal
.
- The datatype of a literal with a language tag is rdf:langString
.
-
Returns the datatype IRI of + the given literal.
+
+ The datatype IRI of a literal with a
+ language tag
+ and no base direction
+ is rdf:langString
.
+
+ The datatype IRI of a literal with a
+ language tag
+ and a
+ base direction
+ is rdf:dirLangString
.
+
PREFIX foaf: <http://xmlns.com/foaf/0.1/> @@ -6336,13 +6525,24 @@BNODE
This functionality is compatible with the treatment of blank nodes in SPARQL CONSTRUCT templates.
++ STRDT
literal STRDT(xsd:string lexicalForm, IRI datatypeIRI)-The
+STRDT
function constructs a literal with lexical form and type as - specified by the arguments.The
STRDT
function constructs a literal with + lexical form + and + datatype IRI + as specified by the arguments. +++ +
+ +Expression +Result +@@ -6355,23 +6555,108 @@ STRDT("123", xsd:integer)
STRDT
+ `STRDT` should not be called with `datatypeIRI` argument + `rdf:langString` or `rdf:dirLangString`. To create literals with + these IRIs as datatype IRI, function `STRLANG` + or `STRLANGDIR` should be used. ++ + STRLANG
literal STRLANG(xsd:string lexicalForm, xsd:string langTag)-The
+STRLANG
function constructs a literal with lexical form and language - tag as specified by the arguments.The
+STRLANG
function constructs a literal with + lexical form + and + language tag + as specified by the arguments. ++ The argument `langTag` MUST not be an empty string and SHOULD be a + a valid language tag. +
++ +
-+ +Expression +Result +- - -- STRLANG("chat", "en")
"chat"@en ++ STRLANG("chat", "fr")
"chat"@fr + ++ STRLANG("abc", "")
error ++ + + ++ STRLANG(123, "en")
error ++ STRLANGDIR
+literal STRLANGDIR(xsd:string lexicalForm, xsd:string langTag, xsd:string baseDirection)++ The
+STRLANGDIR
function constructs a literal with + lexical form, + language tag and + base direction + as specified by the arguments. ++ The argument `langTag` MUST not be an empty string and SHOULD be a + a valid language tag. + The argument `baseDirection` MUST be either `"ltr"` or `"rtl"`. +
+++ +
++ + + +Expression +Result ++ ++ STRLANGDIR("abc", "en", "ltr")
+ "abc"@en--ltr
+ ++ STRLANGDIR("abc", "en", "LTR")
error ++ ++ STRLANGDIR("قطة", "ar", "rtl")
"قطة"@ar--rlt ++ ++ STRLANGDIR("abc", "en", "")
error ++ ++ STRLANGDIR("abc", "", "ltr")
error ++ ++ STRLANGDIR(123, "", "ltr")
error ++ + ++ STRLANGDIR(<x:uri>, "en", "ltr")
error +UUID
iri UUID()@@ -6415,7 +6700,7 @@Strings in SPARQL Functions
String arguments
Certain functions (e.g., REGEX, STRLEN, CONTAINS) take a
string literal
as an argument and accept a literal with datatypexsd:string
, or a literal with a - language tag. They then act on the lexical form + language tag. They then act on the lexical form of the literal.The term
@@ -6431,9 +6716,27 @@string literal
is used in the function descriptions for this. Use of any other RDF term will cause a call to the function to raise an error.Argument Compatibility Rules
functions raises an error.Compatibility of two arguments is defined as:
-
- The arguments are literals with datatype
-xsd:string
- The arguments are literals with identical language tags
-- The first argument is a literal with a language tag and the second argument is a literal with datatype
+xsd:string
- + The arguments are literals with datatype
+xsd:string
+- + The arguments are literals with datatype
+rdf:langString
+ and the same language tags +- + The arguments are literals with datatype
+rdf:dirLangString
+ and the same + language tag + and base direction +- + The first argument is a literal with datatype
+rdf:langString
+ and the second argument is a literal with datatypexsd:string
+- + The first argument is a literal with datatype
rdf:dirLangString
, + and the second argument has datatypexsd:string
+@@ -6485,7 +6803,11 @@@@ -6470,9 +6773,24 @@
Argument Compatibility Rules
+ "abc" +"b"@en--ltr +no ++ +"abc"@en--ltr +"b"@en--ltr +yes ++ +"abc"@en--ltr "b"@en no + "abc"@en--ltr +"z" +yes +Argument Compatibility Rules
String Literal Return Type
Functions that return a string literal do so with the string literal of the same - kind as the first argument (literal with datatype
xsd:string
, literal with the same language tag). + kind as the first argument (literal with datatypexsd:string
, literal + with the same + language tag + and optional + base direction). This includes SUBSTR, STRBEFORE and STRAFTER.The function CONCAT returns a string literal based on the @@ -6498,7 +6820,8 @@
STRLEN
The
strlen
function corresponds to the XPath fn:string-length function and returns an -xsd:integer
equal to the length in characters of the lexical form of the +xsd:integer
equal to the length in characters of the + lexical form of the literal.@@ -6528,8 +6851,10 @@
SUBSTR
The
+ as thesubstr
function corresponds to the XPath fn:substring function and returns a literal of the same kind (literal with datatypexsd:string
, literal with the same language tag) - as thesource
input parameter but with a lexical form derived from - the substring of the lexical form of the source.source
input parameter but with a + lexical form + derived from the substring of the lexical form of the source. +The arguments
startingLoc
andlength
may be derived types of xsd:integer.The index of the first character in a strings is 1.
@@ -11862,10 +12187,11 @@Changes between SPARQL 1.1 Query Language and SPARQL 1.2 Query Language
Remove concepts of plain and simple literals, in favor of explicit mentions of xsd:string Update grammar for triple terms, reifiers, reified triples, annotation syntax, and triple term functions in -Update grammar for initial text direction syntax and functions in +Update grammar for literal base direction syntax and functions in Migrate XML Schema references to 1.1 Update references to XPath from 2.0 to 3.1 Add functions on triple terms to +Add functions related to base direction and language tag `LANGDIR`, `hasLANG`, hasLANGDIR, `STRLANGDIR`