Passing URIs as strings to RDF Interfaces

Currently, the RDFEnvironment#createTriple and Graph#match methods only
accept URIs in the form of a NamedNode instance, which is created through
the RDFEnvironment#createNamedNode method. This is rather lengthy and
verbose, and creates really lengthy lines of code:

    var triple =
rdfenv.createTriple(rdfenv.createNamedNode(resources.variant.resource),
rdfenv.createNamedNode(rdfns('type')), rdfenv.createNamedNode(thing));

Passing URIs as simple strings would be much nicer:

    var triple = rdfenv.createTriple(resources.variant.resource,
rdfns('type'), thing);

(Here, rdfns is a function that serves the role of a CURIE by prepending an
RDF namespace URI to a given string.)

Does anyone see any problems with adding this behavior as de-facto? One
potential problem is that it's confusing that you put a string in but get a
NamedNode out. And all the standard problems that come with such extensions.

Perhaps we (The RDF JavaScript Libraries Community Group) should undertake
work on RDF Interfaces and related specifications where the RDFa WG left
off? Particularly the following:

http://www.w3.org/TR/rdf-interfaces/
http://www.w3.org/TR/rdfa-api/
http://www.w3.org/TR/rdf-api/

Some other features I would like to see:

* Chunked streaming of documents like Turtle, as now it only defines how to
pass an entire document all-at-once.
* Addition of Graph#merge, Graph#union, Graph#instanceOf, and
Graph#equals/isomorphic (as defined in RDF 1.1 Semantics).
* Utilities for working with RDF Collections and iterating arbitrary linked
lists
* New API for making more complex queries on data, e.g. SPARQL (maybe)

Does anyone have interest in any of these?

Can a CG even take over the RDFa WG's work?

Thanks,

Austin Wright.

Received on Monday, 29 September 2014 17:23:18 UTC