RDFa DOM API Version 0.1beta committed

Hi,

Today I committed Version 0.1beta of the RDFa DOM API prototype.
It is availlable on our draft page [1].

I documented the whole API with jsdoc  and published it on our drafts 
page [2].
 From my point of view, this API documentation will be the base for 
specifying
the new WEB IDL version.

New Changes

Version 0.1beta has following changes. Please have a look into the USE 
CASES section of [1]
There you see executable code samples.

1. Replaced PlayGround section with Use Cases Section
    Here the use of all types and methods are shown in small code snippets.
2. Added rdfa.version attribute to describe the current API version
3. jsdoc[3] annotations are added to all public interface types and methods.
4. All attributes and methods of the global object rdfa are set to be 
static.
5. Moved vocabulary mappings to be attributes of rdfa (e.g., 
rdfa.rdf.type results in an URI value)
6. Added rdfa.setMapping(prefix, value, uri) to add new vocabulary mappings
7. RDF and XSD are implemented as default mappings in the RDFa DOM API. 
Other mappings
   can be reloaded by importing external documents.
8. In order to be compliant to ECMA 3 the method rdfa.each(array, 
function) is added.
    It calls function for each RDF triple in array.
9. Added Array behaviour to RDFTriple and RDFTripleList
    (e.g., triple.subject can also be written as triple[1])
    (e.g., tripleList.get(1) can also be written as tripleList[1])
10. Therefore rdfa.filter(...) is removed because rdfa.list() now 
provides same functionality and
      usability to work with arrays

Based on several good proposals done by Mark, following things were added:
11.  Added type RDFaObject that contains all information about 
properties of a single subject.
       It can be used in JSON style.
12. Added rdfa.extractObject(subject) to create such an RDFaObject for a 
given subject URI.
13. Added rdfa.getElements(subject, predicate, object, filter). This 
method gives you a list of DOM nodes that
      contain RDF triples that match with subject, predicate, object, 
and a user defined filter function.
14. Added the attributes URI.element, BlankNode.element, 
PlainLiteral.element, TypedLiteral.element.
      These attributes are set by the RDFaParser to a DOM Node that 
contains exactly this RDf Resource in its
      RDFa data.

Open Issues are:
 - What's the encoding of the value of TypedLiteral or PlainLiteral if 
the web page is encoded in ISO or in UTF-8?
 - Adding the shared attribute element for TypedLiteral, PlainLiteral, 
URI, and BlankNode may let us re-consider
   to order them in a small hierarchy starting with RDFResource as root.
 - A problem with chaining and NodeTraversals in the RDFa DOM API.
   Expect you have
   <div about="[p:1]">
       <b id="1" property="[foaf:name]"> foo </b>
   </div>
   If you now call  rdfa.list(null, null, null, 
document.getElementByID("1")),
   what kind of triple is in the list?    <?>  foaf:name "foo"
   Is <?> a BlankNode?
 
My open WorkItems are:
  - update the API specification [4]
  - create WEB IDL specification for the RDFa DOM API JS prototype

Best regards,

Benjamin

[1] 
http://www.w3.org/2010/02/rdfa/drafts/2010/ED-rdfa-dom-api-20100421/rdfa_dom_api.js
[2] 
http://www.w3.org/2010/02/rdfa/drafts/2010/ED-rdfa-dom-api-20100421/js_docs_out/index.html
[3] http://jsdoc.sourceforge.net/
[4] 
http://www.w3.org/2010/02/rdfa/drafts/2010/ED-rdfa-dom-api-2010042/Overview.html 


-- 
__________________________________________
Benjamin Adrian
Email : benjamin.adrian@dfki.de
WWW : http://www.dfki.uni-kl.de/~adrian/
Tel.: +49631 20575 145
__________________________________________
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, 21 April 2010 10:35:48 UTC