Redirecting PURLs to ID anchors in HTML documents

46 views
Skip to first unread message

Thomas Baker

unread,
May 14, 2012, 10:33:01 AM5/14/12
to Pedantic Web
Dear all,

With excellent help from Gregg Kellogg and Hugh Barnes on the public-rdfa
mailing list, DCMI should be in a position one week from now to publish DCMI
Metadata Terms in RDFa. The code and source data for this work is available on
GitHub [2].

The RDFa document is being generated with ID= references in the HTML. Already
today, clicking on [3] will take you to the spot in the Web page that describes
dcterms:title, while clicking on [4] will take you to dc:title.

Next week, we could simply redirect the PURLs to the "latest version URI" of
DCMI Metadata Terms -- now containing RDFa -- which would, in turn, redirect to
the URI of the latest snapshot. However, it would be nicer if we could
redirect the PURLs directly to the ID= references.

Currently, if you dereference the URI for Title [7], it redirects to the RDF
schema URI plus "#title" [8] -- which, perhaps unfortunately, does not resolve
to anything in the RDF schema. If we edit the PURLs to point to the latest
version of /documents/dcmi-terms/, the PURL server will presumably return the
URI of the latest version, plus "#title" [9].

I suppose it might be possible to batch-upload PURL mappings for each the URIs
of the 126 terms in the DCMI vocabularies (see list below), but that seems like
a rather cumbersome way to solve the problem, as new mappings would need to be
entered for each new DCMI term. I haven't checked the PURL server documentation
to see if this would be possible.

It might be better if the mappings could be maintained in the DCMI server,
perhaps as Apache rewrites, but I do not see any way to get around the problem
of disambiguating [9] to either [3] or [4].

There are only fifteen URIs that share a common ending -- the fifteen
properties of the Dublin Core Metadata Element Set. One "85%" solution would
be to change the ID= references to be identical to the ending of the
corresponding PURL. In other words, "s/classes-Agent/Agent/". However, that
would mean that the PURL resolution would not work correctly either for
dcterms:title or for dc:title. Is a 85% solution perhaps close enough?

Your comments and suggestions would be much appreciated, along with any advice
about what we would need to consider in serving up the RDFa page.

Many thanks,
Tom

[1] http://lists.w3.org/Archives/Public/public-rdfa/
[2] https://github.com/dublincore/website
[3] http://dublincore.org/documents/dcmi-terms/#terms-title
[4] http://dublincore.org/documents/dcmi-terms/#elements-title
[5] http://dublincore.org/documents/dcmi-terms/
[6] http://dublincore.org/documents/2012/05/21/dcmi-terms/
[7] http://purl.org/dc/terms/title
[8] http://dublincore.org/2010/10/11/dcterms.rdf#title
[9] http://dublincore.org/documents/dcmi-terms/#title

