- From: Benjamin Adrian <benjamin.adrian@dfki.de>
- Date: Wed, 19 Jan 2011 13:54:25 +0100
- To: RDFa WG <public-rdfa-wg@w3.org>
Hi,
Manu asked me to look for a way to fuse TermMap[1] and PrefixMap[2] in
the RDF-API.
[1] http://www.w3.org/2010/02/rdfa/sources/rdf-api/#term-maps
[2] http://www.w3.org/2010/02/rdfa/sources/rdf-api/#prefix-maps
I recommend using an IriMap interface that fuses the interfaces TermMap
and PrefixMap. Any comments from your side?
[NoInterfaceObject]
interface IriMAP {
getter DOMString get(in DOMString abbreviation);
setter void set (in DOMString abbreviation, in DOMString iri);
deleter void remove (in DOMString abbreviation);
DOMString resolve (in DOMString abbreviation);
DOMString shrink (in DOMString iri);
void setDefault (in DOMString iri);
IriMapMap import (in IriMap abbreviations, in optional boolean override);
IriMap importFromGraph (in Graph graph, in optional boolean override);
}
Short Example of using the IriMap:
// create a new prefix mapping for the prefix "rdfs"
iris.set("rdfs", "http://www.w3.org/2000/01/rdf-schema#")
// resolve a known CURIE
iris.resolve("rdfs:label");
// --> "http://www.w3.org/2000/01/rdf-schema#label"
// create a new token mapping for the token label
iris.set("label", "http://www.w3.org/2000/01/rdf-schema#label")
// resolve a known token
iris.resolve("label")
// --> "http://www.w3.org/2000/01/rdf-schema#label"
Compared to the current spec, the necessary interface changes that
specify this IriMap are:
1. set:
Parameter Type Description
abbreviation DOMString The abbreviation must be a valid NCName
iri DOMString An IRI, as defined by [IRI].*
* If the value of the parameter iri is classified as Namespace IRI that
is an IRI that ends either with a character value "/" or a character
value "#", then abbreviation is handled as prefix value that substitutes
the Namespace IRI.
Else, if iri is not classified as Namespace IRI, then abbreviation is
handled as token value that substitutes the IRI.
2. resolve:
Parameter Type Description
abbreviation DOMString CURIE to resolve.**
** If abbreviation is a CURIE, then resolve the abbreviated IRI as
prefix (for example "rdfs:label" is resolved as
"http://www.w3.org/2000/01/rdf-schema#label"). Else, if abbreviation is
a valid NCName, then resolve the abbreviated IRI as token (for example
"label" is resolved as "http://www.w3.org/2000/01/rdf-schema#label").
3. get, remove:
Parameter Type Description
abbreviation DOMString The term must be a valid NCName. ***
*** It deletes both, existing tokens and prefixes having the value of
the parameter abbreviation.
4. setDefault, shrink, importFromGraph, import: These methods work
similar in TermMap and PrefixMap , so they won't change in IriMap.
Best regards,
Ben
--
__________________________________________
Benjamin Adrian
Email : benjamin.adrian@dfki.de
WWW : http://www.dfki.uni-kl.de/~adrian/
Tel.: +49631 20575 1450
Twitter: http://twitter.com/BenBanBun
Skype: benbanbun
__________________________________________
Deutsches Forschungszentrum für Künstliche Intelligenz GmbH
Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
Geschäftsführung:
Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster (Vorsitzender) Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats:
Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313
__________________________________________
Received on Wednesday, 19 January 2011 12:54:59 UTC