Re: RDFa DOM API Version 0.1beta committed

Dear all,

I have a more general comment on this API, not on the details.

As I look through the interface elements, most of them are, in fact, independent of RDFa. Objects like an RDF Literal, URI references, various iterators on triples, filtering, etc, are not RDFa specific, they are the core of a generic RDF api for Javascript. I am not saying that is wrong (on the contrary!), but it may be worth making this point much more strongly in the document and in the code. I am not 100% sure how to do that in Javascript; in Python, I would separate the generic parts into a separate module or a package and I'd put the rdfa part into yet another one. That would allow non-RDFa applications, for example ones that connect to a SPARQL endpoint from javascript, to use the common classes and API implementation to extend beyond RDFa, if they wish, easily.

This also means that, at least for the core parts, we may want to solicit comments from the non-RDFa community. As an example, it might be interesting to ask the MIT Tabulator team (eg, Tim BL) to look at the documentat some point; I do not know who else is out there that have been active in this area (Mark and Benjamin probably know). I do _not_ mean to stop the FPWD publication, on the contrary: I think that we should actively ask for comments once the FPWD is public...

How does that sound?

Ivan



On Apr 21, 2010, at 12:34 , Benjamin Adrian wrote:

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


----
Ivan Herman, W3C Semantic Web Activity Lead
Home: http://www.w3.org/People/Ivan/
mobile: +31-641044153
PGP Key: http://www.ivan-herman.net/pgpkey.html
FOAF: http://www.ivan-herman.net/foaf.rdf

Received on Wednesday, 21 April 2010 12:03:20 UTC