classes-Agent http://purl.org/dc/terms/Agent
classes-AgentClass http://purl.org/dc/terms/AgentClass
classes-BibliographicResource http://purl.org/dc/terms/BibliographicResource
classes-FileFormat http://purl.org/dc/terms/FileFormat
classes-Frequency http://purl.org/dc/terms/Frequency
classes-Jurisdiction http://purl.org/dc/terms/Jurisdiction
classes-LicenseDocument http://purl.org/dc/terms/LicenseDocument
classes-LinguisticSystem http://purl.org/dc/terms/LinguisticSystem
classes-Location http://purl.org/dc/terms/Location
classes-LocationPeriodOrJurisdiction http://purl.org/dc/terms/LocationPeriodOrJurisdiction
classes-MediaType http://purl.org/dc/terms/MediaType
classes-MediaTypeOrExtent http://purl.org/dc/terms/MediaTypeOrExtent
classes-MethodOfAccrual http://purl.org/dc/terms/MethodOfAccrual
classes-MethodOfInstruction http://purl.org/dc/terms/MethodOfInstruction
classes-PeriodOfTime http://purl.org/dc/terms/PeriodOfTime
classes-PhysicalMedium http://purl.org/dc/terms/PhysicalMedium
classes-PhysicalResource http://purl.org/dc/terms/PhysicalResource
classes-Policy http://purl.org/dc/terms/Policy
classes-ProvenanceStatement http://purl.org/dc/terms/ProvenanceStatement
classes-RightsStatement http://purl.org/dc/terms/RightsStatement
classes-SizeOrDuration http://purl.org/dc/terms/SizeOrDuration
classes-Standard http://purl.org/dc/terms/Standard
dcam-VocabularyEncodingScheme http://purl.org/dc/dcam/VocabularyEncodingScheme
dcam-memberOf http://purl.org/dc/dcam/memberOf
dcmitype-Collection http://purl.org/dc/dcmitype/Collection
dcmitype-Dataset http://purl.org/dc/dcmitype/Dataset
dcmitype-Event http://purl.org/dc/dcmitype/Event
dcmitype-Image http://purl.org/dc/dcmitype/Image
dcmitype-InteractiveResource http://purl.org/dc/dcmitype/InteractiveResource
dcmitype-MovingImage http://purl.org/dc/dcmitype/MovingImage
dcmitype-PhysicalObject http://purl.org/dc/dcmitype/PhysicalObject
dcmitype-Service http://purl.org/dc/dcmitype/Service
dcmitype-Software http://purl.org/dc/dcmitype/Software
dcmitype-Sound http://purl.org/dc/dcmitype/Sound
dcmitype-StillImage http://purl.org/dc/dcmitype/StillImage
dcmitype-Text http://purl.org/dc/dcmitype/Text
elements-contributor http://purl.org/dc/elements/1.1/contributor
elements-coverage http://purl.org/dc/elements/1.1/coverage
elements-creator http://purl.org/dc/elements/1.1/creator
elements-date http://purl.org/dc/elements/1.1/date
elements-description http://purl.org/dc/elements/1.1/description
elements-format http://purl.org/dc/elements/1.1/format
elements-identifier http://purl.org/dc/elements/1.1/identifier
elements-language http://purl.org/dc/elements/1.1/language
elements-publisher http://purl.org/dc/elements/1.1/publisher
elements-relation http://purl.org/dc/elements/1.1/relation
elements-rights http://purl.org/dc/elements/1.1/rights
elements-source http://purl.org/dc/elements/1.1/source
elements-subject http://purl.org/dc/elements/1.1/subject
elements-title http://purl.org/dc/elements/1.1/title
elements-type http://purl.org/dc/elements/1.1/type
ses-Box http://purl.org/dc/terms/Box
ses-ISO3166 http://purl.org/dc/terms/ISO3166
ses-ISO639-2 http://purl.org/dc/terms/ISO639-2
ses-ISO639-3 http://purl.org/dc/terms/ISO639-3
ses-Period http://purl.org/dc/terms/Period
ses-Point http://purl.org/dc/terms/Point
ses-RFC1766 http://purl.org/dc/terms/RFC1766
ses-RFC3066 http://purl.org/dc/terms/RFC3066
ses-RFC4646 http://purl.org/dc/terms/RFC4646
ses-RFC5646 http://purl.org/dc/terms/RFC5646
ses-URI http://purl.org/dc/terms/URI
ses-W3CDTF http://purl.org/dc/terms/W3CDTF
terms-abstract http://purl.org/dc/terms/abstract
terms-accessRights http://purl.org/dc/terms/accessRights
terms-accrualMethod http://purl.org/dc/terms/accrualMethod
terms-accrualPeriodicity http://purl.org/dc/terms/accrualPeriodicity
terms-accrualPolicy http://purl.org/dc/terms/accrualPolicy
terms-alternative http://purl.org/dc/terms/alternative
terms-audience http://purl.org/dc/terms/audience
terms-available http://purl.org/dc/terms/available
terms-bibliographicCitation http://purl.org/dc/terms/bibliographicCitation
terms-conformsTo http://purl.org/dc/terms/conformsTo
terms-contributor http://purl.org/dc/terms/contributor
terms-coverage http://purl.org/dc/terms/coverage
terms-created http://purl.org/dc/terms/created
terms-creator http://purl.org/dc/terms/creator
terms-date http://purl.org/dc/terms/date
terms-dateAccepted http://purl.org/dc/terms/dateAccepted
terms-dateCopyrighted http://purl.org/dc/terms/dateCopyrighted
terms-dateSubmitted http://purl.org/dc/terms/dateSubmitted
terms-description http://purl.org/dc/terms/description
terms-educationLevel http://purl.org/dc/terms/educationLevel
terms-extent http://purl.org/dc/terms/extent
terms-format http://purl.org/dc/terms/format
terms-hasFormat http://purl.org/dc/terms/hasFormat
terms-hasPart http://purl.org/dc/terms/hasPart
terms-hasVersion http://purl.org/dc/terms/hasVersion
terms-identifier http://purl.org/dc/terms/identifier
terms-instructionalMethod http://purl.org/dc/terms/instructionalMethod
terms-isFormatOf http://purl.org/dc/terms/isFormatOf
terms-isPartOf http://purl.org/dc/terms/isPartOf
terms-isReferencedBy http://purl.org/dc/terms/isReferencedBy
terms-isReplacedBy http://purl.org/dc/terms/isReplacedBy
terms-isRequiredBy http://purl.org/dc/terms/isRequiredBy
terms-isVersionOf http://purl.org/dc/terms/isVersionOf
terms-issued http://purl.org/dc/terms/issued
terms-language http://purl.org/dc/terms/language
terms-license http://purl.org/dc/terms/license
terms-mediator http://purl.org/dc/terms/mediator
terms-medium http://purl.org/dc/terms/medium
terms-modified http://purl.org/dc/terms/modified
terms-provenance http://purl.org/dc/terms/provenance
terms-publisher http://purl.org/dc/terms/publisher
terms-references http://purl.org/dc/terms/references
terms-relation http://purl.org/dc/terms/relation
terms-replaces http://purl.org/dc/terms/replaces
terms-requires http://purl.org/dc/terms/requires
terms-rights http://purl.org/dc/terms/rights
terms-rightsHolder http://purl.org/dc/terms/rightsHolder
terms-source http://purl.org/dc/terms/source
terms-spatial http://purl.org/dc/terms/spatial
terms-subject http://purl.org/dc/terms/subject
terms-tableOfContents http://purl.org/dc/terms/tableOfContents
terms-temporal http://purl.org/dc/terms/temporal
terms-title http://purl.org/dc/terms/title
terms-type http://purl.org/dc/terms/type
terms-valid http://purl.org/dc/terms/valid
ves-DCMIType http://purl.org/dc/terms/DCMIType
ves-DDC http://purl.org/dc/terms/DDC
ves-IMT http://purl.org/dc/terms/IMT
ves-LCC http://purl.org/dc/terms/LCC
ves-LCSH http://purl.org/dc/terms/LCSH
ves-MESH http://purl.org/dc/terms/MESH
ves-NLM http://purl.org/dc/terms/NLM
ves-TGN http://purl.org/dc/terms/TGN
ves-UDC http://purl.org/dc/terms/UDC

--
Tom Baker <t...@tombaker.org>

Richard Cyganiak

unread,
May 14, 2012, 3:16:43 PM5/14/12
to pedant...@googlegroups.com
Hi Tom,

What prevents you from redirecting
http://purl.org/dc/terms/XXX
to
http://dublincore.org/documents/dcmi-terms/#terms-XXX
and
http://purl.org/dc/elements/1.1/XXX
to
http://dublincore.org/documents/dcmi-terms/#elements-XXX
?

It seems to me that a 303 redirect would be more appropriate than the current 302 in this case. The redirect origin identifies a property, the redirect target identifies a section of a document describing the resource. So it's (part of) a related document.

But besides this small httpRange-14 nitpick, isn't it just a matter of setting up these redirect rules?

Best,
Richard

Thomas Baker

unread,
May 14, 2012, 10:18:19 PM5/14/12
to pedant...@googlegroups.com
On Mon, May 14, 2012 at 08:16:43PM +0100, Richard Cyganiak wrote:
> What prevents you from redirecting
> http://purl.org/dc/terms/XXX
> to
> http://dublincore.org/documents/dcmi-terms/#terms-XXX
> and
> http://purl.org/dc/elements/1.1/XXX
> to
> http://dublincore.org/documents/dcmi-terms/#elements-XXX
> ?

