From 55b944bf036afd7dce1462cf249d7a8a212d1bed Mon Sep 17 00:00:00 2001
From: Ruben Taelman Literal interface
attribute DOMString termType;
attribute DOMString value;
attribute DOMString language;
+ attribute DOMString? direction;
attribute NamedNode datatype;
boolean equals(optional Term? other);
};
@@ -241,11 +242,17 @@ Literal interface
language the language as lowercase [[BCP47]] string (examples:
"en"
, "en-gb"
) or an empty string if the literal has no language.
+ direction is defined if the string is a directional language-tagged string.
+ In this case, the direction
MUST be either be "ltr"
or "rtl"
.
+
datatype a NamedNode
whose IRI represents the datatype of the literal.
- If the literal has a language, its datatype has the IRI
+ If the literal has a language and a direction, its datatype has the IRI
+ "http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString"
.
+ If the literal has a language without direction, its datatype has the IRI
"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"
. Otherwise, if no
datatype is explicitly specified, the datatype has the IRI
"http://www.w3.org/2001/XMLSchema#string"
.
@@ -254,7 +261,8 @@
true
if
all general Term.equals conditions hold,
term.value
is the same string as other.value
,
- term.language
is the same string as other.language
, and
+ term.language
is the same string as other.language
,
+ term.direction
is the same string as other.direction
or are both undefined, and
term.datatype.equals(other.datatype)
evaluates to true
;
otherwise, it returns false
.
@@ -383,13 +391,19 @@ @@ -404,10 +418,13 @@
- literal() returns a new instance of Literal
. If
- languageOrDatatype
is a NamedNode
, then it is used for the value of
- datatype
. Otherwise languageOrDatatype
is used for the value of
- language
.
+ literal() returns a new instance of Literal
.
+ If languageOrDatatype
is a NamedNode
,
+ then it is used for the value of datatype
.
+ If languageOrDatatype
is a DirectionalLanguage
,
+ then its language
and direction
attributes
+ are respectively used for the literal's language
and direction
.
+ Otherwise languageOrDatatype
is used for the value of language
.
variable() returns a new instance of Variable
. This method is
From 1d6209d712ae1bde72aca8c84bf53899e8a0396e Mon Sep 17 00:00:00 2001
From: Ruben Taelman Literal interface
"en"
, "en-gb"
) or an empty string if the literal has no language.
- direction is defined if the string is a directional language-tagged string.
+ direction is not falsy if the string is a directional language-tagged string.
In this case, the direction
MUST be either be "ltr"
or "rtl"
.
@@ -272,7 +272,7 @@
term.value
is the same string as other.value
,
term.language
is the same string as other.language
,
- term.direction
is the same string as other.direction
or are both undefined, and
+ term.direction
is the same string as other.direction
or are both falsy, and
term.datatype.equals(other.datatype)
evaluates to true
;
otherwise, it returns false
.
@@ -433,7 +433,7 @@ datatype
.
If languageOrDatatype
is a DirectionalLanguage
,
then its language
and direction
attributes
- are respectively used for the literal's language
and direction
.
+ are respectively used for the literal's language
and direction
, where direction
is optional or can be falsy.
Otherwise languageOrDatatype
is used for the value of language
.