ISSUE-50: TypedLiteralConverter modifier parameter

TypedLiteralConverter modifier

TypedLiteralConverter modifier parameter

State:
POSTPONED
Product:
RDFa 1.1 API
Raised by:
Nathan Rixham
Opened on:
2010-10-27
Description:
Spec Issue:
"The RDFa Working Group is still discussing whether or not having a modifier is a good idea as 90% of use cases will never use it and the remaining use cases could provide the functionality with an external switch to the conversion function."

Proposal:
remove "modifier" from DataContext.convertType and TypedLiteralConverter.convert
change return of registerTypeConversion from void to TypedLiteralConverter.

IDL:

interface DataContext {
void setMapping (in DOMString prefix, in DOMString iri);
TypedLiteralConverter registerTypeConversion (in DOMString iri, in TypedLiteralConverter converter);

IRI resolveCurie (in DOMString curie);
any convertType (in DOMString value, in optional DOMString inputType);
}

[NoInterfaceObject Callback]
interface TypedLiteralConverter {
any convert (in DOMString value, in optional IRI inputType);
};


TypedLiteralConverter usage:

function myStringIntConverter(value,inputType) {
// implementation which returns a string representation
// of an int rather than a native int
}
var context = document.data.context;
// get the native converter and register a custom one
var nativeConverter = context.registerTypeConversion('xsd:int', myStringIntConverter);
// work with data
context.registerTypeConversion(nativeConverter); //return to native mode

The above should handle any use case which the modifier parameter could handle, without needing an additional parameter.
Related Actions Items:
No related actions
Related emails:
  1. RDFa API new Issues - summary (from nathan@webr3.org on 2010-10-28)
  2. ISSUE-50: TypedLiteralConverter modifier parameter [RDFa 1.1 API] (from sysbot+tracker@w3.org on 2010-10-27)

Related notes:

No additional notes.

Display change log ATOM feed


Chair, Staff Contact
Tracker: documentation, (configuration for this group), originally developed by Dean Jackson, is developed and maintained by the Systems Team <w3t-sys@w3.org>.
$Id: 50.html,v 1.1 2015/03/27 14:12:24 vivien Exp $