Skip to content

Introduce datatypes for CssSelector and XPath  #1672

Description

@danbri

Suggestion building on (experience implementing) the xpath/css mechanism from SpeakableSpecification ie. #1389

Context: http://pending.schema.org/SpeakableSpecification was added in v3.2 (including 'xpath' and 'cssSelector' properties which expect 'Text' values), in "pending review" area of schema.org.

Proposal:

  • XPathType (new datatype, subtype of Text), "Text that encodes a W3C XPath".
  • CssSelectorType (new datatype, subtype of Text), "Text that encodes a CSS selector".

Motivation: to allow applications to offer more accurate validation, error checking, and automated coercion to other representations of these datatypes. Also to help decouple the generic aspects of the SpeakableSpecification proposal from its Text-to-Speech specifics.

Currently http://pending.schema.org/xpath expects a value of type Text; if these datatypes went through, it could expect XPathType instead (and the schemas would declare this to be a specialization of Text). Similarly for cssSelector.

Potentially there could be subtypes tied to versions of Xpath and CSS. My understanding is that XPath is more explicitly versioned than CSS, perhaps Xpath explicit versions would be more necessary? e.g. https://www.w3.org/TR/xpath-30/#nt-bnf

/cc @chaals

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions