[ 
https://issues.apache.org/jira/browse/MARMOTTA-505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14005867#comment-14005867
 ] 

Chris Beer commented on MARMOTTA-505:
-------------------------------------

Sure. The immediate problem I'm trying to solve is working with id.loc.gov 
linked data service's known label API 
(http://id.loc.gov/techcenter/searching.html#knownLabel). 

With that API, you give it a term name URI (e.g. 
http://id.loc.gov/authorities/label/orchids) and it will redirect you to an 
authority URI (http://id.loc.gov/authorities/subjects/sh85095334). The HTTP 
response has two headers that I'd like to use:

X-PrefLabel:Orchids
X-URI:http://id.loc.gov/authorities/subjects/sh85095334

The X-PrefLabel header would just be a (premature) performance optimization on 
my part, because at least some of the time I don't need the full RDF response 
in the first place.

The X-URI header is (I believe) essential to parsing their RDF response. The 
graph they produce at http://id.loc.gov/authorities/subjects/sh85095334.rdf 
uses the X-URI as the subject of the graph of interest. In combination with 
MARMOTTA-500 and a pull request I'm still developing, I can use this 
information to retrieve the data I need. (Some may rightly argue that loc.gov's 
serialization leaves something to be desired, but I'm sure there are other 
less-than-perfect implementation in the wild too).

There are a couple other use cases that I'd find HTTP header information of 
interest, including following the object of a triple to a non-linked data 
resource and being able to pull some basic information from common headers 
(content type, last modified and/or an ETag) or some implementation-defined 
headers. There may also be some interesting Link: information, but I'm not sure 
how to parse that out in an actionable way (e.g. rel="canonical")









> Add a LDPath function to access response headers, which may contain useful 
> information
> --------------------------------------------------------------------------------------
>
>                 Key: MARMOTTA-505
>                 URL: https://issues.apache.org/jira/browse/MARMOTTA-505
>             Project: Marmotta
>          Issue Type: New Feature
>          Components: LDCache, LDClient, LDPath
>    Affects Versions: 3.2.1
>            Reporter: Chris Beer
>            Assignee: Jakob Frank
>             Fix For: 3.3.0
>
>
> Some linked data resources that I'm requesting have important information in 
> their HTTP headers. I would like to access those headers from an LDPath 
> program.
> To do so, I expanded the LDCache and LDClient APIs to support exposing 
> headers to a newly created LDPath function. 
> {code}
> content_type = fn:header("Content-Type") :: xsd:string ;
> /* content_type = {application/rdf+xml} */
> {code}
> https://github.com/apache/marmotta/pull/6



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to