Ah yes - I'm recalling now that we considered this possibility a few
years ago... And we would only have to do this once.

> It seems to me that a 303 redirect would be more appropriate than the
> current 302 in this case. The redirect origin identifies a property,
> the redirect target identifies a section of a document describing the
> resource. So it's (part of) a related document.

Agreed.

> But besides this small httpRange-14 nitpick, isn't it just a matter of
> setting up these redirect rules?

Yes, I think so.

Thanks,
Tom

--
Tom Baker <t...@tombaker.org>

Thomas Baker

unread,
May 15, 2012, 8:49:05 AM5/15/12
to pedant...@googlegroups.com
On Mon, May 14, 2012 at 10:18:19PM -0400, Tom Baker wrote:
> > It seems to me that a 303 redirect would be more appropriate than the
> > current 302 in this case. The redirect origin identifies a property,
> > the redirect target identifies a section of a document describing the
> > resource. So it's (part of) a related document.
>
> Agreed.

I was looking for examples of RDFa documents using 303 redirects for
serving up documentation about term URIs, but I'm seeing:

-- VoID uses 302 with content negotiation

$ curl -I http://rdfs.org/ns/void#objectsTarget
HTTP/1.1 302 Found
Date: Tue, 15 May 2012 11:53:18 GMT
Server: Apache/2.2.11 (Debian) PHP/5.3.3-7 with Suhosin-Patch
mod_ssl/2.2.11 OpenSSL/0.9.8o
Location: http://vocab.deri.ie/void
Content-Type: text/html; charset=iso-8859-1

$ curl --header "Accept: application/turtle" http://vocab.deri.ie/void
[Turtle output]

$ curl --header "Accept: application/rdf+xml" http://vocab.deri.ie/void
[RDF/XML output]

-- FOAF uses 303 with content negotiation

$ curl -I http://xmlns.com/foaf/0.1/maker
HTTP/1.1 303 See Other
Date: Tue, 15 May 2012 11:50:00 GMT
Server: Apache/2.2.14 (Ubuntu)
Access-Control-Allow-Origin: *
Location: http://xmlns.com/foaf/spec/
Vary: Accept-Encoding
Content-Type: text/html; charset=iso-8859-1

$ curl --header "Accept: application/rdf+xml" http://xmlns.com/foaf/spec/
[RDF/XML output]

Are there other examples demonstrating RDFa + 303 redirect, or would
DCMI be breaking new ground? If the latter, then I would want to put a
concise but complete explanation into place explaining our rationale.

As I understand it, one potential downside of using RDFa _only_ for
serving the RDF vocabulary (i.e., without supporting content negotiation
for RDF/XML and possibly Turtle) is that some RDF data consumers will
not have up-to-date tools for consuming the RDFa. Are there any other
potential negatives?

I'm wondering if best practice would be to implement content negotiation
_in addition_to_ RDFa? In that case, we could derive the RDF/XML (or
should it be Turtle?) from the RDFa, but we would need to configure
.htaccess with conditional redirects.
Reply all
Reply to author
Forward
0 new messages