On 21/01/11 23:11, Reto Bachmann-Gmuer wrote:
On Fri, Jan 21, 2011 at 2:39 PM, Andy Seaborne<
[email protected]> wrote:
On 20/01/11 15:56, Reto Bachmann-Gmuer wrote:
Hi
It retreives the map and then asks for the set of entries. So it seems
there's no way to bind it to a service, it wants to know all possible
bindings before it starts.
I created JENA-31 to have a more felxible support here.
Cheers,
reto
Why not override the other methods? - presumable it's calling
getNsPrefixMap.
The contract to the writer (and this applies to all writers, not just
RDF/XML) is "here's some prefixes, here's some RDF, go write stuff as best
you can".
Yes, currently it needs the finite set of prefix-mappings, JENA-31 the
contact is generalied to "here's something that delivers prefixes for URIs,
here some RDF, go...". This allows to pass in a map as this is possible now,
but also a service that consults a huge database or does some complicated
magic to generate a prefix suggestion.
It breaks some serializers. Now everything is RDF/XML. In Trutle
serializers, there is no need to have any prefix mappings because the
graph can be written out without them (unlike RDF/XML).
Note you can add your own RDF writers so you can put a serialaizer in
that does what you want, indeed, you could intercept the calls to one
writer, do the preparation specific to Clerezza and then call the
underlying code.
Adding calls into the application for decisions still requires application
code.
RDF/XML is special because to write properties in RDF/XML requires an XML
namespace. Other formats do not need any prefixes to write legal output and
would be greatly complicated to have
Prefixes often get set because they are in the input. Carrying them around
is convenient and (as we have found) expected by users even if not used.
For the specific use case in Clerezza,
1/ Layer the problem.
Why not look through the model, decide the prefixes you do want, then set
the prefix mapping for model and then write it. This gives the application
(i.e. Clerezza) a chance to influence the choices.
In Clerezza we have a service that delivers CURIE-prefixes, this should be
sued by serializers
2/ Set the prefixes when the data is created - this seems to me to be the
more natural point to make choices.
The Clerezza storage abstraction is based on the RDF abstract syntax which
doesn't know about prefixes. So while the CURIE prefix service might learn
from the prefixes used in incoming data, the prefixes should not be tied to
the data in which they were used.
There is a strong user expectation that the namespace declarations and
prefix declarations in the data read into a model, they will be used on
output. We know because when this does not happen, we hear about it.
Andy