obj-c redland bindings

For Johan, who may or may not be interested in this:

http://librdf.org/docs/objc.html

Redland is an RDF framework, with a variety of different backend
options (sqlite, postgresql, bdb, etc.).

Bruce

Thanks Bruce. That is interesting… I think… I’ll give it a spin.
Do you have a good test file on the RDF format for me to work with?

Btw, did you find where your buried your MODS to HTML XSLT?

Thanks,

JohanOp 24-feb-2006, om 14:52 heeft Bruce D’Arcus het volgende geschreven:

For Johan, who may or may not be interested in this:

http://librdf.org/docs/objc.html


http://www.geo.vu.nl/~jkool/

Thanks Bruce. That is interesting… I think… I’ll give it a spin.

The advantage of something like this is that you’re working directly
with the RDF, and you leave the library to handle storage and
serialization and such. You want to export to RSS/RDF? No problem; just
use that output option. You can to store the data in PostgreSQL or
MySQL? Again, no problem; there are multiple backends.

Ideally, I’d like to build a web-enabled app based on an RDF store; I
just don’t have time to think about that now.

Do you have a good test file on the RDF format for me to work with?

There are a few here:

http://www.users.muohio.edu/darcusb/meta/references/

To run citeproc now I just have a little XSLT that copies all those
files into a single local one, and then uses that as the “database.”

Btw, did you find where your buried your MODS to HTML XSLT?

This is the closest I found. It’s probably at least a good start:

<?xml version='1.0' encoding='utf-8'?>

<xsl:stylesheet
xmlns:xsl=“http://www.w3.org/1999/XSL/Transform
xmlns:mods=“Metadata Object Description Schema (MODS)
version=“1.0”>

<xsl:output method=‘html’ version=‘1.0’ encoding=‘utf-8’ indent=‘yes’/>

<xsl:strip-space elements=“*”/>

<xsl:template match=“/”>

Test body { background-color: silver; font-family: 'lucida sans', verdana; } table.details { background-color: white; width: 400px; padding: 20px; } td.details_heading { font-weight: bold; background-color: silver; text-align: right; } td { padding-left: 5px; padding-right: 5px; font-size: 10px; padding-top: 3px; padding-bottom: 3px; }

<xsl:template match=“mods:mods”>

<xsl:template match=“mods:abstract”>

<xsl:template match=“mods:genre”>

Genre:

<xsl:template match=“mods:originInfo”>

Issuance:

<xsl:template match=“mods:detail[@type=‘volume’]”>

Volume:

<xsl:template match=“mods:detail[@type=‘issue’]”>

Issue:

<xsl:template match=“mods:detail[@type=‘page’]”>

Page:

<xsl:template match=“mods:extent[@unit=‘page’]”>

Pages: –

<xsl:template match=“mods:part”>
<xsl:apply-templates select=“mods:detail”/>
<xsl:apply-templates select=“mods:extent”/>
</xsl:template>

<xsl:template match=“mods:relatedItem[@type=‘host’]”>
<xsl:apply-templates select=“mods:genre”/>
<xsl:apply-templates select=“mods:part”/>
<xsl:apply-templates select=“mods:titleInfo”/>
<xsl:apply-templates select=“mods:originInfo”/>
</xsl:template>

<xsl:template match=“mods:titleInfo[not(@type)]”>
xsl:choose
<xsl:when test=“…/…/…/mods:mods”>
xsl:choose
<xsl:when test=“…/mods:genre=‘academic journal’”>
Journal Title:
</xsl:when>
xsl:otherwise
Container Title:
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test=“…/…/mods:mods”>
Title:
</xsl:when>
</xsl:choose>

<xsl:apply-templates select=“mods:nonSort”/>
<xsl:apply-templates select=“mods:title”/>
<xsl:apply-templates select=“mods:subTitle”/>

</xsl:template>

<xsl:template match=“mods:nonSort”>
xsl:apply-templates/
xsl:text </xsl:text>
</xsl:template>

<xsl:template match=“mods:title”>
xsl:apply-templates/
</xsl:template>

<xsl:template match=“mods:subTitle”>
xsl:text: </xsl:text>
xsl:apply-templates/
</xsl:template>

<xsl:template match=“mods:titleInfo[@type]”/>

<xsl:template match=“mods:name”>

Creator:

