cygri/pubby — pull request #18 by jeremycarroll (2013-08-23 22:38:06+00:00)
Title: Master

Hi Richard
so, I have made a moderate amount of change to get pubby to do what I wanted.
This suggests that my use case is somewhat off-center from your development and/or I see the world somewhat differently.

I will sketch my use case, and then describe the changes.

We have all our triples in a single local SPARQL end point, including cached copies of say the RDF ontology, and owl.rdf etc.
The target users for pubby are the developers, particularly those who have little semantic web expertise.
Given this, the careful management of resources and pubby proxy resources with different URLs seems like a confusion that this target audience would rather have glossed over.
In my use case, the data option as opposed to the page option is totally uninteresting.

Thus, I put some effort into managing the mapping between the two mirrored URI spaces.

Specific changes are:

1: Longest namespace URI lookup - we have nested namespaces, and your code was a bit naive for us
The SimplePrefixMapping class is an improvement even if you are not convinced by the rest of the code

2: In ModelTranslator I use all the datasets to map uris not just the current dataset

3: I map any variant of a namespace URI to the same prefix in SimplePrefixMapping (with non null config)
This includes ones in the pubby namespace, and ones ending in %23 rather than #. This means that basically
all my URIs of interest get mapped to qnames, which gloss away the difference between the pubby proxy URIs
and the originals

4: For data pages (untested) I try to leave the behavior unchanged.

5: I have a method on config that guesses the original URIs for pubby proxy URIs, and use this to munge the display wherever I saw a pubby proxy URI in the raw (I basically don't want to see them)

I hope some or all of this is helpful.

Jeremy