From 55b944bf036afd7dce1462cf249d7a8a212d1bed Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Wed, 25 Oct 2023 12:43:06 +0200 Subject: [PATCH 1/3] Add directional language tagged literals --- index.html | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 01a0879..50e0d62 100644 --- a/index.html +++ b/index.html @@ -225,6 +225,7 @@

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 @@

Literal interface

equals() returns 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 @@

DataFactory interface

interface DataFactory { NamedNode namedNode(DOMString value); BlankNode blankNode(optional DOMString value); - Literal literal(DOMString value, optional (DOMString or NamedNode) languageOrDatatype); + Literal literal(DOMString value, optional (DOMString or NamedNode or DirectionalLanguage) languageOrDatatype); Variable variable(DOMString value); DefaultGraph defaultGraph(); Quad quad(Term subject, Term predicate, Term _object, optional Term? graph); Term fromTerm(Term original); Quad fromQuad(Quad original); }; + + [Exposed=(Window,Worker)] + interface DirectionalLanguage { + attribute DOMString language; + attribute DOMString? direction; + };

@@ -404,10 +418,13 @@

DataFactory interface

parameter is undefined a new identifier for the blank node is generated for each call.

- 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 Date: Wed, 25 Oct 2023 12:43:53 +0200 Subject: [PATCH 2/3] Add Ruben Taelman as editor --- index.html | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/index.html b/index.html index 50e0d62..f07d094 100644 --- a/index.html +++ b/index.html @@ -22,6 +22,11 @@ url: "https://ruben.verborgh.org/", company: "Ghent University – imec", companyURL: "http://idlab.ugent.be/" + }, { + name: "Ruben Taelman", + url: "https://www.rubensworks.net/", + company: "Ghent University – imec", + companyURL: "http://idlab.ugent.be/" }], authors: [{ name: "Thomas Bergwinkl", @@ -47,6 +52,11 @@ url: "https://ruben.verborgh.org/", company: "Ghent University – imec", companyURL: "http://idlab.ugent.be/" + }, { + name: "Ruben Taelman", + url: "https://www.rubensworks.net/", + company: "Ghent University – imec", + companyURL: "http://idlab.ugent.be/" }], bugTracker: { open: "https://github.com/rdfjs/data-model-spec/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20", From f65464b448f2e5c1ffeefa4d0ca54981a7455a1e Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Fri, 27 Oct 2023 15:13:22 +0200 Subject: [PATCH 3/3] Allow direction to be falsy Co-authored-by: Thomas Bergwinkl --- index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index f07d094..a0cca3e 100644 --- a/index.html +++ b/index.html @@ -253,7 +253,7 @@

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 @@

Literal interface

all general Term.equals conditions hold, 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 @@

DataFactory interface

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. + 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.