<xsl:if test=“position() > 1”>
xsl:text; </xsl:text>
</xsl:if>
xsl:choose
<xsl:when test=“mods:namePart[not(@type)]”>
<xsl:apply-templates select=“mods:namePart[not(@type)]”/>
</xsl:when>
<xsl:when test=“mods:namePart[@type=‘family’]”>
<xsl:variable name=“name”>
<xsl:value-of
select=“mods:namePart[@type=‘family’]”/>,
<xsl:value-of
select=“mods:namePart[@type=‘given’]”/>
</xsl:variable>
<xsl:value-of select=“$name”/>
</xsl:when>
</xsl:choose>
<xsl:if test=“mods:namePart[@type=‘date’]”>
xsl:text [</xsl:text>
<xsl:value-of select=“mods:namePart[@type=‘date’]”/>
xsl:text]</xsl:text>
</xsl:if>
<xsl:if test=“mods:role”>
xsl:text (</xsl:text>
<xsl:value-of select=“mods:role/mods:roleTerm”/>
xsl:text)</xsl:text>
</xsl:if>


</xsl:template>

 <xsl:template match="mods:typeOfResource">
     <tr>
         <td class="details_heading">Type of Resource:</td>
         <td><xsl:apply-templates/></td>
     </tr>
 </xsl:template>


 <xsl:template match="mods:subject">
     <xsl:apply-templates select="mods:topic"/>
 </xsl:template>

 <xsl:template match="mods:topic">
     <xsl:if test="position() != 1">
         <xsl:text>; </xsl:text>
     </xsl:if>
     <xsl:apply-templates/>
 </xsl:template>

 <xsl:template match="mods:originInfo">
     <xsl:apply-templates select="mods:edition"/>
     <xsl:apply-templates select="mods:publisher"/>
     <xsl:apply-templates select="mods:place"/>
     <xsl:apply-templates select="mods:copyrightDate"/>
     <xsl:apply-templates select="mods:dateIssued[1]"/>
 </xsl:template>

 <xsl:template match="mods:dateIssued">
     <tr>
         <td class="details_heading">Date Issued:</td>
         <td><xsl:apply-templates/></td>
     </tr>
 </xsl:template>

 <xsl:template match="mods:copyrightDate">
     <tr>
         <td class="details_heading">Copyright Date:</td>
         <td><xsl:apply-templates/></td>
     </tr>
 </xsl:template>

 <xsl:template match="mods:edition">
     <tr>
         <td class="details_heading">Edition:</td>
         <td><xsl:apply-templates/></td>
     </tr>
 </xsl:template>

 <xsl:template match="mods:place">
     <xsl:apply-templates select="mods:placeTerm[@type='text']"/>
 </xsl:template>

 <xsl:template match="mods:placeTerm">
     <tr>
         <td class="details_heading">Place:</td>
         <td><xsl:apply-templates/></td>
     </tr>
 </xsl:template>

 <xsl:template match="mods:publisher">
     <tr>
         <td class="details_heading">Publisher:</td>
         <td><xsl:apply-templates/></td>
     </tr>
 </xsl:template>



 <xsl:template match="mods:identifier">
     <tr>
         <td class="details_heading">
             Identifier (<xsl:value-of select="@type"/>)
         </td>
         <td>
             <xsl:choose>
                 <xsl:when test="@type='uri'">
                     <a href="{text()}">
                         <xsl:apply-templates/>
                     </a>
                 </xsl:when>
                 <xsl:otherwise>
                     <xsl:apply-templates/>
                 </xsl:otherwise>
             </xsl:choose>
         </td>
     </tr>
 </xsl:template>

</xsl:stylesheet

Wouldn’t it be best to develop the next bibliographic web app as a
generic, fully-featured SRW/U-client?

This would allow for different stores as a database backend (be it RDF,
MODS, etc).

You could choose between different kinds of data sources, be it local
(e.g. your personal RDF store) or remote such as the LoC or a refbase
SRU server etc.

Does this make sense?

Matthias

Yes.

I’ve mentioned on my blog that the new RDF-related (though not RDF
exclusive) SPARQL query language – which Redland supports – is
intended to cover a similar area as SRU. It even now has a JSON result
format, to complement the existing XML one! That ought to make possible
some interesting things in next-generation web apps. See for example
this post from an IBM researcher:

http://torrez.us/archives/2006/02/24/418

I think an app that supported both – in whatever way – might well be
ideal for the next-generation bib app.

In the grand scheme of things, I’d really like to not have to really
think much about reference management in the future. I think we need to
start thinking more about distributed metadata, and maybe proxies
that’s can bring it together for formatting and such.

Bruce